Is there any way to solve df(t)/dt = 0 for t and f(tsolved) value if we know F(s), the Laplace transform of f?

Question: I am trying to know max(f(t)) value but I have only F(s) equation of it and I thought that by solving df(t)/dt == 0 by Laplace using F(s) which is s*F(s) == 0, I can easily solve what is t for max(f(t)) and using solved t I will find f(tsolved) value which will give me global max or min value.
Two questions: how can I solve df(t)/dt == 0 diff equation by F(s) and how can I get the value of f(tsolved) again from F(s)
Comment: I'm fairly confident that this wouldn't be possible. If we consider the Fourier which in hand way sense can be got by putting $s=j\omega$, then you are moving from time to frequency domains and you cannot deduce time domain characterstics from the frequency domain signal. But, probably I'm wrong. Or, there will be a better way to explain it.
Comment: Thanks for the comment, Is it possible to solve df(t)/dt == 0 differential equation by F(s)?
Comment: AFAIK, you have to get $f(t)$ using any initial conditions (f(0) etc) given and solve the maximum. Actually the Laplace of the differential has a constant term dependent on $f(0)$. So, it is not directly possible to solve $\frac{df(t)}{dt} = 0$ from the Laplace transform.
Comment: If we know f(0), we can solve t which makes df(t)/dt == 0, is that correct and how can we do this?
Answer: There are at least two  very different things  one might mean by "Solve $f'(t)=0$"; it's not at all clear from the OP which one is intended:

Problem 1. "Given"  $f$,  find $t$ such that $f'(t)=0$.
Problem 2. Find $f$ such that $f'(t)=0$ for all $t$.

Indeed, it seems  possible that the OP doesn't appreciate the distinction. The two tags ordinary-differential-equations and global-optimization would appear to indicate this, since the ode tag is relevant to Problem 2 but not to Problem 1, and vice-versa for the optimization  tag.
Anyway, it seems  very unlikely that the Laplace transform can be used for Problem 1.  Otoh one could use the LT on Problem 2, but that would be a very curious thing to do, since the solution to Problem 2 is so  obvious without the LT.
By the way, you have a detail  wrong about how the Laplace transform plays with differential equations: Saying $f'==0$ does not say $sF(s)=0$, rather it says $sF(s)-f(0)=0$.
Comment: If we solve sF(s)−f(0)=0 equation and get s, how can we convert s to t
Comment: @ÖmerYıldız Huh? If $F(s)=c/s$ then $f(t)=c$. This is like the first example in the chapter on the Laplace transform in any elementary book on differential equations...
Comment: I need t which makes sF(s) = 0, saying F(s)=c/s  then f(t)=c is not saying how to find t by getting s from sF(s) = 0 equation...
Comment: There's no such  thing as a $t$ that makes $sF(s)=0$; that simply makes no sense. I answered what seems like a sensible version of the question - given $F$, find $f$.


How to trace Drupal 7 Core Logic Using Netbeans with xdebug?

Question: I'd like to understand how Drupal core works by tracing core logic and how functions unfold. I installed Netbeans with xdebugger and started a new project. The project includes drupal installation run on localhost. I read several Netbeans quickstart manuals and began studying core by putting breakpoints. But when I start debugging the project they do not seem to work. Please explain any productive approach for studying drupal 7 core logic using Netbeans with Xdebug?
Thanks!
Comment: So what exactly is the problem? You stated that "But when I start debugging the project they do not seem to work." but now you say that you can step into and out functions.
Comment: Is your xdebug setup working properly?
Comment: I believe that it works properly. How can I check this?
Comment: Debug session starts, drupal runs, i can step into and out functions.
Comment: I tried to formulate a general question on how to study Drupal core using Netbeans and xdebug. Should I follow function by function from index.php? How can I understand Drupal core logic? I read Drupal documentation, but it is devoted to specific APIs.
Comment: In Tomlison book Pro Drupal 7 development authors said that "If you want to trace it yourself, use a good debugger, and start at
index.php, which is where Drupal receives most of its requests". I installed Netbeans and Xdebug and now try to figure out how to use them to understand Drupal core
Answer: In my opinion, studying drupal core using netbeans and xdebug is somewhat too overwhelming. Starting in index.php will lead you through the whole bootstrap and other parts which do not need to be studied by someone who is starting to understand drupal. The most important parts to be familiar with are menu system and node system. These two parts are the basic building blocks on which you can build further (entities, taxonomy etc.). To study these, I would recommend the combination of 3 approaches:

Study the documentation

menu - you can start with hook_menu (https://api.drupal.org/api/drupal/modules%21system%21system.api.php/function/hook_menu/7)
node api hooks (https://api.drupal.org/api/drupal/modules!node!node.api.php/group/node_api_hooks/7)

Study the examples module (https://drupal.org/project/examples) - it provides a lot of very well documented code which you can see in action (by turning on the module and its submodules)
Playing around with your own code snippets (=trying out what you learned)

I think xdebug comes later into this mix because it is a debugging tool (by definition) and even though jumping from function to function, from module to module can give you some understading of the flow of things, it is usually easier to just check it out in the documentation.
Comment: not have enough reputation yet to do this)
Comment: thanks, I earned enough credits and upvoted your answer)
Comment: ah ok then, thanks for cooperation, if you have any further questions regarding this topic, let me know


Async image in button issue

Question: I have a piece of code like this in my function. And I do a looping creating a async image inside the button.
But when I run it, my button do not show the async image.Please tell me what's wrong with my code.
When I print NSLog the url, its going well and show all of the image url.
<code>            // ADD BUTTON
            UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
            [btn setFrame:CGRectMake(topLeft.x,topLeft.y,width,height)];

            //Asyncronous Image
            NSMutableString *imageUrl;

            if ([[[type objectAtIndex:btnNumber] objectForKey:@"LAST_CONTENT_IMAGE"] isEqualToString:@""] || [[type objectAtIndex:btnNumber] objectForKey:@"LAST_CONTENT_IMAGE"] == nil) {
                imageUrl = [NSMutableString stringWithFormat:@"bank_images/actual/"];
            }else{
                imageUrl = [[type objectAtIndex:btnNumber] objectForKey:@"LAST_CONTENT_IMAGE"];
            }

            NSURL *url1 = [NSURL URLWithString:imageUrl];
            NSLog(@"URL GBR : %@", url1);

            NSArray  *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
            NSString  *documentsDirectory = [paths objectAtIndex:0];
            NSString *stringSub = [imageUrl substringWithRange:NSMakeRange (imageUrl.length-9, 9)];
            NSString *path = [NSString stringWithFormat:@"%@/%u_%@", documentsDirectory,[GlobalVariable sharedInstance].indexCategoryGlobal,stringSub];

            if ([[NSFileManager defaultManager] fileExistsAtPath:path])
            {
                NSData *img = [NSData dataWithContentsOfFile:path];
                UIImage *imageExist = [UIImage imageWithData:img];
                image = imageExist;
                [btn setImage:image forState:UIControlStateNormal];
            }else{
                dispatch_queue_t queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH,  0);
                dispatch_async(queue, ^{
                    //This is what you will load lazily
                    NSData   *data1 = [NSData dataWithContentsOfURL:url1];

                    dispatch_sync(dispatch_get_main_queue(), ^{
                        image = [UIImage imageWithData:data1];
                        [btn setImage:image forState:UIControlStateNormal];

                        if ([stringSub isEqualToString:@"s/actual/"]){
                            image = [UIImage imageNamed:@"default_thumb.png"];
                            [btn setImage:image forState:UIControlStateNormal];
                        }

                        [[NSFileManager defaultManager] createFileAtPath:path
                                                                contents:data
                                                              attributes:nil];
                    });
                });
            }
            [btn setTag:btnNumber];
</code>
Comment: Are you aware of SDWebImage and if not go through this link:  https://github.com/rs/SDWebImage
Comment: So that you can use directly [btn setImageWithUrl:];
Comment: thanks @venkat, but I prefer to use this code now.
Could you help me please without using that library?
:)
Comment: Where you are adding that btn to which View you are adding ??
Comment: I set a blank in the json and then it show default_thumb.png, so I think the problem is not from the view.
Comment: I think the button instance is nil in the dispatch block. Make button variable as __block level variable so that it will be accessible within the block.
Answer: Looks like you create NSURL object in a wrong way
Apple documentation says us that
URLWithString:
Creates and returns an NSURL object initialized with a provided string.

(id)URLWithString:(NSString *)URLString
Parameters
URLString
The string with which to initialize the NSURL object. Must be a URL that conforms to RFC 2396. This method parses URLString according to RFCs 1738 and 1808. (To create NSURL objects for file system paths, use fileURLWithPath:isDirectory: instead.)

So, looks like you should use
fileURLWithPath:isDirectory:
Comment: could you explain more specifics @vlad?
Comment: You have such code imageUrl = [NSMutableString stringWithFormat:@"bank_images/actual/"];
NSURL *url1 = [NSURL URLWithString:imageUrl]; Here @"bank_images/actual/" looks like a path in a file system. If so you should create NSURL object with method like NSURL *url1= [NSURL fileURLWithPath:imageURL];
Comment: Also it will be very helpful if you provide info what are you put into [[type objectAtIndex:btnNumber] objectForKey:@"LAST_CONTENT_IMAGE"]?
Comment: Also i don't understand what is the data var here [[NSFileManager defaultManager] createFileAtPath:path contents:data attributes:nil]; where are you get it from? It should be a data1?

Async image in button issue


Turn off struts validation per input box based on checkbox value

Question: I have a struts application that has a form to edit user details. I am using struts validator to validate the user input.
I have a checkbox that, when clicked, makes 'Password' and 'Confirm Password' input boxes appear.
If the checkbox box is UNchecked, I do not want the app to validate the invisible input boxes. If I check the checkbox, I then want the validator to kick it.
I have put an c:if around the  to only display if the checkbox is checked.
My problem is that the Password/Confirm password validation kicks in, but is invisible.
My question is, is there a way to only validate an input box based on a checkbox value?
Answer: Not sure, but i believe you can use validWhen" validation, this validation is for such use-cases for more details refer to the official doc
validator
Comment: I need more help...

