Why is my Rules data comparison not evaluating correctly?

Question: This should be easy, but I can't figure out what is going wrong. I have created a field on the user account called "User profile type." It has two options: "General user" and "Grant Network user".
I am trying to create a rule (using the Rules module)to apply a role to these options if they are selected upon saving or updating of the user account form.
However, despite everything I have tried, I can't get the data comparison to evaluate as TRUE:

I am selecting site:current-user:field-user-profile-type:0 as the data to compare.
Then, in the conditions field, I am given the option in the direct input method to choose the item I want.
I am trying to choose "Grant Network user" and it evaluates to FALSE every time no matter what I try.
I have set it up with an OR statement, so that I also am selecting site:current-user:field-user-profile-type:1 as well. But, neither of these will evaluate to TRUE.

The weird thing is that when I test these data selection values in a rule to show a message on the site, they both display a message of "Grant Network user."
So, I don't understand why the data comparison is evaluating to FALSE.
Any ideas? It's probably something simple, but I can't seem to figure it out.
Note: I have tried selecting the field without the colon, but it doesn't seem to work either. It makes sense to try that, but part of my problem is also that I want to be able to select for more than one item. I'd prefer to use a "contains" operator, but it isn't available, so I'm trying to use the "...:0" and "...:1" options with an OR statement to allow for both options being selected. Am I understanding this wrong?
Comment: You shouldn't have to be choosing the "...:0" option. Can you select simply "site:current-user:field-user-profile-type"?
Comment: Thanks for your response! I have tried selecting it without the colon, but it doesn't seem to work either. It makes sense to try that, but part of my problem is also that I want to be able to select for more than one item. I'd prefer to use a "contains" operator, but it isn't available, so I'm trying to use the "...:0" and "...:1" options with an OR statement to allow for both options being selected. Am I understanding this wrong?
Comment: Ok, two things. 1. You should be referring to the user whose account is being updated--not "current user." If an admin updates someone's account they way you have it, then the change will be enacted on the admin's account, not the updated user. 2. Is "user profile type" a checkbox or radio button field?
Comment: @rrr45 : Are you familiar with "List contains item"? Check my answer for details on that ...
Answer: As per the "site:current-user:field-user-profile-type:X" part of your question (X=0 or 1), it seems that your "User profile type" field is a multi value field. Whereas you're trying to use a Data Comparison rules condition. Sorry to say, but for a multi value field, you should NOT use a "Data Comparison", because that's like trying to compare an array with a single value (which doesn't make sense).
To get your rule to work like you want it to work, you should use these Rules Conditions (in the specified order):

Entity has field, for your "User profile type" field, to make it available for subsequent Rules Conditions and/or Rules Actions.
List contains item, whereas:

the list is also about that same "User profile type" field (since your field allows multiple values, it is also considered as a list).
the item you want to check for (if it is contained in the list) is (e.g) "Grant Network user".

With those 2 Rules Conditions, your Rules Actions should be performed as you want it to work. For the sake of (basic) unit testing, just (temporary) add a Rules Action like "Display a Drupal Message" (as the very first Rules Action), with whatever message text (eg: "bingo, Pierre is right ...").
For an example Rule (in rules export format) in which you can see this at work, refer to the answer to "How to check for product taxonomy term in Rules actions (Ubercart)". In that case it's about a list of taxonomy terms, but the idea is the same.
PS: I'm assuming this question is about D7 ...


How to fit a longitudinal GAM mixed model (GAMM)

Question: I have repeated measurements of individuals, like this
y  |  id  | time  |  V1   | V2
100    1       1     23.2   0.8
88     1       2     22.6   0.9
98     2       1     10.6   1.1
83     2       2     11.1   1.3

y is a continous outcome variable, id is the patient id, time is the time point of oberservation and V1 and V2 are covariates.
In this data example we have 2 patients that have 2 observations each, one at time 1 and another one at time 2.
My real data sets has hundreds of patients (ids) and 2-5 observations (time) for each patient.
I now know that the effect of V1 on y is non-linear and what to model this with a GAM.
In the mgcv package there is a function called gamm(). In my example, I use it like this:
m <- gamm(y ~ s(V1) + V2 + time ,family=gaussian,
          data=dat,random= ~(time|id))

Is this correct?
Does this model integrate the fact that V1 can change over time for each individual?
Comment: I suggest to implement random effects within `gam` as a smoother instead, i.e., `bs = "re"` or even `bs = "fs"`. Such a model is easier to handle since it doesn't consist of two models internally as `gamm` does. Anyway, what does "V1 can change over time for each individual"  mean exactly? Is `V1` perhaps strongly collinear with `time`?
Comment: @spore234 the main effects and interaction would be `te(BMI, time, k = c(a,b))` with suitable values for a and b if needed. This is the smooth equivalent of `BMI * time`. If you want to decompose this, then: `s(BMI) + s(time) + ti(BMI, time)`. If you want the linear effect of `BMI` to vary smoothly with time, i.e. a varying coefficient model, then `s(time, by = BMI)` assuming BMI is coded as a numeric variable. It really depends on what you want to represent in the model.
Comment: @Roland how would I formulate this using `gam` ? Do I still get parameter estimates for V2 ? V1 is a variable like BMI that may be strongly correlated with its observation at the previous time point.
Comment: Can you explain what you mean by "may be strongly correlated with its observation at the previous time point"? This suggests a lagged effect, but you include `V1` as a predictor of `y` contemporaneously (unless you lagged it yourself?). If the effect of `V1` is intended to vary with `time`, then your model isn't accounting for that. Some further explanation would be helpful.
Comment: @GavinSimpson let's assume `V1` is BMI and I want to integrate individual BMI changes over time into the model
Comment: If the effect of BMI==1, or BMI==10 stays the same over time, then `s(BMI)` will include the effect of BMI on the response as the recorded BMI changes over time. The effect of smooth effect of BMI won't be correlated with time (the smooth of time will look quite different to the smooth of BMI), but the smooth of time will explain temporal variation in the response not captured by the other terms in the model.
Comment: If you want the effect of BMI==1 at time t=1 to be different from the effect of BMI=1 at time t=100, then no, the specification used currently is not going to account for that sort of time variation.
Comment: @GavinSimpson How would I add the later? I could add a fixed effect interaction BMI*time but I would want something on the individual level too
Answer: What @Roland is getting at is to use a random spline basis for the time by id random part. So your model would become:
m <- gam(y ~ s(V1) + V2 + s(time, id, bs = 'fs'),
         family=gaussian, data=dat, method = "REML")

This model says that the effect of time is smooth and varies by id, with a separate smooth being estimated for each id but each smooth is assumed to have the same wiggliness (a single smoothness penalty is estimated for all the time smoothers) but can differ in shape.
To estimate a separate "global" effect the model could be
m <- gam(y ~ s(V1) + V2 + s(time) + s(time, id, bs = 'fs'),
         family=gaussian, data=dat, method = "REML")

If you want similar models but where each smooth can have different wiggliness as well as shape, then the by smoothers can be used:
## without a "global" effect
m <- gam(y ~ s(V1) + V2 + s(id, bs = 're') + s(time, by = id),
         family=gaussian, data=dat, method = "REML")

## with a "global" effect
m <- gam(y ~ s(V1) + V2 +
         s(id, bs = 're') + s(time) + s(time, by = id, m = 1),
         family=gaussian, data=dat, method = "REML")

The m=1 means that the smoother uses a penalty on the squared first derivative, which penalises departure from a flat function of no effect. As this is on the subject specific smooths, the model is penalising deviations from the "global" smooth.
Some colleagues and I have described these models in some detail in a paper submitted to PeerJ, which is available as a preprint. A new version in response to reviewers comments should be up in a few days (we've submitted it to the journal).
Comment: Nice manuscript. Looks like a useful reference for a paper's methods section.


Calculating set. Did I do it right?

Question: I have done this assignment in my homework, and I am not sure if I did it in the right way. So maybe you can help me.
So this is the assignment.

Write all elements in the set:
  $$
V:=\left\{a\in\mathbb{R}\;\middle|\;a<0\text{ and }\sqrt{4a+4a^2+1}=1\right\}
$$

I did this set like this. I calculated quadratic equation:
$$
\sqrt{4a+4a^2+1}=1\;\to\;\sqrt{(2a+1)^2}=1
$$
Then I just simply solved the equation for the $a$, and then I got that this is a empty set, because $a$ is smaller than $0$, and I have logical "and" Operator.
Did I do this in the right manner? If I did something wrong please advise me. Thank you very much!
Comment: Hint: $(-1)^2 =1$.
Answer: Your method is almost right...You forgot that when $x\in \mathbb{R}$ then $\sqrt{x^2}=|x|$ (the absolute value of $x$).
So you get $V= \{ a\ \in \mathbb R ∣a<0\ \text{ and }\ |2a+1|=1 \}$. Could you finish with that?
Comment: Yes at the end, you should get $V = \{ -1 \}$.
Comment: Thanks. I tried solving it, and I got that a=0 and a=-1, so the set is only -1. Is this right?

Calculating set. Did I do it right?


Obtaining normal form of a line from the general form

Question: This is a question relating to SL Loney's coordinate geometry book (article 56).
We have $Ax + By + C = 0$ as the general form of a line.
Want to arrive at $xcos(\alpha)+ ysin(\alpha) - p = 0$ as the 'normal form'
So we have the equations represent the same line thus we have the common ratios of coefficients
$ cos(\alpha)\over A$ =$ sin(\alpha)\over B$ =$ -p\over c$
Now here is where I can't arrive myself.
$ p\over c$ = $ cos(\alpha)\over -A$ = $ sin(\alpha)\over -B$ = $ \sqrt{cos^2(\alpha) + sin^2(\alpha) \over A^2 + B^2}$ = $ 1 \over \sqrt{A^2 + B^2}$
Ultimately, I'm hoping someone can shed some light on how he arrived at the $ \sqrt{cos^2(\alpha) + sin^2(\alpha) \over A^2 + B^2}$ part...
Comment: thanks all for the insight, very much appreciated.
Answer: If $\dfrac p c  =  \dfrac{\cos(\alpha)}{-A } = \dfrac{  \sin(\alpha)}{ -B}=k$
$$1=\cos^2\alpha+\sin^2\alpha=k^2(A^2+B^2)\implies k^2=?$$
Answer: $$\frac{p}{c}=\frac{cos\alpha}{-A}=\frac{sin\alpha}{-B}=n$$
let's take each term apart:
$$\frac{cos\alpha}{-A}=n ==> -An=cos\alpha$$
$$\frac{sin\alpha}{-B}=n ==> -Bn=sin\alpha$$
Now square both sides :
$$A^2n^2=cos^2\alpha$$
$$B^2n^2=sin^2\alpha$$
Now add them up :
$A^2n^2 + B^2n^2 = sin^2\alpha+cos^2\alpha$
$n^2(A^2+B^2)=1$
$n^2=\frac{1}{A^2+B^2}$
$n=\sqrt{\frac{1}{A^2+B^2}}$
So you can say:
$$\frac{p}{c}=\frac{cos\alpha}{-A}=\frac{sin\alpha}{-B}=\sqrt{\frac{1}{A^2+B^2}}$$
Answer: So, we have a line represented by an equation: $Ax + By + C = 0$.
To get the equation of this form we need to multiply the $x \sin \alpha + y \cos \alpha + r = 0$ form by some koefficient $\mu$. Now, lets find the $\mu$:
$\mu \cdot A x + \mu \cdot B y + \mu \cdot C = x \cos \alpha + y \sin \alpha + r;$
from which(because x and y are separate axises):
$\mu \cdot A = \cos \alpha$
and
$\mu \cdot B = \sin \alpha$
from which
$(\mu \cdot A)^2 + (\mu \cdot B)^2 = (\cos \alpha)^2 + (\sin \alpha)^2$ => $\mu^2 (A^2+B^2) = 1$ => $\mu = \sqrt{\frac{1}{A^{2} + B^{2}}}$;
also, $C = \frac{r}{\mu}$ => $\mu = \frac{r}{C}$;


"No such resource" setting activity's theme

Question: I want to display a picture full screen without an action bar in Android tablet, but when I write android:theme="@android:style/Theme_NoTitleBar_Fullscreen" in Android Manifest, it says there is no such resource. How is it possible since it is on the list of themes?
Answer: You should use:
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"

Answer: you can use this
@Override
public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        this.requestWindowFeature(Window.FEATURE_NO_TITLE);
        this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
                WindowManager.LayoutParams.FLAG_FULLSCREEN);
}


