SNMP4j - Cannot send RESPONSE PDU on some OID

Question: I'm trying to respond to SNMP GET requests from SnmpB with SNMP4j 2.3.1 (running on Windows).
In "Discover" mode, SnmpB queries by broadcasting 255.255.255.255 (checked with Wireshark) and I receive a GET request with standard OID (sysDescr, sysUpTime, sysContact, sysName and sysLocation). It finds my instance with the information I coded ("My System", "Myself", ...) (note that it also works when I enter the IP address under the "IP networks" textboxes, though I don't see any traffic on Wireshark but I receive the GET request):

I did write a very simple MIB file that I imported into SnmpB. It defines a single Integer32 data that I want to retrieve using an SNMP GET request from SnmpB.
However, using the same code than for the standard sys* OID, SnmpB doesn't seem to receive that data ("Timeout" in red on the top-right):

I did try Wireshark to check network activity and I don't see anything, so I guess it takes place on localhost (which is not accessible with Wireshark on Windows)? But the traces below show it does not (peerAddress=192.168.56.1)...
Here is the MIB file (code follows):
MY-TEST-MIB DEFINITIONS ::= BEGIN

IMPORTS
    enterprises, MODULE-IDENTITY, OBJECT-TYPE, Integer32
        FROM SNMPv2-SMI;

myTest MODULE-IDENTITY
    LAST-UPDATED "201412301216Z"
    ORGANIZATION "My org"
    CONTACT-INFO "Matthieu Labas"
    DESCRIPTION "MIB Test"
    REVISION "201412301216Z"
    DESCRIPTION "Generated"
    ::= { enterprises 12121 }

myData OBJECT-TYPE
    SYNTAX Integer32
    MAX-ACCESS read-only
    STATUS current
    DESCRIPTION "My data for test"
    ::= { myTest 1 }

END

... and the code:
public class RespondGET implements CommandResponder {

    public static final OID sysDescr = new OID("220.127.116.11.220.127.116.11.0");
    public static final OID sysUpTime = new OID("22.214.171.124.220.127.116.11.0");
    public static final OID sysContact = new OID("184.108.40.206.188.8.131.52.0");
    public static final OID sysName = new OID("22.214.171.124.184.108.40.206.0");
    public static final OID sysLocation = new OID("188.8.131.52.126.96.36.199.0");

    public static final OID myData = new OID("184.108.40.206.4.1.12121.1.0");

    private Snmp snmp;

    public RespondGET() throws IOException {
        MessageDispatcher dispatcher = new MessageDispatcherImpl();
        dispatcher.addMessageProcessingModel(new MPv2c()); // v2c only
        snmp = new Snmp(dispatcher, new DefaultUdpTransportMapping(new UdpAddress("192.168.56.1/161"), true));
        snmp.addCommandResponder(this);
        snmp.listen();
    }

    @Override
    public void processPdu(CommandResponderEvent event) {
        System.out.println("Received PDU "+event);
        PDU pdu = event.getPDU();
        switch (pdu.getType()) {
            case PDU.GET:
                List<VariableBinding> responses = new ArrayList<VariableBinding>(pdu.size());
                for (VariableBinding v : pdu.getVariableBindings()) {
                    OID oid = v.getOid();
                    // Answer the usual SNMP requests
                    if (sysDescr.equals(oid)) {
                        responses.add(new VariableBinding(oid, new OctetString("My System description")));
                    } else if (sysUpTime.equals(oid)) {
                        responses.add(new VariableBinding(oid, new TimeTicks(ManagementFactory.getRuntimeMXBean().getUptime())));
                    } else if (sysContact.equals(oid)) {
                        responses.add(new VariableBinding(oid, new OctetString("Myself")));
                    } else if (sysName.equals(oid)) {
                        responses.add(new VariableBinding(oid, new OctetString("My System")));
                    } else if (sysLocation.equals(oid)) {
                        responses.add(new VariableBinding(oid, new OctetString("In here")));
                    } else if (myData.equals(oid)) { // MyData handled here
                        responses.add(new VariableBinding(oid, new Integer32(18)));
                    }
                }

                try {
                    CommunityTarget comm = new CommunityTarget(event.getPeerAddress(), new OctetString(event.getSecurityName()));
                    comm.setSecurityLevel(event.getSecurityLevel());
                    comm.setSecurityModel(event.getSecurityModel());
                    PDU resp = new PDU(PDU.RESPONSE, responses);
                    System.out.println(String.format("Sending response PDU to %s/%s: %s", event.getPeerAddress(), new String(event.getSecurityName()), resp));
                    snmp.send(resp, comm);
                } catch (IOException e) {
                    System.err.println(String.format("Unable to send response PDU! (%s)", e.getMessage()));
                }
                event.setProcessed(true);
                break;

            default:
                System.err.println(String.format("Unhandled PDU type %s.", PDU.getTypeString(pdu.getType())));
                break;
        }
    }

    public static void main(String[] args) throws IOException {
        RespondGET rg = new RespondGET();
        System.out.println("Listening...");
        int n = 300; // 5 min
        while (true) {
            try { Thread.sleep(1000); } catch (InterruptedException e) { }
            if (--n <= 0) break;
        }
        System.out.println("Stopping...");
        rg.snmp.close();
    }

}

It produces the following output when I click "discover" under SnmpB and right-click on myData in the MIB Tree and "Get" (slightly reformatted for readability):
Listening...
Received PDU CommandResponderEvent[securityModel=2, securityLevel=1, maxSizeResponsePDU=65535,
    pduHandle=PduHandle[16736], stateReference=StateReference[msgID=0,pduHandle=PduHandle[16736],
    securityEngineID=null,securityModel=null,securityName=public,securityLevel=1,
    contextEngineID=null,contextName=null,retryMsgIDs=null], pdu=GET[requestID=16736, errorStatus=Success(0), errorIndex=0,
    VBS[188.8.131.52.220.127.116.11.0 = Null; 22.214.171.124.184.108.40.206.0 = Null; 22.214.171.124.126.96.36.199.0 = Null; 22.214.171.124.188.8.131.52.0 = Null; 220.127.116.11.188.8.131.52.0 = Null]],
    messageProcessingModel=1, securityName=public, processed=false, peerAddress=192.168.56.1/49561, transportMapping=org.snmp4j.transport.DefaultUdpTransportMapping@120d62b, tmStateReference=null]

Sending response PDU to 192.168.56.1/49561/public: RESPONSE[requestID=0, errorStatus=Success(0), errorIndex=0,
    VBS[220.127.116.11.220.127.116.11.0 = My System description; 188.8.131.52.184.108.40.206.0 = 0:01:03.18; 22.214.171.124.18.104.22.168.0 = Myself; 18.104.22.168.220.127.116.11.0 = My System; 188.8.131.52.18.104.22.168.0 = In here]]

Received PDU CommandResponderEvent[securityModel=2, securityLevel=1, maxSizeResponsePDU=65535,
    pduHandle=PduHandle[1047], stateReference=StateReference[msgID=0,pduHandle=PduHandle[1047],
    securityEngineID=null,securityModel=null,securityName=public,securityLevel=1,
    contextEngineID=null,contextName=null,retryMsgIDs=null], pdu=GET[requestID=1047, errorStatus=Success(0), errorIndex=0,
    VBS[220.127.116.11.4.1.12121.1.0 = Null]], messageProcessingModel=1, securityName=public, processed=false, peerAddress=192.168.56.1/49560, transportMapping=org.snmp4j.transport.DefaultUdpTransportMapping@120d62b, tmStateReference=null]

Sending response PDU to 192.168.56.1/49560/public: RESPONSE[requestID=0, errorStatus=Success(0), errorIndex=0, VBS[184.108.40.206.4.1.12121.1.0 = 18]]

Stopping...

What am I missing here? Could that "just" be a network routing issue?
Comment: Did you try running them on separate machines? It your response message is invalid, it would explain the behavior, and a good way to see if it's malformed is checking in Wireshark.
Comment: I think windows is being clever and routing the traffic over your loopback interface, even though you use the external address. So you shouldn't expect to be able to snoop it as long as you run agent and manager on the same host.
Comment: @Jolta it would explain why I don't see anything on Wireshark, but not why SnmpB does not receive my response PDU though. I'm guessing it could be a problem with it, I'll try another one if I can find some time...
Comment: @Jolta not yet, I'm a little bit lazy (and have only my laptop) during the holidays ;) But I think it's worth setting up a VM to check the frames. Though in the end it will run on the same computer.
Comment: @Jolta I just unlazied and installed SnmpB on a VirtualBox. It turned out I forgot to set the proper request ID in my response PDU. If you can say that in an answer I'd be happy to accept it. I'll also add my own answer to show the tests results. And happy new year! :).
Comment: Great, you solved it yourself with only minimal "prodding" from others =)
Answer: After setting up a VM and checking with Wireshark, it turned out I forgot to set, on the response PDU, the same request ID than the GET PDU.

It was solved by adding resp.setRequestID(pdu.getRequestID()); when building the response PDU
CommunityTarget comm = new CommunityTarget(event.getPeerAddress(), new OctetString(event.getSecurityName()));
comm.setSecurityLevel(event.getSecurityLevel());
comm.setSecurityModel(event.getSecurityModel());
PDU resp = new PDU(PDU.RESPONSE, responses);
resp.setRequestID(pdu.getRequestID()); // Forgot that!
snmp.send(resp, comm);

Thanks to @Jolta for his patience during New Year holiday and his insisting on using Wireshark for further checking. :)


Controls não Aparecem no Windows 10

Question: Após atualização para o Windows 10, sumiram os componentes nos meus formulários, aparece apenas o cursor no campo. Já troquei cores do fundo, das fontes, porem, não funcionou.
VisualStudio 2013, Net Framework 4.5. Print Windows 7 e Print Windows 10
Formulários:
Comment: Cara Só por Curiosidade na maquina a onde esta instalado não tem nenhum plugin do banco do brasil rodando ?
Comment: Tem o da caixa e do BB
Comment: Este mesmo problema ocorreu aqui na empresa, não era em nenhuma versão específica do sistema, e eram em computadores aleatórios de clientes aleatórios. Não existia nenhum tipo de padrão que pudemos identificar que ocasionava o problema, tentamos atualizar a versão do .net framework do cliente e nada. Depois de algumas semanas, os computadores que apresentavam o problema, simplesmente pararam de apresentar.E até hoje a causa e a solução do problema permanecem como mistério.
Answer: Ao atualizar do Windows 7 para o Windows 10 o driver de vídeo não fornecia mais compatibilidade, deixando assim os formulários de vários sistemas como as fotos em anexo a pergunta.
Atualizando o driver de vídeo para o compatível com o Windows 10 fornecido pelo fabricante da placa o erro foi resolvido!
Comment: Foi alterado, essa foi a solução do meu problema, não tem mais detalhes. Só posso marcar como resposta dentro de dois dias.

