text:
Q: Apache Marmotta Importer from Docker I installed Apache Marmotta with Docker using docker pull apache/marmotta on an AWS server. I am able to see Core Services (http://34.229.180.217:8080/marmotta/core/admin/import) via the Import interface in my browser. However, I am not able to import RDF files through the interface.

The files (RDF and TTL) are on both my local machine and on the server. The files are very large (over 2 GB each) and so I'd like to use KiWi Loader to bring them into Marmotta so I can run SPARQL queries against them.
Is there a parameter I can adjust in Marmotta to allow for larger file imports? Otherwise, is it possible to use the KiWi Loader through the Docker installation? Any suggestions would be great.

A: You can import using the local directory. Just copy your RDF/TTL files to $MARMOTTA_HOME/import. You can define you context base in file-like structure. For example, if you want to store your data in http://34.229.180.217:8080/marmotta/foo, just store your file in $MARMOTTA_HOME/import/foo, here you are using the default context. However, if you want to store in other context create a folder with a URL encoded. For more details of the options that Apache Marmotta provide to import files check the documentation.
IMHO, I have had a lot of problems uploading big files. I think is mostly because Apache Marmotta commit the data after is everything in memory, it is an implementation of KiWi. I don't if you can upload by chunks, and using importer.batchsize property hasn't work much for me.


text:
Q: Compare two columns of two files and count the differences I have two files, tab separated, where I want to compare line by line the values of column 1 of file1 with column 1 of file2 and so forth until n columns.
The comparisons are to count the differences.
Values in columns can be either 0, 1 or 2, for example:
File1:

col1 col2 col3 col4
1 1 1 2
1 1 1 2
2 1 2 2
2 1 2 2

File2:
col1 col2 col3 col4
1 1 1 1
1 1 0 1
0 1 0 1
1 0 1 0

Results
2 1 3 4

So, col1 of file1 and file2 with 2 differences, col2 off file1 and file2 with 1 difference and so forth...
I have seen many similar questions in AWK but the majority of them is to compare columns and append a column from either files if matches or not, but not count differences.
I believe the comparison of not match from two columns would start with something like this, but from there I am totally lost...
awk 'NR==FNR { a[$1]!=$1; next}

Thanks

A: You may use this awk:
awk 'BEGIN{FS=OFS="\t"} FNR == NR {for (i=1; i<=NF; ++i) a[i,FNR] = $i; next} FNR > 1 {for (i=1; i<=NF; ++i) if ($i != a[i,FNR]) ++out[i]; ncol=NF} END {print "Results"; for (i=1; i <= ncol; ++i) printf "%s%s", out[i]+0, (i < ncol ? OFS : ORS)}' f2 f1

Results
2   1   3   4

A more readable form:
awk 'BEGIN {FS=OFS="\t"}
FNR == NR {
   for (i=1; i<=NF; ++i)
      a[i,FNR] = $i
   next
}
FNR > 1 {
   for (i=1; i<=NF; ++i)
      if ($i != a[i,FNR])
         ++out[i]
}
END {
   print "Results"
   for (i=1; i <= NF; ++i)
      printf "%s%s", out[i]+0, (i < ncol ? OFS : ORS)
}' f2 f1

A: If you have paste available you can do this without storing anything in an array except the output
paste File1 File2 |
awk '
    NR > 1 {
        mid = NF/2
        for (i=1; i<=mid; i++) {
            count[i] += ( $i == $(mid+i) ? 0 : 1 )
        }
    }
    END {
        for (i=1; i<=mid; i++) {
            printf "%d%s", count[i], (i<mid ? OFS : ORS)
        }
    }
'

Output:
2 1 3 4

A: With getline:
$ cat foo.awk
NR == 1 { n = NF; }
{
  if(NF != n) { print "error"; exit 1; }
  for(i = 1; i <= n; i++) a[i] = $i;
  if(getline < f != 1 || NF != n) { print "error"; exit 1; }
  for(i = 1; i <= NF; i++) if($i && a[i] != $i) c[i] += 1;
}
END {
  for(i = 1; i <= n; i++) printf("%d%c", c[i], (i == n) ? "\n" : " ");
}

$ awk -v f=File1 -f foo.awk File2
2 1 3 4

Explanation:

*

*Variable f holds the name of the first file, we pass it to awk with the -v f=File1 option and we pass the second file name (File2) to awk as the file to process.

*We set n (number of fields) from the first line of the second file. Later, if we encounter a line with a different number of fields in one of the two files we exit with an error message.

*We fill array a with the fields from the current line.

*Then we read the next line form the first file with getline, which sets the current fields with the new values. We exit with an error message if getline fails.

*We compare the fields with array a and increment elements of array c if a difference is found.

*At the end we print array c.

Note: some awk experts advocate against getline. If you prefer avoiding it too, prefer the solutions that pass File1 and File2 to awk and store the content of the first one in an array. But if your files are large remember that you could encounter memory issues, while the getline-based solution could process billions of lines of hundreds of fields without any problem (but would you use awk in this case?).

A: As the values in the fields are single chars (0,1,2), we exclude the headers and pack field values to field number indexed strings without delimiters (for example a[1]="1122") and use substr() for extracting char for comparing ($i!=substr(a[i],FNR-1,1)):
awk '
NR==FNR && NR>1 {                         # process first file, ignore header
    for(i=1;i<=NF;i++)                    # since column values are 1 digit only
        a[i]=a[i] $i                      # just catenate themem, no separators
    next
}
FNR>1 {                                   # process second file
    for(i=1;i<=NF;i++)
        r[i]+=($i!=substr(a[i],FNR-1,1))  # compare field data and count mismatches
}
END {                                     # in the end
    for(i=1;(i in r);i++)                 # loop and ...
        printf "%s%s",(i==1?"":OFS),r[i]  # output
    print ""
}' file1 file2

Output:
2 1 3 4

Notice: This only works for single char values, as requested in the OP.

redpajama_set_name: RedPajamaStackExchange


text:
Q: Interpretation of power calculations We got the following comment from an associate editor who asked for ex-post power calculations. We used the treatment difference and sample size from our study and reported the power of detecting the effect of the observed point estimate at a 5% significance level.
The AE was not happy and wrote:

It appears that you used your existing data. However, power calculations
are something one does (or should do) ex ante, i.e., when the
treatments averages are unknown.
it continued
"More to the point, the idea of the power calculations is to test for
the probability of type I and type II errors. This, by definition,
means that the sample mean and standard deviation are likely to be
different than those in the population. "

If I am not mistaken, I can not jointly test (determine, I think is what s/he meant), as one has to fix at least one of the errors. I am really not sure what to make out of this comment.

A: The reason for doing power calculations is to determine ahead of time how large a sample ($n$) would be needed to detect a particular difference, which we can call effect size. From
Power Analysis, Statistical Significance, & Effect Size, one reads (at the end of it)
"How do I estimate effect size for calculating power?
Because effect size can only be calculated [sic, estimated] after you collect data from program participants, you will have to use an estimate for the power analysis. Common practice is to use a value of 0.5 as it indicates a moderate to large difference."
After collecting data, one can calculate what effect size is (should have been) detectable. This becomes important when no significant effect is detected in the experiment. Because that information is missing in the question, i.e., Was the result of the difference A) significant or B) not significant? If not significant, then what difference would have been detected becomes an issue. For example, suppose that the difference between two different measurement methods of renal clearance is 0 where the average value for each is 454 ml/min. Does this mean that those methods are the same? Hardly, and this is a common error that experimenters make, to take a not significant result and claim significance. Here is an example from the literature,
"To justify their claim of 100% renal clearance at 48 h, Pentikainen et al set total clearance equal to renal clearance. However, they did not substantiate that equality numerically. Although their average value of total clearance was only 5.7 ml/min greater than renal clearance, the 95% confidence interval for this difference is from −173 to 184 ml/min, such that their insignificant difference in clearance by Student's $t$ test did not exclude a huge potential range of clinically significant difference."
So does this answer the question, or, what is the question, anyway?

A: According to one 'authoritative source' I just consulted on
the Internet the average height of US women is $\mu_0 = 5.35$ ft.
Suppose I believe that women students at my university are
taller than that. So I want to test $H_0: \mu = 5.35$ against
$H_a: \mu > 5.35$ at the 5% level of significance.
I plan to sample $n$ women at random from my university and I
would like to  be 'pretty sure' of rejecting $H_0$ if women
at my university average 'substantially' more than 5.35' in height.
Various sources say that the standard deviation of US women's heights
is about 3" or about 0.25'. That would mean almost all US women are
between $5.35 \pm 0.75$ feet, which seems roughly reasonable.
If 'pretty sure' means a power of 95% and 'substantially` means
more than 0.1' (a little more than an inch), then I have the
information necessary to estimate the number $n$ of subjects
I need in my sample.
Here is output from Minitab's 'power and sample size' procedure.
(Many statistical software programs will perform similar computations.)
Power and Sample Size

1-Sample t Test

Testing mean = null (versus > null)
Calculating power for mean = null + difference
α = 0.05  Assumed standard deviation = 0.35

            Sample  Target
Difference    Size   Power  Actual Power
       0.1     134    0.95      0.950080

So I will have to measure heights of about 134 women
at my university to meet my requirements for the design
of the study.
Of course, as several people have commented, the time for
a power and sample size computation is before you start taking data.
What the AE may be asking you to do is to make it seem as if you
had some reason to believe in advance that your sample size
would be adequate.
You cannot ethically claim to have done a power computation in
advance. However:

*

*You might be able to cite other studies making
measurements similar to yours to see the standard deviations
of your measurements; or maybe you did a few trial runs before
the experiment and have your own estimate for $\sigma.$

*You must have had some idea how big a difference would be
of sufficient practical importance to get your work published.

*Also, it would have been reasonable to aspire to a
$90\%$ or $95\%$ chance of detecting a difference of important size with whatever
number of subjects you used.
Without making false claims, you could talk generically about
power and sample size as outlined just above. Maybe you are
astonished to have found any effect at all or maybe you had
wished to find a larger effect, but it might be helpful to readers
of your paper to have some context for what
must (should?) have been in your mind when embarking on the experiment.
Moreover, maybe the AE is hoping your next submission shows evidence
of a cogent power and sample size study at the beginning. Do that,
make notes, and save relevant computer printouts.


text:
Q: Scan hexadecimal floating points in Windows with Linux code I am trying to compile Wapiti 1.3.0 (a NLP tagging tool) in a Windows 8 based machine. The C source code is intended for Linux (and similar) systems. I have managed to compile it using Cygwin gcc. Unfortunately it's not working as it needs to read data from a model file (text file where training information is saved).
It seems that the variable v is not being read, in this code line:
double v;
if (fscanf(file, "%"SCNu64"=%la\n", &f, &v) != 2)