I have removed the checkbox from the screen. The scenario now is that the password and confirm password boxes are visible. If you don't want to update your password, you leave the boxes empty. If you do want to change, you fill in the details.
Comment: I have my valication.xml with the password property 'password' as follows:

mask
^[^<>\&\r\n\\\"\'\|]+$

test
(*this* == null)
Comment: If you add a password, it must adhere to the mask.
If you do not add a password, validation will pass.

I need to have an 'either/or' check.. As it stands, validation will pass if the password box is empty. If you add a password that adhere's to the rules, validation rightly fails because password != null.

Anyone any ideas?


Is the category of quasi-coherent $\mathcal{O}_X$-algebras cocomplete?

Question: Let $X$ be a scheme.
Is the category of quasi-coherent (commutative) $\mathcal{O}_X$-algebras cocomplete?
Answer: Since you posted this on mathoverflow, I've answered it there:
https://mathoverflow.net/questions/139968
Answer: If $X$ is a scheme (no a simple ringed or locally ringed space) the question is easy (by the usual Grothendieck isomorphism between q.c.modules and algebraic modules on a a affine schema)::
Let $X=\bigcup_{i\in I} U_i$ where $U_i$ is a affine open. If $(\mathcal{M_t})_{t\in T}$ is a diagram of of q.c-modules (quasi coherent modules sheaves). You have $ (\mathcal{M_t})_{|U_i}\cong \widetilde{(M_{t, i})} $ where $M_{t, i}$ a (algebraic) module on the ring $X(U)$, let $M_i:= \varinjlim_{t\in T} M_{t, i}$, now $(\widetilde{M_i})_{|U_j}\cong
\varinjlim_{t\in T}\ \mathcal{M_t}_{|U_i\cap U_j}\cong (\widetilde{M_j})_{|U_i}$ and the isomorphisms are a $descent\ data$, then you "glue" these elements and get a module sheaf $\mathcal{M}$ such that $\mathcal{M}_{|U_i}\cong \widetilde{M_i}$ then $\mathcal{M}$ is q.c.module. The some proof if you use q.c.algebras instead modules.


Can't access custom field through entity_metadata_wrapper

Question: I've created a custom field and widget with the Field API. I've added this custom field to one of my node entities by using the Field UI and named it field_pec_uuid. However, when i try to access the values of this field by using entity_metadata_wrapper like so:
$node_wrapper = entity_metadata_wrapper('node', $nid);
print $node_wrapper->field_pec_uuid->value();

It will give me the following error:
EntityMetadataWrapperException: Unknown data property field_pec_uuid. in EntityStructureWrapper->getPropertyInfo() (regel 335 van /webroot/d7_root/sites/all/modules/contrib/entity/includes/entity.wrapper.inc).

When I print the values of $node_wrapper->value() I can clearly see the field exists and even has the value I've been giving it. However, when I print the values of $node_wrapper->getPropertyInfo() I can see the field name is not listed. What am I missing here? Anyone has any indications?
I can't for the life of me figure out how to get my field listed by $node_wrapper->getPropertyInfo(). Below is my code.
/**
 * Field & Widget section
 */

/**
 * Implementation of hook_field_info()
 *
 * @return [type] [description]
 */
function poh_eduref_field_info() {
  return array(
    'eduref_uuid' => array(
      'label' => t('Eduref UUID Field'),
      'description' => t('This field stores UUID values.'),
      'settings' => array('allowed_values' => array(), 'allowed_values_function' => ''),
      'default_widget' => 'poh_eduref_eduref_widget',
      'default_formatter' => 'poh_eduref_field_formatter_view',
    ),
  );
}

/**
 * Implements hook_field_widget_info
 *
 * @return [type] [description]
 */
function poh_eduref_field_widget_info() {
  return array(
    'poh_eduref_eduref_widget' => array(
      'label' => t('Education Reference Field'),
      'field types' => array('eduref_uuid'),
      'settings' => array(
        'autocomplete_path' => 'eduref/autocomplete',
      ),
    ),
  );
}

/**
 * Implements hook_field_widget_form()
 *
 * @param  [type] &$form       [description]
 * @param  [type] &$form_state [description]
 * @param  [type] $field       [description]
 * @param  [type] $instance    [description]
 * @param  [type] $langcode    [description]
 * @param  [type] $items       [description]
 * @param  [type] $delta       [description]
 * @param  [type] $element     [description]
 * @return [type]              [description]
 */
function poh_eduref_field_widget_form(&$form, &$form_state, $field, $instance, $langcode, $items, $delta, $element) {
  $item =& $items[$delta];

  $element['uuid'] = array(
    '#type' => 'fieldset',
    '#title' => $element['#title'],
    '#description' => t('This is the description.'),
  );

  $element['uuid']['value'] = array(
    '#type' => 'textfield',
    '#title' => 'Education Reference',
    '#autocomplete_path' => $instance['widget']['settings']['autocomplete_path'],
    '#default_value' => isset($item['value']) ? $item['value'] : '',
  );

  return $element;
}

function poh_eduref_field_presave($entity_type, $entity, $field, $instance, $langcode, &$items) {
  if($field['type'] == 'eduref_uuid') {
    foreach ($items as $delta => $item) {
      if (isset($item['uuid']['value'])) {
        $items[$delta]['value'] = $item['uuid']['value'];
      }
    }
  }
}

/**
 * [poh_eduref_autocomplete_callback description]
 * @param  [type] $string [description]
 * @return [type]         [description]
 */
function poh_eduref_autocomplete_callback($string) {

  $query = new EntityFieldQuery();
  $result = $query->entityCondition('entity_type', 'node')
  ->entityCondition('bundle', 'poheduref')
  ->fieldCondition('field_eduref_display_name', 'value', $string.'%', 'LIKE')
  ->execute();

  if($result['node']) {
    foreach(array_keys($result['node']) as $nid) {
      $node = entity_metadata_wrapper('node', $nid);
      if($node->field_eduref_uuid && $node->field_eduref_display_name) {
        $json_array[$node->field_eduref_uuid->value()] = $node->field_eduref_disorder->value().'/'.$node->field_eduref_type->value().'/'.$node->field_eduref_display_name->value();
      }
    }
  }

  return drupal_json_output($json_array);
}

/**
 * Implementation of hook_field_is_empty()
 *
 * @param  [type] $item  [description]
 * @param  [type] $field [description]
 * @return [type]        [description]
 */
function poh_eduref_field_is_empty($item, $field) {
  $temp = array_keys($field['columns']);
  $key = array_shift($temp);
  return empty($item['uuid'][$key]);
}

function poh_eduref_field_formatter_info() {
  return array(
    'eduref_uuid' => array(
      'label' => t('UUID'),
      'field types' => array('eduref_uuid'),
    ),
  );
}

function poh_eduref_field_formatter_view($entity_type, $entity, $field, $instance, $langcode, $items, $display) {
  $element = array();
  switch ($display['type']) {
    case 'eduref_uuid' :
      foreach ($items as $delta => $item) {
        if (isset($item['value'])) {
          $element[$delta]['#markup'] = $item['value'];
        }
      }
      break;
  }
  return $element;
}

/**
 * [poh_eduref_field_validate description]
 * @param  [type] $entity_type [description]
 * @param  [type] $entity      [description]
 * @param  [type] $field       [description]
 * @param  [type] $instance    [description]
 * @param  [type] $langcode    [description]
 * @param  [type] $items       [description]
 * @param  [type] $errors      [description]
 * @return [type]              [description]
 */
function poh_eduref_field_validate($entity_type, $entity, $field, $instance, $langcode, $items, &$errors) {
  foreach ($items as $delta => $item) {
    if(empty($item['field_pec_uuid'])) {
      //$errors[$field['field_name']][$langcode][$delta][] = array('error' => 'uuid_empty_error', 'message' => t('Field empty.'));
    }
  }
}

EDIT: For anyone who stumbles into the same issue; the solution as provided by Clive was to add a property_type key to the hook_field_info implementation, like so:
function poh_eduref_field_info() {
  return array(
    'eduref_uuid' => array(
      'label' => t('Eduref UUID Field'),
      'description' => t('This field stores UUID values.'),
      'settings' => array('allowed_values' => array(), 'allowed_values_function' => ''),
      'default_widget' => 'poh_eduref_eduref_widget',
      'default_formatter' => 'poh_eduref_field_formatter_view',
      'property_type' => 'text',
    ),
  );
}

In my case 'text' as value will suffice, as its a simple textfield. If you need more advanced examples I recommend reading the links Clive provided.
Comment: OK, you stated some facts, posted some code... But I can't see where you actually ask a question.
Answer: EntityMetadataWrapper comes from the Entity API module; by default it only knows about core field types, you have to explicitly tell it how to handle custom fields.
That involves adding property_type and possibly property_callbacks keys to your field info array.
See What does the 'property_type' key do in hook_field_info()? for a bit more information, and here for a code sample.
Comment: Hi Clive! Thank you dear sir! Adding property_type = 'text' to my hook_field_info has solved the issue (its a simple text field)! I can access the field using entity_metadata_wrapper now!
Comment: Happy to help :)


Kint works in pre_process but not in Twig

Question: On my site, I'm able to use print variables using kint in my pre-process functions.
However, when I try to do the same in twig, nothing happens.  I do have debug mode turned on.  Has anyone ever ran into this fact pattern? Any ideas?
To clarify:

It does not work in any of my templates
The specific template I'm using is for styling the output of a view, which is a page and has unformatted HTML as its type.

This is how I use kint  kint()
This is what I have seen on tutorials.
Comment: Just to make sure that you know, you do like this to kint in twig, `{{ kint(variable) }}`
Comment: Without seeing how you actually use is, we can't say what's wrong. Please update your question to include code snippets of what you are trying to do and WHERE. What file? What template? What code?
Comment: Jdrupal, I will be happy to let you know once I test. I have had to work on other things and have not yet tested.
Answer: In php you use kint like this, kint($variable), but in twig you use kint like this, {{ kint(variable) }}.
This is the only problem I can spot by looking at your question.
Hope it helps.
Comment: In PHP I'd recommend `ksm($variable)` which will print the output into the Status messages block (in D7 this was `dpm($variable)`).
Comment: When I try to "kint" the "item" variable in a loop, I get a white screen.