Controls não Aparecem no Windows 10


Train a model on a "fleet" of related datasets

Question: Suppose I have a machine that has some output behavior y over some independent variable x.  I set up a predictive model to predict the value of y for an arbitrary x and it's working well.
Then I get a second machine which is a lot like the first.  I build a model for this as well.  The models are completely independent.  It works fine, too.  When you examine the data, you see that the machines behave in pretty similar ways -- maybe they both have a linear relationship, but a slightly different slope.  Probably there's a physical variation between the machines.
Maybe my third machine is similar, but I have almost no operating data for it so I can't make a very good model.  I know it will behave similarly to the other machines and I want to exploit this knowledge.
What sort of options exist for modeling $n$ related items as a "fleet"?
Here are some naive ideas:

Treat all data as one big dataset, i.e. fit one 'average' model for all machines
As above but add as many additional features as possible that might capture variations across machines
Cluster the machines into k groups and fit k models
Use a more sophisticated method which is designed for this type of problem (what options exist?)

If the input data is time-series, does that change anything?
Also, my company is calling this "fleet analytics", is there another name for this type of problem?
Answer: The classical approach to this kind of problem is a multilevel model. The basic idea is that the parameters of each cluster (machines, in your case) are treated as random variables themselves, coming from one or more higher-order distributions that are common to all the clusters. The practical consequence of using a multilevel model, compared to fitting a separate model for each cluster, is that parameters sharing a common distribution are estimated as being closer together in value.
There's a rich frequentist toolbox for multilevel models, but they also work well with a Bayesian approach; the distributions of the random effects work just like prior distributions.


Create table while installing my custom module

Question: My custom module name is "person" and its .install file has the following code.
<?php
/**
 * Implementation of hook_install().
 */
function person_install() {

  drupal_install_schema('person');
}

/**
 * Implementation of hook_schema.
 */
function person_schema() {

  // Static (meta) tables.

  $schema['person'] = array(
    'fields' => array(
      'pid'            => array('type' => 'int', 'length' => 11, 'not null' => TRUE, 'default' => ''),
      'name' => array('type' => 'varchar', 'length' => 50, 'not null' => TRUE),
      'city'        => array('type' => 'varchar', 'length' => 50, 'not null' => TRUE),
      'country'        => array('type' => 'varchar', 'length' => 50, 'not null' => TRUE)
    ),
    'primary key' => array('pid'),
  );
return $schema;
}

But when I installed my module the table has not been created.Any thing wrong with this code?
Comment: Did you definitely _install_ the module and not just re-enable it? Enabling/disabling and installing/uninstalling are two separate things with Drupal modules. If you have Drush + Devel try `drush dre person` to be 100% sure. If not, you can do the same thing through the UI. Your code looks right, so it's probably just that the hooks aren't being invoked
Comment: @Clive.Yes two things are different.But am sure I uninstalled and re-installed it.ok will try it out your idea.
Answer: In your schema your setting pid  as primary key. You are setting '' value for primary key. Remove that default value for pid and try.
Then your code should be:
<?php
/**
 * Implementation of hook_install().
 */
function person_install() {

  drupal_install_schema('person');
}

/**
 * Implementation of hook_schema.
 */
function person_schema() {

// Static (meta) tables.

$schema['person'] = array(
  'fields' => array(
    'pid'            => array('type' => 'int', 'length' => 11, 'not null' => TRUE),
    'name' => array('type' => 'varchar', 'length' => 50, 'not null' => TRUE),
    'city'        => array('type' => 'varchar', 'length' => 50, 'not null' => TRUE),
    'country'        => array('type' => 'varchar', 'length' => 50, 'not null' => TRUE)
  ),
  'primary key' => array('pid'),
  );
return $schema;
}

After edit the code don't disable and enable the module, hook_install will only call at module install process, so you should first disable the module, unistall the module and then install the module again.
Comment: Change your primary key **type** attribute in to **serial** instead of **int**. Then your code shhould be:
    'pid'            => array('type' => 'serial', 'length' => 11, 'not null' => TRUE),
Comment: It created table after installation but the pid column is not set as auto increment field.Any idea?
Comment: remove length attribute and add **size** attribute with primary key. Then your code should be: 'pid' => array('type' => 'serial', 'size' => 'big', 'not null' => TRUE),


Como criar um menu de abas, com JavaScript?

Question: Tenho um menu que caso o usuário selecione a opção ele vai mudando, etc! O problema é que ele deixa todos os outros programas abertos quando acessa um.
Menu:

    Usuario
    Empresa
    Nota Fiscal
    Software

AlternarAbas:
function AlternarAbas(menu,conteudo)
{
  for (i=0;i<arAbas.length;i++)
  {
   m = document.getElementById(arAbas[i].menu);
   m.className = 'menu';
   c = document.getElementById(arAbas[i].conteudo)
   c.style.display = 'none';
  }
  m = document.getElementById(menu)
  m.className = 'menu-sel';
  c = document.getElementById(conteudo)
  c.style.display = '';
}

arAbas:
var arAbas = new Array();
arAbas[0] = new stAba('td_usua','div_usua');
arAbas[1] = new stAba('td_empr','div_empr');
arAbas[2] = new stAba('td_nota','div_nota');
arAbas[3] = new stAba('td_soft','div_soft');

stAba:
function stAba(menu,conteudo)
{
  this.menu = menu;
  this.conteudo = conteudo;
}

JSFiddle
Assim, pensei em utilizar o switch ou (if..else) para mudar o modo de seleção. Ou seja, só ira abrir determinada área quando ela for acessada. Mas não tenho ideia de como implementar .. Alguma sugestão ou dica?

Mesmo postando uma resposta, gostaria de saber pelo menos se a uma maneira de fazer utilizando o switch ou o (if..else)!
Comment: Não entendi :( @Felipe - crie um jsfiddle
Comment: Legal @Felipe, mas não entendi assim.. oque é pra fazer.. Vc quer que quando clique ela fique ativa? Alguma coisa assim?
Comment: @JeffersonAlison, o meu problema é que quando eu seleciono uma aba, ele traz o conteúdo das demais abas juntos .. ou seja, eles permanecem abertos! Eu desejo que quando selecionar uma aba, só ela tenha conteúdo e as demais permaneçam em branco!
Answer: O teu código de JavaScript para que possam ser chamado no evento onload da tag BODY, deverá estar presente dentro da secção  da tua página:
Exemplo a Funcionar no JSFiddle
...

 ...

Tudo correcto mas não funciona
Se tens a tag de script presente na secção head da tua página e mesmo assim o código não é executado em condições conforme pode ser visto no link em cima para o JSFiddle, então o provável é existir um erro de JavaScript na página cujo mesmo está a levar o navegador a interromper a execução de scripts.
Quando isto acontece, determinadas coisas controladas por JavaScript não se verificam na página.
No teu caso em particular, como a tua função AlternarAbas está responsável por esconder todas as abas e activar apenas uma, se a execução de JavaScript é interrompida antes desta função ser executada, ficas com todas as abas visíveis.
Solução
Deverás fazer uso do Inspector do teu navegador para observar os erros que aparecem na consola de forma a identificar e resolver os mesmos.
Documentação
Como pode ser lido na MDN - window.onload:

The load event fires at the end of the document loading process. At this point, all of the objects in the document are in the DOM, and all the images and sub-frames have finished loading.

Que traduzido:

O evento de carregamento dispara no final do processo de carregamento do documento. Neste ponto, todos os objectos no documento estão no DOM, e todas as imagens e sub-frames terminaram de ser carregadas.

Isto diz-nos que a tua função AlternarAbas vai ser chamada após a leitura do documento, se o mesmo contiver erros a função não é executada, levando ao problema que enfrentas.

JSFiddle
Para que este tipo de cenários possa ser testado no JSFiddle, é preciso escolher as duas opções em baixo indicadas:

Indicar que a tab de javascript deve ficar no ;
Preencher o campo para a tag body ao invés de colocar no editor.

Comment: Bem @Zuul, ele já se encontra dentro da secção ``, eu só  não coloquei no exemplo!
Comment: @Felipe Como podes ver pelo JSFiddle que criei, o teu código está a funcionar em condições. Complementei a pergunta com informação adicionar sobre o JavaScript poder estar a ser interrompido por um erro antes desse teu código das Abas.
Answer: Olá,
Sei que já responderam utilizando Javascript puro, mas que tal essa solução em jQuery?
http://jsfiddle.net/vrcca/a8yM7/
Abs!


Xencenter Console is very slow

Question: I am using xencenter to administer xenserver 6.2. Xencenter VM console is very slow. I am using vpn connection. I don't want to setup ports. So, what can I do?
Answer: Upgrade your XenCenter or reinstall it, if that doesn't work get onto a faster and more reliable network.

Xencenter Console is very slow


Who is out if both batsmen end up at the same end and the fielders hit the stumps at that end?

Question: I have a query regarding a run out dismissal: Who is out in the following scenario:
The batsman runs, while his partner doesn't. Both batsmen end up at the non-striker end, and a fielder hits the stumps at this end. Then the non-striker leaves the crease, and runs to the striker end. No fielder hits the stump at the striker end?
What will be the result of this?
Answer: Nobody is out. When the wicket was put down at the non-striker's end, the batsman who owned that ground (whichever reached that ground first) was in their ground so are not out. After that, no wicket is put down so there is no dismissal.
The batting team would also score one run as the batsmen exchanged ends.
For reference, see Law 29 (Batsman out of his ground) and Law 38 (Run Out).


Combining expert estimates

Question: I am trying to work on a process to improve how how well my team estimates. I want to look at using some statistics to help out and embrace the uncertainty in how we estimate tasks.
If I have a group of experts and I ask them for a best (b), average (a) and worst (w) case estimate for a task, creating a triangular distribution.
Using a monte carlo method I can generate 10,000 trials using the triangular distribution for each of the estimators and combine these together into one sample set.
I can then use a MLE to create a beta distribution from the sample statistics, then use the cdf(x) functions to determine the likelihood of an estimated number of days, or use the inverseF to determine the number of days to maintain a certain likelihood.
This seems to make sense to me logically, however I am unsure about the fitting of a Beta distribution to the samples. I am wondering if there is a better distribution I should be using, especially given that the samples are just randomly generated from N triangular distributions.
Does anybody have any suggestions or experience in doing this that could point me in the right direction? It's been a few years since I left uni, so my statistics is a little rusty. There are plenty of examples of this process for one expert, however I would like to be able to do the same thing for multiple experts.
Thank you,
Aidan
Answer: If you have an estimate for the minimum $\hat a$, the maximum $\hat b$, and the mode $\hat m$, then you can fit a Generalized Beta distribution of the form $a + (b-a)BETA(\alpha_1,\alpha_2)$ to the data.
Let $a =\hat a$ and $b=\hat b$.
Calculate the ratio: $$r = \frac{\hat b-\hat m}{\hat m- \hat a}.$$
Then $$\alpha_1 = \frac{4+3r+r^2}{1+r^2}$$ and $$\alpha_2=\frac{1+3r+4r^2}{1+r^2}.$$
The resulting BETA distribution will have mode $m=\hat m$ and variance $\sigma^2=(\frac{\hat b - \hat a}{6})^2$. The mean will be $\mu = \frac{\alpha_1 b + \alpha_2 a}{\alpha_1 + \alpha_2}$.
Comment: To address D.W.'s very valid concern (separate answer posted Dec 13 '11), I suggest using a "range expansion" and assuming a value for that. This could be context dependent.  As it relates to the formulas presenting, it would decrease $\hat a$ and increase $\hat b$ resulting in a larger variance.
Answer: I think you're being a little over-ambitious --- using the beta distribution vs. another distribution function is the least of your problems.  I'm not really sure what resampling the forecasts is supposed to achieve, and then re-estimating some parameters based on those resampled data isn't getting you anything that couldn't be estimated from the original forecasts.
A better approach might be to track the estimate and the actual outcome over time and keep track of some other information about the task.  Then you can look at bias (i.e. the average difference between the estimate and the outcome) and how the bias depends on other task characteristics.  Unless you're in a setting where you have a lot of historical data (offhand, I'd say estimates and outcomes for ~ 20 past tasks if you don't car about conditioning on characteristics; more if you do, but that number's just off the top of my head) or are going to be accumulating new forecasts quickly (weekly forecasts or so) you're not going to be able to do anything that is very statistically airtight, so that shouldn't be your focus.  You should be able to detect obvious problems pretty quickly, though, and may be able to give the forecasters useful feedback.
In general, averaging the various forecasts is a pretty good strategy; you want to discard any seriously inferior forecasters first, though, which is where the stuff from the previous paragraph matters.
Comment: I realize that you didn't invent the bootstrap, but what you're describing isn't it.  For a simplistic bootstrap, you'd start with data and an estimator; resample n observations (n is the sample size) a bunch of times with replacement; calculate the estimator on each resample; then use the distribution of the statistic across draws to characterize its uncertainty.  But it's an **asymptotic** technique --- if you have 10 observations, it's going to do badly. The MLE and beta distribution part seems to be your own invention, but I'd be happy to look at a reference.
Comment: I don't think that artificially creating historical data is going to help; you're still basing everything on the few real observations that you've recorded. Until you accumulate enough data, you can get a feel for the uncertainty among your experts by looking at the a measure of the spread of their forecasts -- the standard deviation or the median absolute difference.
Comment: I completely agree with you about historical data, but there is a boostrapping problem that I can't overcome - the fact that we have no historical data.