I guess it is because the Cygwin dll's not being C99 and not being able to use the hex floating points.
I don't think I can compile it with MingW as it requires POSIX system headers, plus I am not sure if MingW handles C99 fscanf formatting anyway.
Is there any suggestion of what can I do, or am I missing something?
Thanks for your help!
The program is compiling/working in Linux no problems.


text:
Q: iPhone SDK: SearchDisplayController with Core Data Table Sample Code? Are there any good samples of using a SearchDisplayController with a Core Data backed tableview? None of the Apple samples I see use Core Data, NSFetchedResultController or NSPredicates.

A: http://developer.apple.com/cocoa/coredatatutorial/index.html
checkout the 6th link "Adding the Search Field"


text:
Q: Can all language constructs be first-class in languages with offside-rules? In LISP-like languages all language constructs are first-class citizens.
Consider the following example in Dylan:
let x = if (c)
          foo();
        else
          bar();
        end;

and in LISP:
(setf x (if c (foo) (bar)))

In Python you would have to write:
if c:
    x = foo();
else:
    x = bar();

Because Python destinguishes statements and expressions.
Can all language constructs in a language which adheres to the off-side rule (has an indention-based syntax) be expressions, so that you can assign them to variables or pass them as parameters?

A: Python has the following syntax that performs the same thing:
x = foo() if c else bar()

A: I don't see the relation with first-classness here - you're not passing the if statement to the function, but the object it returns, which is as fully first class in python as in lisp.  However as far as having a statement/expression dichotomy, clearly it is possible: Haskell for instance has indentation-based syntax, yet as a purely functional language obviously has no statements.
I think Python's separation here has more to do with forbidding dangerous constructs like "if x=4:" etc than any syntax limitation. (Though I think it loses more than it gains by this - sometimes having the flexibility sufficient to shoot off your foot is very valuable, even if you do risk losing a few toes now and again.)


text:
Q: Is it safe to use this arrangement of charging NiMH batteries in series and then using them in parallel? I have built a solar charger that charges 6 AA NiMH rechargeable batteries in series using a constant current source at a little under C/10. That part is fine.
I want to use the batteries to power a 3 W LED that is driven by a different constant current driver. Again, that part is fine. To power the LED I want to use 2 lots of 3 series-connected batteries, connected in parallel.
To change over between charge mode and power-the-LED mode, I intend to use a double-pole, double-throw switch using this arrangement:

Is this safe, or are their risks involved when switching from charge mode to power-the-LED mode?
Updated circuit (Schottky diodes added) to address feedback received:

A: You need to ensure that the switch is 'break before make' -- i.e. when the switch is changing over; in the middle, you have all switches open, not all closed. Most simple SPST slide switches are like this, but some rotary switches may not.
If you are charging in series, be aware that if the cells are not at equal states of (dis)charge (e..g some have aged differently from others), then you are at risk of over charging those cells as you wait for the whoel stack to reach a termination votlage. If your charging current is less than the continuous trickle charge limit of the cells, then there would be less of an issue.

A: It might be safe but the cells will likely suffer.
It is probably safe in the sense that it won't burn your house down and if you follow the suggestions in the answer by jp314, it may work fairly well.
However, if you just charge the series string of six cells without any special balancing, the two halves of that stack will likely end up at slightly different final voltages. Once you flip the switch over, the higher-voltage 3-cell battery will immediately start discharging into the other 3-cell battery and will keep doing so until their voltages equalize. Even if the voltage difference is just 0.1 V, the small resistances involved will lead to non-negligible currents, potentially overcharging and damaging the cells in the receiving half.
Worst case, once one of the cells fails (loses capacity, develops a short), the resulting large equalization current may easily kill the other two cells in the same stack.
Finally, there's also the risk of you forgetting to flip the switch into the right position and then frying the LED driver by feeding >8 V to it. Similarly, if your charger is dumb enough, connecting the parallel arrangement to it may damage the cells. (And if it doesn't, this means you could have just used the parallel arrangement all the time and skip the switch altogether.)

A: In it's original form, it wasn't entirely safe (from the perspective of the batteries) for reasons given in the comments on it. I asked the same question in the Electronics Hobbyists Facebook group and also got some helpful suggestions. As a result of both sets of feedback, I've updated the schematic and built and tested it. It works well.

The schottky diodes (1N5817) drop 0.45V on each battery stack when powering the 3W LED, and that's just fine. They also prevent any issues that would otherwise arise if the two battery stacks end up at different voltages after charging or when powering the LED.
I do have to remember to set the switch to the "Charge" position before plugging in the charger, and to the "Power-the-LED" position when the LED is plugged in and before I switch it on.

A: There are issues with charging in series. Unless you are using a certain NiMH formula for charging in series, the weaker cells will tend to get less charge and overdischarge. If you use a higher charging current, you may cause those weaker ones to overcharge, bulge and vent.
The problem is that they don't charge up exactly the same, even at a 0.1 C rate of charge.
There were some brands where you could charge in series on slow and the capacities would stay the same with a smart slow charger. The company used a certain NiMH formula I have not seen with other brands (Maha) C size. They didn't put much effort into matching their cells during manufacture, though.


text:
Q: Sending attachment with reqwest I'm trying to do a POST request using reqwest. I need to send attachments in my request. I am looking for the equivalent of
curl -F attachment=@file.txt

In older versions (see here) it was as simple as
let file = fs::File::open("much_beauty.png")?;
let client = reqwest::Client::new();
let res = client.post("http://httpbin.org/post")
    .headers(construct_headers())
    .body(file)
    .send()?;

But for newer versions (see here) looks like the functionality has been removed. I get the error:
21 |         .body(file)
   |          ^^^^ the trait `From<File>` is not implemented for `Body`
   |
   = help: the following implementations were found:
             <Body as From<&'static [u8]>>
             <Body as From<&'static str>>
             <Body as From<Response>>
             <Body as From<String>>
           and 2 others
   = note: required because of the requirements on the impl of `Into<Body>` for `File`

Despite the official documentation claiming

The basic one is by using the body() method of a RequestBuilder. This lets you set the exact raw bytes of what the body should be. It accepts various types, including String, Vec<u8>, and File.

A: The new API may not implement From<File> for Body anymore but does implement From<Vec<u8>> for Body and we can easily convert a File into a Vec<u8>.
In fact, there's already a handy function in the standard library called std::fs::read which will read an entire file and store it in a Vec<u8>. Here's the updated working example:
let byte_buf: Vec<u8> = std::fs::read("much_beauty.png")?;
let client = reqwest::Client::new();
let res = client.post("http://httpbin.org/post")
    .headers(construct_headers())
    .body(byte_buf)
    .send()?;