Integrate $\int \frac{dx}{(x^2-x+1)\sqrt{x^2+x+1}}$

Question: Evaluate $$I=\int \frac{dx}{(x^2-x+1)\sqrt{x^2+x+1}}$$
My Try:
we have $x^2-x+1=(x+w)(x+w^2)$ where $w$ is complex cube root of unity
I have splitted $I$ as
$$I=AI_1+BI_2$$  where $A,B$ are some constants
$$I_1=\int \frac{dx}{(x+w)\sqrt{x^2+x+1}}$$
By taylor's series $$x^2+x+1=P(x+w)^2+Q(x+w)+R=(x+w)^2 \left(P+\frac{Q}{x+w}+\frac{R}{(x+w)^2}\right)$$ for some constants complex $P,Q,R$
hence
$$I_1=\int \frac{\frac{dx}{(x+w)^2}}{\sqrt{ \left(P+\frac{Q}{x+w}+\frac{R}{(x+w)^2}\right)}}=\int \frac{dt}{\sqrt{Rt^2+Qt+P}}$$  which is a standard Integral. Similar analysis for $I_2$.
Any other approach?
Comment: $$\mathscr{I}:=\int\frac{1}{\left(x^2-x+1\right)\cdot\sqrt{x^2+x+1}}\space\text{d}x=2\int\frac{1}{\left(x^2-x+1\right)\cdot\sqrt{\left(1+2x\right)^2+3}}\space\text{d}x\tag1$$

Now, substitute $\text{u}:=1+2x$:

$$\mathscr{I}=4\int\frac{1}{\left(\text{u}^2+4\text{u}+7\right)\cdot\sqrt{\text{u}^2+3}}\space\text{d}\text{u}\tag2$$

Substitute $\text{u}=\sqrt{3}\tan\left(\text{p}\right)$:

$$\mathscr{I}=4\int\frac{\cos\left(\text{p}\right)}{5+4\sin\left(\frac{\pi}{6}-2\text{p}\right)}\space\text{d}\text{p}\tag3$$
Comment: I don't know if the integral will be harder but,you can try Euler substitution because  your integral has the form of $\displaystyle \int R(x,\sqrt{ax^2+bx+c})dx$, where $R$ is a rational function of $x$ and $\sqrt{ax^2+bx+c}$. In your case $a=1>0$ so the substitution is $\sqrt{x^2+x+1}=x+t \implies x=\frac{1-t^2}{2t-1}$. From here you can do it.
Answer: Substituting
$$ x = \frac{\alpha + \beta t}{1 +t}$$
we have:
$$ x^2- x+1 = \frac{(\alpha +\beta t)^2-(1+t)(\alpha +\beta t)+(1+t)^2}{(1+t)^2}$$
$$ x^2+x +1 = \frac{(\alpha +\beta t)^2+(1+t)(\alpha +\beta t)+(1+t)^2}{(1+t)^2}$$
Numbers $ \alpha, \beta $ we define like, that coefficients at $ t $ are zero.
Hence
$$ 2\alpha \beta - \alpha - \beta + 2 =0,\ \  2\alpha \beta +\alpha +\beta +2=0.$$
$$ \alpha = 1, \ \ \beta = -1.$$
We have
$$ x = \frac{1-t}{1+t}; \ \ dx = \frac{-2dt}{(1+t)^2};$$
$$ x^2 -x +1 = \frac{3t^2 +2}{1 + t^2};$$
$$\sqrt{x^2+x +1} =\frac{\sqrt{t^2+3}}{1+t}; \ \ 1+t>0. $$
$$I =-2\int \frac{(t+1)dt}{(3t^2+1)\sqrt{t^2+3}}= -2\int \frac{tdt}{(3t^2+1)\sqrt{t^2+3}} - 2\int \frac{dt}{(3t^2+1)\sqrt{t^2+3}} = I_{1} + I_{2}.$$
$$ I_{1} = -2\int \frac{tdt}{(3t^2+1)\sqrt{t^2+3}} = (\sqrt{t^2+3}= u) = 2\int \frac{du}{8 -3u^2} = \frac{1}{2\sqrt{6}}\ln \left| \frac{2\sqrt{2}+\sqrt{3}u}{2\sqrt{2}-\sqrt{3}u}\right| = \frac{1}{\sqrt{6}}\ln\left|\frac{2\sqrt{2}+\sqrt{3(t^2+3)}}{2\sqrt{2}- \sqrt{3(t^2+3)}}\right|=\frac{1}{\sqrt{6}}\ln\left|\frac{(1+x)\sqrt{2}+\sqrt{3(x^2+x+1)}}{\sqrt{x^2-x+1}}\right|.$$
$$ I_{2}=-2\int\frac{dt}{(3t^2+1)\sqrt{t^2+3}}=(\frac{t}{\sqrt{t^2+3}}=z)=-2 \int\frac{dz}{8z^2 +1} =-\frac{1}{\sqrt{2}}\arctan\left(\frac{2\sqrt{z}}{1}\right)= -\frac{1}{\sqrt{2}}\arctan\left(\frac{\sqrt{2}(1-x)}{\sqrt{x^2+x +1}}\right).$$
In the end
$$ I =\frac{1}{\sqrt{6}}\ln\left|\frac{(1+x)\sqrt{2}+\sqrt{3(x^2-x+1)}}{\sqrt{x^2-x+1}}\right| -\frac{1}{\sqrt{2}}\arctan\left(\frac{\sqrt{2}(1-x)}{\sqrt{x^2+x +1}}\right) + C.$$
Comment: I have also carried out the solutions numerically and find that your solution does not agree. I do get the same numerical values as with WolframAlpha.
Comment: This is the famous technique I once read in  Hardy's Pure Mathematics. +1
Comment: How do you possibly verify this solution? It's very nice mathematics but it's very different than what I get with Mathematica or WolframAlpha (http://www.wolframalpha.com/input/?i=Integrate%5B1%2F((x%5E2+-+x+%2B+1)+Sqrt%5Bx%5E2+%2B+x+%2B+1%5D),+x%5D). This solutions are so long that I can't even tell if they agree with each other.
Comment: Paranamand Singh. J don't know Hardy's Pure Mathematics.
Comment: Cye Waldman. Programs Wolfram Alpha and Mathematica are giving very unpleasant result with complex numbers. Y'll attempt to differentiate this result.
Answer: Substitute $t_{\pm}= \frac{\sqrt{x^2+x+1}}{x\pm 1}$
to establish
$$\int \frac{x+1}{(x^2-x+1)\sqrt{x^2+x+1}}\ dx
-= \int \frac{2}{t_-^2+2} dt_-
$$
$$\int \frac{x-1}{(x^2-x+1)\sqrt{x^2+x+1}}\ dx
= \int \frac{2}{3t_+^2-2} dt_+
$$
Then
\begin{align}
& \int \frac{1}{(x^2-x+1)\sqrt{x^2+x+1}}\ dx\\
 =& - \int \frac1{3t_+^2-2}dt_+-\int \frac1{t_-^2+2}dt_-\\
=& \ \frac1{\sqrt6}\coth^{-1}\frac{\sqrt3 t_+}{\sqrt2}
-\frac1{\sqrt2}\tan^{-1}\frac{t_-}{\sqrt2}\\
=& \ \frac1{\sqrt6}\coth^{-1}\frac{\sqrt3 \sqrt{x^2+x+1}}{\sqrt2(x+1)}-\frac1{\sqrt2}\tan^{-1}\frac{\sqrt{x^2+x+1}}{\sqrt2(x-1)}
\end{align}
As a by-product, $\int \frac{x}{(x^2-x+1)\sqrt{x^2+x+1}}\ dx$ can also be evaluated.


Android Room: FOREIGN KEY constraint failed (Sqlite code 787)

Question: I'm trying to create two tables dare_table and step_table and ran into the FOREIGN KEY constraint failed error (787) while inserting Steps.
I have followed these posts with no success:

Android Room FOREIGN KEY constraint failed (code 787)
Android Room FOREIGN KEY constraint failed (code 787) when insert
new row
How to avoid room foreign key error - constraint failed (code
787)
SQLite Foreign Key Constraint Failed (code 787)

I'm still new to Room, any help is appreciated!
Dare.class:
@Entity(tableName = "dare_table",
indices = {@Index(value = {"stepList"}, unique = true),

public class Dare {

@PrimaryKey(autoGenerate = true)
public int id;

public Dare(String dareTitle, String stepList) {
    this.dareTitle = dareTitle;
    this.stepList = stepList;
}

public void setId(int id) {
    this.id = id;
}

private String dareTitle;

@ColumnInfo(name = "stepList")
private String stepList;

public int getId() {
    return id;
}

public String getDareTitle() {
    return dareTitle;
}

public String getStepList() {
    return stepList;
 }
}

Step.class
@Entity(tableName = "step_table",
    indices = {@Index(value = {"stepName"})},
    foreignKeys = @ForeignKey(
            entity = Dare.class,
            parentColumns = "stepList",
            childColumns = "stepName"
    ))

public class Step {

@PrimaryKey //Gets the same error with and without autoGenerate = true
public int id;

@ColumnInfo(name = "stepName")
private String stepName;

private boolean isCompleted;

public Step(String stepName, boolean isCompleted) {
    this.stepName = stepName;
    this.isCompleted = isCompleted;
}

public void setId(int id) {
    this.id = id;
}

public int getId() {
    return id;
}

public String getStepName() {
    return stepName;
}

public boolean isCompleted() {
    return isCompleted;
 }
}

The doInBackground (in a Repository class) as referenced in Error Log
    private static class InsertStepAsyncTask extends AsyncTask<Step, Void, Void> {

    private StepDao stepDao;

    private InsertStepAsyncTask(StepDao stepDao) {
        this.stepDao = stepDao;
    }

    @Override
    protected Void doInBackground(Step... steps) {
        stepDao.insert(steps[0]);
        return null;
    }
}

Error Log:
E/AndroidRuntime: FATAL EXCEPTION: AsyncTask #3
Process: com.kyperstudios.daretowork, PID: 9845
java.lang.RuntimeException: An error occurred while executing doInBackground()
    at android.os.AsyncTask$3.done(AsyncTask.java:365)
    at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:383)
    at java.util.concurrent.FutureTask.setException(FutureTask.java:252)
    at java.util.concurrent.FutureTask.run(FutureTask.java:271)
    at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:257)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
    at java.lang.Thread.run(Thread.java:784)
 Caused by: android.database.sqlite.SQLiteConstraintException: FOREIGN KEY constraint failed (Sqlite code 787), (OS error - 0:Success)
    at android.database.sqlite.SQLiteConnection.nativeExecuteForLastInsertedRowId(Native Method)
    at android.database.sqlite.SQLiteConnection.executeForLastInsertedRowId(SQLiteConnection.java:818)
    at android.database.sqlite.SQLiteSession.executeForLastInsertedRowId(SQLiteSession.java:803)
    at android.database.sqlite.SQLiteStatement.executeInsert(SQLiteStatement.java:86)
    at androidx.sqlite.db.framework.FrameworkSQLiteStatement.executeInsert(FrameworkSQLiteStatement.java:51)
    at androidx.room.EntityInsertionAdapter.insert(EntityInsertionAdapter.java:64)
    at com.kyperstudios.daretowork.Data.StepDao_Impl.insert(StepDao_Impl.java:89)
    at com.kyperstudios.daretowork.Data.DareRepository$InsertStepAsyncTask.doInBackground(DareRepository.java:164)
    at com.kyperstudios.daretowork.Data.DareRepository$InsertStepAsyncTask.doInBackground(DareRepository.java:154)
    at android.os.AsyncTask$2.call(AsyncTask.java:345)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:257)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
    at java.lang.Thread.run(Thread.java:784)

