Achar div irmã anterior no CSS

Question: Tenho o seguinte HTML:

    Teste

o seguinte css:
.carregando {
    display: none;
}

.load {
    display: none;
}

.load > .carregando {
    display: block;
}

e o JS:
$(".loadimg).click(function(){
    $('.tela').removeClass('carregando');
});

Quero que quando remover a class carregando o CSS mude o estilo pra algo do tipo:
.load > .carregando {
    display: block;
}

Se a classe carregando tiver ativa a classe load é display block... nesse ultimo CSS de exemplo tentei usando > mas não deu certo...
Tem que ser em CSS em jQuery eu sei fazer...
Answer: Tenta estilizar o CSS assim:

$(".loading").click(function(){
    $('.tela').removeClass('carregando');
});
.carregando {
    display: none;
}

.load {
    display: none;
}

.carregando ~ .load {
    display: block;
}

    Teste

<button class='loading'>TESTE</button>

Como isso se chama Sibling tive que mudar a ordem dos elementos.
Comment: vlw!"!!!!!!!!!!!!!!

Achar div irmã anterior no CSS


Decision Tree as variable selection for Logistic Regression

Question: I have to do a Logistic Regression, and have to use a subset of the variables. I received this "tip": do a Decision Tree first, and use the most relevant variables in the Logistic Regression.
Is this a valid technique? If not, what problems does it face?
PS: This tip is also given here for a standard regression.
UPDATE: First of all thanks for all the answers. I'm definitely going to try the LASSO model. But, the algorithm must be simple, and easy for the IT to implement. It's a "millions of lines" kind of database, and the model needs to recurrently be estimated. Does it change the approach?
Comment: ...The source of the tip you cite is chock-full of advice that would be anathema to a lot of knowledgeable people.  In fact it would be a useful exercise to see how many pieces of questionable advice you could find; to explain what's wrong with each; and to compare your list with others'.
Comment: You'll find some relevant info if you search this site for "chaid."
Answer: In addition to the usual problems with automatically choosing variables, this uses trees for a purpose they were not designed for. To me, there are two big advantages to classification trees:
1) They are intuitively very clear.
2) They allow you to look at interactions in ways that would be very difficult in a regression model, because the interactions can be different in different branches of the tree.
Variable selection is a big topic and has been often discussed here. I am partial to LASSO and or LAR, myself.
Answer: If you have access to LASSO and your predictors are all numeric then that is a good choice as Peter mentioned.
If you have a massive number of predictors as experienced often in fields like marketing - then this can be computationally too expensive. In that case, a tree can be used, but a random forest or gradient boosted regression tree would likely be better choices as variable importance is more robust (for the same reason boosted and bagged trees are expected to be more stable).
The party package in R might be another good choice, as the conditional inference trees and associated forests and variable importance measures are purported to be less biased. Party VI
Outside of statistics, Googling "Feature Selection" might give you more ideas.
Comment: By the way, which algo between RF and BRT would you better consider for variable selection?
Answer: The random forest technique is related to decision trees. A metric that it outputs is a variable importance measure. This measure of often used for feature selection, which is a technique to select a subset of variables. They key aspect to understand is that there are many ways to go wrong with feature selection (subset selection). For example, if your model is assessed with a resampling plan  (cross validation/bootstrap), you must repeat the variable selection at each iteration. This requires a good amount of background reading to fully appreciate. But searching this site and others for "randomForest",  "variable importance", "variable selection", "cross-validation", and "overfitting" will get you started.
Answer: One of the problems with this approach is that logistic regression and decision trees are very different algorithms, so the set of features that work well with a decision tree are not necessarily going to be the features that work well with a logistic regression model (and vice versa).  So my advice would be that this approach is a bit of a hack and there are likely to be better approaches.  There is a good tutorial on feature selection:
Isabelle Guyon, André Elisseeff, "An Introduction to Variable and Feature Selection", Journal of Machine Learning Research, 3(Mar):1157-1182, 2003. (www)
I, like Peter Flom (+1) and B_Miner (+1), am quite keen on LASSO/LARS based methods (The Random Forest is also a good algorithm), my own contribution to this can be found here:
Gavin C. Cawley and Nicola L. C. Talbot, Gene selection in cancer classification using sparse logistic regression with Bayesian regularization, Bioinformatics, (2006) 22 (19): 2348-2355. (www)
where the regularisation parameter for a LASSO type penalty is integrated out analytically, so there are no hyper-parameters to tune.
As @julieth points out (+1) if you use feature selection, you must perform the feature selection step independently in each fold of the cross-validation procedure, or you will end up with an optimistically biased performance estimate.  See this paper for details
Christophe Ambroise and Geoffrey J. McLachlan, Selection bias in gene extraction on the basis of microarray gene-expression data, PNAS, vol. 99, no. 10, pp 6562–6566, 2002 (www)
This paper is a "must read" for anybody that is interested in feature selection!


Windows Service running in multiple instances - best practice?

Question: I have a project where a number of 'environments' are running simultaniously: Local development environment (VS), Dev, Test and Prod.
We now wish to expand the program suite with a 'server application' to process background assignments as calculations and mail sending.
I'm trying to find best practice for this situation.
I'm thinking that it should be a windows service.
As a result, I need to have three copies of the service running (Dev, Test and Prod) and preferable on the single server assigned as our application server. I'm thinking I can copy relevant exe to separate directories and 'somehow' instruct each service which environment it is supposed to connect to.
It's important to notice that the three services would not nessesarily be running the same release of the code.
What is the best practice for doing this?
Any input appreciated!
Anders, Denmark
Comment: Define "background assignments", "calculations" and "mail sending".  I understand you're using Windows, probably talking about some kind of Windows Service, and after that have no idea what you're talking about. :)
Answer: Definitely sounds like Windows Services would be the right call. These services would be daemons, running independently from each other.
I recommend against creating 3 executables. Stick with just one as it is easier for deployment.
Have your exe take a command line parameter telling it which environment it should run, and fire off the appropriate part of the code.
Its then pretty easy to start, stop and query your services.
Let me know your thoughts!
Answer: Use an application config file for each installed instance of the service executable so you can set the environment to run against.


Finding the global maximum of sum-of-exponentials