I was using the monte-carlo as a mechanism of artificially creating the historical data. By basically running the project 10,000 times using a random value between the prescribed values I can get an indication of the likely estimates.
Comment: I can understand your point, this technique is not something I have invented - it's a quite commonly used approach for measuring variance and uncertainty in estimates. My problem is that all of the examples I can find deal with one source of estimates, whereas I want to be able to work with multiple sources of estimates and combine them.
Answer: I don't know how to answer your question.  However, I want to give one slight word of caution about trusting the "worst case" and "best case" estimates too much.
There has been a lot of research suggesting that people tend to be overly confident in their estimates, and to underestimate the degree of uncertainty in their answers.  For instance, you can give people a 20-question quiz, where each quiz question asks them something they don't know (e.g., "How many gas stations are there in the US?"), but rather than asking them to give the answer, you ask them to give a 90% confidence interval.  Then, you grade their quiz by marking their answer correct if the true answer falls within their chosen interval, and false otherwise.  If we were perfect at estimating our own level of confidence accurately, you would expect that people would score on average about 18 out of 20 questions correct.  Instead, what you find is that most people's scores are much lower.  In other words, they choose a confidence interval that is too narrow, underestimating their lack of knowledge or the amount of uncertainty in their estimate.
Therefore, if you ask people for the best case and worst case time to complete a task, I would expect their worst-case estimates to be too optimistic: I would expect that the true worst case may be significantly worse than their estimates would indicate.  This bias seems to be a fundamental human phenomenom, that is difficult to counter (even for experts).  So, just beware that the amount of uncertainty in your estimates may be greater than your polls of the experts may indicate.  I don't know of any easy way to correct for this through statistics; it is just something you'll have to be aware of and keep in mind.

Combining expert estimates


Bias of omitting squares and interactions

Question: With $x_1\sim N(\mu,\sigma^2)$ and a population model...
$Y=\alpha_0+\alpha_1X_1+\alpha_2X_1^2+\epsilon$
...if I run OLS omitting the square term...
$y_i=\beta_0+\beta_1x_{1,i}+u_i$
...the $x_1$ slope has a bias of $2\alpha_2E[x_1]$. I think the bias should be:
$\frac{\partial E[u|x_1]}{\partial x_1}=\frac{\partial E[\alpha_2x_1^2|x_1]}{\partial x_1}=\frac{\partial \alpha_2E[x_1^2|x_1]}{\partial x_1}=\frac{\partial \alpha_2x_1^2}{\partial x_1}=2\alpha_2 x_1$
which doesn't make a lot of sense, but where exactly does the expectation in $2\alpha_2E[x_1]$ come from?
Similarly, with $x_2\sim N(\mu,\sigma^2)$, $\rho_{x_1 x_2} \neq0$, and a population model...
$Y=\alpha_0+\alpha_1X_1+\alpha_2X_2+\alpha_3X_1X_2+\epsilon$
...if I run OLS omitting the interaction, the bias for the slope of $x_1$ is $\alpha_3 E[x_2]$ and the bias for the slope of $x_2$ is $\alpha_3 E[x_1]$, but I would also like to know how the math works:
$\frac{\partial E[u|x_1,x_2]}{\partial x_1}=\frac{\partial E[\alpha_3x_1x_2|x_1,x_2]}{\partial x_1}=\frac{\partial \alpha_3E[x_1x_2|x_1,x_2]}{\partial x_1}=?$
Comment: When $\hat \theta$ is used to estimate $\theta$, the bias is defined as $E(\hat\theta) - \theta$. Two questions: 1)which one is parameter $\theta$, and which one is its estimate? 2) Any relation between definition of bias and partial derivative?
Comment: I see..  If you post this as an answer, I will accept it: $bias(\hat{\beta_1})=E[\hat{\beta_1}]-\alpha_1=E[\alpha_1 +2\alpha_2x_1]-\alpha_1=2\alpha_2E[x_1]$
Answer: When $\hat θ$ is used to estimate $θ$, the bias is defined as E(\hat θ)−θ$. Two questions: 1)which one is parameter θ, and which one is its estimate? 2) Any relation between definition of bias and partial derivative?


CSS DIV position problem (2 divs with absolute position)

Question: I set up 2 divs with some backgrounds and I want to set div2 under div 1, but I don't know how to do this, please help. Now, div2 is over div1 and div1 is invisible on this website.

.div1 {
      perspective: 100px;
      height: 100vh;
      overflow-x: hidden;
      overflow-y: auto;
      position: absolute;
      top: 0;
      left: 50%;
      right: 0;
      bottom: 0;
      margin-left: -51%;
    }

    .div2 {
      perspective: 100px;
      height: 100vh;
      overflow-x: hidden;
      overflow-y: auto;
      position: absolute;
      top: 0;
      left: 50%;
      right: 0;
      bottom: 0;
      margin-left: -51%;
    }

Some very important text...

Not so important text...

Comment: Are you wanting the divs in exactly the same position?  If so why not just nest them.  If not please can you clarify what the problem is as it isn't very clear.  Things to clarify - when you say underneath, do you mean there is some overlap, or do you mean that div one is at the top of the page and div to is at the bottom of the page?  Explain the context of why you are using absolute positioning - you shouldn't really use if for layout
Comment: Welcome to StackOverflow! "Questions seeking code help must include the shortest code necessary to reproduce it in the question itself preferably in a [Stack Snippet](https://blog.stackoverflow.com/2014/09/introducing-runnable-javascript-css-and-html-code-snippets/). See How to [create a Minimal, Complete, and Verifiable](http://stackoverflow.com/help/mcve) example."
Answer: Maybe this helps you, I added a top: 100%; to div2.

.div1 {
  perspective: 100px;
  height: 100vh;
  overflow-x: hidden;
  overflow-y: auto;
  position: absolute;
  top: 0;
  left: 50%;
  right: 0;
  bottom: 0;
  margin-left: -51%;
  background-color: red;
}

.div2 {
  perspective: 100px;
  height: 100vh;
  overflow-x: hidden;
  overflow-y: auto;
  position: absolute;
  top: 100%; /*Changed*/
  left: 50%;
  right: 0;
  bottom: 0;
  margin-left: -51%;
  background-color: blue;
}

.div1::-webkit-scrollbar {
    display: none;
}

.div2::-webkit-scrollbar {
    display: none;
}

a

a

Comment: Thanks, It works but I have 3 scrolls, 2 for div content and 1 for all page.
Comment: Add this the code .div1::-webkit-scrollbar {
    display: none;
}

.div2::-webkit-scrollbar {
    display: none;
} Let me know if that helps


Placement and role of thumb of fretting hand for speed and fast chord changes