text:
Q: numeric keypad in vi and emacs terminal I use an external keypad with a lapton, mainly with the numlock off for the arrow keys, as I'm a lefty. Ever since updating from Ubuntu 14.04 lts to 16.04 lts, the behavior has been somewhat different.
The keypad home and end keys work better now, as they now give the same control signal as the normal home and end keys. (ESC-[h AND ESC-[f, instead of ESC-[1~ and ESC-[4~)  but the kp_begin is starting to drive me nuts when I use it in a terminal with either vim or emacs.
kp_begin is the function that the 5 key has with numlock off. In an emacs GUI, it moves to the very beginning of the document (similar to M-<). It never worked in the terminal window with emacs, which was fine. But now, it prints the number 5 to the screen in an emacs terminal, even if numlock is off.  Accidentally hitting it instead of an arrow key gets irritating.
With vim, in the termial, the kp_begin used to have the same effect as the escape key. Now, it causes vim to enter insert mode, then prints a capital E and a newline character to the document.  This is just as irritating, as I sometimes hit it instead of an arrow key.
There must be some way to restore its old behavior.

A: I found a solution.  I can alter the behavior of the key with the code:
[CODE]
xmodmap -e "keycode NN = Begin KP_5 Begin KP_5"
[/CODE]
where NN is the keycode of the key in question.  Apparently, KP_Begin is what was causing problems, so changing it to Begin solved things.


text:
Q: Summation of square root fractional part Is there a way to calculate the following sum for large $c>K$, closed-form or approximation?
$$\sum_{n=1}^{c}\left\{\sqrt{K+n^2}\right\}$$Where K and n are positive integers and $\{\}$ indicates the fractional part.
A similar question: Fractional part summation

A: The given sum can be written as
$$
\Sigma = \Sigma_1 - \Sigma_2
$$
where
$$
\Sigma_1 = \sum_{n=1}^{c} \sqrt{n^2 + K}
$$
and
$$
\Sigma_2 = \sum_{n=1}^{c} \lfloor\sqrt{n^2 + K}\rfloor.
$$
Now using $H_n = \log n + \gamma + \mathcal{O}(1/n)$ where $H_n$ is the $n$-th harmonic number,
\begin{align*}
\sum_{n=1}^{c} \sqrt{n^2 + K} - n &= \sum_{n=1}^c \frac{K}{\sqrt{n^2 + K} + n} \\
                                  &\le \frac{K}{2} \sum_{n=1}^{c} \frac{1}{n} = \frac{K}{2}(\log c + \gamma + \mathcal{O}(1/c)).
\end{align*}
Hence
$$
\Sigma_{1} = \sum_{n=1}^{c} \sqrt{n^2 + K} = \frac{1}{2}c(c+1) + \frac{K}{2}(\log c + \gamma) + \mathcal{O}(1/c)
$$
Let $A = \lfloor\sqrt{K+1} - 1\rfloor$. Then,
\begin{align*}
  \Sigma_{2} = \sum_{n=1}^{c} \lfloor\sqrt{n^2 + K}\rfloor &= \sum_{j=1}^{A}\sum_{\frac{K-(j+1)^2}{2(j+1)} < n \le \frac{K-j^2}{2j}}(n+j) + \sum_{\frac{K-1}{2} < n \le c}n \\
&= \sum_{n=1}^c n +  \sum_{j=1}^{A}\sum_{\frac{K-(j+1)^2}{2(j+1)} < n \le \frac{K-j^2}{2j}}j\\
&= \frac{1}{2}c(c+1) + \sum_{j=1}^A j\left(\frac{3}{2} + \frac{K}{2j(j+1)}+ \mathcal{O}(1)\right)\\
&= \frac{1}{2}c(c+1) + \frac{3}{4}A(A+1) + \frac{K}{2}(H_A - 1) + \mathcal{O}\left(\sum_{j=1}^A j\right)\\
&= \frac{1}{2}c(c+1) + \frac{3}{4}A(A+1) + \frac{K}{2}(H_A - 1) + \mathcal{O}(1)
\end{align*}
since $\mathcal{O}\left(\sum_{j=1}^A j\right) = \mathcal{O}(K) = \mathcal{O}(1)$.
Thus,
\begin{align*}
\Sigma &= \frac{K}{2}(\log c + \gamma) - \frac{3}{4}A(A+1) - \frac{K}{2}(H_A - 1) + \mathcal{O}(1).\\
\end{align*}


text:
Q: Can a time series model be improved when the residuals are white noise? For a weekly time series, I have been trying some very basic models to get an understanding of time series analysis. The models I tried so far: naive, seasonal naive, an overall mean model, and a simple exponential smoothing (SES) model.
My objective is getting a reasonably accurate forecast. In the end I have to model 2000+ time series, so I would not have time to check every ACF plot, residuals, etc.
The naive and the SES model seem to both do a reasonable job, in the sense that the residuals are white noise. Edit: As pointed out in the comments by @BryanKrause, this means that the model cannot be improved.
Three (related) questions to this:

*

*How to differentiate between the complexer model (SES) vs the simpler
model (naive) when in both cases the residuals are white noise? The RMSE is very similar.

*If I use the Ljung-Box test to check if the residuals are white noise, could it then still be that my series is non-stationary? (aside from sampling error)

I am using the fpp2 package in R and my code is really basic (see below). I am sorry for not providing sample data.
y <- ts(data$weekly_sales, start = c(min(data$Year)), frequency = 52)
#weekly_sales = the weekly sales data to be modelled

train <- subset(y, end = length(y)-13)

fit1 <- naive(train, h = 13)
fit2 <- snaive(train, h=13)
fit3 <- meanf(train, h =13)
fit4 <- ses(train, h = 13)

checkresiduals(fit1)
checkresiduals(fit2)
checkresiduals(fit3)
checkresiduals(fit4)

accuracy(fit1, y)
accuracy(fit2, y)
accuracy(fit3, y)
accuracy(fit4, y)


text:
Q: Cannot execute external PHP with Laravel artisan scheduler I have an external PHP script, that is processing an XML array to insert, update or delete rows in a database. This script lies in the root of the project in a folder called scripts and I can run and execute it via terminal with no problems whatsoever and it updates the database accordingly:
php index.php

I have also set up a schedule in Laravel (using October CMS syntax)
public function registerSchedule($schedule)
{
 $schedule->exec(public_path() . '/script/index.php')->everyMinute();
}

This however is doing nothing. I tried manually running the schedule with artisan in command line by:
php artisan schedule:run

And the output is
Running scheduled command: /Users/x/x/x/x/scripts/index.php > '/dev/null' 2>&1 &

Nothing happens in the database tho.

A: Did you try to generate a new key?
php artisan generate:key


text:
Q: Is there other way to write this if code? I Have just started to learn c#. I am most comfortable with if and if else. Right now I am working on a program where it writes an IP address and I need to type the correct subnet, and all that. It takes too long time to make the code with if and else if, so I was wondering if there is a faster way to do it.
Random r = new Random();
            int randomip = r.Next(256);
            int secondip = r.Next(256);
            int subnetip = r.Next(24, 31);
            int numbers = subnetip;

Console.WriteLine("192.168." + randomip + "." + secondip + "/" + subnetip);

            Console.Write("Type the correct netID: ");
            Console.ReadLine();
            Console.Write("Type the correct subnet: ");
            Console.ReadLine();

            if (numbers == 24)
            {
                Console.WriteLine("correct netID is: 192.168." + randomip +
                "." + secondip / 256);
                Console.WriteLine("correct subnet is: 255.255.255.0");
            } else if (numbers == 25)
            {
                Console.WriteLine("correct netID is: 192.168." + randomip +
                "." + secondip / 128);
                Console.WriteLine("correct subnet is: 255.255.255.128");
            } else if (numbers == 26)

and so on… with other numbers. Isn't there a faster and easier way to make it work? It works but if I want to add more numbers there would be a problem

A: If you think backwards, these are your divisors based on the value of numbers
31 => 2
30 => 4
29 => 8
28 => 16
27 => 32
26 => 64
25 => 128
24 => 256

In other words, they're two to the power of an incrementing number.
31 => 2^1
30 => 2^2
29 => 2^3
28 => 2^4
27 => 2^5
26 => 2^6
25 => 2^7
24 => 2^8

In other words, two to the power of 32 minus numbers
31 => 2^(32-31)
30 => 2^(32-30)
29 => 2^(32-29)
28 => 2^(32-28)
27 => 2^(32-27)
26 => 2^(32-26)
25 => 2^(32-25)
24 => 2^(32-24)

In other words,
var divisor = Math.Pow(2, 32-numbers);
var subnet = 256 - divisor;

Down to 4 lines with no switch or if. Yay!
Console.WriteLine("correct netID is: 192.168." + randomip + "." + secondip / divisor);
Console.WriteLine("correct subnet is: 255.255.255." + subnet);


text:
Q: Ramified covering interpretation of an elliptic curve Let $E:y^2=x(x-1)(x-\lambda)$ be the Legendre form of an elliptic curve $E$ defined over $\mathbb{C}$. The ramified covering $E\to \mathbb{P}_{1}$ defined so that $(x,y)\mapsto x$ has two branches and ramification points $0,1,\lambda,\infty$.
The two branches $y=\pm \sqrt{x(x-1)(x-\lambda)}$ are therefore glued at the ramification points. $E$ would turn out to be hence the glueing of two spheres $\mathbb{P}_{1}$ at the 4 distinct points $0,1,\lambda,\infty$.
Such an object has not genus 1, therefore there has to be a mistake.
In J. Silverman's AEC at the very beginning of chapter 6 it is explained that what one does is actually to glue the spheres along the two segments $\overline{\infty 0}$ and $\overline{1\lambda}$. This gives a torus, but still I don't understand why all the points of the segments has to be removed by the two branches? And why not to choose another couple of disjoint segments like $\overline{01}$ and $\overline{\infty\lambda}$? All integrals of $dx/y$ over paths in the complement of the ramification points are perfectly defined in the same branch once the sign of the square root is chosen, see for example figure 6.5 at page 159, where a closed path $\alpha$ is taken across both segments.
So my question is: why do we remove the entire segments if the junction points of the two branches are only 4?


text:
Q: Facebook's mobile open graph I've recently heard that you don't have to create webpages for opengraph objects anymore and just post them from iOS app directly.
Having said that i've configured my Facebook app to be enabled for iOS only, but when i try posting OG object like that i get error:
NSMutableDictionary<FBOpenGraphObject> *object =
    [FBGraphObject openGraphObjectForPostWithType:@"designdailyapp:item"
                                            title:[NSString stringWithFormat:@"%@ by %@", [currentObject objectForKey:@"Title"], [currentObject objectForKey:@"Designer"]]
                                            image:@"https://s-static.ak.fbcdn.net/images/devsite/attachment_blank.png"
                                              url:@"http://designdaily.me/site.html?id=111"
                                      description:[currentObject objectForKey:@"Description"]];

    [FBRequestConnection startForPostOpenGraphObject:object completionHandler:^(FBRequestConnection *connection, id result, NSError *error) {
        NSString* resultID = [result objectForKey:@"id"];
        //THIS IS WHERE I GET THE ERROR
        if (!error) {

        }
    }];

This is the error i'm getting.

Error Domain=com.facebook.sdk Code=5 "The operation couldn't be completed. (com.facebook.sdk error 5.)" UserInfo=0xc0a3ae0 {com.facebook.sdk:HTTPStatusCode=400, com.facebook.sdk:ParsedJSONResponseKey={
      body =     {
          error =         {
              code = 100;
              message = "(#100) Object Base Domain Not Allowed: Object at URL 'http://designdaily.me/site.html?id=111' of type 'designdailyapp:item' is invalid because the domain 'designdaily.me' is not allowed for the specified application id '477605465664930'. You can verify your configured 'App Domain' at https://developers.facebook.com/apps/477605465664930.";
              type = OAuthException;
          };
      };
      code = 400;
  }, com.facebook.sdk:ErrorSessionKey=, expirationDate: 2013-12-08 15:28:35 +0000, refreshDate: 2013-10-09 15:28:35 +0000, attemptedRefreshDate: 0001-12-30 00:00:00 +0000, permissions:(
      "user_friends",
      installed,
      "basic_info",
      email,
      "publish_actions"
  )>}

I can get around it by configuring my Facebook app to also enable 'Website with Facebook login' and filling in domain field, but then i get rejected by not having a web site with Facebook login.
Anyone got mobile open graph to work?
thanks in advance!


text:
Q: What happens internally when `ls *.c` is executed? I've got very interested in Linux internals recently, and currently trying to understand how things work.
I knew that when I type ls

*

*opendir() - function is called;

*readdir() - function called for each directory entry in directory data store;

*stat() - function can be called to get additional information on files, if required.

Please correct me if I'm missing something or if it's wrong.
The part which is mystery to me is filename expansion(globbing).
I've compared the output of strace ls
open(".", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFDIR|0755, st_size=270336, ...}) = 0
getdents(3, /* 14 entries */, 32768)    = 440
getdents(3, /* 0 entries */, 32768)     = 0
close(3)                                = 0
fstat(1, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 1), ...}) = 0
write(1, "2q.c  ds.c  fglob  fnoglob\n", 272q.c  ds.c  fglob  fnoglob

and strace ls *.c,
stat("2q.c", {st_mode=S_IFREG|0664, st_size=0, ...}) = 0
lstat("2q.c", {st_mode=S_IFREG|0664, st_size=0, ...}) = 0
stat("ds.c", {st_mode=S_IFREG|0664, st_size=0, ...}) = 0
lstat("ds.c", {st_mode=S_IFREG|0664, st_size=0, ...}) = 0
fstat(1, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 0), ...}) = 0
write(1, "2q.c  ds.c\n", 112q.c  ds.c
)            = 11

and from my limited knowledge can tell that in the first case, it indeed behaves as I expected open, stat followed by getdents.
But the later one, with shell globbing isn't clear to me, because it there's already a list of files, which match the pattern. Where does this list came from?
Thanks!

A: Shell globbing patterns on the command line are expanded by the shell before the utility is invoked.
You can see this by enabling tracing in the shell with set -x:
$ set -x
$ ls -l f*
+ ls -l file1 file2 file3
-rw-r--r--  1 kk  wheel  0 May 11 16:49 file1
-rw-r--r--  1 kk  wheel  0 May 11 16:49 file2
-rw-r--r--  1 kk  wheel  0 May 11 16:49 file3

As you can see, the shell tells you what command it invokes (at the + prompt), and at that point it has already expanded the pattern on the command line.
The ls command does not do filename globbing. In fact, if you single quote the globbing pattern to protect it from the shell, ls is bound to be confused:
$ ls -l 'f*'
+ ls -l f*
ls: f*: No such file or directory