Comment: Why there is unique = true in Step class? Does one Dare contains only one Step?
Comment: @tamanneupane Thanks for the heads up, I removed that --still getting the same error though.
Answer: you may try to insert the a step with a name which is a foreign key to non exists element in the Dare class. so you have first to insert Dare object with stepList field you want to reference in the step class then you can insert the step successfully
daredao().insertAll(new Dare("dare_title1", steps[0].getStepName()));
stepdao().insertAll(steps[0]);


os.rename fail with [Errno 2] No such file or directory

Question: using os.rename in python and getting '[Errno 2] No such file or directory'
full code:
import os
from string import digits # digits are one of 0123456789

path = "/Users/xxx/Documents/version-control/secret-msg/prank/"
l = os.listdir(path) # returns list of files in folder
for o in l: #o for 'original'
    c = o.lstrip(digits) # c for 'clean', without leading digits; lstrip = left strip - so left strip any digit
    if (o != c):
        os.rename (o, c) #rename original filename to clean one
        print o + '-> ' + c # for debug only

Comment: You're listing the content of directory "/Users/xxx/Documents/version-control/secret-msg/prank/", but when using os.rename, you do not reference it, so the method looks for a file with name *o*  in the _current_ directory. either change directory, or reference the complete path to the files (original and renamed)
Answer: listdir returns a list of files without the path
So, you should do:
import os
import os.path
from string import digits # digits are one of 0123456789

path = "/Users/xxx/Documents/version-control/secret-msg/prank/"
l = os.listdir(path) # returns list of files in folder
for o in l: #o for 'original'
    c = o.lstrip(digits) # c for 'clean', without leading digits; lstrip = left strip - so left strip any digit
    if (o != c):
        os.rename (os.path.join(path, o),
                   os.path.join(path, c) #rename original filename to clean one
        print o + '-> ' + c # for debug only

We use os.path.join to join the path to the filename.


Issue splitting datetime - 'str' object has no attribute 'strptime'

Question: I'm trying to split datetime... it works well to store date but I get an error whenever I try and store time.
The following code works:
datetime =  tweet.date.encode( 'ascii', 'ignore')
struct_date = time.strptime(datetime, "%a, %d %b %Y %H:%M:%S +0000")
date = time.strftime("%m/%d/%Y")

But if I add the following line, I get an error:
  time = time.strftime("%H:%M:%S")

AttributeError: 'str' object has no attribute 'strptime'
Answer: You assigned a string to a variable named time. Use a different name instead, it is masking your time module import.
tm = time.strptime(datetime, "%H:%M:%S")

Answer: It probably worked once and then stopped working because you overwrote the module 'time' with a variable named 'time'. Use a different variable name.
This overwrites the time module
>>> import time
>>> type(time)
<type 'module'>
>>> time = time.strftime("%H:%M:%S")
>>> type(time)
<type 'str'>
>>> time = time.strftime("%H:%M:%S")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'str' object has no attribute 'strftime'

This is how you should do it
>>> import time
>>> type(time)
<type 'module'>
>>> mytime = time.strftime("%H:%M:%S")
>>> type(time)
<type 'module'>
>>> time.strftime("%H:%M:%S")
'11:05:08'


Who are frequentists?

Question: We already had a thread asking who are Bayesians and one asking if frequentists are Bayesians, but there was no thread asking directly who are frequentists? This is a question that was asked by @whuber as a comment to this thread and it begs to be answered. Do they exist (are there any self-identified frequentists)? Maybe they were just made-up by Bayesians who needed a scapegoat to blame when criticizing the mainstream statistics?
Meta-comment to the answers that were already given: As contrast, Bayesian statistics are not only defined in terms of using Bayes theorem (non-Bayesians also use it), nor about using subjectivist interpretation of probability (you wouldn't call any layperson saying things like "I bet the chance is less than 50:50!" a Bayesian) - so can we define frequentism only in terms of adopted interpretation of probability? Moreover, statistics $\ne$ applied probability, so should definition of frequentism be focused solely on the interpretation of probability?
Comment: I would still like to know what *is* a "Frequentist"? I have seen this term used as an apparent reference to "any non-Bayesian" as well as to someone who subscribes to a Frequentist philosophy of probability.  I know there are many of the former but I'm not sure there are any living exponents of the latter!
Comment: @Aksakal repeat it infinite number of times and I'll consider it significant ;)
Comment: Tim, I am afraid this thread might be affected by the same confusion as some related threads: namely, there are frequentist-vs-bayesian statistical methods and there are frequentist-vs-bayesian interpretations of probability. **These are two different issues!** Which one are you asking about? The confusion is obvious already now, in the comments to @fcop's answer; fcop talks about the definition/interpretation of probability, whereas you mentioned OLS and this is about statistical methods.
Comment: Count me in as a frequentist, please. Let's unite! United we'll be strong to destroy Bayesian at the gate once a for all!
Comment: Careful whom you call Bayesian. Per D.V. Lindley "There's no one less Bayesian than an empirical Bayesian". Many users of so-called Bayesian methods are not really Bayesian. Now with fast computers and MCMC everyone suddenly is a Bayesian? To many, it's just another calculation, like any other, not a deep-seated philosophy. Is the population disjointly divided, and only between Frequentists and Bayesian. How about someone without relevant education, what are they? Can there be a degree (or frequency) of Bayesianness? Maybe different on different days of week or types of analysis?
Comment: @luchonacho no they don't, e.g. sometimes "likelihoodists" are mentioned as third alternative.
Comment: @MarkL.Stone, there are probabilists who are neither B nor F, the guys like [Vovk and Shafer](http://www.probabilityandfinance.com/)
Comment: @amoeba I totally agree that it may be affected. This is one of the reasons I'm looking for a definition of the "frequentist". There are frequentist statistics and frequentist definition of probability, so there are frequentists and the question is - who are they? Notice that I'm not asking about definition of probability as this was asked in other questions.
Comment: Do frequentist and bayesian exhaust all the positions on the issue?
Comment: @Tim Beyond that, there's the "It Depends on the Problem-ists".
Comment: @luchanacho: There's also Keynes' view of "logical" probability as partial implication, & Fisher's fiducial probability.
Comment: Let's ask instead, who are not frequentists? If you have a prior distribution on the number of frequentsts, and you perform a Bayesian update on it to produce a posterior based on what gets posted in this thread, you might not be a requentist.
Comment: @Tim; good question (+1), maybe the answer is that the frequentists are ''those that are able to give the definition asked in this thread'' ;-) http://stats.stackexchange.com/questions/232339/frequentist-definition-of-probability-does-there-exist-a-formal-definition
Comment: @Mark L. Stone: that might depend on the prior that you choose so the conclusion would be ''subjective'' ?  :-)
Comment: @whuber: I tried to define them in my answer, I am not sure but it may be a basis for a discussion :-)
Comment: @whuber I made a small research by myself and made an attempt to provide my own answer: http://stats.stackexchange.com/a/232636/35989 , feel free to comment it.
Answer: Some existing answers talk about statistical inference and some about interpretation of probability, and none clearly makes the distinction. The main purpose of this answer is to make this distinction.

The word "frequentism" (and "frequentist") can refer to TWO DIFFERENT THINGS:

One is the question about what is the definition or the interpretation  of "probability". There are multiple interpretations, "frequentist interpretation" being one of them. Frequentists would be the people adhering to this interpretation.
Another is statistical inference about model parameters based on observed data. There is a Bayesian and a frequentist approaches to statistical inference, and frequentists would be the people preferring to use the frequentist approach.

Now comes a speculation: I think there are almost no frequentists of the first kind (P-frequentists), but there are lots of frequentists of the second kind (S-frequentists).

Frequentist interpretation of probability
The question of what is probability is a subject of intense ongoing debate with 100+ years of history. It belongs to philosophy. I refer anybody not familiar with this debate to the Interpretations of Probability article in the Stanford Encyclopedia of Philosophy which contains a section on frequentist interpretation(s). Another very readable account that I happen to know of, is this paper: Appleby, 2004, Probability is single-case or nothing -- which is written in the context of foundations of quantum mechanics, but contains sections focusing on what probability is.
Appleby writes:

Frequentism is the position that a probability statement is equivalent to a frequency
  statement about some suitably chosen ensemble. For instance, according to
  von Mises [21, 22] the statement "the probability of this coin coming up heads is
  0.5" is equivalent to the statement "in an infinite sequence of tosses this coin will
  come up heads with limiting relative frequency 0.5".