Question: Problem: find $R$ that maximizes the following:
$$f(R) = \sum_{i} k_i \exp^{-y_i^T R x_i}\\
k_i \in \mathbb{R},\; y_i, x_i \in \mathbb{R}^2\\
R \in SO(2)\;\; (\text{i.e. 2D rotation matrix (2x2, orthogonal, det=1})$$
I'd like to understand how to solve the above problem. I've described the problem for 2 dimensions to keep it simple, but I believe that a solution would generalize to higher dimensions (please correct me if I'm wrong about this).
I would like to understand the different aspects of this problem:
(1) if there is a global minimum or not
(2) can the (global) solution be found in closed form (if so, how?)
(3) how to solve with gradient descent (or other technique), if no closed form solution.
I'm happy to provide clarification if the problem formulation is unclear (this is my first post so apologies in advance if I'm not following the guidelines properly)
Thanks!!
Comment: Thanks for the help. After reviewing the comments and digging into this a little bit it looks like a closed form solution is not likely to exist.
Answer: Given $x_i$, $y_i$, and $k_i$, you can rewrite the expression for $f(R)$. The rotations in two dimensions are described by a matrix with a simple form. If you do a rotation by $\theta$, the rotation matrix is $$R(\theta)=\begin{pmatrix}\cos\theta&-\sin\theta\\\sin\theta & \cos\theta\end{pmatrix}$$
With this, $$f(R)=f(\theta)=\sum_ik_i\exp{[(y_{i1}x_{i1}-y_{i2}x_{i2})\cos\theta+(y_{i2}x_{i1}-y_{i1}x_{i2})\sin\theta]}$$
The above function is continuous in $\theta$, and has a periodicity of $2\pi$. Unless it is constant, it means that it has a minimum in the interval $[0,2\pi)$. That's the answer to question 1.
You can take the derivative with respect to $\theta$ and equate it to $0$. Unfortunately, it looks pretty complicated, with a summation of exponentials multiplied by trigonometric functions. I'm not sure it can be simplified in such a way to get a nice closed form solution. The nice thing is that you can write out this equation, and solve it numerically. My guess that even something simple might work fine. Look up Newton's method.
Comment: To add to this, we can then try minimizing $\log(f)$ instead of $f$ which is much simpler. This is okay because $\log$ is a monotonically increasing function, so $\log(f)$ will have the same minimum.
Comment: Not sure how much will that help, since $f$ is a sum of different terms, not a product.
Comment: Oh whoops, my bad, for some reason I instinctually read it as a product since it is very common to have that in probability optimizations.
Answer: For the general problem $(n\geq 2)$:
Since the set of orthogonal matrices is compact, a global minimum exists.
A closed form solution is unlikely to exist. And there are probably multiple local minima in general.
You can find a minimum from a starting point using the the gradient descent or a similar method by considering the Frobenius inner product on $M_n(\mathbb R)$.
If your current position is $R$, the tangent space of $SO(n)$ at $R$ is the space $R\times \text{Skew}_n$,
which has an orthonormal basis
$$\mathrm r_{ij} = \frac{R(\mathrm e_{ij} - \mathrm e_{ji})}{\sqrt 2} ;\; i < j$$
The gradient is then $\sum_{i,j} \nabla_{\mathrm r_{ij}} f(R) \mathrm r_{ij}$ where $\nabla_{\mathrm r_{ij}} f(R)$ is the directional derivative of $f$ at $R$ along $\mathrm r_{ij}$, which is relatively simple to compute in this case.


redeclare file_get_html simple_html_dom.php

Question: I am using simple html dom to parse itunes preview page
When I put URL in code [download]url[/download] once everything okey, but when I have 2 or more [download]url[/download] codes I getting an error
Fatal error: Cannot redeclare file_get_html() (previously declared in /var/.../simple_html_dom.php:65) in /var/.../simple_html_dom.php on line 80
function download_link($link){
$file=ROOT_DIR."/engine/data/obmennik.php";
include '/var/.../simple_html_dom.php'; //ПАРСИНГ
require($file);
$site=parse_url($link);
$domain=$site['host'];
$itunes = file_get_html($link); //ПАРС
$image = $itunes->find('img.artwork[width=175]',0); //ПАРС
$e = $itunes->find("div.price", 0);
$u = $itunes->find("h1", 0);
$star = $itunes->find("div.rating", 0);
$un = $itunes->find("div.fat-binary-blurb", 0);
$dt=date('Y-m-d [H:00]');

if(array_key_exists($domain,$link_arr)){
       $link="\n".'

src.'\"  />	 '.iconv("UTF-8","cp1251",$u->plaintext). '
 [iTunes Link, '.iconv("UTF-8","cp1251",$e->plaintext).']

'.iconv("UTF-8","cp1251",$un->outertext).'
Рейтинг на: '.$dt.' '.$star->outertext.'

';

} return $link; }

function decode_base64($code){
$code="[download]".trim(base64_decode($code))."[/download]";
return $code;
$itunes->clear();
}

Answer: Change your include to include_once. This is because you are including the same file twice  - and each time you include it, you are declaring the file_get_html function.
Edit: You probably want to do the same with your require on the following line, changing it to require_once
Comment: @nik1004 Glad to hear it. Please mark the answer as accepted so others are aware that a solution has been provided.


Why are my discord buttons disabling until I press a button?

Question: In my discord, file-based connect 4 game, I'm creating a way for your game to be to reshown by calling the original function. It unsends your first game and works perfectly fine, but it doesn't carry over which buttons are disabled. A button becomes disabled if the top item of its column is full, meaning that when they aren't disabled, you are able to place them in full rows. Once I press a button, it seems to update the other buttons. Is there a way to possibly update the view they are in, or something along those lines?
<code>  open_file = open(ctx.author.name + "#", "r")
  board = []
  IDS = open_file.readline()
  piece = open_file.readline()
  for _ in range(6):
    value = open_file.readline()
    board.append(value.strip("\n").split(","))
# board is a 2d array made up of each played piece, being 6 lists, each list having 7 values
  open_file.close()
# where I'm trying to disable the buttons
  buttons = [button1,button2,button3,button4,button5,button6,button7]
  for items in range(7):
    print(board[0][items])
    if board[0][items] == ":green_circle:" or board[0][items] == ":red_circle:":
      print(',,')
      buttons[items].disabled = True

</code>
Comment: This is way too much code. Please post a [mre] with just the code related to the problem.
Comment: Even when I check if the button is disabled, it returns true. So it has the property of disabled, but its not being truly disabled
Comment: Yeah. Though so. Removed most of the basic stuff
Answer: Found Out my Fix. I moved my code which disables the buttons above their addition to view, meaning that their disabled property was now passed onto the discord message
<code>  button1 = Button(label="",
                   emoji="1⃣",
                   style=discord.ButtonStyle.gray,
                   row=0)
  button2 = Button(label="",
                   emoji="2⃣",
                   style=discord.ButtonStyle.gray,
                   row=0)
  button3 = Button(label="",
                   emoji="3⃣",
                   style=discord.ButtonStyle.gray,
                   row=0)
  button4 = Button(label="",
                   emoji="4⃣",
                   style=discord.ButtonStyle.gray,
                   row=1)
  button5 = Button(label="",
                   emoji="5⃣",
                   style=discord.ButtonStyle.gray,
                   row=1)
  button6 = Button(label="",
                   emoji="6⃣",
                   style=discord.ButtonStyle.gray,
                   row=1)
  button7 = Button(label="",
                   emoji="7⃣",
                   style=discord.ButtonStyle.gray,
                   row=1)
  button8 = Button(label="End Game",
                   style=discord.ButtonStyle.gray,
                   row=2)
# Placed the check here, before adding buttons to view
   open_file = open(ctx.author.name + "#", "r")
  first = open_file.readline()
  message = ""
  if not first == ":green_circle:\n":
    IDS = open_file.readline()
  board = []
  for _ in range(6):
    value = open_file.readline()
    board.append(value.strip("\n").split(","))
  open_file.close()
  buttons = [button1,button2,button3,button4,button5,button6,button7]
  for items in range(7):
    if board[0][items] == ":green_circle:" or board[0][items] == ":red_circle:":
      buttons[items].disabled = True

  view1 = View()
  view1.add_item(button1)
  view1.add_item(button2)
  view1.add_item(button3)
  view1.add_item(button4)
  view1.add_item(button5)
  view1.add_item(button6)
  view1.add_item(button7)
  view1.add_item(button8)

  m = await ctx.send(piece + " turn\n" + L1 + "\n" + L2 + "\n" + L3 + "\n" +
                     L4 + "\n" + L5 + "\n" + L6,
                     view=view1)
# check used to be below, meaning that its attributes wouldn't be added to view1 when sent
</code>
Comment: It would be helpful to post the fixed code.
Comment: Just did. Found out that by simpling placing the disabling check before my declaration of view, I was able to have the buttons have the correct states


Why is there special notation for the tensor product? (Multilinear algebra of real vector spaces)

Question: The following definition is from p. 306 of the 2nd edition of John Lee's Introduction to Smooth Manifolds -- note that I have seen similar definitions elsewhere:

Let $V_1, \dots, V_k, W_1, \dots, W_l$ be real vector spaces, and suppose $F$ is a multilinear map from $V_1 \times \dots \times V_k$ to $\mathbb{R}$ and $G$ is a multilinear map from $W_1 \times \dots \times W_l$ to $\mathbb{R}$. Define a function $$F \otimes G: V_1 \times \dots \times V_k \times W_1 \times \dots \times W_l \to \mathbb{R} $$ $$F \otimes G (v_1, \dots, v_k, w_1, \dots, w_l)=F(v_1, \dots, v_k)G(w_1, \dots, w_l). $$ ... $F \otimes G$ is a multilinear map from $V_1 \times \dots \times V_k \times W_1 \times \dots \times W_l$ to $\mathbb{R}$ called the tensor product of $F$ and $G$.

Question: Why invent a special symbol $\otimes$ for the tensor product when it is just a pointwise product? Wouldn't it just be easier to write $FG$ or $F \cdot G$ or $F(\dots,v_i, \dots)G(\dots, w_j, \dots)$?
Seemingly being misled by the special symbol, I always misremember the tensor product as being something far more complicated than it actually is, and thus I never remember the actual definition until I read it again. So I was hoping that some motivation for the symbol will help me in the future to remember the definition for what it is, something simple, and to be less afraid of the object. That way I'll be able to use and do calculations with tensors much more readily, instead of panicking when I see the tensor product symbol and forgetting that it just denotes pointwise multiplication.
Comment: Remember that tensor product is not commutative. A notation like you suggest might not be preferable for this reason.
Comment: It's not a pointwise product. $V \otimes W $ consists of pairs $(u, v)$ *subject to the relations* $(au, v) = (u, av) = a (u, v)$ for any scalar a. It is thus a quotient of the Cartesian product.
Comment: It's not such a complicated symbol.  It's the regular $\times$ symbol from grade school with a circle around it.  $FG$ or $F\cdot G$ or even $F\times G$ could have also been used but someone chose $\otimes$.  Don't get hung up on notation.
Comment: In order to be less afraid of tensors, see also here: http://math.stackexchange.com/questions/10282/an-introduction-to-tensors
Comment: @Tac-Tics No, the question is asking about the tensor product of two maps, not the tensor product of vector spaces (which itself isn't a quotient of the Cartesian product).
Answer: Let $F(x) := Ax$ and $G(y) := By$ for some real matrices $A$ and $B$.
Then $F\cdot G$ usually denotes the inner product map ($x^TA^TBy$) and
$FG$ usually denotes composition ($ABy$).
Now in this special case you have an example where your suggested altenatives are both occupied with meaning.
$F\otimes G$ is a linear map with matrix
$A \otimes B = \pmatrix{a_{11}B & a_{12} B & \cdots \\ a_{21} B & \ddots & \\ \vdots &&}$
in the canonical basis of $\mathbb R^n \otimes \mathbb R^m$ by the way.


Como funciona utilizar um vector do tipo struct ? (C++)

Question: Eu gostaria de ajuda para entender como funciona declarar um vector do tipo struct. No exemplo do código abaixo eu crio a struct configcarros e gostaria de criar um vector do tipo desta estrutura e posteriormente acessar num_car e tempodevolta inserindo valores dentro do vector.
    struct configcarros{

        int num_car, tempodevolta;

    };

    int main(){

        int C,V, tempo;
        struct configcarros cars_ORD;
        cin >> C >> V;
        vector<struct configcarros> cars(C);

    }

Alguém poderia me ajudar a entender isso ? Não tô encontrando muita coisa pesquisando sobre vectors do tipo struct.
Comment: não seria apenas `vector  cars`?
Answer: Começo por dizer que, assim como o @RicardoPontual indicou nos comentários, em C++ não precisa de incluir a palavra struct na utilização da estrutura. Para além disso, sendo o <vector> algo com tamanho dinâmico pode cortar a inicialização que tem, e simplificar a declaração deixando apenas:
vector<configcarros> cars;

Inserir estruturas no <vector>
Para inserir estruturas no vetor, pode criar a estrutura em si, definir os seus valores e adicionar através do método push_back:
configcarros c1; //criar objeto da estrutura
c1.num_car = 1; //definir o valor para num_car
c1.tempodevolta = 30; //definir o valor para tempodevolta

cars.push_back(c1); //adicionar ao vetor

Pode até utilizar uma inicialização mais direta fazendo:
configcarros c2{2, 35}; //inicializar logo com os 2 valores
cars.push_back(c2);

Ou fazer tudo inline:
cars.push_back(configcarros{5,15});

Ler as estruturas guardadas no <vector>
A leitura é feita como se fosse um array normal utilizando [ e ], colocando a posição que quer aceder no meio. Assim para aceder ao campo num_car da primeira posição do vetor, a posição 0, faria:
cars[0].num_car

Para mostrar os dois valores do primeiro carro na consola pode fazer:
cout<<cars[0].num_car<<" "<<cars[0].tempodevolta;

Quando precisa de percorrer todos deve utilizar um laço/ciclo, no qual o for costuma ser o mais apropriado. Existem muitas formas diferentes de fazer este for mas irei exemplificar a mais simples e clássica:
for (int i = 0; i < cars.size(); i++){
    cout<<cars[i].num_car<<" "<<cars[i].tempodevolta<<endl;
}

É importante de notar que o for baseia-se no tamanho de vetor, chamando o método size do mesmo. Para que não ficasse tudo na mesma linha no ecrã adicionei um endl no fim do cout
Exemplo de tudo isto no Ideone
Documentação

push_back()
size()


Dockerfile vs docker run

Question: I am having a problem with published ports in Docker using Dockerfile compared to using docker run manually. Using the following command, the Docker container starts successfully, and when I visit the Host IP address (192.168.99.100) in the browser with http://192.168.99.100:8080 – the RabbitMQ Web Management Dashboard loads.
docker run -d --hostname my-rabbit --name some-rabbit -p 8080:15672 rabbitmq:3.5.6-management

At this point, I run the following to free up the ports I want to use from the Dockerfile:
docker stop some-rabbit

When I run the following docker-compose commands, once I visit the same URL above (http://192.168.99.100:8080) I receive "This site can't be reached 192.168.99.100 refused to connect."
docker-compose build
docker-compose up -d

Here is the Dockerfile I am using:
version: '2'
services:
    rabbitmq:
        container_name: rabbit
        hostname: rabbit
        ports:
            - "8080:15762"
        image: rabbitmq:3.5.6-management

Below is the result of docker ps after docker run
6c5a97bd51bc rabbitmq:3.5.6-management "/docker-entrypoint.s" 16 seconds ago Up 15 seconds 4369/tcp, 5671-5672/tcp, 15671/tcp, 25672/tcp, 0.0.0.0:8080->15672/tcp some-rabbit

Below is the result of docker ps after docker-compose up -d
99987aeb5cbf rabbitmq:3.5.6-management "/docker-entrypoint.s" 13 seconds ago Up 11 seconds 4369/tcp, 5671-5672/tcp, 15671-15672/tcp, 25672/tcp, 0.0.0.0:8080->15762/tcp rabbitmq

Comment: maybe you should rm container after you stop it. try docker rm some-rabbit after docker stop. then try docker-compose up -d.
Comment: Why are you doing `docker-compose build`? Also what's the result of `docker-compose ps` after the `docker-compose up -d`.
Comment: @kyur, I have also used docker rm some-rabbit after docker stop to no avail.
Comment: @JHarris I've added the results of `docker ps` to the bottom of my question
Answer: After further testing, I discovered that all ports used by RabbitMQ must be explicitly published in the Dockerfile.
version: '2'
services:
    rabbitmq:
        container_name: rabbitmq
        hostname: rabbitmq
        ports:
            - "4369:4369"
            - "5672:5672"
            - "15672:15672"
            - "25672:25672"
        image: rabbitmq:3.5.5-management

Comment: Thanks for coming back and answering your own question
Comment: This looks like a `docker-compose.yml` and not a `Dockerfile`

Dockerfile vs docker run


proxmox summary graphs not refreshing

Question: In the proxmox summary page, the graphics are not refreshing. Or they are, but no info is displayed.
Also, the containers status is wrong.
Any suggestions?
Thank you
Comment: i've already restarted pvedeamon with no luck.
Answer: In the end, it was as simple as doing this:
<code>service pvestatd start
</code>
No upgrade, no machine restart.
Answer: You must update and upgrade your proxmox version from repository or install new versions. I solved the above with proxmox 2.1
I hope help you.
Comment: I didn't upgrade and I solved it. Check the answer above. Thanks anyway!
Comment: Thanks! I was (will) try this but I need to backup everything and it's going to take a wile. No problems with the upgrade?
Comment: Yes, if you upgrade your version of proxmox of the repository not will lose any data.

I recommend that you upgrade.
Comment: Do you upgraded?
Comment: not yet. I will feedback when I do.

proxmox summary graphs not refreshing


Show that $\frac{x^4 +7x^3+5}{4x+1}$ is big-theta($x^3$)

Question: I'm having trouble grasping how to set these types of problems.  There are a lot of related questions but it's difficult to abstract a general procedure on finding constants that give the given function bounding constraints to make it big-theta(general function).
so $\frac{x^4 +7x^3+5}{4x+1}$ is $  \Theta (x^3) $
to show this, we need to find constants such that.
$$ |c_1|(x^3) \leq \frac{x^4 +7x^3+5}{4x+1} \leq |c_2|(x^3)$$
In addition, there also has to be a $k$ such that for all values $x >k $ the argument holds.
start with one inequality
$$ |c_1|(x^3) \leq \frac{x^4 +7x^3+5}{4x+1}$$
$$ = |c_1| \leq \frac{x^4 +7x^3+5}{4x^4+x^3}$$
$$ = |c_1| \leq \frac{x^4}{x^3(4x+1)} + \frac{7x^3}{x^3(4x+1)} + \frac{5}{x^3(4x+1)}$$
so basically for $x > 0$, $$ |c_1| \leq \frac{1}{4} + 0 + 0$$
I'm assuming after I take the limit as x goes to infinity, i could choose any $c_1$ less than or equal to $\frac{1}{4}$?  The other way would then have the same procedure?  What would I set $k$ to?
Answer: Here is a nice simple method.
If $x>1$ then
$$\frac{x^4 +7x^3+5}{4x+1}<\frac{x^4+7x^4+5x^4}{4x}=\frac{13}{4}x^3$$
and
$$\frac{x^4 +7x^3+5}{4x+1}>\frac{x^4}{4x+x}=\frac{1}{5}x^3\ .$$
That is, we have shown that if $x>1$ then
$$\frac{1}{5}x^3<f(x)<\frac{13}{4}x^3\ .$$
Answer: Yes, you could take $c_1=\frac{1}{4}$, then you have the following:
$$ \frac{1}{4}x^3 \leq \frac{x^4 +7x^3+5}{4x+1} \Rightarrow \frac{4x^4+x^3}{4} \leq x^4+7x^3+5 \Rightarrow x^4+\frac{1}{4}x^3 \leq x^4+7x^3+5 \\ \Rightarrow \frac{27}{4}x^3 \geq -5 \Rightarrow x^3 \geq -\frac{20}{27} \Rightarrow x \geq - \sqrt[3]{\frac{20}{27}}$$
Since $x>0$ and $x \geq - \sqrt[3]{\frac{20}{27}}$, it must be $x>0$, therefore $k_1=1$.
From the other inequality you will find $k_2$, such that $\frac{x^4 +7x^3+5}{4x+1} \leq |c_2|(x^3), \forall x \geq k_2$.
Then $k=\max \{k_1, k_2 \}$.
Answer: You are on the right track. However, rather than dividing by $x^3$, I would recommend multiplying by $(4x+1)$. The reason for this is so that you will have polynomials of degree $4$ on all sides of the inequality.
It is okay to try different values for $k$ once you get a more simplified inequality. For this problem, I believe setting $k$ to $1$ will work great.


postfix multi instance transport

Question: I'm configuring a postfix mailing server with multiple instances.
Each instance has been assigned it's own ip and domain.
For some of the instances, I've enabled rate delays for specific domains:
main.cf
yahoo_destination_rate_delay = 5s
yahoo_concurrency_failed_cohort_limit = 10
yahoo_destination_concurrency_limit = 10
ymail_destination_rate_delay = 5s
ymail_concurrency_failed_cohort_limit = 10
ymail_destination_concurrency_limit = 10

master.cf
yahoo      unix  -       -       n       -       -       smtp
    -o syslog_name=postfix-3
    -o smtp_fallback_relay=
ymail      unix  -       -       n       -       -       smtp
    -o syslog_name=postfix-3
    -o smtp_fallback_relay=

transport
yahoo.com    yahoo:
ymail.com    ymail:

My question is, how does each instance know which transport to use? i set
postmap /etc/postfix-3/transport

but is that enough?
It seems to be working but that could only be because a few other instances have similar transports. I'm afraid each instance could be reading an incorrect transport map. Should I assign each instance a specific transport file or is that assumed?
Thanks!
Answer: I don't know what you mean. Each instance has it's own folder under /etc/ and you have transports configured in each master.cf in each instance folder.
All instances are independent of each other and don't know each others configuration. Except the few configuration parameters that configure the instances itself.
Answer: This seemed to answer my question:
Mail transport switch
Once the trivial-rewrite(8) daemon has determined a default delivery method it searches the optional transport(5) table for information that overrides the message destination and/or delivery method. Typical use of the transport(5) table is to send mail to a system that is not connected to the Internet, or to use a special SMTP client configuration for destinations that have special requirements. See, for example, the STANDARD_CONFIGURATION_README and UUCP_README documents, and the examples in the transport(5) manual page.
Transport table lookups are disabled by default. To enable, edit the transport_maps parameter in the main.cf file and specify one or more lookup tables, separated by whitespace or commas.
Example:
/etc/postfix/main.cf:
    transport_maps = hash:/etc/postfix/transport
/etc/postfix-3/main.cf:
    transport_maps = hash:/etc/postfix-3/transport

I simply edited each instances main.cf and added the transport_maps option and pointed to the correct transport map. All seems to work ok.
source: http://www.postfix.org/ADDRESS_REWRITING_README.html

postfix multi instance transport


how do I update php on centOS?

Question: I have php 5.1.6 installed on a centOS server, and I need at least 5.3.2 (but would rather install the latest available 5.* version).
If I run
yum update php

it says it will update to 5.1.6-34.el5_8 (mine is 5.1.6-27.el5_5.3)..... what the heck????
Are the available packages for centOS THAT much behind the current version, or is it because yum will by default only update within the subversion after the second dot (or something) and I need to tell it to give me a more recent version? If so how do I do that?
Comment: @AndrewSmith: CentOS 5 is supported till 2017, so there is no need to upgrade just because it's old, except you really need newer software.
Comment: @SvenW Exactly what the user wants: "newer software". He just have two options: upgrade to a newer CentOS version or install php directly.
Comment: RedHat 5 was released in 2007, time to upgrade to Centos 6.
Comment: If centOS is supported till 2017, then I wonder what they mean by "supported", if you can't keep something as vital as php up-to-date. That the php update shouldn't be _automated_ (because it's not fully backward compatible) doesn't mean that it should be _impossible_ Then there exists a plugin for yum that would allow the replacement, but again, I can't install the plugin, so again, what kind of _support_ is this? well sorry for the rant and thenk you all for the answers
Comment: Because it would break PHP apps.
Answer: You are most likely running old version of Centos (5.5 or even earlier), which doesn't have PHP 5.2.x or 5.3.x in it's repos. You have 2 options: update Centos to a more recent version (5.6 is the first one with PHP 5.3) or use http://iuscommunity.org/About
Comment: Actually I've found out that there _is_ a php53 package. However, it won't let me install it because it conflicts with the php package. I guess I would have to first remove php, but that sounds risky. Why do they do that? Why do they call the package with another name and defeat the purpose of update?
Comment: Isn't there a way to install a new version of PHP and have it coexist with the new one, and then configure apache to use different versions for different web directories? I think it used to be common for having both php4 and php5
Comment: PHP 5.3.x isn't fully backwards compatible with 5.1.x or 5.2.x - an automated update would be a bad idea.

To replace 5.1 with 5.3 use `yum replace php --replace-with php53` or something similar (check package names)
Comment: my yum doesn't recognize the "replace" command nor the "-replace-with" option. I guess my yum version is old too, but it won't update either (only to a slightly less old version)
Comment: then your only options is to remove old php and install 5.3
Comment: you can try something like `# rpm --whatrequires -V php` to get a list of what updating the `php` to `php53` is likely to break
Answer: Yes, as I recall getting a newer version of php on CentOs 5.x was mighty painful.
Basically there is a php53 package in the updates repos;
# cat /etc/redhat-release
CentOS release 5.8 (Final)

# repoquery -i php53

Name        : php53
Version     : 5.3.3
Release     : 7.el5_8
Repository  : updates

but if you run something like this;
 # yum provides php
php-5.1.6-32.el5.x86_64 : The PHP HTML-embedded scripting language. (PHP: Hypertext Preprocessor)
php-5.1.6-34.el5_8.x86_64 : The PHP HTML-embedded scripting language. (PHP: Hypertext Preprocessor)

you will see that php53 package does not actually provide php, which means that installing it will break any packages that depend on php, despite there being a php on the system.
In the end I used a shim rpm that just contained a single provides line, which I found somewhere on the web because all my php requirements were simple.
The alternatives are as @c2h5oh mentioned, to use a 3rd party re-packaged version, (or to upgrade to Centos 6.2 :-<  ).
You can see what replacing all the php with php53 will break with the following command;
# rpm --whatrequires -V php
Unsatisfied dependencies for pastebin-0.60-4.el5.noarch: php

You can see from the output of that last command, that in my case I wasn't using any packages that require php that were important, so I just did used --nodeps to force remove all the php.
Comment: Well, you would need to install two versions and use separate php.ini, which you define in virtualhost as well you would use fast-cgi using separate account. Basically you could use some hosting panel with automated install like virtualmin or cpanel snd simply change the path to the new php in the apache config.
Comment: Assuming for a moment that I menage to get the yum-plugin-replace and run "yum replace", does this mean that it won't work anyway?: "you will see that php53 package does not actually provide php, which means that installing it will break any packages that depend on php, despite there being a php on the system."
Comment: Why not to run both versions and configure apps to use 5.3? This is because 5.3 is not working same as with 5.1
Comment: @matteo show the output of `rpm --whatrequires -V php` for your system, so we can see what has it as a dependency...
Comment: @AndrewSmith that would be perfect, how do I do that?
Comment: @TomH here it is:  SM5....T    /usr/local/psa/admin/plib/modules/sbm3/upgrade.php
Comment: @AndrewSmith if you could please post that last comment as an answer, and maybe enrich it with (almost) step-by-step instructions, I'd like to mark it as answer.
Comment: Just add REMI repo and run yum update
Answer: You can use yum shell to perform the remove (of php-*) and install (of php53-*) operations in the same transaction.
Comment: the problem is that it won't let me remove php without removing Plesk which depends on it (and I guess it doesn't "know" that php53 will be equally fine)
Comment: Unfortunately that's something you'd have to bring up with Parallels.
Answer: Use yum update, then yum upgrade to upgrade CentOS to 5.8, then retry yum update php

how do I update php on centOS?


How to pass value from activity to ViewModel?

Question: How to pass value from Activity to View Model? I try to find anything on web but I failed. What I want is this: I have two recyclerviews in one activity. If user click on item A in recyclerview 1 I want to send ID of this item to View Model and return something by this ID. There is an error with dokladId parameter in testToShow variable.
What is the easy way to handle it?
This is my ViewModel:
<code>@HiltViewModel
class SkladViewModel @Inject constructor(
    repository: SybaseRepository
): ViewModel(){
    val skladyPolozky = repository.getAllSkladFromPolozka().asLiveData()
    val dokladyPolozky = repository.getAllHlavickyToDoklad().asLiveData()
    val testToShow = repository.getSelectedDokladyBySklad(dokladId).asLiveData()
}

</code>
This is the activity
<code>@AndroidEntryPoint
class DokladActivity : AppCompatActivity(), SkladAdapter.OnItemClickListener, DokladAdapter.OnItemClickListener {
    private val skladViewModel: SkladViewModel by viewModels()

    //private val dokladViewModel: DokladViewModel by viewModels()
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        val binding = ActivityDokladBinding.inflate(layoutInflater)
        //setContentView(R.layout.activity_doklad)
        setContentView(binding.root)
        binding.btVybratDoklad.setOnClickListener{
            openActivity(binding.root)
        }
        val skladAdapter = SkladAdapter (this)
        val dokladAdapter = DokladAdapter(this)
        binding.apply {
            recyclerViewSklady.apply {
                adapter = skladAdapter
                layoutManager = LinearLayoutManager(this@DokladActivity)
            }
            skladViewModel.skladyPolozky.observe(this@DokladActivity) {
                skladAdapter.submitList(it)
                Log.d("Doklad", skladAdapter.currentList.toString())
            }
            recyclerViewDoklady.apply {
                adapter = dokladAdapter
                layoutManager = LinearLayoutManager(this@DokladActivity)
            }
            skladViewModel.dokladyPolozky.observe(this@DokladActivity){
                dokladAdapter.submitList(it)
                Log.d("Doklad", dokladAdapter.currentList.toString())
            }
        }
    }

    fun openActivity(view: View){
        val intent = Intent(this,PolozkaActivity::class.java )
        startActivity(intent)
    }

    override fun onItemClick(polozkaSklad: SkladTuple) {
        val action = polozkaSklad.reg
    }

    override fun onItemClick(polozkaHlavicka: DokladTuple) {
        val intent = Intent(this, PolozkaActivity::class.java)
        intent.putExtra("doklad", polozkaHlavicka.doklad)
        //intent.putExtra("polozkaHlavicka", polozkaHlavicka as Serializable)
        startActivity(intent)
    }
}
</code>
Repository with some function:
<code>fun getSelectedDokladyBySklad(sklad: Int) : Flow<List<SkladDokladTuple>>{
        return sybaseDao.getAllDokladFromPolozkaBySklad(sklad)
    }
</code>
and DAO:
<code>@Query("SELECT distinct doklad FROM cis06zebrap where sklad=:skladId")
    fun getAllDokladFromPolozkaBySklad(skladId:Int?=null): Flow<List<SkladDokladTuple>>
</code>
Comment: You have `ViewModel` instance in Activity . That's all you need . Just call a method .
Answer: <code>@HiltViewModel
class SkladViewModel @Inject constructor(
    repository: SybaseRepository
): ViewModel(){
    val skladyPolozky = repository.getAllSkladFromPolozka().asLiveData()
    val dokladyPolozky = repository.getAllHlavickyToDoklad().asLiveData()
    val testToShow = repository.getSelectedDokladyBySklad(dokladId).asLiveData()

   fun someNameYouFindUseful(id: String) {
      // do something with the id
      ...
      // notify the UI
      someLiveDataYouShoudlBeObservingFromTheUI.value = SomeSealedClassWrappingTheStates.SomeStateYouFindDescriptive

   }
}
</code>
Then in your Activity/Fragment you'd do:
<code>  viewModel.someNameYouFindUseful("the Id")
</code>
Since you will likely have a viewModel reference there.
To complete the missing pieces, please take a look at the Google official documentation about ViewModels including how to expose a "state" and react to it.


What is this key signature used in Gymnopedie 1 - F major or D major?

Question: I'm learning Gymnopedie no 1 from the Faber-music Piano Anthology but I'm confused about the key signature of B-flat. All of the B-flats within the piece are written as a natural and there's an abundance of F# and C# accidentals. Why not just write the key signature in D major? Why is a B-flat used instead? A detailed explanation would be greatly appreciated, thank you!
Answer: Autograph manuscript...

First edition...

I did a little analysis of the piece here: https://music.stackexchange.com/a/122476/23919
If it is not a mistake, I think maybe the Faber edition made a choice to notate it in D minor, because the piece ends in D minor.

Personally, I wouldn't change the key signature for that, because Satie used the key signature of two sharps, and there is no reason to think he was making some twisted musical joke via the key signature in this case.
Comment: That's great, I completely understand and appreciate your detail!
Comment: Though, Satie *is* known for making twisted musical jokes, he was quite the eccentric.  Don't think that's what's going on here, but it wouldn't be *entirely* out of character for him.
Answer: Seems like a mistake.
All the versions of Satie's Gymnopedie No. 1 on IMSLP (including a manuscript) have two sharps in the key signature.
Maybe at some point someone got D minor and D major mixed up?
Comment: Computers have made it possible for us to make many more mistakes per hour than we ever could before
Comment: I'm not sure, it's from a reputable book - Faber with the Foreword by Melanie Spanswick. I just don't understand why it's in the key of D major but there's a b flat in the key signature!
Comment: @Jgrant I wouldn't take that as a guarantee for anything. Probably just a lack of QA. Also the scores of this edition (from the few previews I could find) do not not look particularly good (not extremely bad, but a bit bottom line of a reputable publisher ...). You need to keep in mind that such editions usually do not sell particularly well, so the publisher will not put in that much effort into such a thing. Most likely they print what the Editor (Spanswick) gives them, without looking too much into it. And then you just get mistakes.
Answer: I don't know for sure, but I can't help wondering if Faber have changed the key signature to create a "new edition" that's protected by copyright.
Comment: Their edition would be protected regardless. The piece itself is no longer under copyright, but a publisher's engraving and formatting are protected even with no editorial changes to the content.
Comment: @Aaron, you're probably right.  But it may not be equally clear-cut across all jurisdictions.  And I don't find the other answers here at all convincing, so I'm putting forward an alternative hypothesis.


Is the "hybrid" between Fisher and Neyman-Pearson approaches to statistical testing really an "incoherent mishmash"?

Question: There exists a certain school of thought according to which the most widespread approach to statistical testing is a "hybrid" between two approaches: that of Fisher and that of Neyman-Pearson; these two approaches, the claim goes, are "incompatible" and hence the resulting "hybrid" is an "incoherent mishmash". I will provide a bibliography and some quotes below, but for now suffice it to say that there is a lot written about that in the wikipedia article on Statistical hypothesis testing. Here on CV, this point was repeatedly made by @Michael Lew (see here and here).
My question is: why are F and N-P approaches claimed to be incompatible and why is the hybrid claimed to be incoherent? Note that I read at least six anti-hybrid papers (see below), but still fail to understand the problem or the argument. Note also, that I am not suggesting to debate if F or N-P is a better approach; neither am I offering to discuss frequentist vs. Bayesian frameworks. Instead, the question is: accepting that both F and N-P are valid and meaningful approaches, what is so bad about their hybrid?

Here is how I understand the situation. Fisher's approach is to compute the $p$-value and take it as an evidence against the null hypothesis. The smaller the $p$, the more convincing the evidence. The researcher is supposed to combine this evidence with his background knowledge, decide if it is convincing enough, and proceed accordingly. (Note that Fisher's views changed over the years, but this is what he seems to have eventually converged to.) In contrast, Neyman-Pearson approach is to choose $\alpha$ ahead of time and then to check if $p\le\alpha$; if so, call it significant and reject the null hypothesis (here I omit large part of the N-P story that has no relevance for the current discussion). See also an excellent reply by @gung in When to use Fisher and Neyman-Pearson framework?
The hybrid approach is to compute the $p$-value, report it (implicitly assuming that the smaller the better), and also call the results significant if $p\le\alpha$ (usually $\alpha=0.05$) and nonsignificant otherwise. This is supposed to be incoherent. How can it be invalid to do two valid things simultaneously, beats me.
As particularly incoherent the anti-hybridists view the widespread practice of reporting $p$-values as $p<0.05$, $p<0.01$, or $p<0.001$ (or even $p\ll0.0001$), where always the strongest inequality is chosen. The argument seems to be that (a) the strength of evidence cannot be properly assessed as exact $p$ is not reported, and (b) people tend to interpret the right-hand number in the inequality as $\alpha$ and view it as type I error rate, and that is wrong. I fail to see a big problem here. First, reporting exact $p$ is certainly a better practice, but nobody really cares if $p$ is e.g. $0.02$ or $0.03$, so rounding it on a log scale is not soooo bad (and going below $\sim 0.0001$ does not make sense anyway, see How should tiny p-values be reported?). Second, if the consensus is to call everything below $0.05$ significant, then error rate will be $\alpha=0.05$ and $p \ne \alpha$, as @gung explains in Interpretation of p-value in hypothesis testing. Even though this is potentially a confusing issue, it does not strike me as more confusing than other issues in statistical testing (outside of the hybrid). Also, every reader can have her own favourite $\alpha$ in mind when reading a hybrid paper, and her own error rate as a consequence. So what is the big deal?
One of the reasons I want to ask this question is because it literally hurts to see how much of the wikipedia article on Statistical hypothesis testing is devoted to lambasting hybrid. Following Halpin & Stam, it claims that a a certain Lindquist is to blame (there is even a large scan of his textbook with "errors" highlighted in yellow), and of course the wiki article about Lindquist himself starts with the same accusation. But then, maybe I am missing something.

References

Gigerenzer, 1993, The superego, the ego, and the id in statistical reasoning -- introduced the term "hybrid" and called it "incoherent mishmash"

See also more recent expositions by Gigerenzer et al.: e.g. Mindless statistics (2004) and The Null Ritual. What You Always Wanted to Know About
Significance Testing but Were Afraid to Ask (2004).

Cohen, 1994, The Earth Is Round ($p<.05$) -- a very popular paper with almost 3k citations, mostly about different issues but favourably citing Gigerenzer
Goodman, 1999, Toward evidence-based medical statistics. 1: The P value fallacy
Hubbard & Bayarri, 2003, Confusion over measures of evidence ($p$'s) versus errors ($\alpha$'s) in classical statistical testing -- one of the more eloquent papers arguing against "hybrid"
Halpin & Stam, 2006, Inductive Inference or Inductive Behavior: Fisher and Neyman-Pearson Approaches to Statistical Testing in Psychological Research (1940-1960) [free after registration] -- blames Lindquist's 1940 textbook for introducing the "hybrid" approach
@Michael Lew, 2006, Bad statistical practice in pharmacology (and other basic biomedical disciplines): you probably don't know P -- a nice review and overview

Quotes

Gigerenzer: What has become institutionalized as inferential statistics in psychology is not Fisherian statistics. It is an incoherent mishmash of some of Fisher's ideas on one hand, and some of the ideas of Neyman and E. S. Pearson on the other. I refer to this blend as the "hybrid logic" of statistical inference.
Goodman: The [Neyman-Pearson] hypothesis test approach offered scientists a
  Faustian bargain -- a seemingly automatic way to limit the number of mistaken conclusions in the long run, but only by abandoning the ability to measure evidence [a la Fisher] and assess truth from a single experiment.
Hubbard & Bayarri: Classical statistical testing is an anonymous hybrid of the competing and frequently contradictory approaches [...]. In particular, there is a widespread failure to appreciate the incompatibility of Fisher's evidential $p$ value with the Type I error rate, $\alpha$, of Neyman-Pearson statistical orthodoxy. [...] As a prime example of the bewilderment arising from [this] mixing [...], consider the widely unappreciated fact that the former's $p$ value is incompatible with the Neyman-Pearson hypothesis test in which it has become embedded. [...] For example, Gibbons and Pratt [...] erroneously stated: "Reporting a P-value, whether exact or within an interval, in effect permits each individual to choose his own level of significance as the maximum tolerable probability of a Type I error."
Halpin & Stam: Lindquist's 1940 text was an original source of the hybridization of the Fisher and Neyman-Pearson approaches. [...] rather than adhering to any particular interpretation of statistical testing, psychologists have remained ambivalent about, and indeed largely unaware of, the conceptual difficulties implicated by the Fisher and Neyman-Pearson controversy.
Lew: What we have is a hybrid approach that neither controls error rates nor allows assessment of the strength of evidence.
Comment: @Momo: to you question about "what exactly is confusing" -- well, confusing is the frenzy of the anti-hybrid rhetoric. "Incoherent mishmash" are strong words, so I would like to see a pretty bad inconsistency. What you said about alternative hypothesis does not sound as such to me (in the garden variety case of $H_0: \mu=0$ the alternative is obviously $H_1: \mu \ne 0$, and I don't see much room for inconsistency), but if I am missing your point then maybe you would like to provide it as an answer.
Comment: Having just read Lew (and realizing I'd read it before, probably around 2006), I found it quite good, but I don't think it represents how I use p-values. My significance levels - on the rare occasions I use hypothesis testing at all\* - are always up front, and where I have any control over sample size, after consideration of power, some consideration of the cost of the two error types and so on - essentially Neyman-Pearson. I still quote p-values, but not in the framework of Fisher's approach  .... (ctd)
Comment: (ctd) ... \* (I often steer people away from hypothesis testing - so often their actual questions are related to measuring effects, and are better answered by constructing intervals). The specific problem Lew raised for the 'hybrid' procedure applies to something I don't do and would tend to caution people against doing. If there are people really doing the mix of approaches he implies, the paper seems fine. The earlier discussion of the meaning of p-values and the history of the approaches seems excellent.
Comment: @Glen_b, Lew's historical overview is very nice and clear, I fully agree. My trouble is specifically with the hybrid issue (section "Which approach is most used?"). Certainly there *are* people doing what he describes there, i.e. reporting the strongest of p<.001, <.01, or <.05; I see it all the time in neuroscience. Consider one of the cases when you do use testing. You choose e.g. alpha=.05, and follow the NP framework. When you get p=.00011, is your certainty about H1 and your choice of wording going to be different from when you would get p=.049? If so, it is hybrid! If not, how come?
Comment: +1 for this well researched (even if long) question. It would help I think to perhaps continue to specify what exactly is confusing. Is it enough to know that for Fisher there doesnt exist an alternative hypothesis at all whereas for NP the world of possibilities is exhausted with both null and alternative? Seems incoherent enough to me but alas I do the hybrid thing all the time because you cant avoid, so ingrained has it become.
Comment: @amoeba I don't think Fisher's approach is wrong - the intuitive appeal is clear - it's just that there are enough caveats to go along with it that I tend not to use it when being formal. Which is odd, because I'd have described myself as using a hybrid approach. I guess it depends on the situation.
Comment: And a note on the wording in the anti-hybrid papers (or other contested things in ststs for that matter), never forget that they are often polemic to bring their point across. Rarely do these papers really reflect the subtelties, normativities and necessities involved in such a debate. Everyones a critic.
Comment: For me the wording *might* differ slightly in that it might point out that the sample would have led to rejection at smaller significance levels than the one used (which is logically true, but not [especially meaningful](http://www.stat.columbia.edu/~gelman/research/published/signif4.pdf) in the context of my test). Since I'm in effect using the p-value itself as a test statistic, there's no more problem reporting it than there is reporting any other test statistic -- the issue is the interpretation. ...(ctd)
Comment: (ctd) ... I think that counts as technically hybrid, but it's really not like what Lew lists for the Fisher approach. [There are particular circumstances where I do something more like a Fisher approach, however - but those would not be formal hypothesis tests, as one would report in a paper.]
Comment: (ctd) ... One example is a situation where I am explaining to someone else how to carry out a test, and I don't know what significance level they want to use, I may point out at which typical significance levels they'd reject.
Comment: @Glen_b: That is interesting, thank you. It seems that you strongly prefer NP, and don't particularly appreciate Fisher's "strength of evidence" approach, even outside of the hybrid. Personally, I would be happy to see your comments joined together in one reply (especially if you elaborate on them a bit); this thread seems to become quite popular and to have your point of view clearly expressed here would be a great addition.
Comment: @amoeba thanks for the clarification from above, good to know you were thinking something along those lines of "why this rhetoric?". I think the wording has to be strong to be heard (I recently read something in the same vain that advocates against using CI's).
Answer: I believe the papers, articles, posts e.t.c. that you diligently gathered, contain enough information and analysis as to where and why the two approaches differ. But being different does not mean being incompatible.
The problem with the "hybrid" is that it is a hybrid and not a synthesis, and this is why it is treated by many as a hybris, if you excuse the word-play.
Not being a synthesis, it does not attempt to combine the differences of the two approaches, and either create one unified and internally consistent approach, or keep both approaches in the scientific arsenal as complementary alternatives, in order to deal more effectively with the very complex world we try to analyze through Statistics (thankfully, this last thing is what appears to be happening with the other great civil war of the field, the frequentist-bayesian one).
The dissatisfaction with it I believe comes from the fact that it has indeed created misunderstandings in applying the statistical tools and interpreting the statistical results, mainly by scientists that are not statisticians, misunderstandings that can have possibly very serious and damaging effects (thinking about the field of medicine helps giving the issue its appropriate dramatic tone).  This misapplication, is I believe, accepted widely as a fact-and in that sense, the "anti-hybrid" point of view can be considered as widespread (at least due to the consequences it had, if not for its methodological issues).
I see the evolution of the matter so far as a historical accident (but I don't have a $p$-value or a rejection region for my hypothesis), due to the unfortunate battle between the founders. Fisher and Neyman/Pearson have fought bitterly and publicly for decades over their approaches. This created the impression that here is a dichotomous matter: the one approach must be "right", and the other must be "wrong".
The hybrid emerged, I believe, out of the realization that no such easy answer existed, and that there were real-world phenomena to which the one approach is better suited than the other (see this post for such an example, according to me at least, where the Fisherian approach seems more suitable). But instead of keeping the two "separate and ready to act", they were rather superfluously patched together.
I offer a source which summarizes this "complementary alternative" approach:
Spanos, A. (1999). Probability theory and statistical inference: econometric modeling with observational data. Cambridge University Press., ch. 14, especially Section 14.5, where after presenting formally and distinctly the two approaches, the author is in a position to point to their differences clearly, and also argue that they can be seen as complementary alternatives.
Comment: CONTD For me, this is the "have your cake and eat it too" issue of the hybrid approach. For example, an N-P approach without power-test calculations should be unthinkable, but all the time we see test posed in the N-P framework, but no mention about power calculations.
Comment: The obvious issue is indeed the $p-\alpha$ issue. More subtle and I believe more important, is the fact that the hybrid mixes the exploratory flavor of Fisher (which more over leaves the matter of decision to the researcher), with the more formal approach of N-P. So researchers approached the matter in a Fisherian spirit, but then claimed the strong "rejection/acceptance" weight of the N-P approach,  which in principle gives more credibility to the conclusions. CONTD
Comment: (+1) I appreciate your comments and agree with many of them. But I am not sure what exactly you are referring to when you say that the hybrid "created misunderstandings" (and moreover, that this is "accepted widely as a fact"). Could you give some examples? To be an attack on the hybrid, it should be examples of misunderstandings that do not arise in either F or N-P approaches alone. Are you referring to the potential confusion between $p$ and $\alpha$ that I mentioned in my question, or to something else? Apart from that, I am already reading Section 14.5 in Spanos, thanks.
Comment: Off topic, but... Since you are citing Aris Spanos, I wonder if you might be able to answer [this question](https://stats.stackexchange.com/questions/303887/effects-of-model-selection-and-misspecification-testing-on-inference-probabilis) about his methodology? (I once asked the question to Aris Spanos directly, and he kindly put down some effort in answering it. Unfortunately, his answer was in the same language as his papers, thus it did not help me much.)
Comment: @RichardHardy I had a look -my problem is that I need to revisit concepts like "pre-test bias" in order to maybe be able to say something useful on your issue.
Comment: Thank you for having taken at look! I had the impression that you knew the answer but did not have time to write it up earlier when I contacted you last time. But perhaps my memory is tricking me, perhaps it was a different question.
Answer: My own take on my question is that there is nothing particularly incoherent in the hybrid (i.e. accepted) approach. But as I was not sure if I am maybe failing to comprehend the validity of the arguments presented in the anti-hybrid papers, I was happy to find the discussion published together with this paper:

Hubbard & Bayarri, 2003, Confusion over measures of evidence (p's) versus errors (α's) in classical statistical testing

Unfortunately, two replies published as a discussion were not formatted as separate articles and so cannot be properly cited. Still, I would like to quote from both of them:

Berk: The theme of Sections 2 and 3 seems to be that Fisher did not like what
  Neyman and Pearson did, and Neyman did not like what Fisher did, and therefore we
  should not do anything that combines the two approaches. There is no escaping the
  premise here, but the reasoning escapes me.
Carlton: the authors adamantly insist that most confusion stems from the  marriage of Fisherian and Neyman-Pearsonian ideas, that such a marriage is a
  catastrophic error on the part of modern statisticians [...] [T]hey seem intent on
  establishing that P values and Type I errors cannot coexist in the same universe.
  It is unclear whether the authors have given any substantive reason why we cannot
  utter "p value" and "Type I error" in the same sentence. [...] The "fact" of their [F and NP] incompatibility comes as surprising news to me, as I'm sure it does to
  the thousands of qualified statisticians reading the article. The authors even
  seem to suggest that among the reasons statisticians should now divorce these two
  ideas is that Fisher and Neyman were not terribly fond of each other (or each other's
  philosophies on testing). I have always viewed our current practice, which integrates
  Fisher's and Neyman's philosophies and permits discussion of both P values and
  Type I errors -- though certainly not in parallel -- as one of our discipline's greater triumphs.

Both responses are very worth reading. There is also a rejoinder by the original authors, which does not sound convincing to me at all.
Comment: @Livid, thanks for your comments, this is interesting, but I would like to refrain from further discussion here. I would rather encourage you to post a new answer, if you wish. But if you decide to do so, try to focus on the main issue, which is: what is so bad about "hybrid", as compared to both Fisher and N-P alone. You seem to hate the whole approach of significance testing, "nil null hypothesis", etc., but this is **not** what this question is about!
Comment: @Livid, I understand your arguments against the nil null, I just think that this issue is orthogonal to the issue of hybrid. I have to refresh the anti-hybrid papers in memory, but as far as I remember their critique of the hybrid is not at all centered on the nil null. Instead, it is about combining Fisher and NP. Again, if you disagree with this, please consider posting an answer; for the moment, let's leave it at that.
Comment: A note to myself: I should incorporate into this answer some quotes from this paper: Lehmann 1992, [The
Fisher, Neyman-Pearson Theories of Testing Hypotheses: One Theory or Two?](http://digitalassets.lib.berkeley.edu/sdtr/ucb/text/333.pdf)
Comment: It is one thing to co-exist, it is another for the one to be considered as the other. But indeed, this strand of anti-hybrid approach is in the spirit of "there can be no synthesis whatsoever" -which I strongly disagree with. But I don't see the current hybrid as a _successful_ marriage.
Comment: @Livid, these quotes are taken from a polemic discussion following an anti-hybrid paper. The purpose of these discussion notes is not so much to "justify the hybrid" as such, but to question the validity of the arguments put forward in the main anti-hybrid paper. This is also what my whole question was about. I was interested in what the anti-hybrid arguments are and whether they hold any water; I am not so much interested in the pro-hybrid arguments. By the way, I might still revive this topic (by editing and putting a bounty).
Comment: @Livid: Hmmm, can you actually clarify why you say that is is a distinguishing characteristic of the hybrid? What would the null be in pure Fisher or in pure NP? Say you have two groups and want to test for a significant difference ("nil null"). Can't one approach this situation with all three approaches: pure Fisher, pure NP, and hybrid?
Comment: The problem with those quotes is that they do not justify the "hybrid". This is what many "anti-hybrid" people are looking for, and the lack of one being presented front and center is a glaring red flag. Anyone who investigates the history can see it clearly  arose from some informal process. We cannot deduce from this that it is wrong, but what rationale is it based upon? When is it not applicable? What evidence is there to support its use with regards to different problems? How does it compare with other approaches (e.g., pure fisher, pure N-P, Bayesian, non-nil null hypothesis, etc)?
Comment: @amoeba You imply above your background is in neuroscience. Think about the people who claim to detect "neuroplasticity" after various treatments by measuring the number of dendritic branches in golgi-cox stained tissue. A treatment could result in this by eg 1) Killing smaller neurons or 2) Causing neurons to grow branches. One is clearly deleterious, the other maybe good. The hybrid tells us to see if there is a difference in branching of control vs treatment groups. How has that helped us?...
Comment: If there is a difference, we still do not know if that is a good thing or bad thing. Further, how does it compare to what is reported from longitudinal in vivo 2-photon studies (no one yet has reported observing any dendritic branch formation in adult mammals)? Also, shouldnt we be trying to come up with theories to explain the entire branching pattern anyway, and not just whether there is a difference between groups? This was already done 100 years ago but most people have ignored it. An exception is: http://www.ncbi.nlm.nih.gov/pubmed/20700495. It isn't clear to me what use the hybrid has.
Comment: @amoeba Ok, but my comments are relevant. It is important to recognize that the "nil null hypothesis" is a distinguishing characteristic of the hybrid. Get rid of that, and I think it may be valid.
Comment: @amoeba People can (mis)use Fisher and N-P (or bayes factors or anything else that can be come up with) in that way, but it is **always** done with the hybrid regardless of the problem. I am not talking about cases where a nil null is reasonable (e.g., mind reading does not exist, no difference in radioisotope decay rates in cancer patients vs normal people). The null hypothesis is supposed to be predicted by some theory or accepted explanation. Once you start disproving "chance" instead, often it is irrelevant. There is only an extremely limited set of cases where I can see this as useful.
Answer: I fear that a real response to this excellent question would require a full-length paper. However, here are a couple of points that are not present in either the question or the current answers.

The error rate 'belongs' to the procedure but the evidence 'belongs' to the experimental results. Thus it is possible with multi-stage procedures with sequential stopping rules to have a result with very strong evidence against the null hypothesis but a not significant hypothesis test result. That can be thought of as a strong incompatibility. [Extra from 2023 — I have published an extended account of this distinction in A Reckless Guide to P-values: Local Evidence, Global Errors]

If you are interested in the incompatibilities, you should be interested in the underlying philosophies. The philosophical difficulty comes from a choice between compliance with the Likelihood Principle and compliance with the Repeated Sampling Principle. The LP says roughly that, given a statistical model, the evidence in a dataset relevant to the parameter of interest is completely contained in the relevant likelihood function. The RSP says that one should prefer tests that give error rates in the long run that equal their nominal values.
Comment: Berger and Wolpert is indeed a good exposition, and authoritative too. However, I prefer the more practically directed and less mathemtatical book "Likelihood" by AWF Edwards. Still in print, I think. http://books.google.com.au/books/about/Likelihood.html?id=LL08AAAAIAAJ
Comment: J. O. Berger and R.L Wolpert's monograph "The Likelihood Principle" (2nd ed. 1988), is a calm, balanced, and good exposition of point 2., in my opinion.
Comment: @MichaelLew has explained that a valid use of p values is a summary of effect size. He has done a great thing by writing this paper: http://arxiv.org/abs/1311.0081
Comment: @Livid The paper is v interesting, but for the new reader it's worth noting the following: the main idea, that p values 'index' (presumably: are in one to one relation with) likelihood functions, is generally understood to be false because there are cases where the same likelihood corresponds to different p-values depending on the sampling scheme. This issue is discussed a bit in the paper, but indexing is a very unusual position (which doesn't necessarily make it wrong, of course).
Comment: @conjugateprior The p-value to likelihood function indexing is one to one within the scope of a single statistical model, but the p-value from one model does not point to the same likelihood function as a numerically identical p-value from a different statistical model. cont...
Comment: [...cont] The situation most often pointed to where a different p-value points to the same likelihood function is positive and negative binomial sampling where any particular result will give different p-values but both point to a proportional likelihood function. The positive and negative binomial experiments are analysed using different models to get the p-values and so that situation does not serve as a counter-example to my postulated one-to-one relationship between p-value and likelihood function (within a statistical model).
Answer: An often seen (and supposedly accepted) union (or better: "hybrid") between the two approaches is as follows:

Set a prespecified level $\alpha$ (0.05 say)
Then test your hypothesis, e.g. $H_o: \mu = 0$ vs. $H_1: \mu \ne 0$
State the p value and formulate your decision based on the level $\alpha$:
If the resulting p value is below $\alpha$, you could say

"I reject $H_o$" or
"I reject $H_o$" in favor of $H_1$" or
"I am $100\% \cdot (1-\alpha)$ certain that $H_1$ holds"

If the p value is not small enough, you would say

"I cannot reject $H_o$" or
"I cannot reject $H_o$ in favor of $H_1$"

Here, aspects from Neyman-Pearson are:

You decide something
You have an alternative hypothesis at hand (although it is just the contrary of $H_o$)
You know the type I error rate

Fisherian aspects are:

You state the p value. Any reader has thus the possibility to use its own level (e.g. strictly correcting for multiple testing) for decision
Basically, only the null hypothesis is required since the alternative is just the contrary
You don't know the type II error rate. (But you could immediately get it for specific values of $\mu \ne 0$.)

ADD-ON
While it is good to be aware of the discussion about the philosophical problems of Fisher's, NP's or this hybrid approach (as taught in almost religious frenzy by some), there are much more relevant issues in statistics to fight against:

Asking uninformative questions (like binary yes/no questions instead of quantitative "how much" questions, i.e. using tests instead of confidence intervals)
Data driven analysis methods that lead to biased results (stepwise regression, testing assumptions etc.)
Choosing wrong tests or methods
Misinterpreting results
Using classic statistics for non-random samples
Comment: (+1) This is a good description of the hybrid (and why exactly it is hybrid), but you did not explicitly say what your evaluation of it is. Do you agree that what you described is an "incoherent mishmash"? If so, why? Or do you think it is a reasonable procedure? If so, do the people claiming it is incoherent have a point, or are they simply wrong?
Comment: I often test hypotheses in exactly this manner... But there are other mish mashs I would not accept (e.g. not showing p values above $\alpha$) etc.
Comment: (-1) Having the result p < alpha does not justify claiming I am 100.(1-alpha)% certain that H1 holds. The latter claim would be a claim about H1's (and hence H0's) *relative* plausibility whereas a p-value can only be regarded as a measure of H0's *absolute* plausibility (since a p-value measures the consistency of the data with H0).
Answer:
accepting that both F and N-P are valid and meaningful approaches,
  what is so bad about their hybrid?

Short answer: the use of a nil (no difference, no correlation) null hypothesis irregardless of the context. Everything else is a "misuse" by people who have created myths for themselves about what the process can achieve. The myths arise from people attempting to reconcile their (sometimes appropriate) use of trust in authority and consensus heuristics with the inapplicability of the procedure to their problem.
As far as I know Gerd Gigerenzer came up with term "hybrid":

I asked the author [a distinguished statistical textbook author, whose book went through many
  editions, and whose name does not matter] why he removed the chapter on Bayes as well as the
  innocent sentence from all subsequent editions. "What made you present
  statistics as if it had only a single hammer, rather than a toolbox?
  Why did you mix Fisher's and Neyman–Pearson's theories into an
  inconsistent hybrid that every decent statistician would reject?"
To
  his credit, I should say that the author did not attempt to deny that
  he had produced the illusion that there is only one tool. But he let
  me know who was to blame for this. There were three culprits: his
  fellow researchers, the university administration, and his publisher.
  Most researchers, he argued, are not really interested in statistical
  thinking, but only in how to get their papers published [...]
The null ritual:

Set up a statistical null hypothesis of "no mean difference" or "zero correlation." Don't specify the predictions of your research
  hypothesis or of any alternative substantive hypotheses.
Use 5% as a convention for rejecting the null. If significant, accept your research hypothesis. Report the result as $p < 0.05$, $p <
0.01$ , or $p < 0.001$ (whichever comes next to the obtained $p$-value).
Always perform this procedure.

Gigerenzer, G (November 2004). "Mindless statistics". The Journal of Socio-Economics 33 (5): 587–606. doi:10.1016/j.socec.2004.09.033.
Edit:
And we should always need to mention, because the "hybrid" is so slippery and ill-defined, that using the nil null to get a p-value is perfectly fine as a way to compare effect sizes given different sample sizes. It is the "test" aspect that introduces the problem.
Edit 2:
@amoeba A p-value can be fine as a summary statistic, in this case the nil null hypothesis is just an arbitrary landmark: http://arxiv.org/abs/1311.0081. However, as soon as you start trying to draw a conclusion or make a decision (ie "test" the null hypothesis) it stops making sense. In the comparing two groups example, we want to know how different two groups are and the various possible explanations there may be for differences of that magnitude and type.
The p value can be used as a summary statistic telling us the magnitude of the difference. However, using it to "disprove/reject" zero difference serves no purpose that I can tell. Also, I think many of these study designs that compare average measurements of living things at a single timepoint are misguided. We should want to observe how individual instances of the system change over time, then come up with a process that explains the pattern observed (including any group differences).
Comment: +1, Thanks for your answer and for the link. It seems I haven't read this particular paper, I will take a look. As I said before, I was under impression that "nil null" is an issue orthogonal to the issue of "hybrid", but I guess I should re-read Gigerenzer's writings to check that. Will try to find time in the following days. Apart from that: could you please clarify your last paragraph ("edit")? Did I understand correctly that you meant that having a nil null when comparing two effect sizes is okay, but having a nil null when comparing an effect size to zero is not okay?
Answer: I see that those with more expertise than myself have provided answers, but I think my answer has the potential to add something additional, so I'll offer this as one other layman's perspective.
Is the hybrid approach incoherent?  I'd say it depends on whether or not the researcher ends up acting inconsistently with the rules that they started out with: specifically the yes/no rule that comes into play with the setting of an alpha value.
Incoherent
Start with Neyman-Pearson.  Researcher sets alpha=0.05, runs the experiment, calculates p=0.052.  Researcher looks at that p-value and, using Fisherian inference (often implicitly), considers the result to be sufficiently incompatible with the test hypothesis that they will still claim "something" is going on.  The result is somehow "good enough" even though the p-value was greater than the alpha value.  Often this is paired with language such as "nearly significant" or "trending towards significance" or some wording along those lines.
However, setting an alpha value before running the experiment means that one has chosen the approach of Neyman-Pearson inductive behavior.  Choosing to ignore that alpha value after calculating the p-value, and thus claiming something is still somehow interesting, undermines the entire approach that one started with.  If a researcher starts down Path A (Neyman-Pearson), but then jumps across to another path (Fisher) once they don't like the path they are on, I consider that incoherent.  They are not being consistent with the (implied) rules that they started with.
Coherent (possibly)
Start with N-P.  Researcher sets alpha=0.05, runs the experiment, calculates p=0.0014.  Researcher observes that p < alpha, and thus rejects the test hypothesis (typically no effect null) and accepts the alternative hypothesis (the effect is real).  At this point the researcher, in addition to deciding to treat the outcome as a real effect (N-P), decides to infer (Fisher) that the experiment provides very strong evidence that the effect is real.  They have added nuance to the approach they started with, but have not contradicted the rules set in place by choosing an alpha value at the beginning.
Summary
If one starts by choosing an alpha value, then one has decided to take the Neyman-Pearson path and follow the rules for that approach.  If they, at some point, violate those rules using Fisherian inference as the justification, then they have acted inconsistently/incoherently.
I suppose one could go a step further and declare that because it is possible to use the hybrid incoherently, therefore the approach is inherently incoherent, but that seems to be getting deeper into the philosophical aspects, which I don't consider myself qualified to even offer an opinion on.
Hat tip to Michael Lew.  His 2006 article helped me understand these issues better than any other resource.


How to show fivestar votes in views as number instead of percentage?

Question: I have a view which show a content with a Fivestar field (votes).
The problem is that the field is shown as the percentage of votes, not like the stars, or the number (in fact I need to show the number instead of percentage).
I mean, my Fivestar field has 10 stars. Well then if, for example, a node has 7 stars, rather than see the 7 stars or the number of stars (7) is shown the percentage, 70.
What I have to do to show the number (in my example "7")?
Answer: I found a solution for my question: Hide your vote field in views ("Exclude from display"); then, add a Global field, the "global math expression", and in this field add a replacement token of your exclude field, in my case [value]. Finally add the mathematical expression to divide by 10 the number: [value]/10.
Apply and save the view.


variance-covariance matrix of coefficients in quantile regression

Question: I am using quantile regression to estimate the effect of a categorical variable AG_SEP2 on a response outcome ScoreGSA according to the distribution of this outcome variable, while adjusting on other variables.
quantreg <- rq(ScoreGSA ~ AG_SEP2 + Sexe + Jumeau + ZS_POIDS_NAIS_Cat + CMU + CSPTOT, method="fn", c(0.2,0.5,0.8), data=SepGSA)
a <- summary(quantreg, se="boot", R=500, cov=TRUE)

AG_SEP2 is a 4-class categorical variable, so I get the following output:
    Coefficients:
                          tau= 0.2      tau= 0.5      tau= 0.8
(Intercept)           4.800000e+01  5.400000e+01  5.800000e+01
AG_SEP2AG3234_SEP1    9.907373e-11  1.000000e+00  1.000000e+00
AG_SEP2AG2431_SEP0   -2.000000e+00 -2.000000e+00 -1.000000e+00
AG_SEP2AG2431_SEP1   -7.000000e+00 -5.000000e+00 -2.000000e+00
...

Now, I would like to test whether two coefficients within a class of AG_SEP2 variable are different or not using Wald test. For example, within the class "AG2431_SEP1", does -7 at tau=0.2 is different from -2 at tau=0.8 ?
To do so, I use the following formula:
W = (beta1 - beta2) / (var(beta1) + var(beta2) - 2*cov(beta1,beta2))
My question is: I can get the covariance between coefficients for a given tau with the following code:
a[[1]]$cov

but how can I get the covariance between coefficients within different tau, for example between tau=0.2 and tau =0.8?
Answer: I know this question is very old but I will answer it for the lost souls' sake. You can't get the covariance within a coefficient for different pribabilities (i.e., taus), quantreg does not provide this functionality.
That said, you can test what you want to test using anova.rq, at least according to "Section 6. More on Testing" in vignette(rq). Obviously, this should internally use an estimate for the covariance matrix, which, according to the vignette, is detailed in W. Hendricks and R. Koenker, "Hierarchical spline models for conditional quantiles and the demand for electricity". J. of Am. Stat. Assoc., 87:58–68, 1991. Nonetheless, in Section 3 there, i.e. "Wald Tests for Regression Quantile Models", one can only find asymptotic statements for the covariance function of one regression vector $\beta_\theta$ for a specific $\theta$, and so, the package is, to say the least, poorly documented.


PHP/Apache POST limit?

Question: I'm trying to edit large (200KB or so) articles on my MediaWiki install, but doing so gives me this error:

Request Entity Too Large
The requested resource
/path/to/my/wiki/index.php
does not allow request data with POST
  requests, or the amount of data
  provided in the request exceeds the
  capacity limit.

According to the Apache docs, the LimitRequestBody is by default 0 (unlimited).  I don't think I'm near the MediaWiki limit of 2048KB.  I can't find where/if PHP is limiting me.
What gives?
Update:
My Apache error logs say:
request body exceeds maximum size for SSL buffer

And right below that:
could not buffer message body to allow SSL renegotiation to proceed

It appears that a possible solution can be found here.
But it requires me to recompile mod_ssl.  It appears towards the end of that bug report they were talking about adding in a directive for this, instead of recompiling.  Anyone know if this happened?  Also, do I just need to recompile mod_ssl for this fix?  And if so, how do I use my compiled version instead of the stock Ubuntu one?
Answer: Why don't you double check the size of the POST request.
For example, you can use netcat to listen on 8080.
netcat -l -p 8080

Then, redirect your browser to use a proxy on port 8080 just before submitting the form. You should get something like this:
POST http://example.com/path/to/my/wiki/index.php HTTP/1.1
Host: example.com
Proxy-Connection: keep-alive
Content-Type: application/x-www-form-urlencoded
Content-Length: 217

The most important line is Content-Length and just double check the actual length of the content. That will at least help you to determine where things are going wrong. You will at least have an idea of the actual content size.
Then, ensure that you are directly connecting to Apache and not through either a proxy or a reverse-proxy. Some reverse-proxies place a cap on the maximum size of a request as a sort of security measure. So, you may want to check that as well as your Apache logs to ensure that nothing else is going on.
Comment: Have you tried this http://blog.bombcar.com/2008/01/apache-413-error-problems.html
Comment: Yes sir, the Content-Length is ~195,000.
Comment: That was fast! Anyway, I've added the bit on the reverse proxy.
Comment: Good call on the logs, I'll update the question with the latest error.
Comment: You, my friend, are a genius!  That solves it!  I wish I could up-vote you a dozen times!  Thanks!
Answer: I had this same error and it was from mod security related to ajax uploading 500MB and less files, to fix I opened the config.
sudo vi /etc/httpd/conf.d/mod_security.conf

Changed this
SecRequestBodyLimit 131072
SecRequestBodyNoFilesLimit
SecRequestBodyInMemoryLimit

To:
SecRequestBodyLimit 524288000
SecRequestBodyNoFilesLimit 524288000
SecRequestBodyInMemoryLimit 524288000

Answer: I had the error "413 Request Entity Too Large".
https://stackoverflow.com/a/19447688/784542 has solved my problem.

PHP/Apache POST limit?


How to insert curent datetime using specific format

Question: CREATE TABLE IF NOT EXISTS `posts` (
  `id` int(3) NOT NULL AUTO_INCREMENT,
  `user` varchar(9) NOT NULL,
  `post` text NOT NULL,
  `date` varchar(14) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE = MyISAM  DEFAULT CHARSET=utf8;

table created
INSERT INTO `posts` ( 'user', 'post', 'date') VALUES
('she', 'dolphin', '???');
('me', 'chandra'), '???');

Instead of ??? I need current datetime in the following format:day.month. hour:min
For example for today and now: 03.01. 00:34
Comment: Is there a reason you aren't using a `DATETIME` column type? Then you could just do `('she','dolphin', NOW())` ?
Comment: Why not just store the datetime datatype?
Comment: If possible, it would be better to update the database to use datetime storage for efficiency.
Comment: @MitchDempsey, I tried your solution and got `#1054 - Unknown column 'she' in 'field list'`
Answer: That a bad idea, because you are storing the data

in a format that can't be ordered
in a format that mySQL can't optimize in any  meaningful way
without the year of the date

Use a proper mySQL DATETIME field instead, and format the output using DATE_FORMAT when you make the query:
SELECT DATE_FORMAT(`date`, "%d.%m. %H:%i") FROM `posts`;


Is there any solution for ValueError: could not convert string to float: ''

Question: ** Im getting this Value error on
age2 = float(Age1)
gender2 = float(gender1)
this code im not sure why this error is caused and need a solution**
The data of Age1 and gender1 is str but i want it to be in float so i added this code but the Value error shows up idk why
import pandas as pd
from sklearn.tree import DecisionTreeClassifier
from sklearn.model_selection import train_test_split
from sklearn.metrics import accuracy_score
from tkinter import *

root = Tk()
root.geometry('400x400')
root.resizable(0,0)
root.title('Data Check')
root.config(bg ='seashell3')
Age = StringVar()
gender = StringVar()

def predicts():

    Age1 = Age.get()
    gender1 = gender.get()

    age2 = int(Age1)
    gender2 = int(gender1)

    music_data = pd.read_csv('music.csv')
    x = music_data.drop(columns=['genre'])
    y = music_data['genre']
    x_train,x_test,y_train,y_test = train_test_split(x,y,test_size = 0.2)

    model = DecisionTreeClassifier()
    model.fit(x_train,y_train)
    predictions = model.predict(x_test)

    model1 = DecisionTreeClassifier()
    model1.fit(x,y)
    predictions1 = model1.predict([[age2,gender2]])

    score = accuracy_score(y_test, predictions)
    print(score,predictions1)
    Label(root, text = score, font = 'arial 15 bold').place(x = 90, y = 220)
    Label(root, text = predictions1, font = 'arial 15 bold').place(x = 120, y = 220)

predicts()

Label(root, text = 'Enter Age and Gender(0,1)' , font='arial 15 bold', bg = 'seashell2').place(x = 20,y=70)
Entry(root, font = 'arial 15', textvariable = Age , bg = 'antiquewhite2').place(x=90 , y = 130)
Entry(root, font = 'arial 15', textvariable = gender , bg = 'antiquewhite2').place(x=90 , y = 160)
Button(root, font = 'arial 13 bold', text = 'Predict'  ,padx =5,bg ='seashell4' ,command = predicts). place(x = 90, y = 290)

def Exit():
    root.destroy()

Button(root, font = 'arial 13 bold', text = 'EXIT'  ,padx =5,bg ='seashell4' ,command = Exit).place(x=230,y=310)
root.mainloop()

Comment: @kaktus_car `StringVar` doesn't have any loops in its implementation (or at least that is why I think). Each time you change the contents of the `Entry` it sets the value of the `StringVar`. It's basically a wrapper for a string that exists in tcl's world.
Comment: @kaktus_car: _"I think StringVar() must sit in some sort of loop"_ - no, nothing at all like that. Instances of `StringVar` are just normal objects.
Comment: Does int casting work, since it is in the code?
Comment: Try printing `Age1`. What does it give you? Is it in the form of a float?
Comment: Ok, so it is not string to float but StringVar. I am not very familiar with tkinter but I think `StringVar()` must sit in some sort of loop. So my guess is that at some point it receives something else than string and this explicit `float()` casting does not work. As @TheLizzard suggested try printing those values to see what it will return.
Comment: Oh, ok, my bad then. Glad you found the issue
Answer: I think I found the problem:
in your code you have:
...
Age = StringVar()
...
predicts()
...
Button(..., command=predicts).place(...)

The problem is that you call predicts() just after you create the StringVar so its contents are "". And if we do float("") we get:
>>> float("")
Traceback (most recent call last):
  File "<pyshell#0>", line 1, in <module>
    float("")
ValueError: could not convert string to float:
>>>

So actually that is what python was telling you :D
If you remove the predicts() but keep the command=predicts, it should solve your problem.


How to interprete and describe the results of a Wilcoxon Signed Rank test?

Question: I'm trying to learn about rank tests, and having doubts abouut how I should a result from a Wilcoxon Signed Rank test. Suppose, we are given:
Z = -2.201, r = - 0.845, P < 0.05,
then how should I interprete these three numbers and describe them in words?
Answer: BBR Section 7.2 and especially 7.2.1 cover this.  It shows how to scale the signed rank statistic to [0,1] representing the probability that a randomly chosen pair of observations sum to a positive number.
Don't state P < 0.05. Give the P-value, and a proper conclusion is not reject/accept $H_0$ but rather, when P is small, that there is evidence against the supposition of no difference.
Comment: Thank you for sharing the detailed pdf. I will go through it and hopefully have my doubts resolved. Also, I saw in some of the papers that their Wilcoxon Signed Rank test result was documented as   P < 'some constant value'    instead of a fixed P-value. This was another reason why I got confused.
Comment: A proper conclusion is found/failed to find evidence for $H_{a}$, *never* "accept $H_0$". Rejection decision is reject $H_0$ or fail to reject $H_0$.
Answer: It is not that simple to explain what the signed-rank test actually tests for.  My best advice is read a few respected textbooks covering the test, and pay attention to how they state the null and alternative hypotheses.  However, be ware that some texts may simplify the language for these hypotheses, or may pull in additional assumptions to make interpreting the test easier.
Essentially, the signed rank test assesses whether the differences in pairs ---- or of the one-sample observations ---- is symmetric about zero. Except that the test uses the ranks after taking the differences.  You might say that it tests if the paired differences are systematically different than zero.
Various plots may be helpful.  A histogram of the paired differences.  Plotting group 1 vs. group two and superimposing a 1:1 line.
Beyond that, z and p are commonly reported statistics in the analysis of experiments.  r in this case is likely the z value divided by the number of pairs, and is an effect size statistic.  It more or less ranges from -1 to 1.   A negative r suggests that the second group has larger values than the first group. (But double check this, as software can reverse this !).  An absolute value of 0.8 for this statistic is likely a large value.
Comment: As stated earlier it tests precisely whether the probability that a randomly chosen pair of values sums to a positive number is equal to 0.5 or not.  But a difference in ranks procedure may work better: https://bpspsychub.onlinelibrary.wiley.com/doi/abs/10.1111/j.2044-8317.1990.tb00939.x
Comment: No.  The sign test test $H_{0}: \Pr(Y > 0) = \frac{1}{2}$.   The signed rank test tests $H_{0}: \Pr(Y_{i} + Y_{j} > 0) = \frac{1}{2}$.
Comment: Here we upvote instead of thanks.  Thanks.
Comment: @FrankHarrell , wouldn't that be the hypothesis tests for the sign test, and not for the Wilcoxon signed rank test ?  For example, for the following one-sample data, the p-value for the sign test is 1, whereas the p-value for the signed rank test is c. 0.02.  The probability of A being positive from this sample is 0.5.  But because `rank(A) ⋅ sign(A)` is not symmetric about zero, the signed rank test identifies this asymmetry.  `A = (-15, -14, -13, -12,-11, -10, -9, -8, -7, -6, -5, -4, -3, -2, -1, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115)`
Comment: Thanks, @FrankHarrell .


Trying to compare a fully fixed and and fully random model in R

Question: So I have a data set which I am modeling using the following:
model1 <- lm(subject ~ .^2, data=hre.train)
This model treats all of the variables as fixed.  I want to compare this model to a model which treats all variables as random. Would I use something like:
model2<-lmer(subject~(1|town)+(1|district)+(1|street)+(1|family)+(1|gender)+(1|replicate),data=hre.train)
I can construct a fully nested model by using
model3<-lme(subject~1,random=~1|town/district/street/family/gender/replicate,data=hre.train)
I just keep getting an error when I use
anova(model1,model2,model3)
The goal is to build an optimal mixed model for prediction but I need something to compare to when I start combining fixed and random effects (i.e gender as fixed, others as random etc)
Comment: Curious why you would model all of your effects as random? Are there no explicit comparisons of one level against another that you are interested in (fixed effect)?
Comment: No specific reason, I am just trying to learn about random vs mixed effects in linear models and thought that having a fully random model to compare specific effects to would be interesting.
Answer: When you are comparing models with different fixed effects you have to make sure you are using  ML method (method="ML" in R) vs. the default REML method. Maybe that is why you are having trouble using the ANOVA function?


How do I display a DataGridView within a cell of another datagridview in C# forms app?

Question: How do I display a DataGridView within a cell of another datagridview in C# forms app?
How would I have to handle Sorting & value changed if this possible?
That is the only way I can display data to make some sense.. Think of it like I have a task column and dates column. Under the dates column I have a list of things to be done. These date columns are dynamic & there might be multiple date columns
Comment: A DGV *within* another DGV?  Man, my users would kill me.  They complain enough about *un*nested DGVs. :)
Comment: Yes john.. I could also make it hierarchical (nested)
But How do I do that?
Comment: Sorry Nested isnt possible...

That is the only way I can display data to make some sense.. Think of it like I have a task column and dates column. Under the dates column I have a list of things to be done. These date columns are dynamic & there might be multiple date columns
Comment: Perhaps you want something like two DGVs.  When one DGV is selected a list of other dates would be shown in another DGV?
Comment: @galford13x - I like your Idea! This makes things simple for me, but i would prefer the user to see all the info, rather than selecting one grid and displaying it in other..
Comment: @Sachin: See my answer below as it is sort of a response to above.  Hopefully one of these .NET packages offered by different companies will provide the functionality your looking for.
Answer: That sounds like a difficult interface to use, have you considered some kind of tree control?
If you're determined to use data grid views, look at customizing data grid view columns and cells. You need to declare custom subclasses for the column and cell behaviour that you want. I don't know if it's possible to do what you want, but that's where I would start.
Comment: 1. I am looking for edit functionality (user should be able to edit a value), and not sure how treeview is going to fit into this.

2. The link definetly gives me a starting point. I will try this approach too..

Will update status post weekend..
Answer: This is a suggestion since what your asking I do not think is possible with the built in DGV of .NET.
Using custom controls made by professional companies that provides a DataGrid with the capability of hierarchical data.  For example a row can be expanded to show multiple entries (the multiple entries can be an entirely different table containing completely different columns even).  Here are a few options that you can check out.
Infragistics WinGrid
Component One
There are a few other places/companies that make great .NET component packages that provide added features to the existing .NET components.
Comment: I would love to use one of these, but this is not a sponsored project. Cannot afford the license. :(
Answer: http://blogs.msdn.com/markrideout/archive/2006/01/08/510700.aspx
Found a link where hierarchichal datagrid is implemented.
Now, I have to either modify the control, or settle for hierarchichal gridview!
Hope this helps someone. Will update later