(unless there's actually something in the current directory called f* of course).


text:
Q: Removing Scroll Webkit css classes for mat-select component only I have overridden webkit scroll classes in global.scss. But for mat-select it always stays on the screen whenever there is scroll, despite overflow: auto is set. That is because of overriden scrollbar classes.
Now custom scroll bar is coming to right side of mat-select and looks very ugly. I want to hide it and keep scrolling. All the other answers are related to non-angular.
I don't know how to use ng-deep here properly.
This is my _globals.scss
body {
  ::-webkit-scrollbar {
    width: 8px;
    height: 8px;
    border-radius: 10px;
  }

}
I tried several option in my custom select component like  & lot of combinations.
body {
  ::-webkit-scrollbar {
    display: none !important;
  }
}

how can I acheive this in component scss itself limited to that only  if I use
::ng-deep {
  ::-webkit-scrollbar {
    display: none !important;
  }
}

then it works, but obiviously this is bleeding everywhere! scrollbars gone for everyone once I visit my select component.
Angular v11

A: Ok, I ended up achieving this is using 'panel-class' of mat-select.
In my component template I provided it as '.panelClass' to mat-select.
In SCSS
::ng-deep {
  .panelClass {
    &::-webkit-scrollbar {
      display: none !important;
    }
  }
}

Done! Scrollbar hidden and scrolling works for mat-select!


text:
Q: Is there a way to cache database entries for specific users in Flask So I'm helping to make a Flask API for an app that will allow users to share the creations they make on the app with others. One of the things we want to implement is a way for users to sort by the newest creations uploaded to the server. Currently, we just have the API sort the results by the time they were uploaded, and paginates those results.
The problem is, if a user makes a request to get page 1 of the newest creations, and stays there long enough for more to be uploaded to the server, before going to page 2, some creations may be pushed back, leading the user to see the same thing more than once. What would be the best way to get around this?
Sorry if this is unclear, or if the title is inaccurate. I'm having a hard time putting this issue into words, so I would be happy to try and clarify if needed.

A: A potential workaround is cursor-based pagination. In most pagination issues, ask give me 10 items, starting from item number 100, and you'd get a SQL query like so
SELECT *
FROM posts
...
ORDER BY posted_at DESC
LIMIT 10
OFFSET 100

This query gets all posts, orders them, subtracts the first 100 values, and then applies a LIMIT to get only 10 rows. Now, if there are a lot of new posts, this might lead to a post popping up on page 1, and then when you go to page 2, you see the same post again. Why? There's a new post in the database, pushing this one to the 11th place, and thus to page two. Another issue is that is becomes slow for farther pages (say 100, 1000).
With cursor based pagination, you remove the ability to go to a specific page, and only allow people to go to the next or the previous page. The difference is that you send the posted_at date of the last item on the page with the request, which essentially becomes give me the first 10 items posted before date x.
In SQL:
SELECT *
FROM posts
...
WHERE posted_at < '2020-09-01 00:00:05'
ORDER BY posted_at DESC
LIMIT 10

There is one small problem with this. If two posts are posted at exactly the same time, the person might miss one, if it's number 11 on page 1 and gets cut off, but it's not strictly smaller than the posted_at date of post 10.
A workaround is to use ids, if you can guarantee that they are always increasing. So if having a higher ID means always that it's also newer, then you can do this. Otherwise, you can also use the combination of id and posted_at. This way it doesn't matter whether ids are increasing, since it makes the order deterministic. What I mean is that if you have two posts with the same posted_at time, but B has a higher id than A, it will always be shown on the next page if A is the last on this page. The SQL:
SELECT *
FROM posts
...
WHERE (posted_at < '2020-09-01 00:00:05'
   OR (posted_at = '2020-09-01 00:00:05' AND id > 1500))
ORDER BY posted_at DESC, id
LIMIT 10


text:
Q: Transform the dataframe in R Can we transform this data as shown in expected output?
ColA   ColB  ColC
A        -    0
B        X    3
C        Y    4
D        X    51
D        Y    32

Expected Output
ColA     X    Y
A        0    0
B        3    0
C        0    4
D        51   32

A: Probably, something like this :
library(dplyr)
library(tidyr)

df %>%
  mutate_at(vars(ColB:ColC), ~replace(., . == '-', 'X')) %>%
  pivot_wider(names_from = ColB, values_from = ColC, values_fill = list(ColC = 0))

#  ColA  X     Y
#  <fct> <chr> <chr>
#1 A     0     0
#2 B     3     0
#3 C     0     4
#4 D     51    32

data
df <- structure(list(ColA = structure(c(1L, 2L, 3L, 4L, 4L), .Label = c("A",
"B", "C", "D"), class = "factor"), ColB = structure(c(1L, 2L,
3L, 2L, 3L), .Label = c("-", "X", "Y"), class = "factor"), ColC = c(0L,
3L, 4L, 51L, 32L)), class = "data.frame", row.names = c(NA, -5L))

A: Yes we can.
Using xtabs:
res <- xtabs(ColC ~ ColA + ColB, dat)[,-1]
#     ColB
# ColA  X  Y
#    A  0  0
#    B  3  0
#    C  0  4
#    D 51 32

To get a data frame, do:
res <- as.data.frame(unclass(res))
res
#    X  Y
# A  0  0
# B  3  0
# C  0  4
# D 51 32

Or, all in one:
res <- as.data.frame(unclass(xtabs(ColC ~ ColA + ColB, dat)[,-1]))

Data
dat <- structure(list(ColA = c("A", "B", "C", "D", "D"), ColB = c("-",
"X", "Y", "X", "Y"), ColC = c(0L, 3L, 4L, 51L, 32L)), row.names = c(NA,
-5L), class = "data.frame")

A: A short solution based on data.table (most recommended option if you have voluminous data)
colA = c("A","B","C","D","D")
colB = c(NA,"X","Y","X","Y")
colC = c(0,3,4,51,32)

library(data.table)

dt <- data.table(colA = colA, colB = colB, colC = colC)

dt <- dcast(dt, colA ~ ..., fill = 0)
dt[,"NA" := NULL]

dt
   colA  X  Y
1:    A  0  0
2:    B  3  0
3:    C  0  4
4:    D 51 32

dcast makes your data from long to wide format.


text:
Q: Binding 2 Integer arrays to DataGridView and make it updating when elements of the arrays changed I tried to bind 2 Integer arrays to DataGridView and make it updating when elements of the arrays changed, but failed to update when elements of the array changed.
 var row = new DataGridViewRow();
                for (int i = 0; i < lastN; ++i)
                {
                    row.Cells.Add(new DataGridViewTextBoxCell()
                    {
                        Value = minutesMax[i]
                    });
                }
                dataGridView1.Rows.Add(row);
                var row2 = new DataGridViewRow();
                for (int i = 0; i < lastN; ++i)
                {
                    row2.Cells.Add(new DataGridViewTextBoxCell()
                    {
                        Value = minutesMin[i]
                    });
                }
                dataGridView1.Rows.Add(row2);

The 2 array are defined as below, and them posted well into a datagridview, but when the elements of the arrays are changed, the values in the datagridview failed to update simultaneously.
const int lastN = 21;
    int[] minutesMax = new int[lastN];
    int[] minutesMin = new int[lastN];

A: Try like this,
    const int lastN = 21;
    int[] minutesMax = new int[lastN];
    int[] minutesMin = new int[lastN];

    private void Form1_Load(object sender, EventArgs e)
    {
        for (int i = 0; i < lastN; i++)
        {
            minutesMax[i] = i;
        }

        for (int i = 1; i < lastN; i++)
        {
            minutesMin[i] = (i*10);
        }
        GridBind();
    }

    void GridBind()
    {
        DataTable dt = new DataTable();
        dt.Columns.Add("Max");
        dt.Columns.Add("Min");

        for (int i = 0; i < minutesMax.Length; i++)
        {
            DataRow dRow = dt.NewRow();
            dRow["Max"] = minutesMax[i];
            dRow["Min"] = minutesMin[i];
            dt.Rows.Add(dRow);
        }
        dataGridView1.DataSource = dt;
    }

    private void button1_Click(object sender, EventArgs e)
    {
        minutesMin[0] = 10000;
        GridBind();
    }

A: Since Triple K's DataTable is 21 rows x 2 columns, not fitting to the DataGridView, I provide a new answer to your question.
Construct a DataTable(2 rows x 21 columns) from your arrays, and use it as the DataSource of DataGridView.
const int lastN = 21;
int[] minutesMax = { 1, 2, 3, 4, 5, 1, 2, 3, 4, 5, 1, 2, 3, 4, 5, 1, 2, 3, 4, 5 ,21};
int[] minutesMin = { 6, 7, 8, 9, 10, 6, 7, 8, 9, 10, 6, 7, 8, 9, 10, 6, 7, 8, 9, 10 ,22};

DataTable dataTable;
private void SetBinding()
{
    dataTable = new DataTable();
    for (int i = 0; i < lastN; i++)
    {
        dataTable.Columns.Add();
    }
    dataTable.Rows.Add(dataTable.NewRow());
    dataTable.Rows.Add(dataTable.NewRow());

    for (int i = 0; i < lastN; i++)
    {
        dataTable.Rows[0][i] = minutesMax[i];
        dataTable.Rows[1][i] = minutesMin[i];
    }

    dataGridView3.DataSource = dataTable;
}

When you update the datatable the DataGridView will be updated automatically.
private void UpdateData()
{
    minutesMin[3] = 22222;
    dataTable.Rows[1][3] = 22222;
}


text:
Q: About the new Xubuntu 22.04 window system and sound server I have two questions about the new Xubuntu 22.04.

*

*Is it using X11 or has it switched to Wayland?

*Is it using Pulseaudio or has it switched to Pipewire?

I emphasize that I'm asking about Xubuntu specifically. Not any other flavours.
Thank you.

A: Wayland is the default display server on Ubuntu 22.04 LTS. However, you can choose to use an X11 session.Nothing is mentioned in the XFCE or Xubuntu documentation, however xfwm (the window manager for XFCE4) doesn't work on Wayland, and XFCE4 really isn't designed to work on it yet. You could probably work around that by using a different window manager and layering XFCE on top of a KDE or Gnome install (running XFCE on X-11 inside a virtual environment inside one of them) but what's the point of that?  I haven't run Wayland yet, and don't intend to, and hope XFCE never supports it.
22.04 uses Pulseaudio 16 by default. You can also remove Pulseaudio and use Alsa and maybe Jack, if you prefer, since Pulseaudio and Pipewire are useless features. If you install pipewire, be sure to install any additional libraries: bluetooth, Gstreamer, Jack.. and some programs written for Pulse won't recognise Pipe even so. So, no, Pipe is not installed.


text:
Q: Combinatorial approach to prove divisibility results with the sequence $u_{n+p+1} = u_{n+p} + u_{n}$ in $\mathbb{F}_p$ For a fixed prime number $p$, we consider the sequence :
$$\left\{
\begin{array}{l}
u_n = 1, & 0\leq n \leq p \\
u_{n+p+1} = u_{n+p} + u_n
\end{array}\right.
$$
I want to prove that $\forall a \in \mathbb{N},\ p|u_{pa}-u_a$
My attempt :
I think that there are two natural approaches to tackle this problem:

*

*One way is to apply results about linear sequences, but i'm not very familiar with how it should be done in the field $\mathbb{F}_p$.
We thus consider the characteristic polynomial $Q(X) := X^{p+1}-X^p-1$ in the field $\mathbb{F}_p$. One can easily check that $Q'(X) = X^p$ and has only $0$ as a root, which is not a root of $Q(X)$, thus every roots of $Q(X)$ are simple.

If we could say that $u_n = \sum_{k} \lambda_k\alpha_k^n$ with $\alpha_k$ roots of $Q(X)$, then we would be done by Fermat's theorem.
My problem is that I think that $Q(X)$ has at most $2$ roots, that are those of $X^2-X-1$ (and actually we would need that $5$ is a square $mod(p)$, ie. that $p$ must be either $1\ mod(5)$ or $-1\  mod(5)$ by quadratic reciprocity)

*

*The second approach is more combinatorial, and use the fact that $u_n$ can be interpreted as the number of ways one can tile a $(p+1)\times n$ rectangle with $(p+1)\times 1$ dominos. Indeed the relationship can be derived by observing that a $(p+1)\times(n+p+1)$ tiling is either a $(p+1)\times(n+p)$ tiling with a vertical domino filing the last slice, or a $(p+1)\times n$ tiling with $(p+1)$ horizontal domino filing the remaining square.

If we consider a $(p+1)\times pa$ rectangle, then we can "naturally" slice it in $p$ rectangles of size $(p+1)\times a$. There are $u_a^p$ ways of tiling the initial rectangle with dominos that doesn't "cut" a small rectangle. By Fermat's theorem, we need to show that the number of tilings $v_{pa}$ having a domino that "cut" a small rectangle is a multiple of $p$, because we would have $u_{pa} = u_a^p + v_{pa} = u_a\ mod(p)$.
I don't know how to show this. The ideal proof would be to find an action splitting the possible tilings into $p$ orbits of the same size for example. I also tried to explicit $v_{bp}$ with the inclusion-exclusion principle (but I assumed $a\geq 2p$ so that's not very satisfying):
If we note the inner vertical edges of the small rectangles from left to right by $1,\dots,p-1$ we can try to split by the events $A_j = \{ \text{tilings with a domino cuting the edge}\ j\}$ and I found, if not mistaken:
$$
v_{pa} = \sum_{k=1}^{p-1}(-1)^{k-1}\sum_{1\leq i_1 \leq \dots \leq i_k \leq p-1}\ \sum_{n^k \in \{1,\dots,p\}^k}\ \prod_{j=1}^{k+1}(u_{i_j a - (p+1-n_{j-1}^k+n_j^k)})
$$
with the boundary conditions $i_{k+1} = p-\sum_{j=0}^k i_j$ and $n_0^k = n_{k+1}^k = 0$, but I'm not sure we can make something out of it.
Because I haven't got a proof of this result, anything would be welcomed but I'm particularly curious about where the combinatorial approach would lead as it seems more elementary.

A: For the sake of completeness, I would like to propose additional solutions to the problem, that should be a little bit more elementary in the sense that they don't require extension fields of $\mathbb{F}_p$.
We will use a slightly different combinatorial interpretation of the sequence: for all $n\in \mathbb{N}$, $u_n$ is the number of possible tilings of a $1\times n$ rectangle using $1\times 1$ dominos and $1\times (p+1)$ dominos (simply consider a horizontal slice of the $(p+1)\times n$ rectangle). Using this interpretation, we will refer to the $1\times 1$ dominos as the "short" dominos and the $1\times (p+1)$ dominos as the "long" dominos.

*

*First proof (based on arithmetic identities):

The idea is that we can derive the following closed form of $u_n$ :
$$
u_n = \sum_{k\geq 0} \binom{n-pk}{k}
$$
assuming that $\binom{n}{k} = 0$ whenever $k > n$.
This can be proved with the combinatorial interpretation in the following way:
Partition the set of possible tilings of a $1 \times n$ rectangle according to the number of long dominos a tiling is using.
Let $k \in \mathbb{N}$ be given.
In order to construct a tiling using $k$ long dominos, one need to use $n-(p+1)k$ short dominos, so it amounts to select the position of the $k$ long dominos among the total of $n-pk$ dominos.
In other words, there are $\binom{n-pk}{k}$ possible tilings of the $1\times n$ rectangle that use $k$ long dominos.
Summing over all $k\geq 0$ gives the identity.
We therefore have in particular that
$$
\forall a \in \mathbb{N},\ u_{pa} = \sum_{k\geq 0} \binom{p(a-k)}{k}
$$
We will now use the following arithmetic lemma:
$$
\begin{align*}
  \binom{pn}{k}  &= 0\ mod(p) \quad \text{if $p$ does not divide $k$}\\
  \binom{pn}{pk} &= \binom{n}{k}\ mod(p)
\end{align*}
$$
It is an immediate consequence of Lucas's theorem, but we can also rederive it by considering the following polynomial in $\mathbb{F}_p$:
$$
\begin{align*}
\sum_{k=0}^{pn} \binom{pn}{k} X^k &= (1+X)^{pn} \ mod(p) \\
  &= ((1+X)^p)^n \ mod(p)\\
  &= (1+X^p)^n \ mod(p)\\
  &= \sum_{k=0}^n \binom{n}{k} X^{pk}\ mod(p)
\end{align*}
$$
identifying the coefficient of each monomial gives the identity.
Thus it follows that
$$
\begin{align*}
u_{pa} &= \sum_{k\geq 0} \binom{p(a-k)}{k} \\
  &= \sum_{k\geq 0} \binom{p(a-pk)}{pk} \ mod(p) \\
  &= \sum_{k\geq 0} \binom{a-pk}{k} \ mod(p) \\
  &= u_a \ mod(p)
\end{align*}
$$
Which gives a first proof of the result.

*

*Second proof (based on combinatorics/group actions):
Let us note by $v_n$ the number of possible tilings of the $1\times n$ rectangle where we are eventually allowing the first long domino to be cut in order to fill the beginning and the end of the rectangle (in a sense, we are considering tilings of the $1 \times n$ cylinder).
By considering the way to place the first domino, we clearly have
$$
\left\{
\begin{array}{ll}
  v_n = 1, & 0\leq n \leq p\\
  v_{n+p+1} = u_{n+p} + (p+1)u_n&
\end{array}\right.
$$
In other words, $(v_n)$ and $(u_n)$ satisfy the same recurrence relation in $\mathbb{F}_p$ so they must be equal modulo $p$.
However, note that we can build a simple $\mathbb{F}_p$-action on the set of tilings of the $1 \times pa$ cylinder for $a\in \mathbb{N}$:
cut the rectangle into $p$ rectangular blocks of size $1 \times a$ and permute the block cyclically (it is clear that it gives valid tiling if you see this as a rotation of the cylinder by $a$ units).
Now the orbits of every tiling (ie. the tilings obtained when applying multiple times this cyclic permutation to a tiling) must be of size $p$ or $1$ because $p$ is prime.
The orbits of size $1$ corresponds to the tilings that are fixed by the rotation, therefore they are composed of $p$ times the same block, corresponding to a tiling of a $1\times a$ cylinder.
Therefore there are $v_a$ orbits of size $1$.
Finally, we can conclude by regrouping tilings by orbits that
$$
u_{pa} = v_{pa} = v_a = u_a \ mod(p)
$$
which again concludes the proof.


text:
Q: How to make a bounded set A in R2 with Hausdorff dimension of 1 but $H_{1}(A)$ = $\infty$? I have been tasked with creating a set in $A \subset \mathbb{R}^2$ such that $A$ is bounded and has Hausdorff dimension of 1 but $H_{1}(A) = \infty$.
I started by creating a bounded space, working in the unit square centered at the origin. I then created a circle centered at the origin with radius 1 so that it touches the center of each side of the square but leaves room. I then continue by drawing circles in the space that remains. I would then continue this procedure, eventually getting an infinite amount of circles with decreasing radius all within the unit square. The motivation for this was to create an infinite sequence of circles that have radii under some arbitrary delta, but which ultimately sum up to infinity. However, I think that this procedure will be unsuccessful, since such fractal like images tend to have Hausdorff dimension greater than 1. I know that the Hausdorff dimension is the limit as delta goes to $0$ of the infimum of the sum of the diameter of the sets of covers of the set $A$ where each set in the cover has diameter less than delta.
How should one approach the problem of constructing this set $A$? I assume fractal patterns will not be the way to go. The requirement of making $A$ bounded makes the problem much more difficult.

A: The basic result is:

A countable union of $d$-dimensional sets is still $d$-dimensional.

Indeed, the Hausdorff dimension of a set $E$ is defined as
$$\text{dim}(E)=\inf\,\left\{s>0:\mathcal{H}^s(E)=0\right\}.$$
If you take a countable family $\{E_i\}$ of $d$-dimensional sets, by definition for every $t>s$ we have $\mathcal{H}^t(E_i)=0$. Since $\mathcal H^t$ is an outer measure, by $\sigma$-subadditivity, setting $E=\bigcup_i E_i$, we have $\mathcal{H}^t(E)=0$, from which $\text{dim}(E)\leq s$ (if your restrict to Borel sets you can just use $\sigma$-additivity, because $\mathcal{H}^t$ is a measure on the Borel sets). The other inequality is trivial.
With the same proof you obtain

Given a countable family $\{E_i\}$ and setting $E=\bigcup_i E_i$, then
  $$\text{dim}(E)=\sup_i\, \text{dim}(E_i).$$

Therefore your example is of Hausdorff dimension $1$, but the delicate part is to show that the total length diverges! For that you can have a look at this question (if I understood correctly your proposed construction). Anyway you can build a simpler example by taking concentric circles whose radii add up to $\infty$, or considering the example proposed by Silvia Ghinassi in the comments.
Regarding fractals, it is true that taking a limiting procedure the dimension of the limit object could be greater than the dimension of the approximating sets: for example the Koch snowflake is a limit of $1$-dimensional curves, but it is of dimension $\log 4/\log 3$. However, this can not happen just by taking a countable union; a limiting process is really required!

A: A very basic example is the graph of a linear map, for example if $f(x)=x$, then consider $G=\{(x,f(x): x \in \mathbb R\} \subset \mathbb R ^2$, the graph of $f$. Then $\dim_H G =1$, but $H^1 (G)=\infty$.
Of course, $G$ is unbounded, and bounded set with this property are more intersting!


text:
Q: Bundle multiple git repositories in one project Currently, I am working on a larger software project which incorporates multiple github repositories.
To simplify my setup consider the following:

*

*repo A contains a server app

*repo B holds a desktop client app

*repo C maintains a database API integrated as git submodules into A and B

I have recently started to use the project management features of github.com more to track issues, pull requests & tasks. I was wondering if there is a way to bundle A, B & C under one project. It was difficult to find documentation about all of this, because project and repository are used interchangeably a lot of times.
Note, I am not looking for a way to merge repos A, B & C. I just need a way to manage and review A, B & C tasks, issues, etc. against each other.
Any advice would be appreciated!

A: Well there are multiple ways to do what your trying to do.
Some organizations do one large repo with all their subprojects in it. Facebook and Google are both known to do this with their applications and services.
You could do:
organization repo:
    - serverappfolder
    - desktopclientapp
    - databaseapi

Then use the github project management to manage issues for everything together.
Projects sometimes have something called epics (there are other alternative terminology instead of this). Another option would be to continue to use 3 separate git repos, but create a new master one for managing large issues linked to issues in more than one. As a result, you could continue to use 3 separate repos and create a new one that just has big issues (the epic) that would link or have references to the issues in these other subprojects.
E.g. organizationglobalissues with issues such as (usermanagement, security, etc)
then your 3 repos with a link back to these issues. databaseapi - issue register user - linked to usermanagement global epic.
If your using the database api integrated into the ui's you could keep them separate or just in a .gitignored folder for each of the ui clients that you copy the build to.


text:
Q: Real time event handler in ZKemKeeper library stop responding to device activity after some time I have created a simple Windows Service project to capture real time event from a fingerprint device using ZKemKeeper library. The service seems to work normally at the first time, and it responds well to the events in the device. But I found that, the service stop responding to the event after couple minutes of inactivity. I thought it was the service that caused the problem, but then the problem still there in WinForm application and even the samples included within the SDK showing the exact problem.
Here's the code for Windows Service:
public partial class Service1 : ServiceBase
{
    private System.Diagnostics.EventLog eventLog1;
    CZKEMClass myCZKEMClass;
    public Service1()
    {
        InitializeComponent();

        this.eventLog1 = new System.Diagnostics.EventLog();

        ((System.ComponentModel.ISupportInitialize)(this.eventLog1)).BeginInit();
        this.eventLog1.Log = "MyLog";
        this.eventLog1.Source = "MyLogSource";

        ((System.ComponentModel.ISupportInitialize)(this.eventLog1)).EndInit();

        this.ServiceName = "ZKemKeeperTestService";

    }

    protected override void OnStart(string[] args)
    {
        myCZKEMClass = new CZKEMClass();

        Thread createComAndMessagePumpThread = new Thread(() =>
        {
            myCZKEMClass.Connect_Net("192.168.1.20", 4370);

            if (myCZKEMClass.RegEvent(1, 65535))
            {
                myCZKEMClass.OnAttTransactionEx += new _IZKEMEvents_OnAttTransactionExEventHandler(myCZKEMClass_OnAttTransactionEx);
            }

            Application.Run();
        });
        createComAndMessagePumpThread.SetApartmentState(ApartmentState.STA);

        createComAndMessagePumpThread.Start();

        eventLog1.WriteEntry("Service Started");

    }

    protected override void OnStop()
    {
        eventLog1.WriteEntry("Service Stopped");
        myCZKEMClass.OnAttTransactionEx -= new _IZKEMEvents_OnAttTransactionExEventHandler(myCZKEMClass_OnAttTransactionEx);

    }

    private void myCZKEMClass_OnAttTransactionEx(string EnrollNumber, int IsInValid, int AttState, int VerificationMethod, int Year, int Month, int Day, int Hour, int Minute, int Second, int WorkCode)
    {

        eventLog1.WriteEntry(EnrollNumber.ToString());

    }
}

I have no idea what's the cause of the problem and I'm stuck in there. FYI, I'm using the 64bit version of the library running in Windows 10. I'm using .NET Framework 4.0 as a target framework.
Achmad Mulyadi

A: I have same problem with you, please try to unregister the event than register again every 60 seconds, this work for me. I'm using 64bit version og the library running in windows 8.1
        if (bIsConnected == true)
        {
            this.axCZKEM1.OnFinger -= new zkemkeeper._IZKEMEvents_OnFingerEventHandler(axCZKEM1_OnFinger);
            this.axCZKEM1.OnVerify -= new zkemkeeper._IZKEMEvents_OnVerifyEventHandler(axCZKEM1_OnVerify);
            this.axCZKEM1.OnAttTransactionEx -= new zkemkeeper._IZKEMEvents_OnAttTransactionExEventHandler(axCZKEM1_OnAttTransactionEx);
            this.axCZKEM1.OnFingerFeature -= new zkemkeeper._IZKEMEvents_OnFingerFeatureEventHandler(axCZKEM1_OnFingerFeature);
            this.axCZKEM1.OnEnrollFingerEx -= new zkemkeeper._IZKEMEvents_OnEnrollFingerExEventHandler(axCZKEM1_OnEnrollFingerEx);

            iMachineNumber = 1;//In fact,when you are using the tcp/ip communication,this parameter will be ignored,that is any integer will all right.Here we use 1.
            if (axCZKEM1.RegEvent(iMachineNumber, 65535))//Here you can register the realtime events that you want to be triggered(the parameters 65535 means registering all)
            {
                this.axCZKEM1.OnFinger += new zkemkeeper._IZKEMEvents_OnFingerEventHandler(axCZKEM1_OnFinger);
                this.axCZKEM1.OnVerify += new zkemkeeper._IZKEMEvents_OnVerifyEventHandler(axCZKEM1_OnVerify);
                this.axCZKEM1.OnAttTransactionEx += new zkemkeeper._IZKEMEvents_OnAttTransactionExEventHandler(axCZKEM1_OnAttTransactionEx);
                this.axCZKEM1.OnFingerFeature += new zkemkeeper._IZKEMEvents_OnFingerFeatureEventHandler(axCZKEM1_OnFingerFeature);
                this.axCZKEM1.OnEnrollFingerEx += new zkemkeeper._IZKEMEvents_OnEnrollFingerExEventHandler(axCZKEM1_OnEnrollFingerEx);
            }
        }

A: if you still not find the answer make Timer and put this code inside it
System.Windows.Forms.Application.DoEvents();

This  will make the ActiveX to work

A: you can try to add this code in the thread.
System.Timers.Timer timer = new System.Timers.Timer();
timer.Elapsed += new System.Timers.ElapsedEventHandler((object sender, System.Timers.ElapsedEventArgs e) =>
{
    string IPAddr = null;
    if (axCZKEM1.GetDeviceIP(iMachineNumber, IPAddr))
    {
        LogHelper.Log(LogLevel.Debug, "device " + IPAddr + ":" + port + " connect status is ok.");
    }
});
timer.Interval = 600000;// 10 minutes
timer.Enabled = true;

A: After looking every where for solution reading the manual multiple times I found that my issue was the firewall so try disabling firewall or add exception to your software


text:
Q: VBs script to open .mdb file and update query I do not have experience with VBs. I will need to connect and open .mdb file with protected password e.g. Password1 and user Admin.
I will need then to update the database inside with SQL statement:
update paytype set n_type = 0 where n_type = 1


text:
Q: How run servo and ultrasonic sensor concurently with millis on arduino? I have a problem with the servo and ultrasonic that can not run concurently. My code works at the moment as follow : servo will move every 10 seconds and ultrasonic always detect the range and display the result on LED.
I was looking for references on google and I found out that the delay caused servo and ultrasonic can't run together. multitasking required in order to use the millis (). but I still can not use the function millis ().
how to change the delay in my code with millis()?
Thanks for helping me!
#include <Servo.h>
#define trigPin 13
#define echoPin 12
#define ledM 10
#define ledK 9
#define ledH 8

Servo ikiservo;  //servo
int pos = 0;    //set positon servo
int pinSpeaker = 4;  //buzzer

void setup() {
  Serial.begin (9600); //SERIAL
  ikiservo.attach(3); //servo
  pinMode(pinSpeaker, OUTPUT);
  pinMode(trigPin, OUTPUT); //ultrasonic
  pinMode(echoPin, INPUT); //ultrasonic
  pinMode(ledM, OUTPUT);
  pinMode(ledK, OUTPUT);
  pinMode(ledH, OUTPUT);
}

void loop() {
  //-------------SERVO----------

  for(pos = 0; pos < 90; pos += 1)  // goes from 0 degrees to 90 degrees
  {                                  // in steps of  1 degree
    ikiservo.write(pos);
    delay(10000);       // waits 10s for the servo to reach the position
  }

  //---------ULTRASONIC-----------
  long duration, distance;
  digitalWrite(trigPin, LOW);
  delayMicroseconds(2);
  digitalWrite(trigPin, HIGH);
  delayMicroseconds(10);
  digitalWrite(trigPin, LOW);
  duration = pulseIn(echoPin, HIGH);
  distance = (duration/2) / 29.1;
  Serial.print(distance);
  Serial.println(" cm");
  delay (400);

  if (distance > 4 && distance <7) {  // turn on ledM when distance 4<distance<7
    digitalWrite(ledM,HIGH);
    digitalWrite(ledK,LOW);
    digitalWrite(ledH,LOW);
    playTone(300, 160);          //buzzer ON
    delay(1000);
    //buzzer
  } else if(distance > 2 && distance <4) {// turn on ledK when 7<distance<4
    digitalWrite(ledM,LOW);
    digitalWrite(ledK,HIGH);
    digitalWrite(ledH,LOW);
    playTone(0, 0);
    delay(1000);
  } else if(distance <2) {//turn on ledH when distance<2
    digitalWrite(ledM,LOW);
    digitalWrite(ledK,LOW);
    digitalWrite(ledH,HIGH);
    playTone(0, 0);
    delay(1000);
  } else{                      //turn off all
    digitalWrite(ledM,LOW);
    digitalWrite(ledK,LOW);
    digitalWrite(ledH,LOW);
    playTone(0, 0);
    delay(1000);
  }
}

void playTone(long duration, int freq) { //funtion for add tone on buzzer
    duration *= 1000;
    int period = (1.0 / freq) * 1000000;
    long elapsed_time = 0;
    while (elapsed_time < duration) {
        digitalWrite(pinSpeaker,HIGH);
        delayMicroseconds(period / 2);
        digitalWrite(pinSpeaker, LOW);
        delayMicroseconds(period / 2);
        elapsed_time += (period);
    }
}

A: You are not waiting for 10 seconds, but for 15 minutes. Probably that one is the only issue in your code.
Just write this
for(pos = 0; pos < 90; pos += 1)  // goes from 0 degrees to 90 degrees
{                                 // in steps of  1 degree
    ikiservo.write(pos);
    delay(100); // waits 0.1s for the servo to reach the position
                // so total time will be 9 seconds
}

If, on the other way, you want to span the 90° area in 10 seconds, then go back, the code is
void loop() {
    //-------------SERVO----------

    for(pos = 0; pos < 90; pos += 1)  // goes from 0 degrees to 90 degrees
    {                                  // in steps of  1 degree
        ikiservo.write(pos);

        //---------ULTRASONIC-----------
        long duration, distance;
        digitalWrite(trigPin, LOW);
        delayMicroseconds(2);
        digitalWrite(trigPin, HIGH);
        delayMicroseconds(10);
        digitalWrite(trigPin, LOW);
        duration = pulseIn(echoPin, HIGH);
        distance = (duration/2) / 29.1;
        Serial.print(distance);
        Serial.println(" cm");

        if (distance > 4 && distance <7) {  // turn on ledM when distance 4<distance<7
            digitalWrite(ledM,HIGH);
            digitalWrite(ledK,LOW);
            digitalWrite(ledH,LOW);
        } else if(distance > 2 && distance <4) {// turn on ledK when 7<distance<4
            digitalWrite(ledM,LOW);
            digitalWrite(ledK,HIGH);
            digitalWrite(ledH,LOW);
        } else if(distance <2) {//turn on ledH when distance<2
            digitalWrite(ledM,LOW);
            digitalWrite(ledK,LOW);
            digitalWrite(ledH,HIGH);
        } else{                      //turn off all
            digitalWrite(ledM,LOW);
            digitalWrite(ledK,LOW);
            digitalWrite(ledH,LOW);
        }

        delay(100); // waits 0.1s for the servo to reach the position
    }
}

I had to remove the tone, because the way you use it does not allow other "processes" to work concurrently. Just see if it is the approach you want;if it is report back and we can see how to implement it also with the buzzer


text:
Q: Node-Soap - throwing fault in async method Created a soap api with the node-soap library but when i try to throw a fault using
throw {
    Fault: {
      Code: {
        Value: 'soap:Sender',
        Subcode: { value: 'rpc:BadArguments' }
      },
      Reason: { Text: 'Processing Error' }
    }
  };

as descibed in the library i get a
UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)

this is what i am currently doing
                     ssm.decrypt(args.request, password, base_key)
                        .then(function (res) {
                            console.log(res)
                            parseString(res, async function (err, result) {
                                if (err) {
                               //the throws causes the error
                                    throw {
                                        Fault: {
                                            error: {
                                                data: {
                                                    error
                                                } //Error object from catch
                                            }
                                        }

                                    };
                                } else {
                                 //some code
                                }

thanks

A: Throwing an error inside the async function
parseString(res, async function (err, result)...

rejects the promise returned by the async function - for which there is no catch handler. If parseString calls its callback synchronously, you could just remove the async declaration leaving the call as
 parseString(res, function (err, result)...

If parseString is asynchronous, however, it needs to be promisified so errors can be worked into the surrounding promise chain. As an untested example:
function doParseString( res) {
    return new Promise( function( resolve, reject) {
        parseSting( res, function( err, result) {
             err ? reject( err) : resolve( result);
        });
    });
}

which could be used along the lines of
ssm.decrypt(args.request, password, base_key)
.then( doParseString)
.then( function  (result) {
     // some code
 })
.catch( console.log);   // do something with the error

A: Thanks, guys for your help but I got the issue
if an async function is been used for the soap api been implemented with node-soap
communication need to be done via callbacks
i changed the throw to
                                                   callback({
                                                        Fault: {
                                                            error: {
                                                                data: {
                                                                    error
                                                                }
                                                            }
                                                        }

                                                    });

and it works perfectly
i found it here node-soap doc


text:
Q: How to count number of rows with same field value for a given ID in Redshift? For example, I want to count the number of days in a state for each ID. The table Current_State has three columns (Date, ID, State) and I want to add the calculated column Days-in-state.
Date, ID, State, Days-in-state
1/1/2017, 123, A, 1
1/2/2017, 123, A, 2
1/3/2017, 123, A, 3
1/4/2017, 123, B, 1
1/5/2017, 123, B, 2
1/1/2017, 345, A, 1
1/2/2017, 345, B, 1
1/3/2017, 345, B, 2
1/4/2017, 345, B, 3
1/5/2017, 345, C, 1
I read a post that said window functions would work, but it wasn't very clear, and didn't have the ID requirement. Thanks for your help.

A: Is this what you want?
select id,
       sum(case when state = 'A' then days_in_state else 0 end) as state_a,
       sum(case when state = 'B' then days_in_state else 0 end) as state_b,
       sum(case when state = 'C' then days_in_state else 0 end) as state_c
from t
group by id;

Your data suggests that you might want max() rather than sum().

A: if the states don't come back like ABA, only ABC, the solution is this:
select
 date
,id
,state
,row_number() over (partition by id, state order by date) as days_in_state
from your_table
order by id,date

You can tell the window function to look at some groups of rows independently using partition, in your case you have id/state partitions. If states can change back like A then B then again A it's a bit more complex, needs another query.

A: Your Days-in-state column does not appear to be very informative. I'm ignoring it.
I'm assuming you have a (compound) unique index on date, id, state. Then the desired query is:
select    count(*) as num_days, id, state
from      whatever_you_named_your_table
group by  id, state;


text:
Q: Linq query to get data from array of objects c# public struct Parameter
{
    public Parameter(string name, string type, string parenttype)
    {
        this.Name = name;
        this.Type = type;
        this.ParentType = parenttype;
    }
    public string Name;
    public string Type;
    public string ParentType;
}

Following values are stored in the array of Parameter:
Name        Type                 ParentType
-------------------------------------------------------
composite   CompositeType
isThisTest  boolean
BoolValue   boolean              CompositeType
StringValue string               CompositeType
AnotherType AnotherCompositeType CompositeType
account     string               AnotherCompositeType
startdate   date                 AnotherCompositeType

I want to read this to build an xml. something like:
<composite>
    <BoolValue>boolean</BoolValue>
    <StringValue>string</StringValue>
    <AnotherType>
        <account>string</account>
        <startdate>date</startdate>
    </AnotherType>
<composite>
<isThisTest>boolean</isThisTest>

I am using the following logic to read the values:
foreach (Parameter parameter in parameters)
{
    sb.Append("        <" + parameter.Name + ">");
    //HERE: need to check parenttype and get all it's child elements
    //
    sb.Append("</" + parameter.Name + ">" + CrLf);
}

Is there a simpler way to read the array to get the parents and thier child? May be using LINQ? I still on .Net 3.5. Appreciate any suggestions with example code :)

A: You could write a little recursive method to deal with this :
IEnumerable<XElement> GetChildren ( string rootType, List<Parameter> parameters )
{
    return from p in parameters
        where p.ParentType == rootType
        let children = GetChildren ( p.Type, parameters )
        select  children.Count() == 0 ?
            new XElement ( p.Name, p.Type ) :
            new XElement ( p.Name, children );
}

Each call builds up an Enumerable of XElements which contains the parameters whose parent has the passed in type. The select recurses into the method again finding the children for each Element.
Note that this does assume that the data is correctly formed. If two parameters has eachother as a parent you will get a Stack Overflow.
The magic is in the XElements class (Linq to Xml) that accepts enumerables of XElements to build up the tree like Xml structure.
The first call, pass null (or use default parameters if using C# 4) as the rootType. Use like :
void Main()
{
    var parameters = new List<Parameter> {
        new Parameter {Name = "composite", Type = "CompositeType" },
        new Parameter {Name = "isThisTest", Type = "boolean" },
        new Parameter {Name = "BoolValue", Type = "boolean", ParentType = "CompositeType" },
        new Parameter {Name = "StringValue", Type = "string", ParentType = "CompositeType" },
        new Parameter {Name = "AnotherType", Type = "AnotherCompositeType", ParentType = "CompositeType" },
        new Parameter {Name = "account", Type = "string", ParentType = "AnotherCompositeType" },
        new Parameter {Name = "startdate", Type = "date", ParentType = "AnotherCompositeType" }
    };

    foreach ( var r in GetChildren ( null, parameters ) )
    {
        Console.WriteLine ( r );
    }

}

Output :
<composite>
  <BoolValue>boolean</BoolValue>
  <StringValue>string</StringValue>
  <AnotherType>
    <account>string</account>
    <startdate>date</startdate>
  </AnotherType>
</composite>
<isThisTest>boolean</isThisTest>

Edit
In response to your comment, XElement gives you two options for outputting as a string.
ToString() will output formatted Xml.
ToString(SaveOptions) allows you to specify formatted or unformatted output as well as ommitting duplicate namespaces.
I'm sure you could probably adapt the solution to use StringBuilder if you really had to, although it probably wouldn't be as elegant..

A: It looks like you want to use a recursive method, something like:
string GetChildren(Parameter param, string indent)
{
    StringBuilder sb = new StringBuilder();
    if (HasChildren(param))
    {
        sb.AppendFormat("{0}<{1}>{2}", indent, param.Name, Environment.NewLine);
        foreach (Parameter child in parameters.Where(p => p.ParentType == param.Type))
        {
            sb.Append(GetChildren(child, indent + "   "));
        }
        sb.AppendFormat("{0}</{1}>{2}", indent, param.Name, Environment.NewLine);
    }
    else
    {
        sb.AppendFormat("{0}<{1}>{2}</{1}>{3}", indent, param.Name, param.Type, Environment.NewLine);
    }
    return sb.ToString();
}

The method that looks to see whether a Parameter has child nodes would look like:
bool HasChildren(Parameter param)
{
    return parameters.Any(p => p.ParentType == param.Type);
}

The collection parameters could be defined as an IEnumerable<Parameter> and could be implemented using a List<Parameter>.


text:
Q: What is the plural of "who"? I can use "Who are you?" when talking to one person.
But what can I use if I'm talking to a group of people?

A: It is the same in the plural:

Who is your best friend?
  Who are your best friends?

Who are you? (to one person)
  Who are you? (to more than one person) or
  Who are you all?

A: "Who" can be made plural the usual way, but that is not what is needed here

The "Whos" And "Wheres" Of iOS Device Usage ExplainedSource: TechCrunch headline

This is a plural in the sense that it refers to multiple mentions of (or answers to) the question "who?".

"Who" does not have a plural form like the way that "is" changes to "are" Generally speaking, the word "who" is a pronoun. It stands in for the mention of a person or people, but has no power to determine in and of itself how many people the speaker is talking about.

"You" does not have a plural form either, but can refer to multiple people The word "you" in your sentence does not have to change in order to refer to multiple people. To make the reference more clear, you can add "two" or "all" as in "you two" or "you all" (or, regionally, "y'all").

If you want to ask about the identity of multiple people, convey this with other words

*
*"all" after "who"Person A: We will need four more chairs set at the dinner table tonight.Person B: Who all will be joining us?This construction is informal and mainly AmE."all" after "you"Group A: Trick or treat!Person B: Who are you all supposed to be?As indicated above, the contraction "y'all" is employed this way in some regions.
*"people"Group A: Surprise! You win this prize for being the 100th person to cross this new bridge!Person B: Who are you people?This construction may be considered brusque.
*"they"Person A: You've never heard of the Kardashians?Person B: No, who are they?"They" is usually third person plural but can also be third person singular.

A: "who" has only one form, but it can refer to plural nouns: Who were the Etruscans? Who are all those people waiting outside?

A: There is at least one other common possibility that I do not see listed:
Who are all of you?
with "all of you" being synonymous with "you all."
Another example: Where are all of you going to eat?

A: In short:
There is no plural form for "Wh" questions. They are the same thing whether is singular or plural.
Examples:

Singular: "who are you?"
Plural: "Who are you"?

In this case, people should understand you according to your lookout and  body language.

A: It's just like "What" "HOW", they are not nouns.
Singleton or plural form only apply to nouns


text:
Q: Prove that a function is zero. Let $f$ be a continuous function on $[a,b]$ such that
$$\displaystyle \int_a^b f(x) x^n dx = 0$$
for all $n=0,1,2,\ldots$. So I want to show that $f=0$.
Then I was triying to prove that $\forall \epsilon>0 |f(x)|<\epsilon$ but the thing is that I can only ensure that
$$|\displaystyle \int_a^b f(x) x^n dx |< \epsilon$$
so I don't get any relationship between $f$ and $\epsilon$ doing that, then I thought that the Weirstrass theorem could help here since we have polynomials, but I don't know how to apply it, I was wondering to show that
$$\displaystyle \int_a^b f^2dx = 0$$
or some relation of that sort using Weierstrass, but I don't know how, and another thing that I had in mind is that Is it possible to give a non trivial example of a continuous function $f:[0,1]\to\mathbb{R}$ such that
$$\displaystyle \int_0^1 f(x)dx = \int_0^1 f(x) x dx = \int_0^1 f(x)x^2dx = 0.?$$
Then, Can someone help me with my questions please?
Thanks a lot in advance.

A: The condition implies $\int f . P=0$ for every polynomial. Take a sequence $P_n$ of polynomials converging uniformly to $f$. Then,
$$\int f^2= \int f.f= \lim \int f.P_n=\lim 0=0.$$
For your second question... instead of giving an example, I will give a lot at once:
$$\langle \cdot ,\cdot \rangle:C([0,1], \mathbb{R}) \times C([0,1], \mathbb{R})  \rightarrow \mathbb{R}$$
$$ f, g \mapsto \int fg $$
is an inner product. $C([0,1], \mathbb{R})$ is obviously infinite dimensional. Take any function in $(x)^\perp \cap (x^2)^{\perp} $. (This justifies why Legendre Polynomials (as suggested by Sangchul) are a good idea to search for an explicit example.)

A: For nontrivial $f$ such that $\int_0^1 f(x) x^k\; dx = 0$ for $k = 0, 1, 2$, try e.g. $f$ of the form $a_0 + a_1 x + a_2 x^2  + a_3 x^3$.  In this $4$-dimensional pace, there should be a $1$-dimensional subspace satisfying your constraints.


text:
Q: WCF method sending POST instead of GET I'm trying to create a WCF client that accesses a REST API. The API requires that a GET be used for a certain call, so I'm using the [WebGet] attribute for the method. However when I call the method, the actual call that is produced is a POST (viewed by using Fiddler). My contract is as below:
[OperationContract]
[WebGet(UriTemplate = "/statuses/public_timeline.json",
BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Json,
ResponseFormat = WebMessageFormat.Json)]
List<Status> PublicTimeline();

I've also tried using [WebInvoke] with a method of GET but with no success.

A: I was using a WCF service to do some work and then call another WCF service. It was the second service that had the issue mentioned above. The problem turned out to be how the first service was implemented.
Solution is here: http://social.msdn.microsoft.com/Forums/en-US/wcf/thread/03a2b109-c400-49d4-891e-03871ae0d083/#416d8cbc-b855-46aa-8a6d-5d6b09db97b6


text:
Q: input foreach is not a function The below is returning 'input for each is not a function' in the console, and I cannot figure out why. No syntax issues are being reported.
let inputs = {"cooluser":{"userAchkData":[{"id":"slz1","checked":false},{"id":"slz2","checked":false},{"id":"slz3","checked":false},{"id":"slz4","checked":false},{"id":"slz5","checked":false},{"id":"slz6","checked":false},{"id":"slz7","checked":false},{"id":"slz8","checked":false},{"id":"slz9","checked":false},{"id":"slz10","checked":false},{"id":"slz11","checked":false},{"id":"slz12","checked":false},{"id":"slz13","checked":false},{"id":"slz14","checked":true},{"id":"slz15","checked":false},{"id":"slz16","checked":false},{"id":"slz17","checked":false},{"id":"slz18","checked":false},{"id":"slz19","checked":false},{"id":"slz20","checked":false},{"id":"slz21","checked":false},{"id":"slz22","checked":false},{"id":"slz23","checked":false},{"id":"slz24","checked":false},{"id":"slz25","checked":false},{"id":"slz26","checked":false},{"id":"slz27","checked":false},{"id":"slz28","checked":false},{"id":"slz29","checked":false},{"id":"slz30","checked":false}]}}

                    inputs.forEach(function (input) {
                        if (input.id == 'slz14' && input.checked) {
                            console.log("blahblah");
                            console.log(input.id + " " + input.checked);
                            var inputslz14 = document.getElementById(input.id);
                            inputslz14.id.click();

                        }
                    });

A: you should be repeating its children like below. You can't access id by repeating your inputs, go deeper to userAchkData

let inputs = {
  "cooluser": {
    "userAchkData": [{
      "id": "slz1",
      "checked": false
    }, {
      "id": "slz2",
      "checked": false
    }, {
      "id": "slz3",
      "checked": false
    }, {
      "id": "slz4",
      "checked": false
    }, {
      "id": "slz5",
      "checked": false
    }, {
      "id": "slz6",
      "checked": false
    }, {
      "id": "slz7",
      "checked": false
    }, {
      "id": "slz8",
      "checked": false
    }, {
      "id": "slz9",
      "checked": false
    }, {
      "id": "slz10",
      "checked": false
    }, {
      "id": "slz11",
      "checked": false
    }, {
      "id": "slz12",
      "checked": false
    }, {
      "id": "slz13",
      "checked": false
    }, {
      "id": "slz14",
      "checked": true
    }, {
      "id": "slz15",
      "checked": false
    }, {
      "id": "slz16",
      "checked": false
    }, {
      "id": "slz17",
      "checked": false
    }, {
      "id": "slz18",
      "checked": false
    }, {
      "id": "slz19",
      "checked": false
    }, {
      "id": "slz20",
      "checked": false
    }, {
      "id": "slz21",
      "checked": false
    }, {
      "id": "slz22",
      "checked": false
    }, {
      "id": "slz23",
      "checked": false
    }, {
      "id": "slz24",
      "checked": false
    }, {
      "id": "slz25",
      "checked": false
    }, {
      "id": "slz26",
      "checked": false
    }, {
      "id": "slz27",
      "checked": false
    }, {
      "id": "slz28",
      "checked": false
    }, {
      "id": "slz29",
      "checked": false
    }, {
      "id": "slz30",
      "checked": false
    }]
  }
}

inputs.cooluser.userAchkData.forEach(function(input) {
  if (input.id == 'slz14' && input.checked) {
    console.log("blahblah");
    console.log(input.id + " " + input.checked);
    var inputslz14 = document.getElementById(input.id);
    inputslz14.id.click();

  }
});

A: The inputs is basically a object and object doesn't have forEach. It exists of Array.prototype. Seems that you want to iterate which is nested two levels down in the object.
inputs.cooluser.userAchkData.forEach(function(input) {
  ...
});


text:
Q: xamarin.forms maps hide zoom buttons (+-) I want to hide the +- zoom buttons in xamarin.forms but keep the zooming capability
The property HasZoomEnabled removes the buttons but also disable the zooming capability
is there any solution without rendering ?
if not i will be happy to get a solution with rendering in android

A: Some things have may changed since 2016, so here is an up to date solution for this (At 2020/Jan):
You will need to Create a CustomRenderer as mentioned in the comments, and override the following method "OnMapReady" like this:
    protected override void OnMapReady(GoogleMap map)
    {
        base.OnMapReady(map);
        map.UiSettings.ZoomControlsEnabled = false;
        map.UiSettings.MyLocationButtonEnabled = false;
    }

A: Create your custom control using a custom renderer
So in your pcl project add
public class CustomMap : Map
    {
        public CustomMap(MapSpan region) : base(region)
        {
        }
    }

In your android project add
[assembly: ExportRenderer(typeof(CustomMap), typeof(CustomMapRenderer))]

namespace MobApp.Droid.Renderers
{
    public class CustomMapRenderer : MapRenderer
    {
        protected override void OnElementPropertyChanged(object sender, PropertyChangedEventArgs e)
        {
            base.OnElementPropertyChanged(sender, e);

            var map = ((MapView)Control).Map;
            map.UiSettings.ZoomControlsEnabled = false;
            map.UiSettings.MyLocationButtonEnabled = false;
            map.UiSettings.RotateGesturesEnabled = false;
        }
    }
}

and use it like this
var map = new CustomMap(
                MapSpan.FromCenterAndRadius(
                    new Position(37.990599, 23.766820), Distance.FromKilometers(1)))

            {
                IsShowingUser = true,
                HeightRequest = 100,
                WidthRequest = 960,
                VerticalOptions = LayoutOptions.FillAndExpand
            };


text:
Q: Access the value of a variable, from a different script, using a string (C#) I have a class called Receive and it has a variable public int head=10 for example.
In a different class called Mover I will set a new variable private Receive bodypart.
What I want is to take the value of head of bodypart without using the command bodypart.head but with a string, for example:
string bodyname = "head";

int v = bodypart.bodyname;

I know that this doesn't work and why but I can't find another method. I already look for reflection but didn't get it and don't know if it's the best for this.

A: Reflection will do the task in a way like that
  using System.Reflection;
  ...

  public class Receive {
    // using public fields is a bad practice
    // let "Head" be a property
    public int Head {
      get;
      set;
    }

    // Bad practice
    public int UglyHead = 5;

    public Receive() {
      Head = 10;
    }
  }

  ...

  string bodyname = "Head";

  Receive bodyPart = new Receive();
  // Property reading
  int v = (int) (bodyPart.GetType().GetProperty(bodyname).GetValue(bodyPart));
  // Field reading
  int v2 = (int) (bodyPart.GetType().GetField("UglyHead").GetValue(bodyPart));

A: It looks like you can use Dictionary collection here. For example:
// Receieve class inherits Dictionary. Use <string, object> if your values
// are of different types
class Receive : Dictionary<string, int> {}

class Mover
{
   private Receive bodypart;

   // assigns value to bodypart field
   public Mover(Receive bodypart)
   {
       this.bodypart = bodypart;
   }

   // get element from bodypart using string argument
   public int GetBodyPart(string name)
   {
       return bodypart[name];
   }
}

class Class26
{
    static void Main()
    {
        // instantiates collection
        Receive res = new Receive();

        // add elements to collection
        res.Add("head", 5);

        // instantiates Mover and pass collection as parameter to ctor
        Mover m = new Mover(res);

        // takes one element from collection
        int a = m.GetBodyPart("head");

        Console.WriteLine(a);
    }
}

Output : 5