How can a future observation being predicted even if under sample independency (posterior predictive distribution)?

Question: I was reading https://people.stat.sc.edu/Hitchcock/stat535slidesday18.pdf and I came across with:

It gives us an way to get a distribution for a new observation called for $x_{new}$ given the past sample values $\mathbf{x}$ but $x_{new}$ independs from $\mathbf{x}$ so $P(x_{new}|\mathbf{x})=P(x_{new})$ and:

So here are my questions:
1-Why does $P(x_{new}|\mathbf{x})=\int_{\Theta}P(x_{new}|\theta,\mathbf{x})P(\theta|\mathbf{x})d\theta$ hold?
2-If so then Why is use it worth since I'm able to evaluate $P(x_{new}|\mathbf{x})$ by the second figure?
Answer: $p(x_{new}|x)$ is the posterior predictive distribution. It can be computed as an integral over the parameter $\theta$ as stated in your question, in fact this is just an application of marginal probability density functions (https://en.wikipedia.org/wiki/Marginal_distribution): $p(x_{new}|x)=\int_\theta p(x_{new},\theta|x) d\theta$.
$p(x_{new})$ is the prior predictive distribution. $p(x_{new}|x)$ is never equal to $p(x_{new})$ except in trivial cases, because  $x_{new}$ is not independent of $x$. When the slides mention independence of $x$ and $x_{new}$, they actually mean independence conditional on $\theta$ i.e. the only 'connection' between $x$ and $x_{new}$ is via the parameter $\theta$.
Conditional independence (https://en.wikipedia.org/wiki/Conditional_independence): in this context it means that $p(x_{new}|x,\theta)=p(x_{new}|\theta)$. This is a standard assumption that is made in Bayesian modelling. It's particularly clear that this is reasonable if, say, the data are (conditionally) independent Bernoulli trials with parameter $p$. If we know $p$, then knowing the outcome of any number of Bernoulli trials ($x$) won't tell us anything more about the outcome of future trials ($x_{new}$) (because they're conditionally independent). If we don't know $p$, then $x$ can tell us a lot about $x_{new}$ (because they're not independent).
If conditional independence doesn't hold, we can still proceed but the computations might be more complex. This might happen if, for example, $x$ comprises observation of a continuous time stochastic process over a time interval $[0,T]$ and $x_{new}$ is observations over the future interval $(T,T+1]$.
Comment: What do you mean by 'independence conditional on θ' and why** is that true or even reasonable?
Comment: I made some edits...
Comment: it sounds like $x$ is an useless information if we know $\theta$ and it pretty makes sense.There is just a problem remaining, I didn't stated $P(x_{new}|x)=\int_{\theta} p(x_{new},\theta|x)d\theta$ I do $P(x_{new}|x)=\int_{\theta} p(x_{new}|\theta ,x)p(\theta|x)d\theta$ and your link just tell us about two random variables and its marginalization not 3 as we are in. (It actually tell us a little bit in the end's page but it doesnt use conditional regarding.)
Comment: The two integrands in your comment are equal. This is because $P(A,B|C)=P(A|B,C)P(B|C)$
Comment: great, thank you


Organizar grupos

Question: Eu não consegui achar a lógica para implementar isso.
Então, vou explicar de outra forma para melhor entendimento:
O algoritmo combina 10 números em conjuntos de 6, que dá um total de 210 volantes. Sendo que, eu preciso colocar uma condição para garantir que não mostrem os conjuntos no qual se repetem 5 dos 6 números.
Exemplo: Eu tenho esta combinação 10 números em um conjunto de 6.
1 2 3 4 5 6  //
1 2 3 4 5 7
1 2 3 4 5 8
1 2 3 4 5 9
1 2 3 4 5 10
1 2 3 4 6 7
1 2 3 4 6 8
1 2 3 4 6 9
1 2 3 4 6 10
1 2 3 4 7 8  //
.......

Sendo que, 5 dos 6 números do conjunto sempre se repetem. Então eu preciso que o algoritmo me mostre apenas os conjuntos que não tenham os 5 números repetidos. Conforme eu destaquei com //.
01  02  03  04  05  06 ;
01  02  03  04  07  08 ;
01  02  03  04  09  10 ;
01  02  03  05  07  09 ;
01  02  03  05  08  10 ;
01  02  03  06  07  10 ;
01  02  03  06  08  09 ;
01  02  04  05  07  10 ;
01  02  04  05  08  09 ;
01  02  04  06  07  09 ;
01  02  04  06  08  10 ;
01  02  05  06  07  08 ;
01  02  05  06  09  10 ;
01  02  07  08  09  10 ;
03  04  05  06  07  08 ;
03  04  05  06  09  10 ;
03  04  07  08  09  10 ;
05  06  07  08  09  10 ;

package jogo;

import java.awt.List;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;

public class Combinacoes {

    private int numeros[] = {1,2,3,4,5,6,7,8,9,10};
    private int quantidade = 6;
    private int resultado[] = new int[6];
    private ArrayList<String>aParsear = new ArrayList<String>();
    private HashMap<Integer,String> map = new HashMap<Integer,String>();
    private int count = 0;
    private String[] temp;

    private void busca(int inicio,int fim, int profundidade){

        if ( (profundidade + 1) >= quantidade)
            for(int x = inicio; x <= fim; x++){
                resultado[profundidade] = numeros[x];
                // faz alguma coisa com um dos resultados possiveis
                count++;

                String tmp = ""+  resultado[0] + ", "
                        + resultado[1] + ", "
                        + resultado[2] + ", "
                        + resultado[3] + ", "
                        + resultado[4] + ", "
                        + resultado[5] + "";
                System.out.println(tmp);
                aParsear.add(tmp);
            }
        else
            for(int x = inicio; x <= fim; x++){
                resultado[profundidade] = numeros[x];
                busca(x + 1,fim + 1,profundidade + 1);
            }
    }

    private void parsearListaGerada(){
        Iterator<String> it = aParsear.iterator();

        while(it.hasNext()){
            String tmp = it.next();
            int[]valoresInteiros = new int[6];
            String[]valoresLiterais = tmp.split(",");
            for(int i = 0;i < valoresLiterais.length;i++){
                valoresInteiros[i]= Integer.parseInt(valoresLiterais[i].trim());
            }
            int chave=0;
            for(int j=0;j < valoresInteiros.length;j++){
                chave+=((j+1)*valoresInteiros[j]);
            }
            if(map.containsKey(chave))
                System.out.println("ger,"+tmp);
                map.put(chave,tmp);
            }

            System.out.println("Tamanho final:"+map.size());
            System.out.println("Resultado final");
            for(String valor:map.values())
                System.out.println(valor);

        }

    public static void main(String args[]){

        Combinacoes comb = new Combinacoes();
        comb.busca(0, (10-6), 0);
        System.out.println("Total de combinacoes: " + comb.count);
        comb.parsearListaGerada();

    }

}

Comment: O seu problema provavelmente é simples e fácil de resolver. Entretanto a descrição que você deu ficou super confusa e não entendi nada. Tentei editá-la para ver se assim, faria mais sentido para mim (e para os outros também). Com a edição deu para melhorar um pouco, mas ainda não entendo o que você está querendo fazer.
Answer: Simplificando o código
Vamos dar uma olhada no seu código.

Veja este import:
import java.awt.List;

Não é essa a lista que você quer importar. Você não está utilizando esse List para nada, mas o que você queria de fato importar é o java.util.List.
Essas variáveis:
    private ArrayList<String>aParsear = new ArrayList<String>();
    private HashMap<Integer,String> map = new HashMap<Integer,String>();

Você pode utilizar a sintaxe do diamante para evitar ter que repetir os genéricos. Além disso, é uma boa prática codificar para uma interface e não uma implementação. Ou seja, usar List e Map (do pacote java.util) como tipos ao invés de ArrayList e HashMap. Eis o que seria o resultado:
    private List<String> aParsear = new ArrayList<>();
    private Map<Integer, String> map = new HashMap<>();

Vamos ver a forma que você transforma o array em String:
               String tmp = ""+  resultado[0] + ", "
                        + resultado[1] + ", "
                        + resultado[2] + ", "
                        + resultado[3] + ", "
                        + resultado[4] + ", "
                        + resultado[5] + "";

Isso ficaria bem mais simples e bem melhor se fosse assim, além de não depender do tamanho do array estar fixo em 6:
                StringJoiner sj = new StringJoiner(", ");
                IntStream.of(resultado).boxed().map(Object::toString).forEach(sj::add);
                String tmp = sj.toString();

Ou então, se você não tiver problemas quanto a alterar um pouco o formato da String resultante:
                String tmp = Arrays.toString(resultado);

Vejamos o seu if:
        if (...)
            // Um monte de linhas aqui.
        else
            // Mais um monte de linhas aqui.

Por favor, use as chaves nesse caso porque é muito fácil você fazer besteiras ao não colocá-las. Por exemplo:
if (algumaCoisa)
    System.out.println("Estou dentro do if.");
    System.out.println("Será que ainda estou dentro do if?");

Aliás, mais abaixo, o seu código tem esse exato problema:
            if(map.containsKey(chave))
                System.out.println("ger,"+tmp);
                map.put(chave,tmp);
            }