This might seem reasonable, but there are so many philosophical problems with this definition that one hardly knows where to start. What is the probability that it will rain tomorrow? Meaningless question, because how would we have an infinite sequence of trials. What is the probability of the coin in my pocket coming up heads? A relative frequency of heads in an infinite sequence of tosses, you say? But the coin will wear off and the Sun will go supernova before the infinite sequence can be finished. So we should be talking about a hypothetical infinite sequence. This brings one to the discussion of reference classes etc. etc. In philosophy one does not get away so easily. And by the way, why should the limit exist at all?
Furthermore, what if my coin were to come up heads 50% of the time during the first billion of years but then would start coming up heads only 25% of the time (thought experiment from Appleby)? This means that $P(\mathrm{Heads})=1/4$ by definition. But we will always be observing $\mathrm{Frequency}(\mathrm{Heads})\approx 1/2$ during the next billion years. Do you think such a situation is not really possible? Sure, but why? Because the $P(\mathrm{Heads})$ cannot suddenly change? But this sentence is meaningless for a P-frequentist.
I want to keep this answer short so I stop here; see above for the references. I think it is really difficult to be a die-hard P-frequentist.
(Update: In the comments below, @mpiktas insists that it is because the frequentist definition is mathematically meaningless. My opinion expressed above is rather that the frequentist definition is philosophically problematic.)

Frequentist approach to statistics
Consider a probabilistic model $P(X\mid\theta)$ that has some parameters $\theta$ and allows to compute the probability of observing data $X$. You did an experiment and observed some data $X$. What can you say about $\theta$?
S-frequentism is the position that $\theta$ is not a random variable; its true values in Real World are what they are. We can try to estimate them as some $\hat \theta$, but we cannot meaningfully talk about probability of $\theta$ being in some interval (e.g. being positive). The only thing we can do, is to come up with a procedure of constructing some interval around our estimate such that this procedure succeeds in encompassing true $\theta$ with a particular long-run success frequency (particular probability).
Most of the statistics used in natural sciences today is based on this approach, so there certainly are lots of S-frequentists around today.
(Update: if you look for an example of a philosopher of statistics, as opposed to practitioners of statistics, defending S-frequentist point of view, then read Deborah Mayo's writings; +1 to @NRH's answer.)