Question: As a newbie learner, I am struggling with the usage of thumb of my left hand (right handed guitar player), i.e. where and how to place the thumb, behind the fretboard. Sometimes, I feel that I am using the thumb as a "clamp" or an "anchor" using it to apply pressure on the strings, and that is causing significant slowdown in my chord-changes.
If I consciously try to keep my thumb "mobile" (less "sticky") I sense that I am getting some fret-buzz since insufficient pressure is applied on the strings. As a result, I am slow and clumsy in my chord changes.
What is the right way to use the thumb s.t. it is not slowing me down ? Some guidance would be very helpful. My slow speed of chord changes, is resulting in very jarry transitions.
Comment: This isn't something that can be answered universally. It depends on your anatomy, your guitar neck shape and your preferences. Classical guitarists tend to keep the thumb closer to the middle of the neck, while electric guitarists will often extend it past and even use it to hold notes. In general, such clamping isn't often recommended, though, and a full barre chord should be used instead. OTOH, problems with buzz in the barre chords are common and simply require strength being built up, as well as precise, close touch applied to all of the strings uniformly.
Comment: Can you clarify what style of music you are playing? If you're trying to do compound bends like David Gilmour its very different from trying to articulate precise fingering for a classical piece when it comes to ideal thumb placement.
Comment: @BartekBanachewicz  sounds like you could make an answer out of your comment.
Comment: Right at the moment when I wrote the question, I was trying to play the rhythm portions of a cover of 'Summer of 69' by Bryan Adams, on a mid-sized steel-string acoustic (6-string) with higher-fret cutout. I intend to play more of blues and classic rock eventually, on an electric.
Answer: Many guitar teachers will encourage you to place the thumb close to the center of the neck when forming most chords.  Some chord shapes will require a shift more towards one side or the other of the neck in order to contort your fingers to the proper position to fret the required strings.
However, depending on the anatomy of your hands, it may be more comfortable and easier for you to place your thumb in a different place.
To some extent, the shape of the neck my alter the optimal thumb placement.  Necks are often described as thin or chunky.  Also there are C shaped necks, D shaped necks and V shaped necks.
You should avoid clamping your thumb over the top of the neck when playing barre chords, unless you are using your thumb to fret the bass strings.  Classical guitar purist do not recommend the thumb over the top of the neck, but many guitarist find it much easier to play certain chords that way.
The ability to cleanly fret all the strings with barre chords will improve as you play more.  Until you build more strength in your fretting hand, you might consider lighter gauge strings or lowering the action to reduce the amount of pressure required to cleanly fret all the strings.
I personally keep my thumb position very close to the center of the neck for all barre chords.  But I have short fingers.  I know many excellent guitarist who have long fingers, who do very well positioning their thumbs well north of center or even above the top of the neck.
I sincerely believe that your optimal thumb placement on a given guitar neck could very well be different than mine because your hands and fingers are shaped differently.
I can say that placing the thumb in or near the center of the neck does make chord transitions faster.  And eventually it will become easier to play a clear buzz free barre chord as you develop the necessary strength.
If your grip strength is very weak, you could try a strengthening tool like this Gripmaster strengthening tool to give you a head start in building your grip strength. Many similar devices are sold at music stores, although I have never tried one myself. And Amalgamate makes some good points about the dangers of over training the muscles used primarily for grip as the resulting bulk and tightening of muscles could hinder your flexibility and perhaps even slow you down once you reach a certain level.
The best way to build strength in your fretting hand is to play.  The more you play, the more you will develop the specific muscles needed in your fretting hand and arm for everything you need to do with it.  If you have access to a second guitar, you could put heavier gauge strings on it and play it for the purpose of building strength.  But be sure not to over train your muscles without adequate recovery time between "workouts".
Keep practicing and enjoy the process.
Comment: Hand strengtheners don't have a very good reputation among a lot of musicians I know!
Comment: @topomorto - I've never actually tried one personally.  It might be more appropriate for a beginner who has a need to quickly ramp up to full strength.  Perhaps not as suited for experienced guitarist who is more interested in conserving energy than building strength.  If I wanted to build strength I would just put 13's on one of my acoustics with higher action and play it often.
Comment: @topomorto - your comment inspired me to expand upon the strength building recommendation in my answer.  Thanks.
Comment: Thanks for your answer. I do have a older guitar with high action, and I think I'd put fatter/heavier strings on it to practice. Thanks for the great answer, tips and encouragement. It is going to be hard picking the best answer !
Comment: I was thinking. I really don't know from experience... Truthfully. Lets ask some experts if I am correct about the worst of it: health.stackexchange.com/q/4095/2350
Comment: @icarus74  I agree that all of the answers are excellent.  Good luck on your journey as you continue to grow and improve as a guitarist.
Comment: @amalgamate  Not sure there have been any controlled studies to determine the best way to build strength for guitar playing but fitness science has advanced and out of the more recent scientific studies philosophies such as Cross Fit and Sports Specific Training have emerged.  Sports Specific Training does often promote some general strength training for new athletes - but after some basic core strength has been achieved the emphasis shifts to training that mirrors the demands of the sport as closely as possible.  That concept likely applies to training for becoming a better guitarist as well.
Answer: If any one part of your body is having to apply a lot of force to the guitar, your shape and position changing is going to be slow. That's because however strong your are, it is always going to take time to release pressure, move to another position, and put pressure on again. That's also a recipe for strain injuries.
Let your whole upper body share the work. Move your left elbow around so that your fingers can get in roughly the right shape for a chord without bending your wrist or putting your fingers in too unnatural a position.  Let your fingers focus on getting in exactly the right shape for holding the chord, rather than pressing hard. If you're pressing hard, not only are you going to slow yourself down when moving to the next chord - you'll also find it hard to move a finger or two when you're trying to do chord-melody style riffs. Where possible/necessary, you can use a bit of right arm pressure on the guitar body to take some of the strain off your thumb.
Make sure your guitar is doing its job too. An awful lot of instruments come from the shop set up in a way that an F barre chord (for example) takes too much pressure. Make sure your action is low enough for the techniques you're trying to use. Also, make sure your guitar is high enough and stable enough to be able to adopt all the positions you need comfortably. You shouldn't be needing to hold the instrument up with your left hand.
Push yourself to improve, but not too fast. It always takes time to build up strength, suppleness, and most importantly the finger independence and precision that lets you get the fingers in the right position (and the experience that tells you, when you do have a slight buzz, which finger you need to move, and which way!)
Cheat. You don't actually have to get all your fingers down in exactly the right place at the same time. Get the important melody or bass note down first, play that, and then you can play the rest on the next beat or strum. (obviously this is more applicable to some styles than others - 'miss a few notes' won't wash if you're playing a classical guitar piece from a score!)
So, I haven't talked about the thumb much have I? The only generally-applicable thing I can say is, make sure it's working as part of 'the team'. Sometimes you may want only the tip of your thumb on the back of the neck for maximum range of individual finger movement; Other times, it can relax and lie along the back of the neck as a guide, with you only needing to push gently with your palm; sometimes, you even need it wrapped round the front to assist with muting (this is admittedly more relevant to bass playing, in situations where you can't use right hand muting, but comes into electric guitar playing too). And as others have commented it also depends on the instrument - cross-section of neck, width of fretboard, and so on.
Every position will make some things easy, and other things harder. Whatever you want to play, get into the body position that makes it easiest, and if you're doing it right it shouldn't feel like you're pressing very much at all.
Comment: Plus one for body position - an important part of the equation.
Comment: Thanks for the insightful answer, and I could visualize the elbow movement, to avoid curling wrist incorrectly. I do believe that I was using my wrist and thumb a bit too much, and almost none of my elbow.
Comment: +1 for the cheating. Sometimes on a tough transition I am putting down the note that will get played first like when they were cutting off the power with a chainsaw on DieHard.
Answer: The issue at hand is more complicated than just your thumb. It is possible to use your thumb to compensate for other parts of technique that are missing.
Thumb Position:

I defer to @RockinCowboy. His comments directly about the thumb are good. To reinforce: When you get into a position where you are locked
into a squeeze on the neck of the guitar, it takes longer to
transition from and to a new squeeze.

Technique:

When you squeeze the strings down using only your thumb and fingers,
you slow your hand down. The thumb, and your fingers are just part of
a bigger team that should be working in concert to bring the strings
to the frets. This team includes much of your body, but the key
ingredient is your left arm (assuming your are right handed. Use your
left arm to gently pull back on the neck of the guitar. Sometimes with some techniques your right arm will be needed to support the body of the guitar as it rests and plays.). This will
translate into pressure on the strings and distribute the burden of
pressing the strings down so that your thumb has less to do. You
should use your thumb too, but it is possible to play without it.
When I spoke of this with my students, I would demonstrate by playing
without my thumb touching the strings to prove that it is possible. To be clear: Don't play without your thumb. Your thumb still has a role to play in pressing down the strings, it just should be shared with your body and the way you hold the guitar and the neck. Caveat: it is possible to overdo it and change the pitch of your playing and cause extra stress on the neck of your guitar. Try to balance the work of your arm and the work of your hand.
If your guitar is being held in a stable position where it resists being pulled back, this improves the force your fingers apply to the strings. You need not be rigid, and there are many ways to achieve this depending on instrument and sitting versus standing and comfort, but the stability of the guitar helps you to press down the strings. Allot of times, the stability will come from your right arm, but not always. Sometimes it is the weight of your instrument, or you strap or your leg, or a combination thereof.
Don't use the gripmaster. The reason is the rest of my answer as well as the following: Your hand and it's muscles will slow down as you build strength in a bodybuilder sort of way. You need a stretchy runner/athletic/yoga/dancer kind of strength to your hand, which is not exactly compatible with bodybuilding and the gripmaster. You get the correct kind of strength from practice and technique. I do like @RockinCowboy's idea about heaver strings. The opposite is true too. It may be that your strings are too heavy already. An acceptable alternative to the grip master are the foam stress objects that physical therapists often recommend. Also these Happiness/YinYang Balls are great for training the muscles into a positive guitar direction.
If the hypothetical audience can see your thumb then you have likely wrapped your hand around the neck. If you have wrapped your hand around the neck, then your palm is probably resting on the back of the neck. If your  palm is resting on the back of the neck you are likely to be bending your wrist. If you are bending your wrist while you play you are working on a case of Metacarpal tunnel syndrome. It is possible to have some of these symptoms and still be in the range of proper technique (see @BartekBanachewicz's very helpful comment). If you have a really big hand, then having these problems is less likely. The metacarpal is a tunnel in your wrist where the tendons connect your finger muscles to your fingers. Most of the muscles for your fingers are in your forearm. Bend the tunnel and move the tendons and your movement is slower, also your tendons will swell. Metacarpal tunnel syndrome is the permanent or semi permanent swelling of these tendons.
An issue that we sometimes blame the thumb for, when we sound bad, is finger placement and accuracy. As a beginner you will have difficulty being consistent in your finger placement. There are many things that go into making it easier to press the string to the fret and get good sound. The effective part of your finger is smaller than many beginners consider. You should support the string with the bone inside your finger. One thought is that as a beginner, it is OK to sound bad. You will improve your sound as you improve your finger placement. So improve your finger placement.
A controversial position I take is that you should be close to the fret. It is more effective to be close to the fret, but you can unintentionally alter the pitch if you press too hard. So it is a light technique that I advocate. Light sounds faster right?

Slow Chord Changes:

Consider practicing spending some time just moving back and fourth between chords over and over.
Consider that most beginners move one finger at a time, but the goal is to move all your fingers in concert. If you meet the goal, then your movement takes the time of moving one finger. If not then your movement takes the time of moving however many fingers are involved in the chord. Math says that the later is slower. Sometimes, when I want to get used to a weird transition, I imagine that my fingers are on some sort of set of disks that rotate and guide my fingers into the correct position. Don't worry if you cant relate to my rotating disks, but do try to be able to control and feel all your fingers moving to the correct new chord together. Sometimes I do admit that I am really cheating. If you pair finger movements, you can save time even tho you are not moving all at once. In other words, it is good progress to move two fingers together at a time.
You can also improve your speed by concentrating on your biggest problem. Switch up the way you move, just for speed and just for practice: for any transition, determine your slowest finger and practice moving that finger first.

barre chords
I would talk about barre chords here, but lets just say that there is so much to say that it should be a separate question that probably already exists.
Guitar quality:
It is entirely possible, with some cheep or damaged guitars existing in the world, to lay the blame of poor sound and buzzing on the instrument. You can double check this in a guitar store by trying out some expensive models and compare your performance skill on those to your skill on your own instrument.
Comment: I see your point.  I think I will reference your sentiments in a new edit to my answer.  The beauty of Stack Exchange sites like Music and Theory is that it provides a mechanism for the entire community to weigh in on a given topic - thereby enhancing the quality of the content and minimizing the possibility that bad advice will be followed just because it was on the internet ;-)
Comment: *If you have wrapped your hand around the neck you are likely to be bending your wrist.* - this is just untrue. I find the *exact opposite* to be true. Consider [this photo](http://i.stack.imgur.com/8VtBS.jpg) - had the player tucked the thumb lower, the whole wrist would go lower and bend to compensate.
Comment: I know you can play even barre chords without your thumb, but it should be noted that to do so will require the use of your right forearm (assuming right handed guitar) to add counter pressure to the left hand pressing on the neck and using your torso as a fulcrum point.  Positioning of the guitar whether playing seated or standing will then come into play as well.
Comment: I would say that the correct placement of the thumb changes from moment to moment, and from hand to hand but it is never good to bend your wrist. Sometimes my hand looks like @BartekBanachewicz 's picture sometimes not. It depends on what I am playing, and what guitar I am playing (like RockinCowboy suggests).
Comment: Overall excellent answer.  I gave you an upvote even though you cited disagreement with a portion of my answer ;-).  But I stand by my belief (gained from personal experience as well as observing new guitar players) that strengthening of the fretting hand improves the ability to cleanly play barre chords.  But it seems to come with consistent practice and may not require a specific strength building workout.  But your point about the importance of flexibility in the wrist and fingers of the fretting hand is certainly valid.
Comment: Thanks for the excellent and comprehensive answer, and what a great discussion in comments.
Comment: @RockinCowboy For my part I will edit my answer so as to stop picking on you. :-) Pun intended.
Comment: @BartekBanachewicz I stand by my sentence, but you are absolutely correct and your illustration is a great example. I had many guitar teachers that would pick on the thumb instead of the underlying issue. I will edit to make my position slightly clearer.
Comment: @RockinCowboy **I totally agree**. Further, I should have been clearer: Do not play without your thumb. It is a magic trick I do for demonstration purposes. It is **NOT** a valid technique to eliminate your thumbs role. Your thumb should continue to be a part of the force you use, and in addition it helps guide your hand. If you are missing a thumb then by all means but otherwise **Use your thumb**.
Comment: @RockinCowboy I don't think we are too far off actually. +1 to you too. but those grip master things are for weight trainers to buff out their forearms. If you take it that far, it will shorten your muscles and interfere with your skill. Its better to go with your other suggestion of heavier strings. Also I see many students bogged down with the burden of always covering up other problems (finger placement etc.) with strength, instead of fixing the problems directly.
Comment: Also, if there is any problems in the metacarpal department, the grip master can make them worse.
Comment: @amalgamate Thanks.  Interesting that our discussion in comments has provided further enlightenment (for those who choose to read them) - beyond just the answers to the question.  I suppose that is the way the comments should work in the ideal world.  For the most part, we stuck to the topic at hand.  Thanks again for sharing your insight in a civil and congenial tone.