Perdi algum tempo para entender o programa por causa desse bloco aí em cima. A identação sugere que o } se refere ao if, mas na verdade ele é do while que está do lado de fora. O fato do código estar identado incorretamente e não utilizar todos os pares de chaves que deveria acaba induzindo quem estiver lendo o código ao erro.
Veja o seu laço while:
        Iterator<String> it = aParsear.iterator();

        while(it.hasNext()){
            String tmp = it.next();

Não use o Iterator diretamente se não tiver um bom motivo para fazê-lo. Prefira o enhanced-for:
        for (String tmp : aParsear) {

A sua lista aParsear na verdade consiste de um array que você transforma em String para depois transformar de volta em array. Isso é uma gambiarra. Para resolver isso, você pode trocar esse código:
                aParsear.add(tmp);

Por isso:
                aParsear.add(resultado.clone());

E com isso, pode eliminar a variável tmp do método busca se quiser.
Isso daqui:
    private ArrayList<String>aParsear = new ArrayList<String>()

Fica assim:
    private List<int[]> aParsear = new ArrayList<>();

Você pode então simplificar um monte de coisas no parsearListaGerada com isso:
        for (int[] valoresInteiros : aParsear) {
            String tmp = Arrays.toString(valoresInteiros);

Você pode substituir isso:
        System.out.println("Total de combinacoes: " + comb.count);

Por isso:
        System.out.println("Total de combinacoes: " + comb.aParsear.size());

E então isso daqui pode ser apagado:
                // faz alguma coisa com um dos resultados possiveis
                count++;

E isso também:
    private int count = 0;
    private String[] temp;

Podemos simplificar o seu if com os dois fors:
       if ( (profundidade + 1) >= quantidade)
            for(int x = inicio; x <= fim; x++){
                resultado[profundidade] = numeros[x];
                // Algumas coisas.
            }
        else
            for(int x = inicio; x <= fim; x++){
                resultado[profundidade] = numeros[x];
                // Outras coisas.
            }

E deixá-lo assim:
        for (int x = inicio; x <= fim; x++) {
            resultado[profundidade] = numeros[x];
            if (profundidade + 1 >= quantidade) {
                // Algumas coisas.
            } else {
                // Outras coisas.
            }
        }

Observe que o seu Map é utilizado apenas dentro do método parsearListaGerada e que após o uso do método, o Map não contém nenhuma informação que seja relevante de ser preservada. Assim sendo, coloque o Map como uma variável local deste método.
Podemos trocar quantidade por resultado.length, e com isso eliminar essa variável.
Prefira usar (String[] args) ao invés de (String args[]). Assim você preserva o padrão de declaração [tipo da variável antes e nome da variável depois] utilizado em quase todos os outros lugares da linguagem Java. Caso contrário fica uma coisa no formato [uma parte do tipo da variável antes, nome da variável no meio, resto do tipo da variável depois], o que é um tanto confuso. O mesmo vale para transformar int resultado[] em int[] resultado.
Supondo que a lista de números seja sempre 1, 2, 3, 4... então você pode eliminar o array numeros e trocar o numeros[x] por x + 1.
Um nome melhor para a sua variável aParsear seria volantes.
Para evitar que o seu programa fique fixo em 10 elementos no jogo com 6 no volante e que você tenha que chamar comb.buscar(0, (10-6), 0); no main, passando esses números mágicos, você pode introduzir um construtor e um novo método busca:
    private int[] resultado;
    private List<int[]> volantes = new ArrayList<>();

    public Combinacoes(int quantidade) {
        this.resultado = new int[quantidade];
    }

    public void busca(int numeros) {
        busca(0, numeros - resultado.length, 0);
    }

E então no seu main você faz isso:
        Combinacoes comb = new Combinacoes(6);
        comb.busca(10);

Há ainda algumas outras mudanças possíveis, mas acho que aqui já está de bom tamanho. O código resultante tem exatamente o mesmo comportamento do seu código original da pergunta (com exceção de que ele mostra pares de colchetes para cada sêxtupla na saída). Veja como ficou o seu código:
Código simplificado
import java.util.Arrays;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class Combinacoes {

    private int[] resultado;
    private List<int[]> volantes = new ArrayList<>();

    public Combinacoes(int quantidade) {
        this.resultado = new int[quantidade];
    }

    public void busca(int numeros) {
        busca(0, numeros - resultado.length, 0);
    }

    private void busca(int inicio, int fim, int profundidade) {
        for (int x = inicio; x <= fim; x++) {
            resultado[profundidade] = x + 1;
            if (profundidade + 1 >= resultado.length) {
                System.out.println(Arrays.toString(resultado));
                volantes.add(resultado.clone());
            } else {
                busca(x + 1, fim + 1, profundidade + 1);
            }
        }
    }

    private void parsearListaGerada() {
        Map<Integer, String> map = new HashMap<>();
        for (int[] valoresInteiros : volantes) {
            String tmp = Arrays.toString(valoresInteiros);
            int chave = 0;
            for (int j = 0; j < valoresInteiros.length; j++) {
                chave += ((j + 1) * valoresInteiros[j]);
            }
            if (map.containsKey(chave)) {
                System.out.println("ger," + tmp);
            }
            map.put(chave, tmp);
        }

        System.out.println("Tamanho final:" + map.size());
        System.out.println("Resultado final");
        for (String valor : map.values()) {
            System.out.println(valor);
        }
    }

    public static void main(String[] args) {
        Combinacoes comb = new Combinacoes(6);
        comb.busca(10);
        System.out.println("Total de combinacoes: " + comb.aParsear.size());
        comb.parsearListaGerada();
    }
}

Melhorando o código
Eu não entendi qual é a sua ideia com a chave e com o Map, mas há alguns elementos nos quais as chaves colidem. Por exemplo:
[1, 2, 3, 4, 8, 9] - chave = 124
[1, 2, 3, 5, 6, 10] - chave = 124

[1, 2, 3, 4, 5, 9] - chave = 109
[1, 2, 4, 5, 6, 7] - chave = 109

[1, 2, 3, 5, 7, 9] - chave = 123
[1, 3, 4, 5, 6, 9] - chave = 123

Este código no final das contas vai mostrar onde ocorrem essas colisões dessas chaves, mostrando os 71 lugares que as tem (esse é o tamanho final).
Considerando que o resultado que você almeja na tabela que está na sua pergunta, não acho que esse procedimento do método parsearListaGerada faça sentido para você. Se entendi a sua pergunta direito, o que você quer é eliminar resultados que tenham 5 ou mais números repetidos. Esse método no entanto apenas mostra quais são os volantes que tem chaves colidindo. Acabei jogando fora este método.
Para refazer tudo, primeiro vamos introduzir uma classe Volante:
    private static final class Volante {
        private final Set<Integer> numeros;

        public Volante(int[] valores) {
            this.numeros = IntStream.of(valores).boxed().collect(Collectors.toCollection(TreeSet::new));
        }

        public int dissimilaridade(Volante outro) {
            List<Integer> interseccao = new ArrayList<>(numeros);
            interseccao.removeAll(outro.numeros);
            return interseccao.size();
        }

        @Override
        public String toString() {
            return numeros.toString();
        }
    }

O nome da classe é autoexplicativo. O construtor dela converte um int[] em um Set<Integer>. A grande sacada é o método dissimilaridade(Volante) que mede quantos números diferem entre um volante e outro.
Com isso, podemos fazer o seguinte método:
    private static List<Volante> limitarSimilaridade(List<Volante> volantes, int dissimilaridadeMinima) {
        List<Volante> dissimilares = new ArrayList<>(volantes.size());

        externo:
        for (Volante volante : volantes) {
            for (Volante dejaVu : dissimilares) {
                if (volante.dissimilaridade(dejaVu) < dissimilaridadeMinima) continue externo;
            }
            dissimilares.add(volante);
        }
        return dissimilares;
    }

Este método obtém uma lista de Volantes e devolve uma outra lista filtrada removendo aqueles que são parecidos demais entre si. Por "parecidos demais" entenda-se que tenham uma dissimilaridade abaixo do valor especificado com algum outro volante da lista.
Este é o código completo do que fiz:
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import java.util.TreeSet;
import java.util.stream.Collectors;
import java.util.stream.IntStream;

public final class Combinacoes {

    private static final class Volante {
        private final Set<Integer> numeros;

        public Volante(int[] valores) {
            this.numeros = IntStream.of(valores).boxed().collect(Collectors.toCollection(TreeSet::new));
        }

        public int dissimilaridade(Volante outro) {
            List<Integer> interseccao = new ArrayList<>(numeros);
            interseccao.removeAll(outro.numeros);
            return interseccao.size();
        }

        @Override
        public String toString() {
            return numeros.toString();
        }
    }

    public static List<Volante> busca(int quantidade, int numeros) {
        List<Volante> volantes = new ArrayList<>();
        busca(volantes, new int[quantidade], 0, numeros - quantidade, 0);
        return volantes;
    }

    private static void busca(List<Volante> volantes, int[] resultado, int inicio, int fim, int profundidade) {
        for (int x = inicio; x <= fim; x++) {
            resultado[profundidade] = x + 1;
            if (profundidade + 1 >= resultado.length) {
                volantes.add(new Volante(resultado));
            } else {
                busca(volantes, resultado, x + 1, fim + 1, profundidade + 1);
            }
        }
    }

    private static List<Volante> limitarSimilaridade(List<Volante> volantes, int dissimilaridadeMinima) {
        List<Volante> dissimilares = new ArrayList<>(volantes.size());

        externo:
        for (Volante volante : volantes) {
            for (Volante dejaVu : dissimilares) {
                if (volante.dissimilaridade(dejaVu) < dissimilaridadeMinima) continue externo;
            }
            dissimilares.add(volante);
        }
        return dissimilares;
    }

    public static void main(String[] args) {
        List<Volante> volantes = busca(6, 10);
        System.out.println(volantes.toString().replace("], ", "]\n"));
        System.out.println("Total de combinacoes: " + volantes.size());

        List<Volante> filtrados = limitarSimilaridade(volantes, 2);
        System.out.println("Tamanho final: " + filtrados.size());
        System.out.println("Resultado final");
        System.out.println(filtrados.toString().replace("], ", "]\n"));
    }
}

Como você pode ver, fiz mais algumas outras alterações no código além das que listei acima. Basicamente a ideia era:

Deixar os campos úteis apenas no método busca viverem apenas dentro desse método.
Produzir listas como resultado dos métodos ao invés de apenas armazená-las.

Ao executar esse novo programa, eis o final da saída (após mostrar os 210 volantes gerados):
Tamanho final:18
Resultado final
[[1, 2, 3, 4, 5, 6]
[1, 2, 3, 4, 7, 8]
[1, 2, 3, 4, 9, 10]
[1, 2, 3, 5, 7, 9]
[1, 2, 3, 5, 8, 10]
[1, 2, 3, 6, 7, 10]
[1, 2, 3, 6, 8, 9]
[1, 2, 4, 5, 7, 10]
[1, 2, 4, 5, 8, 9]
[1, 2, 4, 6, 7, 9]
[1, 2, 4, 6, 8, 10]
[1, 2, 5, 6, 7, 8]
[1, 2, 5, 6, 9, 10]
[1, 2, 7, 8, 9, 10]
[3, 4, 5, 6, 7, 8]
[3, 4, 5, 6, 9, 10]
[3, 4, 7, 8, 9, 10]
[5, 6, 7, 8, 9, 10]]

Essa é exatamente a mesma lista que você colocou na sua pergunta e que você esperava ter como resposta.
Veja aqui funcionando no ideone.
Comment: meu muito obrigado, vou fazer uma analise mais me parece correto.

Organizar grupos


Why is HttpUrlConnection not closing?

Question: Why is this connection not closing. When it makes an initial connection, it then sends randomly like 1 or 2 subsequent request, or it might send empty strings like {}.
And the server isn't giving any response on purpose.
<code>     private void playOnLoqooTv (String finalUrl) {
         HttpURLConnection con = null;
         try {

             URL url = new URL(finalUrl);

             // Log.d("TAG", url);
             System.out.println(url);
             //  Log.d("yo");
             con = (HttpURLConnection) url.openConnection();
             readStream(con.getInputStream());
         } catch (Exception e) {
             e.printStackTrace();
         }finally {
             if (con != null) {
                 con.disconnect();
             }
         }
    }

    private void readStream(InputStream in) {
        BufferedReader reader = null;
        try {
            reader = new BufferedReader(new InputStreamReader(in));
            String line = "";
            while ((line = reader.readLine()) != null) {
                System.out.println(line);
            }
            reader.close();
        }catch (IOException e)
        {
            e.printStackTrace();
        }
    }
</code>
Answer: Connection stays on KeepAlive if you are checking if connection is alive somewhere in system it may appear that connection is opened because socket stays opened for a little bit longer than connection alone.
Comment: But it is finishing the reading and calling close? If yes then one option is that connection stays on KeepAlive if you are checking if connection is alive somwhere in system it may appear that connection is opened because socket stays opened for a little bit longer than connection alone.
Comment: it is verified that it is connecting, but all i'm doing is trigging scripts but the connection stays alive. Basically pinging the server until I leave the activity
Comment: Yes, your are correct and I am corrected. It is closing, because it isn't sending the data from the initial connection anymore just empty "pings". WoW! You just solved it. I'm using a remote logging lib that uses sockets and THAT! is what is keeping the connection alive. ok, thank you for your thoughts.

Why is HttpUrlConnection not closing?


find all algebraic elements of $\mathbb{Q}(\pi)$ over $\mathbb{Q}(\pi^2 -2\pi +5)$

Question: Well, it is pretty clear that $\mathbb{Q}(\pi^2-2\pi+5)$ are all algebraic. I don't have any idea how to justify it, but I think those are the only algebraic elements of $\mathbb{Q}(\pi)$ over $\mathbb{Q}(\pi^2-2\pi+5)$, yet I don't succeed to show it or recall a theorem which might help.
I would also like an approach for the general case, when relating $\mathbb{Q}(\pi)$ as $\mathbb{Q}(x)$  and asking the same question regarding a general polynomial $g(x)$.
Answer: $\pi$ is algebraic, as it is the root of $X^2-2X+5 - (\pi^2-2\pi + 5)$.
Then all polynomials in $\pi$ are algebraic, because algebraic numbers are stable under product and sum. Moreover, nonzero algebraic numbers are stable under inverses, so all rational fractions in $\pi$ are algebraic : $\mathbb{Q}(\pi)/\mathbb{Q}(\pi^2-2\pi+5)$ is an algebraic extension.


Syncing files with rsync by file names only, ignore directories

Question: I'm trying to sync files from System A to System B. However, the files are re-organized in another directory structure, which makes usage of rsync difficult.
Is there any way to tell rsync to ignore directories and operate on file names only? The file names are unique - the directories aren't. The directory structure isn't fixed, so I can't simply replace them. I already thought about writing a script which strips the directory information, but I'm not sure if that brings up other problems.
In fact, yes, I wish to flatten the directory structure. Given the answers, rsync is probably not what I wish to use.
I'm working with videos, third parties create a directory structure (and they should be allowed to change the directory structure whenever appropriate). Those videos need to be syncronized to a master file system. File names are agreed not to be changed. So something like a diff between "find . | rip-out-path" on both systems and a diff might do the trick; but I was wondering if rsync had some magic flag to ignore directories at all when recursing - similar to the -p parameter in patch.
Comment: So, if I understand you, you've got lots of files in a consistent directory structure A and some identically named files at B; but in a somehow unpredictable arrangement each time you need to sync? I'm curious how this situation has come about?  Also, do you need to keep the two disparate directory structures? (meaning you can't flatten the filesystem at both sides before you sync)
Comment: Wait what? Do you want rsync to just not recurse? Or is something more complex going on? Can you provide example data?
Comment: @SmallClanger yes, third parties create video projects on their disks and I need to sync them into a master file storage. This is done manually, but the amount of videos has grown so huge that this can't be done manually anymore. Teaching all 3rd parties to use a specific directory structure is more work than inventing some script.
Comment: Do the files on System A change and require to be updated on System B or is it just a "copy once" of files on System A which are missing on System B? And a second point: are all the files on System B in the same directory, or do sub directories exist?
Comment: @Felicitus: I'd advise trying to sort out the filesystem layout instead.  If files are badly organised, then you need to address that, first. Keep it simple, rather than piling more complicated configuration on top of it. That said, if you're pulling from multiple client folders to a single, central location, can't you at least create a holding folder named after each machine or user, so there's no clashes, and then rsync as normal?
Comment: You apparently misunderstand the use of the `-p` option to patch.  It doesn't do at *all* what you seem to want.
Answer: Probably the simplest way to solve moving all files from on directory tree to a single directly would be using find with the -type  and -exec options.  The -type option limits the output to a specific type of directory entry (f for file, d for directory, etc.).  The -exec option passes the name found (as {}) to a command line with options.
A couple examples follow:
find /directory/top/ -type f -exec rsync {} desthost:/destdir

find /directory/top/ -type f -exec scp {} desthost:/destdir

Answer: You're screwed, or or less.  Whilst you can tell rsync to recurse and all sorts of other games, you can't tell it to go hunting around in a filesystem tree to find a file named the same at the other end.
I'd say what you're going to have to do is to have a little wrapper script at the far end that, given a bare file, returns the fully-qualified path to the file at that end, and then iterate through each file at the local end, calling this wrapper script to get the remote path and then executing rsync one... file... at... a... time...
That is, of course, assuming that all the files even already exist at the far end... where do they get put if they're not even there?  Are they skipped?
I'd find whoever came up with this crackpot file storage scheme and break their fingers.
Comment: Different people use different directory structures. I'm handling video storage done by others, and need to sync new stuff into a master filesystem. Currently this is done by hand, and I wish to automate that. No need to break anyone's fingers.
Answer: I'm still sticking with my "finger breaking" other answer in the general case, but I have a different solution for your specific situation, which is, as I understand it:

Other people have their own copy of stuff, in whatever crackpot hierarchy they choose; and
You need all their files, but organised into your own crackpot hierarchy

What I'm thinking is you run an rsync into remote-specific directories (like /storage/.remotes/client1/, /storage/.remotes/client2/, etc) for each of the remote filesystems you're syncing, and then have a script which normalises the filenames into your own hierarchy (assuming you can algorithmically describe your organisational scheme), and which you run over everything after the rsync has done it's thing to symlink into the client-specific remote storage locations.  If you can't describe your desired hierarchy algorithmically, then I guess you'll have to do your symlinking by hand (or at least with some level of human input, even if there is tool support).
The only difficulty then is if the remote rearranges their stuff, but then you just detect the now-broken symlinks, find the new locations of the filenames (assuming the names haven't changed, just the locations).
Answer: SOURCE_DIR=/path/to/lots/of/dirs/and/files
LINK_PATH=/path/to/store/all/files/as/symlinks/in/single/directory
DEST_PATH=/path/to/place/all/files/in/single/directory/with/no/child/directories

find $SOURCE_DIR -type f -print0 | xargs -0 cp -s --target-directory=$LINK_PATH
rsync -Lts $LINK_PATH/* $USER@$DEST_IP:$DEST_PATH

Comment: This is almost what I was thinking: don't you need to create a link_path on both the local and the remote hosts before attempting to rsync?
Answer: You can copy files from various source folders into one target folder (flat) without transferring source subfolders using command:
find source_dir -name "*.pdf" >/tmp/xx.txt
rsync -t -v --no-relative --files-from=/tmp/xx.txt / desthost:/destdir
rm -f /tmp/xx.txt

Answer: what about the --fuzzy option in rsync? I dont know if it would work in your case but you could give it a try.
Comment: No, that's just for reducing the amount of data transferred; it does nothing about storing files in different places.
Answer: If all files are on the same filesystem, it might be easier to hardlink them all to one directory on the source side and then rsync that one directory across. Something like:
#!/bin/bash
set -e
mkdir flattened_dir
find sourcedir1 sourcedir2 sourcedir3 -type f -exec ln -t flattened_dir/ {} +
rsync -avP flattened_dir/ remote:destination/
rm -r flattened_dir

P.S. If find does not support +, you can use \;
Answer: Similarly to this, I wanted to pull files out of directories and put them in a single flat directory using just their filename. The solution is:
 find /directory/top/ -type f -exec rsync -av `basename {}` desthost:/destdir

You can also use some of the other flags in find to limit what files you want... like maybe you only want the JPG files:
 find /directory/top/ -type f -name "*.JPG" -exec rsync -av `basename {}` desthost:/destdir

Answer: You can make use of Bash globopt (**) to match each file recursively, as described in this post.
Since you're only invoking rsync only once, it should be much faster than other approaches where you invoke a command for each file (like find ... -exec).
Answer: You could do one dir at at time if that gives you a good batch size of files in one process call to rsync. So something like:
find . -type d | while read dir; do rsync -a $dir/* user@host:flatdir; done


Type 'Moment' is not assignable to type 'Date'. Property 'toDateString' is missing in type 'Moment'

Question: I have configure moment with my angular2 application, and when i tried to assign the date of this week saturday to a date type variable,
  case "weekend":
        this.fromDate =  moment().startOf('week');

It shows an error saying,
Type 'Moment' is not assignable to type 'Date'.   Property 'toDateString' is missing in type 'Moment'

I have imported moment in my component as follows,
import * as moment from 'moment/moment';

Comment: The message is self-explanatory. You're trying to assign `moment().startOf('week')`, which is of type `Moment`, to the variable `this.fromDate`, which is of type `Date`. Set the type of `this.fromDate`to Moment, or transform the moment to a Date.
Comment: `startOf` returns a moment object use [`toDate()`](http://momentjs.com/docs/#/displaying/as-javascript-date/) if you need to convert to js Date.
Comment: why downvote here?
Comment: @VincenzoC thanks man, i thought there is some issue wiht the import
Comment: @Sajeetharan glad to help, so using `toDate()` solves your issue? I'm not sure if I have to post it as an answer or you are going to delete this question.
Comment: @VincenzoC i need to run and check ! but it solved the issue in IDE. surely i will mark as answer
Comment: @JBNizet please post as answer
Comment: The type of moment function results seem often moment.Moment
Answer: startOf:

Mutates the original moment by setting it to the start of a unit of time

so it returns a moment object. Use toDate() if you need to convert to JavaScript Date.
case "weekend":
    this.fromDate =  moment().startOf('week').toDate();

Comment: Type 'Date' is not assignable to type 'ReactNode'
Comment: @StanleyMohlala so probably your case is different from the one of the the question in which error was "_Type 'Moment' is not assignable to type 'Date'_". I think that left part of the assignment in your code is `ReactNode` object, feel free to ask a new question providing a [mcve] to reproduce your issue


Showing a quotient group $G/\langle x_0\rangle$ to be a direct sum of cyclic groups

Question: There is an infinite p-primary group which is not isomorphic to $\mathbf{Z}_{p^∞}$ :
$G=\langle x_0,x_1,\ldots\mid px_0, x_0-p^nx_n\rangle$ for all $n\geq 1$.
Can I ask any hints, for showing that $G/\langle x_0\rangle$ is a direct sum of cyclic groups?
Comment: simply rewrite the presentation of $G$ by replacing $x_0$ with $0$ - you should see it then
Answer: Can you describe $G/\langle x_0\rangle$ in a similar fashion as your defined $G$? Or if you want : Knowing that in $G$ you have $p x_0 = 0$, $p^n x_n = x_0$ and that $x_0 = 0$ in $G/\langle x_0\rangle$, you should get simpler relations.
Comment: I am really thinking of showing that this quotient group is finite, so the problem will be easy by applying "Basis Theorem" next.
Comment: I don't think this is necessary. You can get a very explicit decomposition if you write the presentation of $G/$.
Comment: For future reference $<,>$ are interpreted as relations, you want \langle and \rangle instead.


Should Features modules be unit tested?

Question: When you write a module, you write unit tests (or you should - I don't because I am a bad person, but I want to change - honest).
Should modules generated with Features be unit tested where applicable/possible, or is a suite of Selenium tests enough?
For example, say I have a Feature that has a node type and a couple of user roles and/or permissions for said content type.  Is it good practice (or even necessary) for SimpleTests to be written to test creation of my content type?
For clarity, I am aware of Unit test for custom content type, but I am after an answer regarding all unit testable functionality, not just content types.
Answer: The Features module has its own tests that verify that the operations done on a feature (e.g. adding or reverting it) as successful. Drupal already has tests to verify that for example, users with the right permission can read/write/update a node, or that a Drupal variable is effectively saved. The Views module should have its own tests to verify that exporting/importing a views is done correctly.
Apart from those tests, you should not have any reason to write tests for the Feature module, as the existing tests should already covers any possibility. The only case I would write a test for a feature is when the feature is using custom code you wrote.
Comment: Yes, but here's a counter argument. Suppose that the requirement for a feature includes setting an option in some third party module. That option happens to be the default, so if you forget to set the strongarm value when creating the feature, general testing won't find it. If someone sets another value manually the feature won't show as overridden, even though it should. So failing to test the feature may be a mistake.
Comment: You missed my point. A feature is created to meet a requirement, but it's quite possible it doesn't do so, most likely because the user forgot to include an item. So a test to ensure that it does what it's supposed to do is quite logical. You wouldn't be testing code of the Features, module, you'd be testing that the feature had been configured correctly. This can be quite important when a site is worked on by a lot of people: try spotting that a single Strongarm variable has got lost in a merge.
Comment: I wouldn't argue that it's always practical or convenient to test features, but good software development practice says that you should. Configuration changes to a system should be both testable and tested. However I am well aware that very few projects always follow good practice, and that includes my own. The OP was asking about good practice so that's how I felt his question should be answered.
Comment: To be fair, the type of testing I am talking about is more strictly an integration test, as what it tests for is the effect of a feature on other parts of the system, not the feature in isolation.
Comment: I wouldn't propose to test the setting of variable Z per se, rather the effect that has on whatever other modules use it.
Comment: Usually, the Features module is used to avoid having to manually edit code. If you add tests that need to be changed when the feature is changed, that would mean to manually edit code. It would be better if the Features module automatically creates test, even if that is done basing on some settings.
Comment: And you missed my point. The Feature module is normally used to export as code something that is not available as code. Instead of using the Feature module, you could manually write the code for a module that sets the value of a Drupal variable, maybe after checking the module that uses that variable is enabled. The Feature module avoids you manually write that code; it would not make sense (from my POV) to then manually write test code. Bear in mind that the Feature module simply exports the Drupal variable value, whatever value that is.
Comment: Tests should verify the code behaves correctly, not that you exported the correct Drupal variable value; that is why I think there should not be tests in this case.

Should Features modules be unit tested?


Access Multiple search filter

Question: I am trying to click a search button with multiple inputs on the textbox.
I have looked around and tried different methods but somehow It didn't work out. Below is the code for the click event:
private void btn_table_Click(object sender, EventArgs e) {
    try {
        connection.Open();

        OleDbCommand command = new OleDbCommand();
        command.Connection = connection;

        string query = "select [Name],[Sex],[Number] from RecordsSheet [Name] like('" + textBox1.Text + "%'),[Sex]=('" + textBox2.Text + "%'),[Number]=('" + textBox3.Text + "%'");

        command.CommandText = query;

        OleDbDataAdapter da = new OleDbDataAdapter(command);
        DataTable dt = new DataTable();
        da.Fill(dt);
        dataGridView1.DataSource = dt;

        connection.Close();
    }
    catch (Exception ex) {
        MessageBox.Show("Error " + ex);
    }
}

Answer: You are currently mixing equals and LIKE syntax on the same operations, which is going to result in some incorrectly formed queries, as well as the absence of a WHERE clause to properly use them.
Use Parameterization
If you have a specific search term, consider adding it in as a parameter with your LIKE section predefined within your query :
// Add your properties using parameters
var query = "SELECT [Name],[Sex],[Number] FROM RecordsSheet WHERE [Name] LIKE ? AND [Sex] LIKE ?,[Number] LIKE ?";

Then add your parameters along with the necessary wildcards to build your query :
OleDbDataAdapter da = new OleDbDataAdapter(command);
// Set your parameters
da.SelectCommand.Parameters.AddWithValue("p1",textBox1.Text + "*");
da.SelectCommand.Parameters.AddWithValue("p2",textBox2.Text + "*");
da.SelectCommand.Parameters.AddWithValue("p3",textBox3.Text + "*");

This approach will not only lead to resolving issues related to syntax, but it should also help keep you protected from nasty things like SQL Injection attacks.
Answer: with [Sex] and [Number] replace "=" with "like", that may help..
if not post the result description.

Access Multiple search filter


Adding the apache user to my default group doesn't give apache group access

Question: The whole Linux user:group topic just gives me headaches again.
Situation
I have my document roots (httpdocs) and everything inside chown-ed to a certain user and a certain group, let's say myuser:mygroup.
chown -R myuser:mygroup httpdocs

Now apache doesn't have access to let's say a public images folder. So I add apache to mygroup, for example with:
usermod -a -G mygroup apache

Question
Any file or folder which I chmod to 775 should now give apache write permission, not?
Doesn't happen... do I have to reload, restart or else reinitiate something for this to happen or do I still just not get the whole thing.
Answer: Did you restart apache after making the change?  The groups will only be enumerated for the apache account when apache server is restarted.
Comment: no I didn't... so there must be another way to cause the enumeration...
Answer: Well, I just realized that it works as I described it. Don't know why the lag, maybe I just didn't properly refresh the browser or maybe CentOS reads the group file after every X minutes or who knows. But the scenario as I described it, works.


Como funcionam os ponteiros do C?

Question: 1º Qual a diferença entre declarar: char* s e char *s?
2º É sempre necessário usar a função malloc sempre que declarar um pointer?
Exemplo:
 char* s = malloc(sizeof(char));

 //ou apenas...

 char* s;

3º Declarar um ponteiro char* s é como se eu estivesse declarando uma string? Posso usar isso como uma String?
4º Exemplo:
char* s;
char s;

Qual a diferença entre elas?
5º Qual a real utilidade de ponteiros? Além de resolver alguns bugs?
Answer: A pergunta é muito ampla, deveria ser separada, mas vamos lá:

Qual a diferença entre declarar: char* s e char *s?

Nenhuma, é gosto.

É sempre necessário usar a função malloc() sempre que declarar um pointer?

Não, mas sempre que declarar um ponteiro, é provável que em algum momento vai ter que colocar um valor lá. Na maior parte das vezes será direta ou indiretamente através do malloc(), ênfase para o indireto. Mas é possível apontar para outras áreas da memória, como a stack (geralmente pela criação de um array ou estrutura, mas em tese qualquer endereço pode ser usado bastando usar o operador & para pegar o endereço) ou a área estática, inclusive, onde estão os métodos (ponteiro para função). O malloc() é usado para alocar memória no heap.

Declarar um ponteiro char* s é como se eu estivesse declarando uma string? Posso usar isso como uma string?

Grosso modo podemos dizer que sim, mas C não tem um tipo string nativo, não é exatamente a mesma coisa.

Exemplo: char* s; e char s; Qual a diferença entre elas?

O primeiro é um ponteiro para um caractere, inclusive pode haver uma sequência deles a partir daquele ponto da memória, o programador deve controlar isto. O segundo é apenas um caractere.

Qual a real utilidade de ponteiros? Além de resolver alguns bugs?

Ponteiros não resolvem bugs. Isto é insano. Ponteiro é um endereço para algum ponto da memória, só isto. Ele é usado para indicar onde estão certos objetos. Ter acesso à memória de forma indireta. Como o nome diz, ele serve para apontar para coisas em outro lugar.
Pode ser melhor respondido em diversas perguntas aqui, por isso não dei mais detalhes:

Qual a diferença entre ponteiro e referência?
Arrays são ponteiros?
Por que declarar ponteiro para array se arrays já são ponteiros?
O que é ponteiro para ponteiro?

Coloquei no GitHub para referência futura.
Comment: Sobre o item 4, muito bem descrito. Geralmente as pessoas tendem a não explicar corretamente a diferença.
Answer:
Qual a diferença entre declarar: char* s e char *s?

Nenhuma. Estética, apenas. É menos confuso escrever:
char *s, *r do que char* s, *r, p.e.

2º É sempre necessário usar a função malloc sempre que declarar um pointer?

Não, você está confundindo as coisas. Um ponteiro nada mais é que uma
variável que armazena um endereço. Da mesma forma que um inteiro aramazena
um número. Como os diversos tipos (int, char, etc) tem tamanhos diferentes,
existe um ponteiro diferente para cada tipo. Isso ocorre por causa de
aritmética com ponteiros, que explico depois.
char c = 'a';
char *s = &a;

O código acima declara uma variável c que armazena um caracter e uma variável
s que armazena o endereço de c.  Podíamos ainda criar uma variável para
armazenar o endereço de
s:
char **ss = &s;

Ficando:
Variável    Endereço (hipotético)     Valor     Tamanho
c           0x0002                    'a'       sizeof(char) bytes
s           0x0010                    0x0002    sizeof(char *) bytes
ss          0xFF10                    0x0010    sizeof(char **) bytes

malloc é uma função que reserva um espaço contínuo de memória no heap,
retornando o endereço do início desse espaço (do tipo ponteiro, pois é um
endereço). P.e.
char *s = malloc(2);

Reserva dois bytes, e o endereço inicial é atribuido para a variável s:
Variável    Endereço (hipotético)     Valor     Tamanho
s           0x0001                    ?         2 bytes

Se formos imprimir:
printf("%p\n", s + 1);

Veremos 0x0002, o endereço de s mais um. Isso porque o tamanho de char é
1 byte (s + 1 traduz para sizeof(*s) + 1). Por essa questão aritmética
(usada em arrays, entre outras coisas) é que cada tipo tem um "tipo ponteiro"
equivalente, inclusive ponteiros de ponteiros de ponteiros de ...

3º Declarar uma variável char* s é como se eu estivesse declarando uma
  string? Posso usar isso como uma String?

Não. char *s contém um endereço. Ponto. Uma string é uma array de caracteres,
que pode ser declarada de várias formas (pesquise sobre quando usar malloc, ou
faça uma pergunta nova, e leia o manual sobre o uso do malloc):
char *s = malloc(10 * sizeof(*s));
char s2[10];
strncpy(s, "123456789", 10);
strncpy(s2, "123456789", 10);
char s3[] = "123456789";
char *s4 = strdup("123456789");
free(s);
free(s4);

Leia o manual das funções supracitadas se quiser entender mais sobre elas. Em
Linux/OSX: man FUNCAO.

char* s; char s;

Como já foi explicado, um guarda um caractere e o outro um endereço.

5º Qual a real utilidade de pointers? Além de resolver alguns bugs?

Talvez essa resposta tenha dado uma ideia inicial sobre ponteiros. São usados
para absolutamente tudo, como você verá quando for aprendendo mais.

Como funcionam os ponteiros do C?


Google Chrome Developer Tools shows my files twice. One can be edited, the other can be debugged

Question: I am developing a single page website using Visual Studio. During development I am using Google Chrome Developer Tools to debug but I was also able to change the files in Chrome. Also my changes were directly reflected in my Visual Studio environment.
I don't know what I have changed but currently my Google Chrome Developer Tools shows me each file twice when I am using CTRL + O I see the following result:

It is exactly the same file. But chrome behaves differently based on the selected result:

selecting www/index/scipts/index.js

can be used to change the code (Also reflected in Visual Studio)
debugging not possible

selecting localhost/www/index/scripts/index.js

not able to change
debugging works

workspace settings

Folder: C:\TFS\MyBranch\www
Mappings:

URL prefix: http://localhost/www/
Folder path: /

local iis settings

Default Website (port:80)

www (path: C:\TFS\MyBranch\www)

Visual studio project settings
The 'www' project has following Web settings:

Servers:

Type: Local IIS
Project Url: http://localhost/www/
Virtual Directory is created
Able to browse to url

Question
I have had it working that Chrome allowed me to edit and debug in the same opened file. How do I need to setup/change my environment to get this working again?
Comment: You need to add a mapping in the dev tools between files from your HTTP server and the filesystem.
Comment: @SLaks My Folder is `C:\TFS\MyBranch\www` and it maps to `http://localhost/www/` as mentioned in the `workspace settings` Are you referring to this mapping or do I miss another required mapping?
Answer: Right-click index.js in the Sources panel and in the context menu select Map to File System Resource... (or Map to Network Resource..., depends on whether you click the network or workspace resource,) then choose its counterpart to establish the actual workspace mapping.