UPDATE: On the relationship between P-frequentism and S-frequentism
@fcop and others ask about the relationship between P-frequentism and S-frequentism. Does one of these positions imply another one? There is no doubt that historically S-frequentism was developed based on P-frequentist stance; but do they logically imply one another?
Before approaching this question I should say the following. When I wrote above that there are almost no P-frequentists I did not mean that almost everybody is P-subjective-bayesian-a-la-de-finetti or P-propensitist-a-la-popper. In fact, I believe that most statisticans (or data-scientists, or machine-learners) are P-nothing-at-all, or P-shut-up-and-calculate (to borrow Mermin's famous phrase). Most people tend to ignore foundation problems. And it is fine. We do not have a good definition of free will, or intelligence, or time, or love. But this should not stop us from working on neuroscience, or on AI, or on physics, or from falling in love.
Personally, I am not a S-frequentist, but neither do I have any coherent view on foundations of probability.
In contrast, almost everybody who did some practical statistical analysis is either a S-frequentist or a S-Bayesian (or perhaps a mixture). Personally, I published papers containing $p$-values and I have never (so far) published papers containing priors and posteriors over model parameters so this makes me a S-frequentist, at least in practice.
It is therefore clearly possible to be a S-frequentist without being a P-frequentist, despite what @fcop says in his answer.
Okay. Fine. But still: Can a P-bayesian be a S-frequentist? And can a P-frequentist be a S-bayesian?
For a convinced P-bayesian it is probably atypical to be a S-frequentist, but in principle entirely possible. E.g. a P-bayesian can decide that they do not have any prior information over $\theta$ and hence adopt a S-frequentist analysis. Why not. Every S-frequentist claim can certainly be interpreted with P-bayesian interpretation of probability.
For a convinced P-frequentist to be S-bayesian is probably problematic. But then it is very problematic to be a convinced P-frequentist...
Comment: Comments are not for extended discussion; this conversation has been [moved to chat](http://chat.stackexchange.com/rooms/44974/discussion-on-answer-by-amoeba-who-are-frequentists).
Comment: I don't get the hate on frequentism. Saying that probability is the ratio between counts of observations is the simplest, most intuitive viewpoint which also explains Bayesian statistics. No need to get hung up on infinite trials or the single case problem. What's crucial is the idea of modeling, which is the process of generalizing previous observations using a regularizer ie Occam's Razor, which is proved by observation but also a model such as Kolmogorov's algorithmic probability, which is supported by observation and the model of universal computation, etc. All we know is what we've seen.
Answer: Kolmogorov's work on Foundations of Theory of Probability has the section called "Relation to Experimental Data" on p.3. This is what he wrote there:

He's showing how one could deduct his Axioms by observing experiments. This is quite a frequentist way of interpreting the probabilities.
He has another interesting quote for impossible events (empty sets):

So, I think that if you're comfortable with these arguments, then you must admit that you're a frequentist. This label is not exclusive. You can be bi-paradigmous (I made up the word), i.e. both a frequentist and Bayesian. For instance, I become Bayesian when applying stochastic methods to phenomena which are not inherently stochastic.
UPDATE
As I wrote earlier on CV, Kolmogorov's theory itself is not frequentist per se. It's as compatible with Bayesian view as with frequentist view. He put this cute footnote to the section to make very clear that he's abstaining from philosophy:
Comment: @fcop, I remember his answer. It seemed reasonable. You can definitely derive Bayes axioms, and Kolmogorov shows that in the book.
Comment: well most axiomatic systems are derived by ''abstracting'' or ''generalizing'' real world concepts. The same holds for the concept (axioms) of a ''metric'', they looked at the real world concept (eucildean distance) and ''found'' three properties that they used as ''axioms'' in a metric space. But your answer is good (+1), it shows that Kolmogorov did not ''invent'' his axioms ''out of the air'', he developed an axiomatic system that was linked to the understanding of what propability was at that time.
Comment: Could you look at @mpiktas 's comments to this question and say that Kolmogorov himself gave that defintion ? see comments on http://stats.stackexchange.com/questions/230415/is-there-any-mathematical-basis-for-the-bayesian-vs-frequentist-debate/230943#230943
Comment: +1 Exactly what I had in mind (the footnote, in particular) when I was writing comments to related threads. Also last comment by @Aksakal.
Comment: @Aksakal: referring to your comment above: it was not ''his'' answer but mine :-)
Answer: I believe that it is relevant to mention Deborah Mayo, who writes the blog Error Statistics Philosophy.
I won't claim to have a deep understanding of her philosophical position, but the framework of error statistics, as described in a paper with Aris Spanos, does include what is regarded as classical frequentist statistical methods. To quote the paper:

Under the umbrella of error-statistical methods, one may include all standard methods using error probabilities based on the relative frequencies of errors in repeated sampling – often called sampling theory or frequentist statistics.

And further down in the same paper you can read that:

For the error statistician probability arises not to measure degrees of confirmation or belief (actual or rational) in hypotheses, but to quantify how frequently methods are capable of discriminating between alternative hypotheses and how reliably they facilitate the detection of error.
Comment: +1, Well done mentioning Mayo's blog. She is indeed the most vocal philosopher of statistics who is supporting frequentist statistics. Most of the other rants on the internet these days are in favour of Bayesian statistics.
Answer: Referring to this thread and the comments on it I think that the frequentists are those that define ''probability'' of an event as the long run relative frequency of the occurence of that event. So if $n$ is the number of experiments and $n_A$ the number of occurences of event $A$ then the probability of the event $A$, denoted by $P(A)$, is defined as $$P(A):=\lim_{n\to +\infty} \frac{n_A}n$$.
It is not hard to see that this definition fulfills Kolmogorov's axioms (because taking limits is linear, see also Is there any *mathematical* basis for the Bayesian vs frequentist debate?).
In order to give such a definition they must ''believe'' that this limit exists.  So the frequentists are those who believe in the existence of this limit.
EDIT on 31/8/2016: on the distintion between S- and P-frequentism
As @amoeba distinguishes in his answer between S-frequentists and P-frequentists, where P-frequentists are the type of frequentists that I define supra, and as he also argues that it is hard to be a P-frequentist I added an EDIT section to argue that the opposite is true;

I argue that all S-frequentists are P-frequentists.

In the S-frequentism section @amoeba says ''this procedure succeeds in encompassing true $\theta$ with a particular long-run success frequency (particular probability).''
In his answer he also states that P-frequentists are a rare species.
But this ''long-run success frequency'', used to define S-frequentism, is what he defines as P-frequentism as it is the interpretation of $P(\widehat{CI} \ni \theta)$.
Therefore, according to his defintions every S-frequentist is also a P-frequentist.  Therefore I conclude that P-frequentists are not so rare as argued by amoeba.
There is even more;  @amoeba also argues that the S-frequentists consider the unknown parameter $\theta$ as fixed or non-random, therefore one can not talk about ''probability of $\theta$ having a particluar value'', he says that

''The only thing we can do, is to come up with a procedure of constructing some interval around our estimate such that this procedure succeeds in encompassing true  $\theta$ with a particular long-run success frequency (particular probability).''

May I ask what might be the origin of the name ''frequentist'' : (a) the ''non-random $\theta$''-idea or (b) the ''long-run frequency''-idea ?
May I also ask @mpiktas who writes in his comment to the answer of amoeba:

'' It is very hard to be a P-frequentist, because it is practically impossible to give mathematically sound definition of such probability ''

If you need a defintion of P-frequentism to define the S-frequentism, how can one then be more S-frequentist than P-frequentist ?
Comment: @Tim: why would OLS be ''frequentist'' ?
Comment: foundation of probability theory precisely for that reason, i.e. to give certain interpretations of probability sound mathematical background. Now you want to go back and "reinvent" probability with your "frequentist" definition. I find this misleading, hence I downvote your answers. You are welcome to ignore this, this is the way site works, there is always possibility for disagreement.
Comment: If it is so, then the whole discussion of who are frequentists does not seem to have much sense since their scope of interest is *very* limited and huge areas of statistics are out of their scope... (Including many areas that are of interest of Bayesians.) What I am saying is that this does not seem to be *the* definition since it is too narrow.
Comment: What do *Bayesians* (self-proclaimed, or merely pragmatists who are wearing their "Bayesian hat" for the interlude) believe is $\lim_{n\to +\infty} \frac{n_A}{n}$?
Comment: @Silverfish $lim_{n→+∞}n_A/n$ Bayesians are free to use long run frequencies as probabilities if they wish to do so, it is only frequentists that have no option.  The key difference is that a Bayesian might say that $p_H \equiv lim_{n→+∞}n_A/n$, but in inference we are interested in defining a *distribution* over the plausible values of $p_H$ that we obtain from the 1E12 observations.
Comment: @Dikran Marsupial see also http://stats.stackexchange.com/questions/230415/is-there-any-mathematical-basis-for-the-bayesian-vs-frequentist-debate/230943#230943
Comment: Dear @fcop, unfortunately Kolmogorov is dead, so it is not possible to speak with him. However I was taught by his students, so I know what I am talking about. The whole context of Aksakal answer should be taken into account. It is quite clear that Kolmogorov refers to one specific example of probability space, for which probabilities match to frequencies. In that case the proof of central limit theorem and the law of large numbers becomes an issue of application Stirling's formula. This however does not constitute **the** definition of probability. I think Kolmogorov invented his ...
Comment: Yes, but... For example, OLS is "frequentist" method and it does not mention "long run frequency" anywhere, it simply minimizes the squared distance. Multiple examples can be given where there is no "long run frequency" involved (I'm not saying that you can't *interpret* those in probabilistic terms, but this is what Bayesians do in most cases rather then frequentists...).
Comment: Well, it's not Bayesian, so it's frequentist - isn't it? And if not, then who are frequentists? If it isn't, then who are the ones who use OLS (I guess it's not least-squerists)?
Comment: @Tim: so your definition of ''frequentists'' is ''non-Bayesian'' ? And those who use OLS are not the ''least-squarists'' I think, in fact I don't know how I would call them, but if I have to give a name I would call them ''ordinary'' ? :-)
Comment: No it isn't, but it is commonly used like this (most of the frequentist vs Bayesians debates). If OLS is not frequentist method, then could you provide some examples of frequentist statistical methods..?
Comment: @Tim:  take a fair coin, toss it 1E12 times and count the number of heads, after that tell me in  a comment what the relative frequency of ''head'' was ? Or the definition of occurence of a type I error in a hypothesis test might also be an example ?
Comment: @Tim: well if everything that is non-Bayesian is frequentist, as you say, then I think the scope of the frequentist approach is much broader than the Bayesian one. That is what follows from your definition and I doubt that...
Comment: @Silverfish: the question is whether they believe that it exists ?  But as I said, it is a trial answer, the best alternative I have seen so far (in fact the only one) is ''frequentist = non-Bayesian''. Fine for me, but then one should post that no ?
Comment: @Silverfish, I think a true Bayesian doesn't have an opinion on $\lim_{n\to +\infty} \frac{n_A}{n}$. A true Bayesian would challenge the premise of the limit to infinity. For instance, if I'm forecasting tomorrow's weather, what does this limit mean practically? I can only have one tomorrow.
Comment: @Tim I don't see why OLS is not Bayesian, it is what you get when you fit your model assuming heteroscedastic Gaussian noise process with a flat prior over the parameters.  OLS is both frequentist *and* Bayesian, depending on how you interpret it.
Comment: @Aksakal degree of belief can be also interpreted as expected frequency in long run, see e.g. http://www.brunodefinetti.it/Bibliografia/Subjectivism,%20objectivism%20and%20objectivity%20in%20Bruno%20de%20Finetti%20Bayesianism.pdf (p 13)
Comment: @Tim, what is "expected" then? from frequentist point of view it doesn't matter what you "expect", the event will happen at the rate defined by the probability measure
Comment: I must downvote again. The definition given is not mathematical one since it relies of belief of existence of the right hand side of the definition. As I've already expanded elsewhere before defining something it is necessary to prove that it exists.
Comment: @mpiktas: you van do whatever you want, the votes are not what I aim at and your opinion is not so important if you read the other answers. Amongst others the reference to kolmogorov.
Comment: @mpiktas: see the answer of Aksakal and the reference to Kolmogorov, i cite: "... repeated a large number of times n then if m be the number of occurences of event A, the ratio m/n will differ very slightly from P(A)'', so as you downvoted me because $lim_{n \to \infty} m/n$ does not exist, can you tell Kolmogorov that it can impossibly be ''slightly different from $P(A)$'' ?
Comment: @mpiktas: I have the greatest respect for mr Kolmogorov, but being thougt by his students is already ''second line'' if that strenthes your ego than I am happy for you.  And indeed, Kolmogorov refers to one specific defintion of probability, namely the frequentist one.  That is what I said in my answer that you also downvoted, I said lterally ''frequentis defintion is a special case'' see: http://stats.stackexchange.com/questions/230415/is-there-any-mathematical-basis-for-the-bayesian-vs-frequentist-debate/230943#230943, but now you seem to conform that.
Comment: @mpiktas: I do not reinvent any defintion, I just say that the frequentist defintion is only a special case of Kolmogorov's probability measure and you confirm that in your previous comment. But as I said, your opinion is not of that much importance to me and you can downvote me as much as you want, if that makes you feel better.  For me one thing is clear; you probably know the defintion of Kolmogorov, but you seem to say that frequentists do not exist because they don't even have a definition
Answer: Let me offer an answer that connects this question with a matter of current and very practical importance -- Precision Medicine -- while at the same time answering it literally as it was asked: Who are frequentists?
Frequentists are people who say things such as [1] (emphasis mine):

What does a 10% risk of an event within the next decade mean to the individual for whom it was generated? Contrary to what is thought, this risk level is not that person's personal risk because probability is not meaningful in an individual context.

Thus, frequentists interpret 'probability' in such a way that it has no meaning in a singular context like that of an individual patient. My PubMed Commons comment on [1] examines the contortions its frequentist authors must undergo to recover a semblance of a probability-like notion applicable to the care of an individual patient. Observing how and why they do this may prove very instructive as to who is a frequentist. Also, the largely unilluminating subsequent exchange in the JAMA Letters section [2,3] is instructive as to the importance of explicitly recognizing limitations in frequentist notions of probability and attacking them directly as such. (I regret many CV users may find that [1] lies behind a paywall.)
The excellent and highly readable book [4] by L. Jonathan Cohen would repay the efforts of anyone interested in the OP's question. Of note, Cohen's book oddly was cited by [1] in connection with the claim "probability is not meaningful in an individual context," although Cohen clearly rebukes this view as follows [4,p49]:

Nor is it open to a frequency theorist to claim that all important probabilities are indeed general, not singular. It often seems very important to be able to calculate the probability of success for your own child's appendectomy...

1] Sniderman AD, D'Agostino Sr RB, and Pencina MJ. "The Role of Physicians in the Era of Predictive Analytics." JAMA 314, no. 1 (July 7, 2015): 25–26. doi:10.1001/jama.2015.6177. PubMed
2] Van Calster B, Steyerberg EW, and Harrell FH. "RIsk Prediction for Individuals." JAMA 314, no. 17 (November 3, 2015): 1875–1875. doi:10.1001/jama.2015.12215. Full Text
3] Sniderman AD, D'Agostino Sr RB, and Pencina MJ. "RIsk Prediction for Individuals—reply." JAMA 314, no. 17 (November 3, 2015): 1875–76. doi:10.1001/jama.2015.12221. Full Text
4] Cohen, L. Jonathan. An Introduction to the Philosophy of Induction and Probability. Oxford : New York: Clarendon Press ; Oxford University Press, 1989. Link to scanned pages 46-53 & 81-83
Comment: Looks like a good answer, but I'm a little confused. I believe frequentists are concerned with procedures (experiments) which could, in theory, be run an infinite number of times. Doesn't mean they can't make a prediction about the next coin toss, just that their concerns/assurances concentrate on the process. True, they would say that "the US will win the World Cup this year" isn't something they could say anything about, but couldn't they say something about your child's appendectomy -- it is unique in once sense, but appendectomies on children are not.
Comment: @Wayne, I would suggest that amoeba's answer above--with its distinction between statistical *procedures* customarily associated with the 'frequency view of probability' and *that frequency view itself*--answers your comment. People might use frequentist statistical procedures, and yet *interpret* and *use* the resulting probabilities in fiducial or subjectivist ways. One need only look at the perpetual error of interpreting P-values as 'the probability the null hypothesis is true' to see that this is so.
Comment: 2] is available online: https://lirias.kuleuven.be/bitstream/123456789/513795/1/Van+Calster+JAMA+2015+risk+prediction+for+individuals.pdf
Comment: I like the quote "risk can be thought of
as the subjective level to which one "believes in" or is "pre-
pared to bet on" the occurrence of a disease or event, 2 just as
one bets on future 1-time events in games of sport". Thanks for your input and references.
Comment: @Tim, thanks for the link, which includes both [2] and [3]. I have updated the text of my answer accordingly.
Comment: In the case of things like Confidence Intervals, I'd agree: people interpret them as Credible Intervals. But that's not what I'm saying. If you flip a (fair) coin, I believe it's consistent with both P- and S-frequentism to say it has a 50% chance of coming up heads in that individual flip. Similarly, it would be correct to say, "Your son has a 10% chance of complications after an appendectomy." Again, if you give a CI around this 10%, it does not mean what a not-P-but-S-frequentist would misinterpret as a Credible Interval, but the point estimate of the probability would still be valid, no?
Comment: @Wayne, I've added a link to a few scanned pages from Cohen; I assume this is 'fair use' as it can only increase sales of this delightful book. I expect the discussion of §7 will help clarify the 'frequency theory'. The intro to Chapter III will give a hint as to the 'pluralism' I invoked in my last comment.
Answer: Really interesting question!
I'd put myself in the frequentist camp when it comes to understanding and interpreting probability statements, although I am not quite so hard-line about the need for an actual sequence of iid experiments to ground this probability.  I suspect most people who don't buy the thesis that "probability is a subjective measure of belief" would also think about probability this way.
Here's what I mean: take our usual "fair" coin, with assignment $P(H)=0.5$. When I hear this, I form an image of someone tossing this coin many times and the fraction of heads approaches $0.5$. Now, if pressed, I would also say that the fraction of heads in any random sample from a finite sequence of such coin tosses will also approach $0.5$ as the sample size grows (independence assumption).
As has been stated by others, the biggest assumption is that this limit exists and is correct (i.e., limit is $0.5$), but I think just as importantly is the assumption that the same limit exists for randomly chosen sub-samples as well. Otherwise, our interpretation only has meaning wrt the entire infinite sequence (e.g., we could have strong autocorrelation that gets averaged out).
I think the above is pretty uncontroversial for frequentists. A Bayesian would be more focused on the experiment at hand and less on the long run behavior: they would state that their degree of belief that the  next toss will be heads is $P(H) = 0.5$...full stop.
For a simple case such as coin tossing, we can see that the frequentist and Bayesian approaches are functionally equivalent, albeit philosophically very different. As Dikran Marsupial has pointed out, the Bayesian may in fact be utilizing the fact that empirically we see coins come up heads about as often as we see them come up tails (long run/large sample frequency as a prior).
What about things that cannot possibly have long run frequencies? For example, what is the probability North Korea will start a war with Japan in the next 10 years? For frequentists, we are really left in the lurch, since we cannot really describe the sampling distributions required to test such a hypothesis. A Bayesian would be able to tackle this problem by placing probability distribution over the possibilities, most likely based on eliciting expert input.
However, a key question comes up: where do these degrees of belief (or assumed value for the long run frequency) come from? I'd argue from psychology and say that these beliefs (especially in areas far from experimental data) come from what is referred to as the availability heuristic and representativness heuristic. There are slew of others that likely come into play. I argue this because in the absence of data to calibrate our beliefs (towards the observed long run frequency!), we must rely on heuristics, however sophisticated we make them seem.
The above mental heuristic thinking applies equally to Frequentists and Bayesians. What is interesting to me is that regardless of our philosophy, at the root, we place more belief in something that we think is more likely to be true, and we believe it to be more likely to be true because we believe there are more ways for it to be true, or we imagine that the pathways leading to it being true would happen more often (frequently:-) than those that would make it not true.
Since it's an election year, let's take a political example: What belief would we place in the statement "Ted Cruz will propose a ban assault rifles in the next 4 years". Now, we do have some data on this from his own statements, and we'd likely place our prior belief in the truth of this statement very near zero. But why? Why does his prior statements make us think this way? Because we think that highly ideological people tend to "stick to their guns" more than their pragmatist counterparts. Where does this come from? Likely from the studies done by psychologists and our own experiences with highly principled people.
In other words we have some data and the belief that for most cases where someone like Cruz could change their mind, they will not (again, a long-run or large-sample assessment of sorts).
This is why I "caucus" with the frequentists. It's not my dislike of Bayesian philosophy (quite reasonable) or methods (they're great!), but that if I dig deep enough into why I hold beliefs that lack strong large-sample backing, I find that I am relying on some sort of mental model where outcomes can be tallied (if implicitly) or where I can invoke long-run probabilities in a particular sub-process (e.g., Republicans vote against gun control  measures X% of the time) to weight my belief one way or another.
Of course, this not really true frequentism, and I doubt that there are many people who subscribe to the von Mieses-esque interpretation of probability to the letter. However, I think it shows the underlying compatibility between Bayesian and Frequentist probability: Both are appealing to our inner heuristics regarding availability or what I call the "Pachinko" principle about frequencies along a chain of causation.
So perhaps I should call myself an "availabilist", to indicate that I assign probabilities based on how often I can imagine an event occurring as the outcome of a chain of events (with some rigor/modelling of course). If I have a lot of data, great. If I don't, then I will try to decompose the hypothesis into a chain of events and use what data I have (anecdotal or "common sense", as need be) to assess how often I would imagine such an event to occur.
Sorry for the longish post, great question BTW!
Comment: You make huge oversimplifications about subjectivist approach to probability. I agree that psychology plays role in how you work with data, but you can make subjectively-biased analysis in frequentist approach as well. Some Bayesians argue that in Bayesian case at least you make your subjective beliefs explicit, rather then ignoring them.
Comment: @Tim I wasn't saying that Frequentists are more objective (see my first part about the major assumptions for frequentists.) Also, what I was pointing out is that both frequentists and Bayesians ground their probabilities in their beliefs about how often something would occur, or how many things need to happen (and their individual likelihood for doing so) to make something true.
Comment: @Tim since this is not a Post about Bayesianism  vs Frequentism per se, I doubt I gave either their due...that would take a lot of page space! Fundamentally through, we all rely on mental heuristics when thinking about probability, and these heuristics lead us think of some types of event being able to happen "in more ways" or being "more accessible in a causal netowork" than others.
Comment: @Tim OK...I added in some langugae to clarify when I transition from my (brief) discussion of Bayesianism to my main spiel.
Answer: As @amoeba noticed, we have frequentist definition of probability and frequentist statistics. All the sources that I have seen until now say that frequentist inference is based on the frequentist definition of probability, i.e. understanding it as limit in proportion given infinite number random draws (as already noticed by @fcop and @Aksakal quoting Kolmogorov)
$$ P(A) = \lim_{n\to\infty} \frac{n_A}{n} $$
So basically, there is a notion of some population that we can repeatably sample from. The same idea is used in frequentist inference. I went through some classic papers, e.g. by Jerzy Neyman, to track the theoretical foundations of frequentist statistics. In the 1937 Neyman wrote