Node template suggestion stopped to work for new content types

Question: I experience the simmilar issue as asked here
I already have several template suggestions that are working properly following structure:
node--type.tpl.php
But for newly added content types, it does not work, whatever i do. I cleared cache, recreated content type, checked spelling.
How can i track in devel or in other way what is source of this error ?
Comment: May be you are not using correct theme suggestion... You can see theme suggestions by doing dpm($variables) in hook_preprocess_page(&$variables)
Answer: This was due to the strange Caching issue, source of which is yet unknown to me. It may me somehow connected to APC caching, or to nodeaccess cache. I am not yet sure.
After nervous session of clearing different layers of cache, i somehow get it to work.


How are third place teams from the UCL group stage incorporated in the round of 32 for the UEFA Europa League?

Question: In its current format, clubs finishing third in their respective groups in the UEFA Champions League (UCL) qualify, if you will, for the round of 32 knockout stage of the UEFA Europa League (UEL).
As with the UCL, the top two finishers for each group of the UEL qualify for the next round. In the UCL, group winners play a runner up from a different group. I assume this doesn't happen in the UEL. How are the 8 UCL teams integrated into the UEL?
Answer: Looks like I found my answer in this article on Wikipedia.

In the draw for the round of 32, the twelve group winners and the four third-placed teams from the Champions League group stage with the better group records are seeded, and the twelve group runners-up and the other four third-placed teams from the Champions League group stage are unseeded. The seeded teams are drawn against the unseeded teams, with the seeded teams hosting the second leg. Teams from the same group or the same association cannot be drawn against each other.

And after the first knock-out round, as with the UCL:

there are no seedings, and teams from the same group or the same association can be drawn against each other.


Java If Statement Receiving User Input To Be Used Throughout Code

Question: I have done thorough research on this topic but cannot seem to find anything on exactly what I'm after.
I am creating a toll invoice (for a school assignment) which requires users to input data via the scanner to be saved under the relevant string and int variables to be called upon at a later time. The issue I'm facing is whilst creating if statements. I have an if statement for the type of vehicle being entered into the system, if it is a Heavy Vehicle (HCV) the user will be prompted to enter the relevant trip time which is then saved into the String "uTripTime."
However from here the String "uTripTime" cannot be recalled later in my code.
The only thing I can assume is that because an if statement is a separate code block the user input being stored in the String 'uTripTime' is only stored within that code block. Is there any way to use this variable later in my code?
Sorry if the format of my question isn't correct, my first time asking a question here.
Comment: So if i understood your problem you are unable to use uTripTime variable further right ? Why don't you make uTripTime a global variable ?
Answer: MAke the variable uTripTime global to access it in outer block, its current scope is local to the if block.
String uTripTime = ""; // initializing empty
if (uVehicleType.equals("HCV")) {
   System.out.print("Enter Trip Time (Peak, Off-Peak or Night): ");
   uTripTime = uInput.nextLine();
}

Answer: You need to declare uTripTime outside of the if block:
String uTripTime = "";
if (uVehicleType.equals("HCV")) {
    System.out.print("Enter Trip Time (Peak, Off-Peak or Night): ");
    uTripTime = uInput.nextLine();
}
// now you can access uTripTime here

Note that prefixes (like "u" in uTripTime) is not Java coding style.


Import the data into view

Question: I want to import data from excel to created view how can I do this? using what module I can achieve? I found some user import tutorial but in views how to import the data?
Your suggestions are valuable thank you.
Answer: You can never import to created view. View is to create, manage, and display lists of content. So first you have to import the data from excel sheet to the content type which you are using into your view as a content type filter.
To import the data, install Feeds module.

Import or aggregate data as nodes, users, taxonomy terms or simple
  database records.

Import the data into view


Como gerar rótulos coloridos no comparison.cloud?

Question: Abaixo segue um exemplo do código para gerar a nuvem:
comparison.cloud(tdm, random.order=FALSE,
                 colors = c("tomato", "wheat", "lightblue","lightgreen"))

As palavras são facilmente coloridas com o comando acima mas os rótulos continuam com fundo cinza.
Comment: você pode postar sua solução como uma reposta à sua própria pergunta. Dessa forma fica mais fácil identificar que o problema foi resolvido.
Comment: Reforçando o que disso o Rodrigo,  o ideal é colocar sua resposta como resposta e não como edição da pergunta. Não tem problema nenhum - na verdade é recomendável - o próprio autor da pergunta compartilhar sua solução como resposta quando a encontra.
Comment: Muito obrigado pelas dicas!
Eu não sabia como colocar uma imagem na resposta então acabei  editando a pergunta. Mas agora coloquei no local correto!
Answer: Encontrei uma solução:
Descobri que para efetuar tal ação faz-se necessário ir ao código fonte.
Basta ir ao R-Forge ou verificar através do próprio console.
Então altere uma linha adicionando o parâmetro de cores col=colors[i] conforme pode ser visto abaixo:
rect(x1-.5*wid,y1-.5*ht,x1+.5*wid,y1+.5*ht,col=colors[i], border="transparent")

E ao executar a função teremos as cores dos rótulos alteradas.

Aproveito para mostrar também como se altera a cor da fonte:
text(x1,y1,word,cex=title.size,col="white")


How can I float a specific field to the right of another field

Question: For example, I have one field in my content type that is a boolean value of "Is this employee certified" next to this field I'd like a Pop-up Date that shows the expiration field. I've created both fields for my content type but I have not seen anything in the CSS that allows my to float or align fields. Any help would be greatly appreciated.
Can I do this with Views? Or with CSS? Thank you
Comment: Are you mean you want to show the two field beside each other?
Comment: Yes, two different field types aligned next to each other.
Comment: http://www.w3schools.com/css/css_float.asp
Answer: You can just use CSS for this. You will need to find the specific element ID or class for the containing element (div for example) for each of the fields (you can find this out using Firebug with Firefox), then create a CSS rule for each of those elements such as:
#field1 {
  float:left;
  width:150px;
}

#field2 {
  float:left;
  width:150px;
}

You will probably need to then use the CSS rule clear:left; for the field or element that follows after them.
Answer: You can use Token Field Or computed Field but the easier way it's to use token field.
You should create a token field then use replacement patterns (each field of your content type has a replacement pattern to print it's value) for example:
I have integer field (field_int), it's replacement pattern should be [node:field_int].
With that you can print the fields between each other.
Comment: Did you mean to answer this question? It looks like might have tried to answer a different one, this isn't what the OP is asking for :)
Comment: but it's alternative solution for what he need.
Comment: Oh right I see what you were going for there. Both of those modules would be a massive amount of overhead to add to solve a simple styling problem though, far better to use `float:left`/`float:right` IMO


Error 1813 when calling CreateWindow() func WinApi

Question: I'm new in C++ and WinApi. I can't create a simple window in WinApi. CreateWindow() function returns null. GetLastError() func returns error 1813.
But before creating window GetLastError() returns 0. Sorry for my English. Here is my full code:
#include <Windows.h>

LRESULT CALLBACK WndProc(HWND hWnd, UINT Message, WPARAM wParam, LPARAM lParam);

int WINAPI WinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance,LPSTR lpCmdLine, int nCmdShow)
{
 LPCWSTR szWindowClass = TEXT("WndClass");
 LPCWSTR szTitle = TEXT("Main window");
 DWORD dwError;

 WNDCLASS wc;
 wc.style = CS_OWNDC;
 wc.hInstance = hInstance;
 wc.cbClsExtra = 0;
 wc.cbWndExtra = 0;
 wc.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);
 wc.hCursor = LoadCursor(NULL, IDC_ARROW);
 wc.hIcon = LoadIcon(NULL,IDI_APPLICATION);

 wc.lpfnWndProc = WndProc;
 wc.lpszClassName = szWindowClass;
 wc.lpszMenuName = L"MenuName";
 dwError = GetLastError(); //0

 RegisterClass(&wc);
 dwError = GetLastError();//0

 HWND hWnd = CreateWindow(szWindowClass, szTitle, WS_OVERLAPPEDWINDOW,
    CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, NULL, NULL, hInstance, NULL);//NULL

 dwError = GetLastError();//1813 =(
 return 0;
}