(ia) The statistician is concerned with a population, $\pi$, which
  for some reason or other cannot be studied exhaustively. It is only
  possible to draw a sample from this population which may be studied in
  detail and used to form an opinion as to the values of certain
  constants describing the properties of the population $\pi$. For
  example, it may be desired to calculate approximately the mean of a
  certain character possessed by the individuals forming the population
  $\pi$, etc.
  (ib) Alternatively, the statistician may be concerned
  with certain experiments which, if repeated under apparently identical
  conditions, yield varying results. Such experiments are called random
  experiments [...]
  In both cases described, the problem with which the
  statistician is faced is the problem of estimation. This problem
  consists in determining what arithmetical operations should be
  performed on the observational data in order to obtain a result, to be
  called an estimate, which presumably does not differ very much from
  the true value of the numerical character, either of the population
  $\pi$, as in (ia), or of the random experiments, as in (ib). [...]
  In (ia) we speak of a statistician drawing a sample from the population studied.

In another paper (Neyman, 1977), he notices that the evidence provided in the data need to be verified by observing the repeated nature of the studied phenomenon:

Ordinarily, the 'verification', or 'validation' of a guessed model
  consists in deducing some of its frequentist consequences in
  situations not previously studied empirically, and then in performing
  appropriate experiments to see whether their results are consistent
  with predictions. Very generally, the first attempt at verification is
  negative: the observed frequencies of the various outcomes of the
  experiment disagree with the model. However, on some lucky occasions
  there is a reasonable agreement and one feels the satisfaction of
  having 'understood' the phenomenon, at least in some general way.
  Later on, invariably, new empirical findings appear, indicating the
  inadequacy of the original model and demanding its abandonment or
  modification. And this is the history of science!

and in yet another paper Neyman and Pearson (1933) write about random samples drawn from fixed population

In common statistical practice, when the observed facts are described
  as "samples," and the hypotheses concern the "populations", for which
  the samples have been drawn, the characters of the samples, or as we
  shall term them criteria, which have been used for testing hypotheses,
  appear often to be fixed by happy intuition.

Frequentist statistics in this context formalize the scientific reasoning where evidence are gathered, then new samples are drawn to verify the initial findings and as we accumulate more evidence our state of knowledge crystallizes. Again, as described by Neyman (1977), the process takes the following steps

(i) Empirical establishment of apparently stable long-run relative
  frequencies (or 'frequencies' for short) of events judged interesting,
  as they develop in nature.
  (ii) Guessing and then verifying the
  'chance mechanism', the repeated operation of which produces the
  observed frequencies. This is a problem of 'frequentist probability
  theory'. Occasionally, this step is labeled 'model building'.
  Naturally, the guessed chance mechanism is hypothetical.
  (iii)
  Using the hypothetical chance mechanism of the phenomenon studied to
  deduce rules of adjusting our actions (or 'decisions') to the
  observations so as to ensure the highest 'measure' of 'success'. [...]
  the deduction of the 'rules of adjusting our actions' is a problem
  of mathematics, specifically of mathematical statistics.

Frequentists plan their research having in mind the random nature of data and the idea of repeated draws from fixed population, they design their methods based on it, and use it to verify their results (Neyman and Pearson, 1933),

Without hoping to know whether each separate hypothesis is true or
  false, we may search for rules to govern our behavior with regard to
  them, in following which we insure that, in the long run of
  experience, we shall not be too often wrong.

This is connected to repeated sampling principle (Cox and Hinkley, 1974):

(ii) Strong repeated sampling principle
  According to the strong repeated sampling principle, statistical procedures are to be
  assessed by their behaviour in hypothetical repetitions under the same
  conditions. This has two facets. Measures of uncertainty are to be
  interpreted as hypothetical frequencies in long run repetitions;
  criteria of optimality are to be formulated in terms of sensitive
  behaviour in hypothetical repetitions.
  The argument for this is that
  it ensures a physical meaning for the quantities that we calculate and
  that it ensures a close relation between the analysis we make and the
  underlying model which is regarded as representing the "true" state of
  affairs.
(iii) Weak repeated sampling principle
  The weak version of the repeated sampling principle requires that we should not follow
  procedures which for some possible parameter values would give, in
  hypothetical repetitions, misleading conclusions most of the time.

As contrast, when using maximum likelihood we are concerned with the sample that we have, and in Bayesian case we make inference based on the sample and our priors and as new data appears we can perform Bayesian updating. In both cases the idea of repeated sampling is not crucial. Frequentists rely only on the data they have (as noticed by @WBT), but keeping in mind that it is something random and it is to be thought as a part of process of repeated sampling from the population (recall, for example, how confidence intervals are defined).
In frequentist case the idea of repeated sampling enables us to quantify the uncertainty (in statistics) and enables us to interpret real-life events in terms of probability.

As a side note, notice that neither Neyman (Lehmann, 1988), nor Pearson (Mayo, 1992) were as pure frequentists as we could imagine they were. For example, Neyman (1977) proposes using Empirical Bayesian and Maximum Likelihood for point estimation. On another hand (Mayo, 1992),