LRESULT CALLBACK WndProc(HWND hWnd, UINT Message, WPARAM wParam, LPARAM lParam)
{
 return 0;
}

Answer: First of all, your error handling is wrong. The documentation tells you to call GetLastError only if CreateWindow failed. And CreateWindow failure is indicated by a return value of NULL. You must check the return value of CreateWindow before calling GetLastError. Please make sure you read the documentation carefully.
You make the exact same mistake in your call to RegisterClass. In your defence, this is the most common mistake made by novice Win32 programmers.
Error code 1813, is ERROR_RESOURCE_TYPE_NOT_FOUND. The documentation says:

The specified resource type cannot be found in the image file.

Again, you can learn this information by reading the documentation, once you know where to look.
What this means is that CreateWindow is trying to find a resource that is not present in the file. Perhaps you did not manage to link a menu resource.
Your window procedure is also defective. It should be:
LRESULT CALLBACK WndProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
{
    return DefWindowProc(hWnd, Msg, wParam, lParam);
}

When you start to add bespoke handling for certain messages, ensure that you still call DefWindowProc for any other messages.
Answer: You need to return the result of DefWindowProc for messages you don't handle yourself.
See here for more information.


Agrupar valores distintos dos dias por mês (Oracle)

Question: Tenho uma consulta para fazer, parece simples, mas não estou conseguindo pensar numa maneira de fazer funcionar rs
Tenho que selecionar valores distintos por dia e agrupa-los por mês...
Por exemplo, um paciente passa por um hospital 10x no dia de hoje, porém no select ele tem q ser somado somente 1x (vale lembrar que o select é a partir da tabela de atendimentos). Segue select
select to_char(a.dt_atendimento, 'MM') mes,
           to_char(a.dt_atendimento, 'DD') dia,
           count(distinct a.cd_paciente) qtd
      from atendime a
     where to_char(a.dt_atendimento, 'RRRR') = '2019'
     group by to_char(a.dt_atendimento, 'MM'),
              to_char(a.dt_atendimento, 'DD')
     order by 1, 2

Uma parte do resultado é este

Desde já agradeço :)
Comment: E qual o problema que você tá encontrando na sua `query`? Consegue fazer um exemplo no [SQL Fiddle](http://sqlfiddle.com/#!4)?
Comment: Utilizar o SELECT acima como uma suquery e a query externa agregar a quantidade apenas por mês não resolveria?
Comment: @Sorack na verdade eu tenho que "ignorar" o valor da coluna dia, mas não posso ignora-la no código, pois preciso dos valores distintos por dia... Ou seja, preciso retira-la e agrupar somente por mês, mas o numero distintos por dia é necessário.
Comment: @ÍtaloSalgado Entendi, tem uma solução simples pra isso
Comment: @anonimo infelizmente foi minha primeira tentativa, ele continua trazendo vários resultados para o mês 01, por exemplo, trás 30 linhas 011 com o valor de cada dia, só nao exibe a coluna
Comment: @Sorack me de uma luz, por favor kkk
Answer: Você pode simplesmente utilizar sua query acima dentro de outro agrupamento em conjunto com o SUM:
SELECT x.mes,
       SUM(x.qtd) AS qtd
  FROM (
  SELECT TO_CHAR(a.dt_atendimento, 'MM') AS mes,
         TO_CHAR(a.dt_atendimento, 'DD') AS dia,
         COUNT(distinct a.cd_paciente) AS qtd
    FROM atendime a
   WHERE TO_CHAR(a.dt_atendimento, 'RRRR') = '2019'
   GROUP BY TO_CHAR(a.dt_atendimento, 'MM'),
            TO_CHAR(a.dt_atendimento, 'DD')
   ORDER BY 1, 2) x
 GROUP BY x.mes

Comment: Rapaz, era mais simples que o esperado... Eu cheguei a fazer algo parecido, porém eu agrupava também pela qtd kkkk erro de principiante. Muito obrigado!


submit data by javascript Partially

Question: I'm working on a javascipt and jquery function to submit data that read from an existed table:

            Post Type
            Show/Hide admin bar by the post status

            Published
            Pending For Review
            Draft

            post

                    <input type="checkbox" checked="">

                    <input type="checkbox" checked="">

                    <input type="checkbox" checked="">

            page

                    <input type="checkbox" checked="">

                    <input type="checkbox" checked="">

<button id="save_settings" class="button button-primary" onclick="readValuesAndStates()">Save Settings</button>

and here is the js function :
function readValuesAndStates() {

        // Create a form and append the values and states
        var form = document.createElement("form");
        form.method = "POST";

        var tableData = [];
        var list = document.getElementById("myListTable");
        var items = list.getElementsByTagName("tr");
        var values = [];

        alert(items.length);

        for (var i = 0; i < items.length; i++) {
            var value0 = items[i].getAttribute("value");
            if (value0 !== null) {
                values.push(value0);

                // Create a new hidden input for the post type (unique name)
                var input1 = document.createElement('input');
                input1.type = 'hidden';
                input1.name = 'value' + i;
                input1.value = value0;
                form.appendChild(input1);

            }
        }

        alert(JSON.stringify(values));

        $("#myTable tr").slice(2).each(function () {
            var row = $(this);
            var rowData = {
                label: row.find("td:first").text().trim(),
                state1: row.find("td:eq(1) input[type='checkbox']").is(':checked') ? 1 : 0,
                state2: row.find("td:eq(2) input[type='checkbox']").length ? (row.find("td:eq(2) input[type='checkbox']").is(':checked') ? 1 : 0) : -1,
                state3: row.find("td:eq(3) input[type='checkbox']").length ? (row.find("td:eq(3) input[type='checkbox']").is(':checked') ? 1 : 0) : -1,
            };

            var input2 = document.createElement('input');
            input2.type = 'hidden';
            input2.name = 'label';
            input2.value = rowData.label;
            form.appendChild(input2);

            var input3 = document.createElement('input');
            input3.type = 'hidden';
            input3.name = 'publish';
            input3.value = rowData.state1;
            form.appendChild(input3);

            var input4 = document.createElement('input');
            input4.type = 'hidden';
            input4.name = 'pending';
            input4.value = rowData.state2;
            form.appendChild(input4);

            var input5 = document.createElement('input');
            input5.type = 'hidden';
            input5.name = 'pending';
            input5.value = rowData.state3;
            form.appendChild(input5);

            tableData.push(rowData);

        });

        alert(JSON.stringify(tableData));

        document.body.appendChild(form);
        form.submit();

        return tableData;
    }

the function alert the corrected data but can't submit
here is the php code that read the POST data :
    if ($_SERVER["REQUEST_METHOD"] == "POST") {

            // Creating arrays to save POST data
        $values = $_POST['values'];
        $tableData = $_POST['tableData'];
        echo "
";
        print_r($values);
        print_r($tableData);
        echo "
";
}

I try to print the $values only but it POST as the last item in the array only Note that I print_r($_POST); to ensure if the array was POST correctly or not.
and the array tableData couldn't be submitted at all .
I can't find the mistakes in my code.
help me please
Comment: what is value in `input2.value = value;` ?
Comment: sorry for the mistake I've edited the function
Answer: You have to use array notation when using same input name.
Demo: https://phpsandbox.io/e/x/zmgxc?layout=EditorPreview&defaultPath=%2F&theme=dark&showExplorer=no&openedFiles=

function readValuesAndStates() {
        var form = document.createElement("form");
        form.method = "POST";
        var tableData = [];
        // here read data from a list called "myListTable"
        var list = document.getElementById("myListTable");
        var items = list.getElementsByTagName("tr");
        var values = [];
        //alert(items.length);
        for (var i = 0; i < items.length; i++) {
            var value0 = items[i].getAttribute("value");
            if (value0 !== null) {
                values.push(value0);
                var input1 = document.createElement('input');
                input1.type = 'hidden';
                input1.name = 'value' + i;
                input1.value = value0;
                form.appendChild(input1);
            }
        }
        //alert(JSON.stringify(values));
        $("#myListTable tr").slice(2).each(function () {
            var row = $(this);
            var rowData = {
                label: row.find("td:first").text().trim(),
                state1: row.find("td:eq(1) input[type='checkbox']").is(':checked') ? 1 : 0,
                state2: row.find("td:eq(2) input[type='checkbox']").length ? (row.find("td:eq(2) input[type='checkbox']").is(':checked') ? 1 : 0) : -1,
                state3: row.find("td:eq(3) input[type='checkbox']").length ? (row.find("td:eq(3) input[type='checkbox']").is(':checked') ? 1 : 0) : -1,
            };
            console.log(rowData)
var input2 = document.createElement('input');
            input2.type = 'hidden';
            input2.name = 'label[]';
            input2.value = rowData.label;
            form.appendChild(input2);

            var input3 = document.createElement('input');
            input3.type = 'hidden';
            input3.name = 'publish[]';
            input3.value = rowData.state1;
            form.appendChild(input3);

            var input4 = document.createElement('input');
            input4.type = 'hidden';
            input4.name = 'state2[]';
            input4.value = rowData.state2;
            form.appendChild(input4);

            var input5 = document.createElement('input');
            input5.type = 'hidden';
            input5.name = 'state3[]';
            input5.value = rowData.state3;
            form.appendChild(input5);

            tableData.push(rowData);

        });
        console.log(tableData);
        document.body.appendChild(form);
        form.submit();
        return;// data;
    }

            Post Type
            Show/Hide admin bar by the post status

            Published
            Pending For Review
            Draft

            post

                    <input type="checkbox" checked="">

                    <input type="checkbox" checked="">

                    <input type="checkbox" checked="">

            page

                    <input type="checkbox" checked="">

                    <input type="checkbox" checked="">

<button id="save_settings" class="button button-primary" onclick="readValuesAndStates()">Save Settings</button>
Comment: basically the function alerts everything well but can't submit the data correctly
Comment: what you are getting in `print_r($_POST);
`?
Comment: only one item from the list that its id = post_id : =>
Array
(
    [post_id] => 37
)
Comment: I've commented all form.appendChild() and then sun the code it still prin tone item from the list array although the form must be empty !!!!
Comment: I can see all the data
Comment: https://phpsandbox.io/e/x/zmgxc?layout=EditorPreview&defaultPath=%2F&theme=dark&showExplorer=no&openedFiles=
Comment: also list array with one item {"post_id":"40"}

submit data by javascript Partially


Why not use instrumental variable directly as a covariate in the regression?

Question: I know this is a silly question, as I know the theory of instrumental variables and two stage regression. Still, I never saw a clear answer to the following:

assume you have endogeneity due to unobserved variable correlated with one of the initial regressors. The typical way to correct for that is to find an instrumental variable correlated to the unobserved effect and to use a two-stage regression approach.

Now my question is, why go through that trouble – why wouldn't you just include the instrumental variable as a standard regressor in the initial estimation?
Answer: The point of instrumental variable regression is to provide an unbiased estimate of the causal effect of exposure $X$ on outcome $O$, when there is some unmeasured—possibly unmeasureable—variable $U$ confounding the relationship between $X$ and $O$. Here's a DAG of the simplest circumstance under which one would use instrumental variables estimation ($X$, $U$, and $Z$ can be sets of variables):

If an instrumental variable $Z$ causes $X$, has no effect on $O$ other than through $X$, there is no prior cause of both $Z$ and $O$, and the effect of $X$ on $O$ is homogeneous, then with a large enough sample $E[O|\hat{X}]$ where $\hat{X} = E[X|Z]$ can provide an unbiased estimate of the causal effect of $X$ on $O$.
In summary you do not care about the effect of $Z$ on $O$ (there is none except through $X$), and $E[O|\hat{X}] \ne E[O|X,Z]$, so simply including $Z$ in your model will not get you an instrumental variable estimate.
Final comment: The "...in the initial estimation?" closing of your question makes me want to clarify: one first estimates $\hat{X}$ (so $Z$ is indeed part of that estimation), and one uses $\hat{X}$ as a predictor in the second estimation (sans $Z$).
Comment: Could you please elaborate on why $E[O|\hat{X}]$ provides an unbiased estimate of causal effect of X on O?
Comment: @АнтонБугаев Because in that DAG (1) $\hat{X}$ only contains information from/variation originating from $Z$, (2) $Z$ only affects $O$ through $X$, and (3)  there is no backdoor path from $O$ to $Z$ that passes through $U$, therefore $U$ cannot confound $E[O|\hat{X}]$. Therefore, for example, $E[O=1|\hat{X}=1] - E[O=1|\hat{X}=0]$ is an unbiased causal estimate.
Answer: You can and people do. As @Alexis points out though, it doesn't give you a complete answer.
Imagine you're interested in the effect of an endogenous variable $X$ on $Y$ and $Z$ is an instrument for $X$. When doing IV in econometrics:

The regression of $X$ on $Z$ is called the first stage regression.
The regression of $Y$ on $Z$ is called the reduced form regression.

The reduced form regression on its own does not estimate the effect of $X$ on $Y$.
Answer: Well actually you could. Now suppose you have two groups of IVs, $Z_1$ and $Z_2$, both could be vectors. Suppose you include $Z_1$ in your regression with $Y$, then they're called "included exogenous variables". For those $Z_2$, they are supposed to have no effect on $Y$ and hence with coefficients 0, they're called "excluded exogenous variables". But like explained in other answers, you cannot just run one regression. Also, including IVs directly in your regression for $Y$ won't give you the desired effect of $X$ on $Y$.
A good reference is Chapter 12 section 5 of Bruce Hansen's Econometrics.


Statistical test for two distributions where only 5-number summary is known?

Question: I have two distributions where only the 5-number summary (minimum, 1st quartile, median, 3rd quartile, maximum) and sample size are known.  Contrary to the question here, not all data points are available.
Is there any non-parametric statistical test which allows me to check whether the underlying distributions of the two are different?
Answer: Under the null hypothesis that the distributions are the same and both samples are obtained randomly and independently from the common distribution, we can work out the sizes of all $5\times 5$ (deterministic) tests that can be made by comparing one letter value to another.  Some of these tests appear to have reasonable power to detect differences in distributions.

Analysis
The original definition of the $5$-letter summary of any ordered batch of numbers $x_1 \le x_2 \le \cdots \le x_n$ is the following [Tukey EDA 1977]:

For any number $m = (i + (i+1))/2$ in $\{(1+2)/2, (2+3)/2, \ldots, (n-1+n)/2\}$ define $x_m = (x_i + x_{i+1})/2.$

Let $\bar{i} = n+1-i$.

Let $m = (n+1)/2$ and $h = (\lfloor m \rfloor + 1)/2.$

The $5$-letter summary is the set $\{X^{-} = x_1, H^{-}=x_h, M=x_m, H^{+}=x_\bar{h}, X^{+}=x_n\}.$  Its elements are known as the minimum, lower hinge, median, upper hinge, and maximum, respectively.

For example, in the batch of data $(-3, 1, 1, 2, 3, 5, 5, 5, 7, 13, 21)$ we may compute that $n=12$, $m=13/2$, and $h=7/2$, whence
$$\eqalign{
&X^{-} &= -3, \\
&H^{-} &= x_{7/2} = (x_3+x_4)/2 = (1+2)/2 = 3/2, \\
&M &= x_{13/2} = (x_6+x_7)/2 = (5+5)/2 = 5, \\
&H^{+} &= x_\overline{7/2} = x_{19/2} = (x_9+x_{10})/2 = (5+7)/2 = 6, \\
&X^{+} &= x_{12} = 21.
}$$
The hinges are close to (but usually not exactly the same as) the quartiles.  If quartiles are used, note that in general they will be weighted arithmetic means of two of the order statistics and thereby will lie within one of the intervals $[x_i, x_{i+1}]$ where $i$ can be determined from $n$ and the algorithm used to compute the quartiles.  In general, when $q$ is in an interval $[i, i+1]$ I will loosely write $x_q$ to refer to some such weighted mean of $x_i$ and $x_{i+1}$.
With two batches of data $(x_i, i=1,\ldots, n)$ and $(y_j, j=1,\ldots,m),$ there are two separate five-letter summaries.  We can test the null hypothesis that both are iid random samples of a common distribution $F$ by comparing one of the $x$-letters $x_q$ to one of the $y$-letters $y_r$.  For instance, we might compare the upper hinge of $x$ to the lower hinge of $y$ in order to see whether $x$ is significantly less than $y$.  This leads to a definite question: how to compute this chance,
$${\Pr}_F(x_q \lt y_r).$$
For fractional $q$ and $r$ this is not possible without knowing $F$.  However, because $x_q \le x_{\lceil q \rceil} $ and $y_{\lfloor r \rfloor} \le y_r,$ then a fortiori
$${\Pr}_F(x_q \lt y_r) \le {\Pr}_F(x_{\lceil q \rceil} \lt y_{\lfloor r \rfloor}).$$
We can thereby obtain universal (independent of $F$) upper bounds on the desired probabilities by computing the right hand probability, which compares individual order statistics.  The general question in front of us is

What is the chance that the $q^\text{th}$ highest of $n$ values will be less than the $r^\text{th}$ highest of $m$ values drawn iid from a common distribution?

Even this does not have a universal answer unless we rule out the possibility that probability is too heavily concentrated on individual values: in other words, we need to assume that ties are not possible.  This means $F$ must be a continuous distribution.  Although this is an assumption, it is a weak one and it is non-parametric.

Solution
The distribution $F$ plays no role in the calculation, because upon re-expressing all values by means of the probability transform $F$, we obtain new batches
$$X^{(F)} = F(x_1) \le F(x_2) \le \cdots \le F(x_n)$$
and
$$Y^{(F)} = F(y_1) \le F(y_2) \le \cdots \le F(y_m).$$
Moreover, this re-expression is monotonic and increasing: it preserves order and in so doing preserves the event $x_q \lt y_r.$  Because $F$ is continuous, these new batches are drawn from a Uniform$[0,1]$ distribution.  Under this distribution--and dropping the now superfluous "$F$" from the notation--we easily find that $x_q$ has a Beta$(q, n+1-q)$ = Beta$(q, \bar{q})$ distribution:
$$\Pr(x_q\le x) = \frac{n!}{(n-q)!(q-1)!}\int_0^x t^{q-1}(1-t)^{n-q}dt.$$
Similarly the distribution of $y_r$ is Beta$(r, m+1-r)$.  By performing the double integration over the region $x_q \lt y_r$ we can obtain the desired probability,
$$\Pr(x_q \lt y_r) = \frac{\Gamma (m+1) \Gamma (n+1) \Gamma (q+r)\, _3\tilde{F}_2(q,q-n,q+r;\ q+1,m+q+1;\ 1)}{\Gamma (r) \Gamma (n-q+1)}$$
Because all values $n, m, q, r$ are integral, all the $\Gamma$ values are really just factorials: $\Gamma(k) = (k-1)! = (k-1)(k-2)\cdots(2)(1)$ for integral $k\ge 0.$
The little-known function $_3\tilde{F}_2$ is a regularized hypergeometric function.  In this case it can be computed as a rather simple alternating sum of length $n-q+1$, normalized by some factorials:
$$\Gamma(q+1)\Gamma(m+q+1)\ {_3\tilde{F}_2}(q,q-n,q+r;\ q+1,m+q+1;\ 1) \\
=\sum_{i=0}^{n-q}(-1)^i \binom{n-q}{i} \frac{q(q+r)\cdots(q+r+i-1)}{(q+i)(1+m+q)(2+m+q)\cdots(i+m+q)} \\
= 1 - \frac{\binom{n-q}{1}q(q+r)}{(1+q)(1+m+q)} + \frac{\binom{n-q}{2}q(q+r)(1+q+r)}{(2+q)(1+m+q)(2+m+q)} - \cdots.$$
This has reduced the calculation of the probability to nothing more complicated than addition, subtraction, multiplication, and division.  The computational effort scales as $O((n-q)^2).$  By exploiting the symmetry
$$\Pr(x_q \lt y_r) = 1 - \Pr(y_r \lt x_q)$$
the new calculation scales as $O((m-r)^2),$ allowing us to pick the easier of the two sums if we wish.  This will rarely be necessary, though, because $5$-letter summaries tend to be used only for small batches, rarely exceeding $n, m \approx 300.$

Application
Suppose the two batches have sizes $n=8$ and $m=12$.  The relevant order statistics for $x$ and $y$ are $1,3,5,7,8$ and $1,3,6,9,12,$ respectively.  Here is a table of the chance that $x_q \lt y_r$ with $q$ indexing the rows and $r$ indexing the columns:
q\r 1       3       6       9       12
1   0.4      0.807  0.9762  0.9987  1.
3   0.0491  0.2962  0.7404  0.9601  0.9993
5   0.0036  0.0521  0.325   0.7492  0.9856
7   0.0001  0.0032  0.0542  0.3065  0.8526
8   0.      0.0004  0.0102  0.1022  0.6

A simulation of 10,000 iid sample pairs from a standard Normal distribution gave results close to these.
To construct a one-sided test at size $\alpha,$ such as $\alpha = 5\%,$ to determine whether the $x$ batch is significantly less than the $y$ batch, look for values in this table close to or just under $\alpha$.  Good choices are at $(q,r)=(3,1),$ where the chance is $0.0491,$ at $(5,3)$ with a chance of $0.0521$, and at $(7,6)$ with a chance of $0.0542.$  Which one to use depends on your thoughts about the alternative hypothesis.  For instance, the $(3,1)$ test compares the lower hinge of $x$ to the smallest value of $y$ and finds a significant difference when that lower hinge is the smaller one.  This test is sensitive to an extreme value of $y$; if there is some concern about outlying data, this might be a risky test to choose.  On the other hand the test $(7,6)$ compares the upper hinge of $x$ to the median of $y$.  This one is very robust to outlying values in the $y$ batch and moderately robust to outliers in $x$.  However, it compares middle values of $x$ to middle values of $y$.  Although this is probably a good comparison to make, it will not detect differences in the distributions that occur only in either tail.
Being able to compute these critical values analytically helps in selecting a test.  Once one (or several) tests are identified, their power to detect changes is probably best evaluated through simulation.  The power will depend heavily on how the distributions differ.  To get a sense of whether these tests have any power at all, I conducted the $(5,3)$ test with the $y_j$ drawn iid from a Normal$(1,1)$ distribution: that is, its median was shifted by one standard deviation.  In a simulation the test was significant $54.4\%$ of the time: that is appreciable power for datasets this small.
Much more can be said, but all of it is routine stuff about conducting two-sided tests, how to assess effects sizes, and so on.  The principal point has been demonstrated: given the $5$-letter summaries (and sizes) of two batches of data, it is possible to construct reasonably powerful non-parametric tests to detect differences in their underlying populations and in many cases we might even have several choices of test to select from.  The theory developed here has a broader application to comparing two populations by means of a appropriately selected order statistics from their samples (not just those approximating the letter summaries).
These results have other useful applications.  For instance, a boxplot is a graphical depiction of a $5$-letter summary.  Thus, along with knowledge of the sample size shown by a boxplot, we have available a number of simple tests (based on comparing parts of one box and whisker to another one) to assess the significance of visually apparent differences in those plots.
Comment: @MichaelM Although sample size is important for assessing uncertainty when the data are a random sample, a traditional boxplot does not depict the sample size.  It is intended as a graphical display of a batch of data, whether or not those data are considered a sample, a random sample, a population, or just a bunch of numbers.  Clearly the solution to the question requires the sample sizes--there's no getting around that.
Comment: Insightful as always. But wouldn't one need to have access to the sample sizes, which are not part of the five number summary? I see that the OP state that these are known in his or her case, but I would prefer that this is more clearly stated.
Answer: I'm pretty confident there isn't going to be one already in the literature, but if you seek a  nonparametric test, it would have to be under the assumption of continuity of the underlying variable --- you could look at something like an ECDF-type statistic - say some equivalent to a Kolmogorov-Smirnov-type statistic or something akin to an Anderson-Darling statistic (though of course the distribution of the statistic will be very different in this case).
The distribution for small samples will depend on the precise definitions of the quantiles used in the five number summary.
Consider, for example, the default quartiles and extreme values in R (n=10):
    > summary(x)[-4]
        Min.  1st Qu.   Median  3rd Qu.     Max.
    -2.33500 -0.26450  0.07787  0.33740  0.94770

compared to those generated by its command for the five number summary:
    > fivenum(x)
    [1] -2.33458172 -0.34739104  0.07786866  0.38008143  0.94774213

Note that the upper and lower quartiles differ from the corresponding hinges in the fivenum command.
By contrast, at n=9 the two results are identical (when they all occur at observations)
(R comes with nine different definitions for quantiles.)
The case for all three quartiles occurring at observations (when $n=4k+1$, I believe, possibly under more cases under some definitions of them) might actually be doable algebraically and should be nonparametric, but the general case (across many definitions) may not be so doable, and may not be nonparametric (consider the case where you're averaging observations to produce quantiles in at least one of the samples ... in that case the probabilities of different arrangements of sample quantiles may no longer be unaffected by the distribution of the data).
Once a fixed definition is chosen, simulation would seem to be the way to proceed.
Because it will be nonparametric at a subset of possible values of $n$, the fact that it's no longer distribution free for other values may not be such a big concern; one might say nearly distribution free at intermediate sample sizes, at least if $n$'s are not too small.

Let's look at some cases that should be distribution free, and consider some small sample sizes. Say a KS-type statistic applied directly to the five number summary itself, for sample sizes where the five number summary values will be individual order statistics.
Note that this doesn't really 'emulate' the K-S test exactly, since the jumps in the tail are too large compared to the KS, for example. On the other hand, it's not easy to assert that the jumps at the summary values should be for all the values between them. Different sets of weights/jumps will have different type-I error characteristics and different power characteristics and I am not sure what is best to choose (choosing slightly different from equal values could help get a finer set of significance levels, though). My purpose, then is simply to show that the general approach may be feasible, not to recommend any specific procedure. An arbitrary set of weights to each value in the summary will still give a nonparametric test, as long as they're not taken with reference to the data.
Anyway, here goes:

Finding the null distribution/critical values via simulation
At n=5 and 5 in the two samples, we needn't do anything special - that's a straight KS test.
At n=9 and 9, we can do uniform simulation:
     ks9.9 <- replicate(10000, ks.test(fivenum(runif(9)),
         fivenum(runif(9)))$statistic)
     plot(table(ks9.9)/10000,type="h"); abline(h=0,col=8)

      # Here's the empirical cdf:
     cumsum(table(ks9.9)/10000)
       0.2    0.4    0.6    0.8
    0.3730 0.9092 0.9966 1.0000

so at $n_1 = n_2=9$, you can get roughly $\alpha=0.1$ ($D_{crit}=0.6$), and roughly $\alpha=0.005$ ($D_{crit}=0.8$). (We shouldn't expect nice alpha steps. When the $n$'s are moderately large we should expect not to have anything but very big or very tiny choices for $\alpha$).
$n_1 = 9, n_2=13$ has a nice near-5% significance level ($D=0.6$)
$n_1 = n_2=13$ has a nice near-2.5% significance level ($D=0.6$)
At sample sizes near these, this approach should be feasible, but if both $n$s are much above 21 ($\alpha \approx 0.2$ and $\alpha\approx 0.001$), this won't work well at all.
--
A very fast 'by inspection' test
We see a rejection rule of $D\geq 0.6$ coming up often in the cases we looked at. What sample arrangements lead to that? I think the following two cases:
(i) When the whole of one sample is on one side of the other group's median.
(ii) When the boxes (the range covered by the quartiles) don't overlap.
So there's a nice super-simple nonparametric rejection rule for you -- but it usually won't be at a 'nice' significance level unless the sample sizes aren't too far from 9-13.

Getting a finer set of possible $\alpha$ levels
Anyway, producing tables for similar cases should be relatively straightforward. At medium to large $n$, this test will only have very small possible $\alpha$ levels (or very large) and won't be of practical use except for cases where the difference is obvious).
Interestingly, one approach to increasing the achievable $\alpha$ levels would be to set the jumps in the 'fivenum' cdf according to a Golomb-ruler. If the cdf values were $0,\frac{1}{11},\frac{4}{11},\frac{9}{11}$ and $1$, for example, then the difference between any pair of cdf-values would be different from any other pair. It might be worth seeing if that has much effect on power (my guess: probably not a lot).
Compared to these K-S like tests, I'd expect something more like an Anderson-Darling to be more powerful, but the question is how to weight for this five-number summary case. I imagine that can be tackled, but I'm not sure the extent to which it's worth it.

Power
Let's see how it goes on picking up a difference at $n_1=9,n_2=13$. This is a power curve for normal data, and the effect, del, is in number of standard deviations the second sample is shifted up:

This seems like quite a plausible power curve. So it seems to work okay at least at these small sample sizes.

What about robust, rather than nonparametric?
If nonparametric tests aren't so crucial, but robust-tests are instead okay, we could instead look at some more direct comparison of the three quartile values in the summary, such as an interval for the median based off the IQR and the sample size (based off some nominal distribution around which robustness is desired, such as the normal -- this is the reasoning behind notched box plots, for example). This should tend to work much better at large sample sizes than the nonparametric test which will suffer from lack of appropriate significance levels.
Comment: Very nice! I wonder off-hand if given the summary statistics you could actually calculate the maximum or minimum possible D statistic for the KS test. For example, you can draw the CDFs based on the summary statistics, and then there will by [p-box](http://stats.stackexchange.com/a/86120/1036) windows for each sample CDF. Based on those two p-box windows you could calculate the maximum or minimum possible D statistic - and then look up the test statistic in usual tables.
Answer: I don't see how there could be such a test, at least without some assumptions.
You can have two different distributions that have the same 5 number summary:
Here is a trivial example, where I change only 2 numbers, but clearly more numbers could be changed
    set.seed(123)

    #Create data
    x <- rnorm(1000)

    #Modify it without changing 5 number summary
    x2 <- sort(x)
    x2[100] <- x[100] - 1
    x2[900] <- x[900] + 1

    fivenum(x)
    fivenum(x2)

Comment: Power calculations will always require assumptions, even with nonparametric tests. Try finding a power curve for a Kolmogorov-Smirnov without more assumptions than you need for carrying out the test itself.
Comment: There is a small finite number of tests that can be considered: they compare the values in one summary to those in another.  One of them would be (for example) a comparison of the upper hinge of one dataset to the lower hinge of another. For sufficiently large sample sizes, this would indicate a significant difference in one population compared to another. It is related to the joint probability that $X\gt Y$ for independent random variables $X$ and $Y$. Although you don't get much control over the significance level, these tests can be reasonably powerful against a large set of alternatives.
Comment: This example only demonstrates a limitation in the power of such a procedure, but otherwise does not seem to shed much light on it.
Comment: I think it means that, without some assumptions, the power of such a test would be inestimable. What could such a test look like?
Comment: @whuber Without any measure of the error or accuracy of the measurements? Or is that supplied by sample size? The quantiles, and even more the max and min, are hard to work with in this way.
Comment: You have the same problem in *any* comparison of two distributions based on data, Peter: that's not a special restriction in this case.  Although the max and min are *variable,* the quartiles are quite a bit less variable and none of them are "hard to work with." The mathematics of this situation are no different than the analysis of conventional tests such as the Wilcoxon; exact values for the sizes of the tests can be obtained assuming only that at least one distribution is absolutely continuous.