in Pearson's (1955) response to Fisher (and elsewhere in his work) is
  that for scientific contexts Pearson rejects both the low long-run
  error probability rationale [...]

So it seems that it is hard to find pure frequentists even among the founding fathers.

Neyman, J, and Pearson, E.S. (1933). On the Problem of the Most Efficient Tests of Statistical Hypotheses. Philosophical Transactions of the Royal Society A: Mathematical, Physical and Engineering Sciences. 231 (694–706): 289–337.
Neyman, J. (1937). Outline of a Theory of Statistical Estimation Based on the Classical Theory of Probability. Phil. Trans. R. Soc. Lond. A. 236: 333–380.
Neyman, J. (1977). Frequentist probability and frequentist statistics. Synthese, 36(1), 97-131.
Mayo, D. G. (1992). Did Pearson reject the Neyman-Pearson philosophy of statistics? Synthese, 90(2), 233-262.
Cox, D. R. and Hinkley, D. V. (1974). Theoretical Statistics. Chapman and Hall.
Lehmann, E. (1988). Jerzy Neyman, 1894 - 1981. Technical Report No. 155. Department of Statistics, University of Califomia.
Comment: +1 (already some days ago). Thanks for writing this up, there are some good quotes here and the list of references is very useful. In turn, I have now updated my answer in several places but mostly in the end, to clarify the relationship between P- and S-frequentism as I see it. I certainly agree that historically S-freq was built on P-freq ideas, as you argue here, but I don't think that they necessarily entail one another.
Answer: "Frequentists vs. Bayesians" from
XKCD (under CC-BY-NC 2.5), click to discuss:

The general point of the frequentist philosophy illustrated here is a belief in drawing conclusions about the relative likelihood of events based solely ("purely") on the observed data, without "polluting" that estimation process with pre-conceived notions about how things should or should not be.  In presenting a probability estimate, the frequentist does not take into account prior beliefs about the likelihood of an event when there are observations available to support computation of its empirical likelihood. The frequentist should take this background information into account when deciding on the threshold for action or conclusion.
As Dikran Marsupial wrote in a concise comment below, "The valuable point the cartoon (perhaps unintentionally) makes is that science is indeed more complex and we can't just apply the "null ritual" without thinking about prior knowledge."
As another example, when trying to determine/declare what topics are "trending" on Facebook, frequentists would likely welcome the more purely algorithmic counting approach Facebook is shifting towards, instead of the old model where employees would curate that list based in part on their own background perspectives about which topics they thought "should" be most important.
Comment: -1. I love XKCD but without any comments I am afraid this is only going to be misleading in this thread. And one needs quite a bit of comments to explain correctly what are the issues pertinent to this comic. If you provide appropriate discussion, I will remove the downvote.
Comment: It isn't true that the frequentist approach doesn't have the pre-concieved notions, they are encoded in the threshold for statistical significance.  ISTR there is a good quote from Fisher about this depending on the nature of the experiment.  This is entirely the problem with the frequentist in the cartoon, they just haven't set an appropriate value for $\alpha$ as they haven't taken into account "prior knowledge" about the problem (that the sun going nova is extremely unlikely) and adjusted the test accordingly.  Using 95% *all* the time is part of the much-criticised "null ritual".
Comment: The "null ritual" is bad application of frequentist statistics, but it isn't a problem with frequintism per se.
Comment: @luchonacho FWIW there is a discussion of the XKCD cartoon here http://stats.stackexchange.com/questions/43339/whats-wrong-with-xkcds-frequentists-vs-bayesians-comic The valuable point the cartoon (perhaps unintentionally) makes is that science is indeed more complex and we can't just apply the "null ritual" without thinking about prior knowledge.
Comment: @Dikran Your comments seem (incorrectly) to equate "Frequentist" with "user of NHSTs."  That is the kind of confusion I have been concerned about.
Comment: @whuber no, for me a frequentist and Baysian differ on how probabilities are defined (long run frequency - v - state of knowledge).  Bayesians do NHSTs as well (the Bayesian is doing that in the cartoon, but hasn't shown his working).  It is just the context of the XKCD cartoon that makes it specific to NHST.
Comment: Totally misleading. A ridiculous example. Science is way more complex than that and using "a-priori knowledge" is in many cases absolutely arbitrary.
Comment: Thanks. I have removed my downvote. I am still not sure that this particular comic itself is helpful in this particular discussion, but together with the above comments it is fine to have it here.
Comment: [More issues with the "null ritual" as commonly practiced in science are nicely described here.](https://www.youtube.com/watch?v=42QuXLucH3Q)
Answer: (A remark, only tangentially relevant for the question and the site.)
Probability is about objective status of individual things. Things cannot have intention and they receive their statuses from the universe. With a thing, an event (giving it its status) always shall have happened: the event is already there accomplished, even if it haven't actually happened yet - the past future of a thing, also called "fate" or contingency.
Again, with probability, the fact of event - having yet occured or not, doesn't matter - is already there [as opposed to the meaning which never is there]; and as such it's already got unnecessary and superfluous. The fact should be discarded, and that invalidation of it is what we call "the event is probable". Any fact about a thing bears in itself its primeval unconvincing side, or probability of the fact (even the actually occured fact - we recognize it by pinprick of disbelief). We are inevitably "tired of things" pre-psychically to an extent. It remains therefore only to quantify that partial negation of facticity, if need a number. One way to quantify is to count. Another is to weigh. A frequentist carries out or imagines of a series of trials lying before him which he turns face over to see if the event actually happens; he counts. A Bayesian consideres a series of psychological motives dragging behing him which he screens; he weighs them as things. Both men are busy with charge/excuse game of mind. Fundamentally, there is no much difference between them.
Possibility is about potentialities of me in world. Possibility is always mine (a rain's chance is my problem to opt for taking an umbrella or getting wet) and concerns not an object (the one I'm considering as being possible or having the possibility) but the whole world for me. Possibility is always 50/50 and it is always convincing, because it implies - either calls for before or entails after - my decision how to behave. Things themselves have no intentions and thus possibilities. We should not confuse our possibilities of these things for us with their own probabilities of "stochastic determinism". Probability can never be "subjective" in the human sense.

An observant reader may feel in the response a masked dig at the bright answer in this thread, where @amoeba says he thinks <code>"there are almost no frequentists of the [probability definition] kind (P-frequentists)"</code>. It could be turned opposite: bayesian probability definers do not exist as different class. Because, as I've admitted, bayesians consider chanks of reality the same manner as frequentists do - as series of facts; only these facts are not experiments, sooner recollections of "truths" and "arguments". But such forms of knowledge is factual and can only be counted or weighed. Probability it erects is not synthesized as subjective, that is, anticipatory ("bayesian" to be) unless human expectation (possibility) enters the scene to meddle. And @amoeba anxiously lets it in when imagines as "the coin will wear off and the Sun will go supernova".
Answer:
Oh, I've been a frequentist for many's the year,
  And I've spent all my time playing the data by ear,
  But now I'm returning with Bayes in great store,
  And I never will play the frequentist no more.
For it's no nay never, no nay never, no more,
  Will I play the frequentist, no never, no more!
I went into a lab where I used to consult.
  The gave me some data, said 'p that for us',
  I said 'No way, Jose' with a bit of a smile,
  P values and evident just don't reconcile!
Chorus
I said it's your prior that we need to shed light,
  And the researcher's eyes opened wide with delight,
  He said, 'My prior views are as good as the rest,
  And for sure a Bayes factor is what will work best!'
Chorus
I'll go back to my teachers, confess what I've done,
  And ask them to pardon their prodigal son,
  But when they've forgave me, as often before,
  I never will play the frequentist no more!
Chorus
And it's no, nay never, no nay never no more,
  Will I play the frequentist, no never, no more!

Source:  A E Raftery, in The Bayesian Songbook, edited by B P Carlin, at
http://www.biostat.umn.edu/. Sung to the traditional folk tune of 'The Wild Rover'. Quoted in Open University M347 Mathematical Statistics, Unit 9.
Comment: This should be rather posted in here: http://stats.stackexchange.com/questions/1337/statistics-jokes
Comment: Agree with @Tim and -1 because I don't see how this adds to the present discussion.

Who are frequentists?


How do you make a custom icon for the Action Bar?

Question: This is not specifically a programming question, but I find I keep having to look this process up in the midst of doing android programming. I'm sharing my answer below for the convenience of other android developers.
Answer: You should start by reading Iconography.
It is best if you can use the standard icons that come with Android. They can be downloaded here. However, if you are like me, sometimes you need to make a custom icon. This is a short tutorial for how to do it.
I use Inkscape to make vector graphics but I imaging the process is similar for Illustrator.
In Inkscape:
One. Make 512x512 pixel document
(File > Document Properties > Custom size > Units=px)
The background should be transparent. (Alpha = 00)
Two. Make the image shape you want.
Three. Change the color and alpha settings (Object > Fill and Stroke)
For Holo Light icons:
Color: #333333
Enabled: 60% opacity (alpha = 153 in dec, #99 in hex)
Disabled: 30% opacity (alpha = 76 in dec, #4C in hex)
For Holo Dark icons:
Color: #FFFFFF
Enabled: 80% opacity (alpha = 204 in dec, #CC in hex)
Disabled: 30% opacity (alpha = 76 in dec, #4C in hex)
(The background in Inkscape defaults to white so your image may appear invisible for white icons. You could change it back to black after you are done exporting your bitmap images.)
Four. Save the file as svg for future editing. (File > Save As)
Five. Export png files at various densities to use in your Android app
(File > Export bitmap)
Make sure that "Page" is selected
Set the width and height to 32px for mdpi
Click "Browse" to select the folder and filename
Use .png for the filename extension.
Click export to save the image
Six. Repeat the process in step 5 for all of the sizes that you need.
The file names should all be the same, but put them each in differently named folders. The following list makes good folder names.
mdpi_32x32
hdpi_48x48
xhdpi_64x64
xxhdpi_96x96
xxxhdpi_128x128
You can copy the images to your app's drawable folders and you are ready to go!
Answer: <code>getActionBar().setIcon(R.drawable.my_icon);
</code>