Should we have tags for individual languages?

Question: We seem to be acquiring tags for many individual languages. While I accept it may be useful to have tags for a few highly significant languages I'm not sure we need a tag for every language.
Answer: You're right, we don't need all of them. They're around 6000 languages so... :P
Luckily the method of tag creation helps us: you can create tags only by posting questions so the system already controls what tags can be there and which ones are not needed.
A good rule of thumb to avoid thousands of tags with many dupes is to choose an existing tag and if a new one is required, it should be not too broad and not too narrow so that it can cover a reasonable range of notions.
Comment: Thanks, that's reasonable; but tags are being created for individual languages, should we reject them as a matter of policy? Should we allow tags for a few particularly important languages? (and, should I add these questions to my original question?)
Comment: @GastonÜmlaut Let me answer in order: There already are language tags and I don't think they're harmful at the moment. If we start to gain traction and get many many then we can re-think it and only allow families but it's really a remote thing. Important languages... how do we decide that? It's necessarily going to bother someone so use tags for the languages treated in the question and if we ever get a problem in the future, we'll see. :D About your last question: Yeah, this way someone else could address those when answering here. :)
Comment: Ok, just counted: at the moment we have 36 tags for individual languages.
Comment: Why not have a tag for "specific language"?    Any further specification can appear in the question itself.
Comment: @JamesGrossmann You mean get rid of all "language" tags? That would not be in our favor either, since tags are meant to be used also to classify questions and to "search" through these classifications. If you remove that you won't be able to search effectively for a certain language. I say, let's keep the most commonly asked languages and so on: the system will do this by itself. :)
Comment: @Alenanno:  Then it's hard to see a way out of having a tag for each specific language discussed, e.g. for English, German, Basque, Ainu, Mandarin, and so on.   Would this present any difficulties?
Comment: @JamesGrossmann Right now, we don't have any. Should too many tags be created then we might have a problem. Do you think we should just use tags like "Romance-languages" and then specify in the question if it's Italian or Spanish or French etc?


Do burst powers affect the square you occupy?

Question: I have a tiny creature occupying the same square as an enemy medium sized opponent. If I use a power with close blast targeting, would it affect the enemy in my square?
Comment: Do you mean burst (expands outward to all squares that are distance n or less from all squares you occupy) or blast (hits an n-by-n area adjacent to a square you occupy)?
Comment: At least it will be easy to pick an answer regardless.  There's a good answer for each below.
Comment: Please specify blast or burst. They are quite different.
Answer: No, a close blast power would not affect enemies in the same square as your tiny creature.
From the DDI definition of Blast (emphasis mine):

A blast fills an area adjacent to you that is a specified number of squares on a side.
The blast must be adjacent to its origin square, which is a square in your space. The origin square is not affected by the blast.

Close attacks come from the caster's square.

A close burst uses your space as its origin square. A close blast uses a square within your space as its origin square.

Despite what might sound logical, there is no smaller grid used in D&D4e than 5x5
Origin Square

The square where an effect originates.

Square

A 1-inch square on the battle grid, which is equivalent to a 5-foot square in the game world.
Comment: @Rob - there are enough other issues with 4e that I've learned not to try to justify anything based on "realism".  Justifying it by the rules-as-written is good enough for me.  Tiny critters are definitely an edge case and the rules seem a bit fugly concerning them at least as to what would be realistic to me :)
Comment: I suppose you could justify the "no smaller grid than 5x5" by saying that burst magic spells are designed to start blasting out 2 1/2 from the centrepoint (the caster) so that stray arms, legs, hats etc aren't caught in the blast...
Comment: This could also be used to the tiny creature's advantage. They could enter a square with an ally and close blast the enemies nearby without harming the ally in their square
Comment: @lunin - good option there!
Answer: Close burst powers do affect the square you occupy. They do not effect you unless they specifically says that they do (IE a leader's healing power always specifies).
Area burst powers are ranged, so if you center it on your self (or include yourself in the burst) it will target your square.
Comment: Is there a specific place where this lists this?  Because I can see how it's interpreted to mean that.  However, I think the point of the close burst is to not target the caster when making the attack.  Meaning you could, theoretically, target tiny in your square.  At least it makes sense to me in that context.
Comment: @CrystalBlue some more research does seem to indicate that a close burst would affect your square, just not the caster.
Comment: @CrystalBlue from the compendium entry for burst (http://www.wizards.com/dndinsider/compendium/glossary.aspx?id=126) : "A burst starts in an origin square and extends..." and "Unless a power description notes otherwise, a close burst you create does not affect you. However, an area burst you create does affect you."


Visa Requirement - At least 2 spread blank visa pages

Question: I have recently come across the Passport Requirement at the Consulate of Japan in Sydney's website asking for at least 2 spread blank visa pages. I am a bit confused with this as i do have several empty pages in my Passport but i am not having 2 spread (consecutive) blank visa pages. Does anyone have experience with this?
Comment: It is a common requirement with stick visas, usually put into odd page (and immigration stamps on left page, but thing will get messier). I assume if they cancel your visa, they need some space near the original visa) You may need to get a new passport.
Comment: Giacomo Catenazzi ... i have travelled more than 30 countries over the past 10 years and the maximum i came across is a requirement of more than one blank page. This sounds really strange that the Consulate requires 2 spread blank pages. In fact, i checked the Embassy's and other Japanese Consulate websites and couldn't find such a requirement ... this is particular to Sydney Consulate.

Finally, its still 3 years to my Passport Expiry and it becomes really difficult to explain to the authorities for a renewal when a number of single pages are still left in Passport.
Comment: Ok. Russia requires two page, but not spread.
Answer: While indeed this is not something other Japan consulates require, alas there is extremely little you can do. You might want to talk to them and ask politely but they might have their own reason, some machine they use, for example.
Let me note this is a very common requirement for other countries as well. For example, this Tripadvisor thread mentions it for a UK visa. This blog post says

Additionally, several countries require at least two blank pages in order to get a visa. For example, South Africa requires Americans who are staying beyond 90 days to obtain a visa, and the passport's two blank pages must be adjacent. China will issue a six-month visa to a passport with any two blank pages, but in order to receive a 10-year visa, the pages need to be consecutive.

Making Your Passport Last Longer When Running Short Of Pages recommends Post It notes to save double blank pages:

However, if you notice your passport is starting to fill up, grab those sticky notes, write a short and polite message, and stick them in your passport.
I've been travelling with these in my passport for over a year now to preserve my last remaining 'double blank' page, and all the passport officers I've encountered have been most obliging.
Some smile, some laugh and some say nothing at all, but whatever their approach, the interaction has always finished with their stamp being placed somewhere other than those valuable blank pages: typically near other stamps to maximise space, which I always appreciate.
Just one tip: don't physically write on your passport visa pages (even in pencil), because doing so could render your passport defaced and invalid

The image shows a double blank page with one post it notes on each page, the left one says "Please kindly stamp on any other page. Saving space for one visa." and an arrow to the left and an arrow to the right and then the other page has "space for visa" with the same arrows.


Getting weird values for a statistical test in python

Question: I'm trying to perform a Mann-Kendall Test of some data. I'm using the code in the following link (https://github.com/mps9506/Mann-Kendall-Trend/blob/master/mk_test.py) modified a little bit bellow for the result to be in an array and it only gives back a p-value (p) and a tau value (z).
def mk_test(x, alpha=0.05):
    """
    This function is derived from code originally posted by Sat Kumar Tomer
    (email@example.com)
    See also: http://vsp.pnnl.gov/help/Vsample/Design_Trend_Mann_Kendall.htm
    The purpose of the Mann-Kendall (MK) test (Mann 1945, Kendall 1975, Gilbert
    1987) is to statistically assess if there is a monotonic upward or downward
    trend of the variable of interest over time. A monotonic upward (downward)
    trend means that the variable consistently increases (decreases) through
    time, but the trend may or may not be linear. The MK test can be used in
    place of a parametric linear regression analysis, which can be used to test
    if the slope of the estimated linear regression line is different from
    zero. The regression analysis requires that the residuals from the fitted
    regression line be normally distributed; an assumption not required by the
    MK test, that is, the MK test is a non-parametric (distribution-free) test.
    Hirsch, Slack and Smith (1982, page 107) indicate that the MK test is best
    viewed as an exploratory analysis and is most appropriately used to
    identify stations where changes are significant or of large magnitude and
    to quantify these findings.
    Input:
        x:   a vector of data
        alpha: significance level (0.05 default)
    Output:
        trend: tells the trend (increasing, decreasing or no trend)
        h: True (if trend is present) or False (if trend is absence)
        p: p value of the significance test
        z: normalized test statistics`

    Examples
    --------
      >>> x = np.random.rand(100)
      >>> trend,h,p,z = mk_test(x,0.05)
    """
    n = len(x)

    # calculate S
    s = 0
    for k in range(n-1):
        for j in range(k+1, n):
            s += np.sign(x[j] - x[k])

    # calculate the unique data
    unique_x = np.unique(x)
    g = len(unique_x)

    # calculate the var(s)
    if n == g:  # there is no tie
        var_s = (n*(n-1)*(2*n+5))/18
    else:  # there are some ties in data
        tp = np.zeros(unique_x.shape)
        for i in range(len(unique_x)):
            tp[i] = sum(x == unique_x[i])
        var_s = (n*(n-1)*(2*n+5) - np.sum(tp*(tp-1)*(2*tp+5)))/18

    if s > 0:
        z = (s - 1)/np.sqrt(var_s)
        #result = (s - 1)/np.sqrt(var_s)
    elif s == 0:
         z = 0
        #result = 0
    elif s < 0:
        z = (s + 1)/np.sqrt(var_s)
        #result = (s + 1)/np.sqrt(var_s)

    # calculate the p_value
    p = 2*(1-norm.cdf(abs(z)))  # two tail test
    result= np.append(p,z)
    h = abs(z) > norm.ppf(1-alpha/2)

    return np.array(result)

I am then using the following code to perform the test.
out = np.empty((0))
for i in range(145):
    for j in range(192):
        out1 = mk_test(yrmax[:,i,j], alpha=0.05)
        out = np.append(out, out1, axis=0)

I think something is going wrong somewhere while performing the test because I would expect to get z values between -1 and 1, but I'm getting back some values that are greater than 1. Is the coding going wrong or am I misunderstanding what z is and it's not actually tau and hence why I'm getting values I'm not expecting?
Comment: If this question is about the calcuation/implementation of your statistic, you might have better luck at https://stats.stackexchange.com/
Comment: I wasn't sure if it was something going wrong with the coding or not. I'll post it there too, thanks!
Answer: This ended up being a statistical issue, but on stackexchange I was offered a solution to modify this code in order to get Kendall-Tau values instead of z-values. They also explain what a z-value and as long as this question is here I'll provide the link for anyone that makes a similar mistake.
https://stats.stackexchange.com/questions/311061/getting-weird-values-for-a-statistical-test-in-python


Is there a proof that the distance from $0$ to $i$ in the complex plane is $1$?

Question: I was just wondering how did people know that the distance between $0$ and $i$ is $1$ in the complex plane, did they just assume this, is it just an axiom, or is there a proof behind it or a reason for it?
Comment: I suppose it's just a convention to put $i$ at a distance $1$ from the origin in the complex plane; but it's nice to have $|zw|=|z||w|$ where $|z|$ denotes the distance from $z$ to the origin, don't you think?
Comment: In some sense, I think the ordinate of a point $z$ at complex plane is exactly its imaginary part, by definition $b\in\mathbb{R}$ such that $z=a+bi$ ($a\in\mathbb{R}$ as well). I understand the answers below, by in some sense I thinks it's a definition (maybe some answer are ciclic). I'd like to receive answer to this comment... I'm curious now. Thanks.
Comment: How did people know that the distance between $0$ and $1$ is $1$ in the complex plane? Same thing.
Comment: How did we know that the distance from $(0,1)$ to $(0,0)$ = $1$?
Comment: @LordSharktheUnknown I think that is the heart of it. As a real vector space the complex numbers can be regarded as an affine system, and one can create a metric using any pair of basis vectors as units. But if you want the metric to be compatible with multiplication of complex numbers then there is only one choice.
Answer: We define the distance between $x$ and $y$ in the complex plane as being $||x-y||$ where if $||a+bi||^2 = a^2+b^2$. Substitution gives that the distance between $i$ and $0$ is $||i-0||=||i||=1^2=1$. However, this doesn't really explain why this is true. However, if you are familiar with vectors the formula $||x-y||$ should look familiar. In fact, this is just the same distance formula we use in the plane. So what happened is that we decided that the distance between $a+bi$ and $c+di$ should be the same as the distance between $(a,b)$ and $(c,d)$. In some sense, this is the more fundamental assumption about what we mean by distance in the complex plane, and then the fact that the distance from $0$ to $i$ is $1$ follows from that.
Comment: The first four words cannot be overemphasized
Comment: so there isn't really a proof? just an axiom?
Comment: @MohannadEl-Nesr. There is no proof of the definition, but given the definition, there is the proof outlined above (ie. the distance between $i$ and $0$ is $||i||=1^2=1$)
Answer: Note that $i=(0,1)$ and the origin is $(0,0)$
According to the distance formula we get $d= \sqrt {0^2+1^2} =1$
Comment: +1 What are we missing? This seems trivial. We knew because we defined the complex numbers.
Comment: @JohnDouma exactly, it's "defined" but I am searching for a proof, obviously it's just convention from the answers I've been seeing but really stating the distance formula doesn't help.
Answer: This is, as mentioned by others, a matter of definition, but there is a reason to believe that the definition is correct.
Given a real polynomial $p(x)=(x-a_1)\cdots(x-a_n)$ with the $a_i$ real, then, when $a$ is a real number such that $p(a)\neq 0,$ the radius of convergence of the Taylor series of $1/p(x)$ at $x=a$ is $\min_i |a-a_i|.$
We can also show[*] that the Taylor series for the real function  $f(x)=\frac1{1+x^2}$ at $x=a$ has interval of convergence with radius equal to $\sqrt{1+a^2}.$
This gives the impression that, if there there are roots of $x^2+1,$ they must be a distance $1$ from $0$ in a direction perpendicular to the real line.
So, even before we have the complex numbers, we know roughly "where" we'd want the root(s) to $x^2+1$ to exist, if they exist.

[*] It is a tedious argument if kept in the reals, but it can be done.
Answer: The distance between two complex numbers $z$ and $z'$ is the module of the difference $|z-z'|$. In particular, the distance to $0$ is the module.
Now $|z|^2=z\bar z$, so $|i|^2=i(-i)=1$, hence $|i|=\sqrt 1$.
Answer: $\mathbb{C}=\{x+iy:x,y\in\mathbb{R}\}$ where $i$ is a root of the equation $z^2+1=0$. A metric $d:\mathbb{C}\times\mathbb{C}\rightarrow \mathbb{R}_{\geq 0}$ is defined by $d((x_1+iy_1),(x_2+iy_2))=\sqrt{(x_1-x_2)^2+(y_1-y_2)^2}$ for $x_j,y_j\in\mathbb{R},j=1,2.$ This metric is called the natural distance in $\mathbb{C}$ because of its similarity with the distance in $\mathbb{R}^2.$ Now by this definition, distance between $0$ and $i$ is $d((0+0i),(0+1i))=\sqrt{0+1}=1.$
Comment: Thanks! That was a typo. Edited now.
Comment: You also have $x_2$ and $y_1$ swapped.
Answer: We simply have by definition
$$|i|=\sqrt{1^2}=1$$

(credit Wikipedia)


How to move folders with similar names

Question: i would like to know how to much a bunch of folders with similar names to different folders.
e.g
(01/15)Mom
(01/15)Dad
(02/15)Dad
(01/15)Brother
(03/15)Son
So what i want to accomplish is Parent folder (01/15) - sub folders (01/15)Mom, (01/15)Dad and so on and so forth. In other words i want to group by whats in the brackets.  So what i want due is generate a date folder to move the pictures folder its matched dated  group. Theirs alot of folders so i cant do it manually.
Comment: Maybe this will help as a starter:
http://pastebin.com/tAsueJzc
Comment: thx helped alot jst can't upvote ur reply cause it a comment tho
Answer: Sounds like you may have multiple issues here. Do your photos have meta data?
How are you originally grouping the photos into Mum, Dad etc - forgetting the date for now.
Are they already grouped into their user name?  Or are all the files in one directory with just the date of when the file was created in the filename?
You can do searches in Windows (I assume its windows?) and order the photos by date and other meta data like tags etc - these filters are all in the windows search function - depending on how the pics are created you may be able to simply set a filter in search, and move them all in one go.
I do this almost daily with photos, all my family and I take a ton every day and its always me that ends up having to sort and back them all up!
Comment: ya i could do that jst that there are alot of files and each has a date and location of where they were taken.
Answer: In the top level directory create the file sort.vbs and add the following text:
set objFSO = CreateObject("Scripting.FileSystemObject")
set objFolder = objFSO.GetFolder(".")
set colSubfolders = objFolder.Subfolders

strStartChar = "("
strEndChar   = ")"

for each objSubfolder in colSubfolders
    strNameOfFolder = objSubfolder.Name

    if instr(strNameOfFolder, strStartChar) > 0 then

        intStartCharacter = instr(strNameOfFolder,strStartChar) +1
        intEndCharacter   = instr(strNameOfFolder,strEndChar)
        intLength         = intEndCharacter - intStartCharacter
        strNewFolderName  = mid(strNameOfFolder, intStartCharacter, intLength )

        wscript.echo "Processing: " & strNameOfFolder & ", extracted text for new folder: " & strNewFolderName

        if not objFSO.FolderExists(strNewFolderName) then
            objFSO.CreateFolder strNewFolderName
        end if

        if objFSO.FolderExists(strNewFolderName) then
            set ExistingFolder = objFSO.GetFolder(strNameOfFolder)
            objFSO.MoveFolder ExistingFolder.name, strNewFolderName & "\"
        end if

    else
        wscript.echo strNameOfFolder & " not for processing.  No " & strStartChar & " character in directory."
    end if

next

Then open a command prompt in the same directory and run:
cscript.exe sort.vbs.

As you can see it takes the string between the ( and the ) to form the new directory and move the contents of the original directory to it.
Note: There is little error checking and it makes a few assumptions about the directory name.

How to move folders with similar names


programming spare key on 2003 ford ranger edge

Question: i have a 2003 ford ranger edge 3.0 .i tried to program a spare key using the 2 existing keys in the vehicle without success..i followed the instructions via you tube put the first key in turned the ignition on until the lights went out  did the second key the same way then put the new or spare key in the lights went out waited a minute then tried the new spare key and it didn't work..any help on this would be appreciated
Comment: I suggest that you check the workshop manual for the correct procedure : I would not rate y**tube as a reliable resource. I can tell you that the procedure for my car (Ford stable 2005) is completely different and more challenging.
Answer: This is what I have found so far.
Other than the instructions below you will need a super star new generation tester to get it programmed.


What is wrong with this homemade modes chart?

Question: What may you see right or wrong with this homemade modes chart? This chart is supposedly read vertically. There are definitely some parts I don't understand I'm just wondering about if it's Accuracy.
Comment: The question is what you see right or wrong with the chart?
Comment: Actually, if I ask someone, what does "C Lydian" mean ... if they explain "play C major and D major, and C major is home", it means they've actually understood something about modes. But if they start explaining about scales and "starting from the Nth degree of such and such scale", then most likely they were just forced to recite these theoretic definitions to pass a theory exam, and in practice they don't have any idea of the whole thing.
Comment: There are 2 ways that helped me understand modes much better than "start the C major scale on a D". One is by looking at the chords (D dorian gives you a minor I chord and a major IV chord) and the other one is the scale-chord combination (the Dorian sound is the sound of a Cmajor scale played over a Dm chord).
Comment: Did you make the chart? If not, do you know where the things come from and what they represent? I think a chart like that is one of those things where the act of creating the chart is what makes you learn, but if even after making the chart you feel a need to look up things from it, it's a sign that you didn't actually learn, and you should re-make the chart from scratch. Like a chart for addition, "2 + 2 = 4", "2 + 3 = 5", "3 + 3 = 6" etc. if you need to look up addition results from a chart, it's time to study more.
Comment: If you need to use such a chart, it's not good in the long run. However, the content of the chart seems nice, IMO it's a great thing to represent modes as a combination of chords instead as a scale or sequence of notes. "Cmaj7 / Fmaj7" is ok for C ionian, though "Cmaj7 / Dm7" or "Cmaj7 / F6" or "Cmaj7 / Dm6" etc would cover the whole scale. Cmaj7 / Fmaj7 leaves out the D note, though it's not so relevant for defining the mood.
Comment: @piiperiReinstateMonica - I thought I understood modes, till I read your last comment. Now I'm not so sure!
Answer: Interesting chart! Let's see what it shows and what it doesn't.
It shows a few characterstics of each mode:

The 1st column summarizes specific intervals to each mode (ie: augmented 4th for Lydian, major 6th for Dorian).
Each "cell" shows 2 chords/mode (generally the I and IV chord, but it varies according to the mode, showing the most identifying ones)

It doesn't show

All the chords in a given mode (only 2 each)
All the intervals in a given mode (only a few characteristic ones)
Any modes with an altered fundamental (Bb, Eb, F#, etc.)
The relative modes (ie D Dorian = C Ionian)

What's inconsistent?

The way in which some intervals are named (-7 for a minor seventh vs b6 for a minor 6th).
Some characteristic notes are written twice (ie b5 for Locrian)
F is written as "Fa" at least once, and G as "Sol"... looks like the Spanish notation

I don't see anything wrong with the chart (but I must admit I didn't go through each and every cell). As @piperii said in their comment, creating the chart yourself might be of more worth, as a learning exercise, than looking it up.
Comment: Did you write it yourself? What was your intention when you wrote it?
Comment: Is there a mode that's not adequately defined by two chords, and you need three or more? I think a pair of chords is an _excellent_ way to tell what it's about.
Comment: With 2 tetrad chords you can define a mode (some notes may not be covered, but there might be no choice left!), but what I meant is that it's not a handy reference that will let you know whether the iii chord of the phrygian mode is minor and whether the 7th is minor or major.
Answer: Aside from the misspellings of the modes (they end in "an" not "en") the information seems pretty accurate. I don't know your reasoning for the chords on the lower half of each box, some are the 4th, some the 5th, 6th, 2nd, what purpose do they serve? Mkorman mentioned they are characteristic of the modes, maybe that it your reason for including them.
My main problem is the usefulness of such a chart. You have the I chord of the 7 modes in only 7 of 12 keys. Are you wanting to learn diatonic modal harmony? If so I would suggest an approach like this example:
DORIAN
Im7 IIm7 bIIImaj7 IV7 Vm7 VIm7b5 bVIImaj7
PHRYGIAN
Im7 bIIMAJ7 bIII7 IVm7 Vm7b5 bVImaj7 bVIIm7 etc.
You can but don't need to write out all the chords for each mode in each key (it's a lot of work), just use the interval relationships to learn how to play them on your instrument.
If you just want to learn the mode scales forget the chords and charts and learn the scales by intervals the same way, 2 examples:
DORIAN 1 2 b3 4 5 6 b7
MIXOLYDIAN 1 2 3 4 5 6 b7 etc.
I find it is much more important to learn intervallic relationships than just memorizing specific notes and chords because that way you can figure anything out in any key.
Feel free to comment with your goals and intentions.


Committing an interactive container in docker

Question: I am trying to install the vim editor on bash in the centOS container in docker. However, as soon as I am exiting the container, I am losing my progress. Is there a way where I can commit the container after I am done with downloading the editor?
This is what I am doing:
user@personal-pc:~/Desktop$ sudo docker run -i -t centos /bin/bash
[root@9c0f428c4907 /]# yum install vim

After the installation is done, the editor works perfectly. However, when I end this running session, and run bash again, then the editor does not exist.
[root@d17ae0e8bf85 /]# vim abc.txt
bash: vim: command not found

How do I go about committing the previous container where the editor was installed?
Answer: when I end this running session
-> so now, you do docker commit 1234 mycontainer , if you start a new interactive session, you lose what you did before
Comment: Thanks. It is working. I tried running another instance of the saved image and the changes were saved.
Answer: commit the container 9c0f428c4907 with a new name.(After installing vim)
Eg: docker commit 9c0f428c4907 centos_viminstalled
Now run this cnetos_viminstalled image in a container
docker run -i -t cnetos_viminstalled /bin/bash
You will be able to see that vim is installed in this new image centos_viminstalled


Multiple "from:" keywords in Outlook advanced search

Question: Re: Desktop client
I've tried this every way I can think of. Scenario: you have an inbox with five emails, each from a different person: personA, personB, ... personE. My goal is to write a search query that excludes people and shows the remaining emails.
I can write positive queries like from:personA OR from:personB, and the query returns a mixed bag of emails from personA and personB.
I've written the converse query NOT (from:personA OR from:personB) and the query returns all emails including personA and personB. I've tried variants like NOT from:personA AND NOT from:personB, NOT from:personA OR NOT from:personB and nothing works.
If I reduce the query to exclude only one person, it works as expected. However, if I try to expand scope to exclude more than one it doesn't returned desired results. What am I missing?
Answer: If you are using the search box above the Inbox switch to Advanced Find.
http://www.oit.uci.edu/exchange/email/using-advanced-find.php
Select the Advanced Tab, filter by From does not contain. Enter any number of names or name fragments separated by a space.

Multiple “from:” keywords in Outlook advanced search


grammatical-number when subject and verb are separated by prepositional phrase

Question: Is the following verb selection correct: "None of the 200 hospital patients was discharged today."
Answer: Both agreements (was/were) are correct in the example given.
It does not matter that a prepositional phrase intervenes. The issue is that none does not have an inherent number specification, since its reference is nonexistent thing(s). Usually you choose depending on the context, as in:

Of all lizards, none spends more time sunning itself than the iguana.
Of all lizards, none spend more time sunning themselves than the various species of iguana.
Comment: See also: http://data.grammarbook.com/blog/singular-vs-plural/none-were-vs-none-was/ – "With words that indicate portions – some, all, none, percent, fraction, part, majority, remainder, and so forth – look at the noun in your of phrase (object of the preposition) to determine whether to use a singular or plural verb."
Answer: The answer to this question about this sentence has nothing to do with whether a prepositional phrase separates the subject and verb, but with whether and when none takes a singular or plural verb. Without the prepositional phrase, the sentence can be either:

(a) None was discharged today.

or

(b) None were discharged today.

It's usually, but not always, a style choice and matter of perception (cf: None of our dancers are as talented as the Russians) at the end of this answer:

If none as a subject refers to something that seems multiple by nature, a speaker will use a plural verb: "None of the guests have arrived yet" feels akin to "people haven't arrived yet." However, if the speaker wants to emphasize "not one," a singular verb tends to be used: "None of the guests has arrived yet! [Dammit!]" Quite often, the underlying concept is what dictates the verb: if I speak for my colleagues and say "Heather, none of us want you to go back to graduate school and leave us" (which she just did), underlying "none of us" is the concept of "we" rather than "not me, nor her, nor him, nor her, etc."

However, not all "experts" agree:

AP STYLE BLOG: "The general rule to follow is that when the noun that follows all or none is singular, you should use a singular verb; when the noun is plural, you should use a plural verb".

and

GRAMMAR BOOK: "Rule: With words that indicate portions–some, all, none, percent, fraction, part, majority, remainder, and so forth –look at the noun in your of phrase (object of the preposition) to determine whether to use a singular or plural verb. If the object of the preposition is singular, use a singular verb. If the object of the preposition is plural, use a plural verb."

and

DICTIONARIES: "None is or none are? When none refers to a singular noun, the answer is easy – is: I needed money immediately, but none was available; None of this meat is worth keeping.
  But when none refers to a plural noun, doubts can arise. This is because the fallacious idea has been implanted in the minds of English speakers that none means 'not one' and therefore, like one, must have a singular verb. It conflicts with the natural tendency of the English language, which is to make the verb agree with the noun to which the pronoun refers – if the noun is plural, then the verb is plural.
       "The result is that in a plural context, both a plural verb: None of my friends were there and a singular verb: None of my friends was there can be used. In general, a plural verb sounds more natural and unaffected, and is to be preferred. It has the particular advantage that an accompanying plural pronoun avoids the sexist 'he' or 'she' and the ponderous 'he or she' in cases where the sex of the referent is unknown or unspecified: None of the directors of the company stand to lose their own money. And sometimes it would simply be ridiculous to insist on the singular – for instance, where none is used in specific comparison with a plural noun: None of our dancers are as talented as the Russians."

This agreement problem is a frequent point of contention in English usage discussions.


How to use ruby win32ole to set Microsoft Exchange proxy settings?

Question: using Outlook to access my work Exchange inbox via a HTTPS proxy used to be very straightforward until my employer changed the principal name I have to use. Mysteriously, in the background, the principal name gets reset to the old value. Now pretty much every time I log in, and often several times in a login session, I have to reconfigure the principal name to the new value in order to use VPN-less Outlook. Reconfiguring the HTTPS proxy principal name requires ten mouse clicks to get to the right text field (Control Panel -> mail, etc), then, once I've changed it, seven further mouse clicks to save it. It really winds me up that my employer can't find a solution to this.
I would love to be able to script this. Does anybody know (a) if it is possible and (b) how to access the Exchange proxy settings via ruby's win32ole? I've googled and googled but nobody else appears to have done this.
Kind regards,
Rob
Answer: through the registry maybe? (win32/registry.rb)


What is a kernel and what sets it apart from other functions

Question: There seem to be many machine learning algorithms that rely on kernel functions. SVMs and NNs to name but two. So what is the definition of a kernel function and what are the requirements for it to be valid?
Comment: I wouldn't say that NNs rely on kernel functions - they rely on a [transfer function](http://en.wikipedia.org/wiki/Artificial_neuron#Types_of_transfer_functions) to achieve nonlinearity, but this is not the same thing as a kernel function
Answer: For x,y on S, certain functions K(x,y) can be expressed as an inner product (in usually a different space). K is often referred to as a kernel or a kernel function. The word kernel is used in different ways throughout mathematics, but this is the most common usage in machine learning.
The kernel trick is a way of mapping observations from a general set S into an inner product space V (equipped with its natural norm), without ever having to compute the mapping explicitly, in the hope that the observations will gain meaningful linear structure in V. This is important in terms of efficiency (computing dot products in a very high dimensional space very quicky) and practicality (we can convert linear ML algorithms to non-linear ML algorithms).
For a function K to be considered a valid kernel it has to satisfy Mercer's conditions. This in practical terms means that we need to ensure the kernel matrix (computing the kernel product of every datapoint you have) will always positive semi-definite. This will ensure that the training objective function is convex, a very important property.
Comment: The part that the objective is convex if the kernel matrix is PSD depends on the objective. This is true for SVMs, but with Gaussian processes the point is that the Kernel matrix is a valid covariance matrix and thus invertible.
Comment: Thanks @carlosdc, but I am afraid that you're trying to teach this old dog, new tricks. A lot of that is way over my head. I read Mercer's conditions, but their meaning in the real world is lost on me. I assume from the above that the integral of a kernel must be constrained to a finite value. Is that assumption correct?
Answer: From Williams, Christopher KI, and Carl Edward Rasmussen. "Gaussian processes for machine learning." the MIT Press 2, no. 3 (2006). Page 80.

kernel = a function of two arguments mapping a pair of inputs $x \in X$, $x' \in X$ into $\mathbb{R}$.

Also, kernel = kernel function.
Kernels used in machine learning algorithms typically satisfied more properties, such as being positive semidefinite.
Answer: Going to try for a less technical explanation.
First, start with the dot product between two vectors. This tells you how "similar" the vectors are. If the vectors represent points in your data set, the dot product tells you if they are similar or not.
But, in some (many) cases, the dot product is not the best metric of similarity. For example:

Maybe points that have low dot products are similar for some other reasons.
You may have data items that are not well represented as points.

So, instead of using the dot product, you use a "kernel" which is just a function that takes two points and gives you a measure of their similarity. I'm not 100% sure of what technical conditions a function must meet to technically be a kernel, but this is the idea.
One very nice thing is that the kernel can help you put your domain knowledge into the problem in the sense that you can say two points are the same because of xyz reason which comes form you knowing about the domain.


How to get python to recognize pip modules

Question: I attempted to import a module that I installed using pip into my gtk code, but once I run it I only get an error "ModuleNotFoundError". It seems that it does not recognize that I even installed the module, Any reason for why this is?
Comment: What command did you use to install module? What version of Python are you using? Add the output of `pip list | grep module` to your question.
Comment: I used Pip3, I am using Python3.8, and it does show up under pip3 list
Comment: Is your code using `pip3` or `pip` to import the module?
Comment: From your description, it sounds like you have multiple versions of Python 3.x.  You mentioned you installed your modules with `pip3`, but did you check that `pip3` is actually using the expected version of Python (3.8) and not a different one?  Please show how you are invoking Python 3 to run your code and also the output of `pip3 -V`.
Answer: You should ensure you use the right package manager to install a module. You cannot install modules for Python 3 using pip and modules for Python 2 using pip3. If you do, the Python interpreter may not recognize that you have installed a module.
To get details about a package that is currently installed you can use the pip show <package> command
If the information was helpful please don't forget to up vote or accept the answer.
Comment: Well I did install them with the correct method (they also only support python3) so I don't think that would be the issue


Can a CAP Form 5 flight evaluation be used as the flight portion of a flight review?

Question: I recently completed successfully a Civil Air Patrol Form 5 flight evaluation.  I was told that the Form 5 satisfied the flight portion of the Flight Review.  If true, which additional seminars do I need to complete?
Comment: You should have asked your CAP CFI do complete the ground portion as well.  Normally they do.
Comment: Welcome to aviation.SE! I reworded your question a little because I *think* you're asking if it's true that your Form 5 is valid for the flight portion of your flight review. If that isn't accurate then you can simply edit again or roll back my change.
Answer: A flight review consists of both a ground portion and a flight portion. You just need a CFI to sign off on the ground training for the flight review.
Alternatively, you could sign up for the FAA Safety Team WINGS program. You get three Flight Activity credits for the above mentioned CAP evaluation. You can earn another three Knowledge Activity credits a number of different ways of your choice. With the three Flight Activity credits and three Knowledge Activity credits, you will complete one phase of the FAASTeam WINGS program. Completing a phase counts as a flight review


varnish: Alter response body

Question: I need to rewrite the response received by the backend in varnish. The C-function is ready, embedded in the configuration file, and passes tests run on response headers. But I need to access the body of the response. I couldn't find a way to extract that from the response struct, though. Does anyone have an idea how I could extract it anyway?
Answer: Wouldn't it be easier to replace the bit of the body you want changed with an ESI tag?
Comment: Maybe he does not own the content? Maybe he is a system admin that has to provide a temporary fix but can't do it with HTML which developers territory and they have a longer SDLC to go through? There are a lot of reasons to do it.

varnish: Alter response body


Least significant bit mips

Question: How can i change least significant bit in a register in Mips?
In another post How to get LSB bit in MIPS? it  saws how to get it but i want to change it.
Comment: (1) Get the LSB using the code at that link. (2) Use the XOR function to flip that bit in the original value.  It looks like that might be called something like `xori`.
Comment: Related: [How to get LSB bit in MIPS?](https://stackoverflow.com/q/2579574) shows copying a bit from one register to another.
Answer: The following one line should do it:
xori $t0, $s0, 1

Explained:
the contents in $s0 contains zeros and ones, while the immediate value has zeros and a one in the LSB. Whenever the LSB is 0, it is xored with 1 and outputs a 1. Whenever it is 1, it is xored with 1 and outputs a 0. The remaining bits will output a 1 if they are 1 and a 0 if they are 0 because they are being xored with 0, thus preserving their state.
Answer: You can use this code:
li $t3,1
xor $t0,$s0,$t3

Comment: why don't just use `xori`?

Least significant bit mips


"This movie format is not supported" error on old iPhones

Question: I've recently upgraded my app to retinal display. The app includes movie files (m4v). In the past week I've received a few emails that say they've received "This movie format is not supported" errors, but I can't seem to track down the common factor, and I can't replicate it.

The original movies were 480x320, the new movies are 960x640.
I believe the same settings were used for both sets of movies: m4v, h2.64
They work fine on my iPod 3G (iOS4.3), iPad 1 (iOS4.3), iPhone 4
They work fine on all simulators down to iOS 3.0.
The first error to come in was on an iPhone 2G, but later I received one from iPod 3 (iOS4.2)

Most people have had no problems, still getting great reviews.
Hypothesis:
I'm thinking it just has to do with low memory on older phones + double size movies, but I can't be sure without testing, and since most people aren't having problems I'm reluctant to downgrade the app.
Anyone else encounter this? Any ideas?
If anyone's got a 2G or early 3G phone I'd be happy to toss out a promo code or two if you'll help me to test this through. Thanks.
-k.
Answer: My iPhone 2g does not play my video encoded with h.264 that works fine on ALL other browsers either. Seems likes it could be the old phone technology as the problem.


Prove that $ f(x) $ has at least two real roots in $ (0,\pi) $

Question: Let $ f $ be a continuous function defined on $ [0,\pi] $. Suppose that

$$ \int_{0}^{\pi}f(x)\sin {x} dx=0,   \int_{0}^{\pi}f(x)\cos {x} dx=0 $$

Prove that $ f(x) $ has at least two real roots in $ (0,\pi) $
Comment: It's worth remarking that the function $f(x)=\sin(3x)$ satisfies the conditions and has exactly 2 roots in $(0,\pi)$, so 2 is the best possible integer in this problem.
Comment: I have the feeling that the Fourier expansion $f(x) = a_0 + \sum_{n\geq 1} (a_n \sin 2n x + b_n \cos 2n x)$ might help, but can't see how exactly.
Comment: @LiorB-S Since $f$ is "just@ continuous you can't be sure that Fourier series of $f$ converges to $f$.
Comment: @Norbert: You are right, but I have no proof for smooth $f$'s either. Moreover it would be nice, I think, to have if a proof using Fourier expansion exists...
Answer: Here is one root:
Let $F(x) = \int_{0}^x f(t) \sin t dt$. Then $F(0)=0$ and $F(\pi)=\int_{0}^\pi f(t)\sin tdt=0$. So by the intermediate value theorem, there exists $0<c<\pi$ such that
$$
0=F'(c) = f(c)\sin c.
$$
But since $\sin c\neq 0$, we get that $f(c)=0$.
Answer: If f has only one real root on $ (0,\pi)$, say $ a \in (0,\pi) $, then define
$ g(x) = f(x) \sin(x-a) = f(x) (\sin(x)\cos(a) - \cos(x)\sin(a))$, then $ g(x) $ is either non-positive or non-negative, not identically zero, and has integral $ 0 $. Contradiction.
Comment: Why is $g(x)$ either non-positive or non-negative?
Comment: Yes, OK -- if $f$ doesn't change sign at $a$, then the $\sin$ integral can't be zero. So $f$ does change sign at $a$, and therefore $f(x)\sin(x-a)$ doesn't.
Comment: @Lev - I think you assume that $f$ changes sign at its root, which doesn't necessarily happen (the function could be tangent to the $x$-axis). However, if $f$ doesn't change sign and is not identically zero, the integral $\int_0^\pi f(x) \sin(x)dx$ would be strictly positive (or strictly negative, if you take $f\leq 0$). This is again a contradiction.
Comment: @TonyK: Note that $\sin (x-a)>0$ for $a<x<\pi$ and $\sin(x-a) <0$ for $0<x<a$.
Comment: @James Fennell: thank you, I missed the case when f does not change sign.
Answer: Since another question has been closed and linked to here, I figure it would be good to make sure there's an answer here that compiles everything nicely.

First, we show that $f$ has at least one root, as in Lior B-S's answer.
Let $F(x) = \int_{0}^x f(t) \sin(t)\, dt$.
Then $F(0)=0$, and by hypothesis $F(\pi)=0$ too.
It follows from the intermediate value theorem that there is some $c \in (0,\pi)$ with
$$0=F'(c) = f(c)\sin c.$$
Because $\sin$ has no zeroes in $(0,\pi)$, we obtain that $f(c)=0$.

We now show that $f$ must have more than one root, by contradiction.
This is in line with Lev's answer and the addtitional explanantions in the comments under it.
Suppose that $f$ has the single root at $c$;
there are two possibilities:

$f$ does not change signs at the root $c$.

In this case, because the sine also does not change signs on $(0,\pi)$, we'd have that $f(x)\sin(x)$ does not change signs on $(0,\pi)$.
This implies that for $x\in(0,\pi)$, $f(x)\sin(x) = 0$ only at $x=c$, and it has the same sign everywhere else, in contradiction with $\int_0^\pi f(t)\sin(t)\,dt =0$.

$f$ changes signs at the root $c$.

In this case, consider
$$g(x) = f(x)\cdot \sin(x-c) = f(x) \Big(\sin(x)\cos(c) - \cos(x)\sin(c)\Big).$$
Notice that
$$\int_0^\pi g(t)\,dt =
\cos(c)\underbrace{\int_0^\pi f(t)\sin(t)\,dt}_0 -
\sin(c)\underbrace{\int_0^\pi f(t)\cos(t)\,dt}_0 = 0.$$
However, $\sin(x-c)$ changes sign exactly once for $x\in(0,\pi)$, on $x=c$.
This implies that for $x\in(0,\pi)$, $g(x) = 0$ only at $x=c$, and it has the same sign everywhere else, in contradiction with $\int_0^\pi g(t)\,dt =0$.

Regardless of the situation, we see that the assumption that $f$ has a single root at $c$ leads to a contradiction, so we  conclude that $f$ must have more than one root, as desired.
Moreover, as per James Fennell's comment under the question, $f(x)=\sin(3x)$ satisfies the conditions in the statement and has exactly $2$ roots in $(0,\pi)$, so 'at least two roots in $(0,\pi)$' is tight.
Answer: This is a problem of complex calculus.
The linear combination of both given integral can be used to represent a path. The function $f$ can be rewritten with the path inside. This is  possible because $f$ depends on one real variable.
The path can be interpreted as the upper half circle above the real axis in the complex plane.
Look at for example: Line integral.
Now just given the pair of identies allows us the combine with $i$ and $-i$. The path can be run clockwise and counterclockwise.
If $F$ is the function $f$ on the complex path over the upper half of the unit circle. With $F$ is the $\overline F$ a solution. This gives without the complexes the existence of two solutions for $f$.
The steadiness of $f$ is needed to the exitence of the integrals. This does not follow from the identities. A function that is steady has an integral. Functions that are steady have integrals multiplied with transcendent functions. These are in the class of steady functions too. This attribut hat to be given in the interval $[0,\pi]$.
If the identities were not given alone the solution will not be double.
I am the opinion it is better practice to be more precise on the question regarding for $x$. The question is hard because it has not contexts. There is reason to mark this duplicate. Now that a correct answer/proof is given the situation changes.
Comment: You can flag a question as "low quality" or "duplicate" if you find that appropriate, but that does not belong in an answer. – Regarding your answer: What is a "steady" function? Do you mean "continuous"? Generally that all is quite vague. Can you demonstrate more concretely how you conclude that $f$ has at least two distinct zeros?
Answer: This statement is not true. Actually, we should prove that $$\int_0^\pi f(x)[\cos x-\sin x]dx=0$$Now, define $$f(x)=\begin{cases}a\left(e-e^{4x\over \pi}\right)+1&,\quad 0\le x\le {\pi\over 4}\\1&,\quad {\pi\over 4}<x\le \pi\end{cases}$$where $a\ge 0$. It is clear that $f(x)\ge 1$ over $[0,\pi]$ for all $a\ge 0$ hence it has no root. However, by defining $$I=\int_0^\pi f(x)[\cos x-\sin x]dx$$we immediately conclude that $I=-2<0$ for $a=0$ and $\lim_{a\to \infty } I=\infty$. Based on intermediate value theorem and since $I$ is continuous w.r.t. $a$, there is a value for $a$ for which $I=0$, hence the statement is not true.
Here is a sketch of the two functions using Python:
Comment: You have found an example where $\int_{0}^{\pi}f(x)\sin {x} dx=  \int_{0}^{\pi}f(x)\cos {x} dx$, but not necessarilty $\int_{0}^{\pi}f(x)\sin {x} dx =  \int_{0}^{\pi}f(x)\cos {x} dx=0$. So this is not a counterexample.


key signing: can't see new signatures

Question: I'm getting a few friends to sign my key. Each time they've signed my key, if they send the signed key to a key server, when I try to get the signatures with gpg --refresh-keys --keyserver some.keyserver, my key is unchanged, I don't see their signatures. The same thing happens if I use gpg --recv-keys. They've tried three different servers. However, if they If they email me my key, or I look up my key on the keyserver's web interface and copy the text, then I import it, I see their signatures on my key. Does anyone have an idea as to why this might be happening or what I'm doing wrong?
Answer: You need to import their signatures into your key. They aren't supposed to send it to the keyservers themselves.
The process looks like this:

Create a GPG signature (you've already done this)
Publish your signature

gpg --send-key 12345678ABCDEF12

Make a physical copy of your fingerprint.  Print the output of this onto your business card or print out a bunch of them on one sheet and chop it up.

gpg -v --fingerprint 12345678ABCDEF12

Go to a key-signing party.  Meet people, have fun, and hand out your physical fingerprint to people.  Often people should ask you for ID so they can verify that your name is really the same name as what's on the GPG key.

The people you've met will use the physical fingerprint you gave them to download your published key from the key-server.  They will check character by character that the physical copy you gave them matches what's on the server.

If they are satisfied, they'll gpg --sign your signature, then export it (and preferably encrypt it too).  Then they email the result to you.
gpg --recv-keys 12345678ABCDEF12
gpg --fingerprint 12345678ABCDEF12
gpg --sign-key 12345678ABCDEF12
gpg --armor --export 12345678ABCDEF12 | gpg --encrypt -r 12345678ABCDEF12 --armor --output 12345678ABCDEF12-signedBy-112233445566778899.asc

You will receive the signature by email.  You'll first need to decrypt it (this is another check that you really own the signature) if it was encrypted, then you will gpg --import their signature into your own key, and publish the results:

gpg -d 12345678ABCDEF12-signedBy-112233445566778899.asc  | gpg --import
gpg --send-key 12345678ABCDEF12

Comment: That is exactly what we're doing since I can't get the new signatures when I use gpg to get the key from a keyserver. The only step we're missing is encrypting the key before it's sent back to me (although I get why we should be doing this - it ensures that the signed key is only imported by someone who has the private key). I am still curious about why I don't see the signatures if I use gpg to get the signed key from the server, despite the fact that the keyserver has them (because the key that I get from the web interface has the signatures).
Answer: Stewart answer is correct when you are dealing with signatures exchanged with your friends.
But if you just want to import signatures from other keys you'll get into the same problem. gpg (in e.g. Debian 11) drops all non-self-signatures. If you need to import/refresh signatures on the keys from server try to use the following commandline argument:
--keyserver-options no-self-sigs-only

key signing: can't see new signatures


Python Virtualbox API

Question: I have made a command-line interface for virtualbox such that the virtualbox can be controlled from a remote machine. now I am trying  to implement the commmand-line interface using python virtualbox api. For that I have downloaded the pyvb package (python api documentation shows functions that can be used for implementing this under pyvb package). but when I give pyvb.startVM(self,"name of vm",type='gui'), it shows an error:
AttributeError: 'module' object has no attribute 'startVM'

Answer: startVM is in pyvb.vb.VB class. Also, it's not 'name of vm', as docs explain startVM should be called with pyvb.vm.vbVM as a first parameter and not a string.

Python Virtualbox API


MySQL Delete all rows from table and reset ID to zero

Question: I need to delete all rows from a table but when I add a new row, I want the primary key ID, which has an auto increment, to start again from 0 respectively from 1.
Answer: Do not delete, use truncate:
Truncate table XXX

The table handler does not remember the last used AUTO_INCREMENT value, but starts counting from the beginning. This is true even for MyISAM and InnoDB, which normally do not reuse sequence values.

Source.
Comment: Truncate works well with non-constrained tables, but if your table has a Foreign Key constraint, you may consider using the Delete method. See this post if you have FK constraints: [truncate foreign key constrained table](http://stackoverflow.com/questions/5452760/truncate-foreign-key-constrained-table)
Comment: do remember that truncate table is not going to rollback
Comment: A quick one and it worked, where I had to clear the existing rows and reset the auto increment primary key column. Thanks.
Answer: If you cannot use TRUNCATE (e.g. because of foreign key constraints) you can use an alter table after deleting all rows to restart the auto_increment:
ALTER TABLE mytable AUTO_INCREMENT = 1

Comment: @NBhargav Because you might be using InnoDB engine on your table instead of MyISAM, the first don't support resetting the index.
Comment: how to delete all the rows before altering the auto_increment value
Comment: @KasunSiyambalapitiya `DELETE FROM tablename;` (but that isn't going to work well when there are FK constraints -- see http://stackoverflow.com/a/5452798/507761)
Answer: If table has foreign keys then I always use following code:
SET FOREIGN_KEY_CHECKS = 0; -- disable a foreign keys check
SET AUTOCOMMIT = 0; -- disable autocommit
START TRANSACTION; -- begin transaction

/*
DELETE FROM table_name;
ALTER TABLE table_name AUTO_INCREMENT = 1;
-- or
TRUNCATE table_name;
-- or
DROP TABLE table_name;
CREATE TABLE table_name ( ... );
*/

SET FOREIGN_KEY_CHECKS = 1; -- enable a foreign keys check
COMMIT;  -- make a commit
SET AUTOCOMMIT = 1 ;

But difference will be in execution time. Look at above Sorin's answer.
Comment: This is a good way to have orphan data in any table that foreign keys to the table you're wiping out.  Enabling the foreign key checks after the fact does not cause MySQL to revalidate those foreign keys as far as I am aware.  This leaves you with rows that contain data that *does not exist* in the reference table.  You may as well not even *have* foreign keys on your table at all.
Answer: if you want to use truncate use this:
SET FOREIGN_KEY_CHECKS = 0;
TRUNCATE table $table_name;
SET FOREIGN_KEY_CHECKS = 1;

Comment: For testing and debugging a database, this is TOTALLY the answer.
Answer: An interesting fact.
I was sure TRUNCATE will always perform better, but in my case, for a database with approximately 30 tables with foreign keys, populated with only a few rows, it took about 12 seconds to TRUNCATE all tables, as opposed to only a few hundred milliseconds to DELETE the rows.
Setting the auto increment adds about a second in total, but it's still a lot better.
So I would suggest try both, see which works faster for your case.


JSON Security

Question: Do Pagemethods and Json have security risks?(I dont use cookies).Forexample i have a pagemethod and i am sending user id as a parameter but i dont want to show it to user.Can user get user id from pagemethod?
Answer: yes they can (see the user id). Any communication between the server and client can be seen by the user. Take a look with fiddler or firebug to see what goes on. You can treat it the same as any regular get or post request.
I know of no reason why not to use it. Without knowing any of the background I can't give a definitive answer on whether I would choose it but in general there is no reason not to use it just apply the same security you would use for HTTP get and post requests like in regular form submissions.
Answer: It has the same security risks as a regulat GET and POST, it is just another format to send the data back and forth. If you were using a regular POST, anyone would be able to see the userid just the same.
So if you don't want to have people messing up with the userid you could add some sort of encrypted string dependent on the userid to go along with it, for validation, to name one of many possible solutions.
Answer: JSON has no security by itself, It's an unencrypted data-format.
Answer: JSON can utilize FormsAuthentication security just like pages.  What I usually do if I don't want the end-user to see an identifier, is to store that value (or something I can use to lookup that value) in User.Identity.Name.
The most complicated part of this approach is that the JSON may not return anything if you aren't authenticated.  To work around this, I tend to include a non-authenticated page for getting JSON to tell you if the user is logged in or not.
Answer: I am hiding user id parameter in Hidden Field  and just concerned that can it be changed while in that Process.Thanks all of your supports
Answer: if the userid is in a hidden form field, then it is completely exposed to anyone who views the source code in the browser.  Not only can they see the userId, but they can see how you are sending it to the server.
In general, you never trust the client with sensitive data.  Assume that they can always manipulate the response.
The way to securely pass messages is to give the user some session token in the form of a string.  This session token should be generated with a fair amount of randomness and includes their username in the algorithm.  Take a look at resources regarding md5 and salting.  With this token that you give them, the assumption is now that they cannot reverse engineer the contents.  Since they do not have the algorithm (it is sitting on the server side), then they cannot tamper with it.  Your server will have to decrypt the session token to retrieve the userId of course.
This in itself does not mean your application is completely secure - it only fixes one of potentially many issues.

JSON Security


Fat cantor set has positive lebesgue measure

Question: This is probably a duplicate of some other question, but it's not immediately obvious which. The fat cantor set is constructed by removing smaller fractions of the center in each stage of the cantor set construction, and it is claimed that this set has positive measure. To be precise, let $C_0=[0,1]$ and $C_n$ be the result of removing the central $1/2^{n+2}$-th of each interval in $C_{n-1}$, and let $C=\bigcap_{n=0}^\infty C_n$. Then $\mu(C_n)=\frac12(1+2^{-n})$, and as a countable intersection of measurable sets $C$ is measurable. Since each $C_n$ is a countable (finite, even) interval cover of $C$, we have $\mu(C)\le\frac12$. But how does one prove $\mu(C)\ge\frac12$? The only proof I have seen that bounds a measure away from zero is the proof that $\mu([a,b])=b-a$, and it's not a simple proof. What argument gives this lower bound on $\mu(C)$? Obviously I can't use monotonicity since $C$ has no interior.
Comment: The measure of the intersection of a decreasing sequence of measurable sets, the first of which has finite measure, is the infimum of their measures. You can prove this as a corollary of the fact that the measure of an increasing union of measurable sets is the supremum of their measures, which is in turn not too hard to verify.
Comment: @AndresCaicedo Does that theorem follow from the axioms of measure (monotonicity, shift invariance, countable additivity, etc.) or does it require consideration of interval coverings specific to lebesgue measure?
Comment: It is valid for all measures.
Comment: see http://en.wikipedia.org/wiki/Volterra%27s_function and http://en.wikipedia.org/wiki/Smith%E2%80%93Volterra%E2%80%93Cantor_set
Answer: Here you find the  Monotone convergence theorem from Lebesgue. In wikipedia is explained as integral of functions, but it can be stated also like that:
Let $A_1, \cdots, A_n, \cdots$ be a decreasing sequence of measurable sets, such that $m(A_1) < \infty$. Then (a) $A = \cap_{n=1}^{\infty} A_n$ is measurable, and (b) $m(A) = \lim_{n\to \infty}m( A_n) $.
The proof of (a) is quite simple from the basic definition, and (b) from monotony and $\sigma$-subaditivity.
A direct proof of $\mu ( C ) \geq \frac{1}{2} $ can be given, then, by $\sigma$-subaditivity of $\mu$ : As $C_1 \subseteq C \cup \bigcup_{n=1}^{\infty} (C_n \setminus C_{n+1})$, then $\frac{1 + 2^{-1}}{2} \leq \mu(C) + \sum_{n=1}^{\infty} \frac{2^{-n} - 2^{-n-1}}{2} = \mu (C) +  \frac{ 2^{-1}}{2} $ if i'm not mistaken.


RMS Values in AC Circuits

Question: When do you use RMS values when calculating power? My physics textbook provides several equations for determining the power dissipated in AC circuits. For example, there are power equations using instantaneous values of current and voltage. Do you use RMS values when calculating only average power and the power factor?
Answer: The voltage drop and the current flowing through a circuit element are changing with time. For an AC source, there is no current through the circuit element at one point of time and at another time, the maximum current flows through it. Therefore, multiplying the peak values of voltage drop and the current will not give you the total energy consumed; rather, they give the power consumed at the instant when maximum current is flowing through the circuit element.
The instantaneous power for any circuit element in any  state (DC or AC or anything) is given by:
$$P(t) = V(t)\times I(t) = [I(t)]^2 Z = \frac{[V(t)]^2}{Z} \tag{1}\label{(1)}$$
where $P(t)$ is the instantaneous power, $I(t)$ is the instantaneous current, $V(t)$ is the instantaneous voltage drop across the circuit element and $Z$ is the impedance(resistance) of the circuit element.
The aforementioned formula for instantaneous power is always true because the work done on a charge $q$ moving through a potential difference of $V$ (for that instant, $V$ is constant) is $qV$. The power is the rate of doing work, therefore, the instantaneous power is the product of $V$ and $\displaystyle \frac{dq}{dt}$ (or $I$).

The average of a function over an interval $[a, b]$ can be calculated using calculus as follows:
$$\langle f(x) \rangle = \frac{\displaystyle \int_a^b f(x) \space dx}{b -a} \tag{2}\label{(2)}$$

We can calculate the average power consumed using equation $\eqref{(1)}$ and concept $\eqref{(2)}$.
$$\langle P(t) \rangle = \frac{\displaystyle \int_0^T P(t) \space dt}{T}$$
$$\langle P(t) \rangle = \frac{\displaystyle \int_0^T \frac{[V(t)]^2}{R} \space dt}{T}$$
$$\langle P(t) \rangle = \frac{\displaystyle \frac{1}{R}\int_0^T [V(t)]^2 \space dt}{T}$$
$$\langle P(t) \rangle = \frac{1}{R} \langle [V(t)]^2 \rangle$$
If you had used instantaneous current to calculate the average power instead, you would have obtained:
$$\langle P(t) \rangle = R \langle [I(t)]^2 \rangle $$
Therefore, the average power consumed depends on the RMS(average value of the function squared) value of the voltage or current across it.

If you calculate the average power consumed per cycle for AC source, you will obtain the following:
$$P_{\text{avg}} = \frac{1}{2} \cdot \frac{V_{\text{peak}}^2}{R} = \frac{1}{2} \cdot v \cdot I_{\text{peak}}^2 R \tag{3} \label{(3)}$$
If you calculate the RMS values of current and voltage separately, you get:
$$V_{\text{rms}} = \frac{V_{\text{peak}}}{\sqrt{2}}, \quad I_{\text{rms}} = \frac{I_{\text{peak}}}{\sqrt{2}} \tag{4}\label{(4)}$$
Plugging the results of equation $\eqref{(4)}$ into equation $\eqref{(3)}$, you get:
$$P_{\text{avg}} = \frac{V_{\text{rms}}^2}{R} = I_{\text{rms}}^2 R \tag{5} \label{(5)}$$
There's something interesting here. You get the above two forms of average power using two different ways (integrating voltage squared expression and integrating current squared expression). Whatever mathematical method you prefer to use, the answer must be the same. Therefore:
$$\frac{1}{2} \cdot \frac{V_{\text{peak}}^2}{R} = \frac{1}{2} \cdot I_{\text{peak}}^2 R$$
$$V_{\text{rms}} = I_{\text{rms}} R \tag{6}\label{(6)}$$
Some of you might ask, what's so special about the above equation? You need to think more deeply. Is it obvious that the RMS values respect the Ohm's law relation? It might be for some who can think through the above equations but it isn't obvious for me.
Using equation $\eqref{(6)}$, you can write the average power in one more way.
$$P_{\text{avg}} = V_{\text{rms}} I_{\text{rms}} = \frac{V}{\sqrt{2}} \cdot \frac{I}{\sqrt{2}}$$

When to use RMS values of current and voltage while calculating power for AC circuits?
If you are calculating the average power over $n$ cycles ($n \in \mathbb{Z}$), you must use RMS values of voltage and current.
For instantenous power, you use instaneous voltage and current.
If you are calculating the average power over non-integer cycles (half of $0.67422$ or aything else), then you have to do the integration (equation \eqref{(2)}).
Answer: Short answer: use it when it makes physical sense.
Slightly longer answer: instantaneous power is the product of voltage and current. When there is a nice linear relationship, $V=I\times R $, then power is $P=VI=V^2 R$ and average power is calculated from the average voltage squared. If you use the RMS value of the voltage to compute the RMS value of the current you get the same result.
Does that help?
Comment: So just to summarize, the RMS values used in power equations should give you the same result as using any other power equation like P = IV = I^2 R = V^2 / R ?
Comment: More to the point, if instantaneous power is proportional to $v^2(t)$, then the rms average of $v(t)$ is the correct average $V$ to use to get average power $P$ to have the same proportionality to $V^2$.
Answer: If you have a purely resistive circuit then the power dissipated in the circuit can vary between zero and $V_{\rm peak}I_{\rm peak} = I_{\rm peak}^2 R = \dfrac{V_{\rm peak}^2}{R}$.
It is often useful to find out what the average power $<P>$ over a period and so what is required is $<VI> = <I^2> R = \dfrac{<V^2>}{R}$ where $<V^2>$ is the mean of the square of the voltage etc.
So a mean square value is defined as $V_{\rm rms}= \sqrt{<V^2>}$ for the voltage and $I_{\rm rms}= \sqrt{<I^2>}$ for the current.
For a sinusoidally varying voltage it is found that $V_{\rm peak} =\sqrt{2}\, V_{\rm rms}$.
Once this has been done it is often more convenient to use rms values rather than peak values because although the ratios of voltage and current stay the same, $\dfrac{V_{\rm peak}}{I_{\rm peak}}= \dfrac{V_{\rm rms}}{V_{\rm rms}}$, when average power is being calculated the use of peak voltages and currents would repeatedly introduce the (annoying) factor $\sqrt{2}$.
When circuits with inductance and capacitance as well as resistance are introduced there is still no problem with the ratios of voltage and current but again if average power is being considered the rms values are easier to use.
However because for such circuits the voltage and current are no longer necessarily going to be in pahse with one another one has to introduce a factor called the power factor $\cos \phi$ into the average power dissipated in the circuit equation $<P> = V_{\rm rms}I_{\rm rms} \cos \phi\, (= \frac 1 2 V_{\rm peak}I_{\rm peak} \cos \phi )$ where $\phi$ is the difference in phase between the voltage and the current.
So in general you will find that something with labels $V$ and $I$ in a textbook will very often refer to rms values.

One place where the peak values need to be used is when one considers the insulation placed around the conductors.
For example if you have a voltage supply of $230\,\rm V\, rms$ then the insulation must be able to withstand a voltage of $\sqrt{2}\times 230=325\,\rm V$.
This may not seem a lot different but when one is dealing with very high voltages eg $1.1\,\rm MV\, rms$ then the insulation has to withstand a peak voltage of $\sqrt{2}\times 1.1=1.55\,\rm MV$ which has lead to the development of a power super highway where dc rather than ac is used for transmitting electrical power..

RMS Values in AC Circuits


Change all pages permalinks instead of hierarchical to have id of the page

Question: I would like to change the permalinks of all the pages of my site to have instead of http://example.com/page1/page2/page3 http://example.com/152 where 152 is the id of the page.
Could i use page_rewrite_rules? and how?
I tried to set the permalinks to default which gives me for the pages the permalink ?page_id=pageid I would like instead to have just the pageid the ?page_id= should be removed from the permalink how could i do it? (It is for pages)
Answer: I think you need something like this:
You need goto this page http://example.com/wp-admin/options-permalink.php
Comment: but it only works for posts not for pages
Comment: ah, I see... well, I forgot about that. I don't have the solution right now


Hide Member list from users

Question: What I would like to find out is how I can hide this memberlist on a sharepoint folder. I would also like to hide it from showing up on the group emails.
Answer: They display be default and there is no OOB method to disable them.
To hide the members on the top right corner, you may need scripts such as CSS or JavaScript.
In SharePoint Online modern experience, we need to use SharePoint Framework Extensions to add scripts to "modern" pages.
Check Information about Customizing the "modern" experiences in SharePoint Online
Another workaround, you could switch the experience from modern to classic. The members are not appeared in classic experience.

Hide Member list from users


Handle error on transaction request

Question: could anyone explain how to handle errors on transaction request (insufficient fund, account not found ),as the request on server is sent by wallet.
Answer: You can catch the error and parse it.
example
try {
   // send transaction
} catch(e) {
  if (e.message.contains('insufficient fund')) {
    toast('insufficient fund')
  }
}

Comment: The request is sent by the wallet to my server and my client is unware of this req,res .
Comment: you can add this code either in your client code or server code. whoever is going to send the transaction to the network will throw an error if it fails.
Comment: This response or error message will go the wallet that is scanned the QR and making the transaction, will wallet show this error , that's where my confusion is
Answer: Error handling is included in the newer v1.1 spec of Solana Pay. Quote:

If the application responds with an HTTP client or server error in response to the POST or PUT operations, the wallet must consider the entire transaction request as failed.
Client and server errors may optionally be accompanied by a JSON body containing a UTF-8 string message field describing the nature of the error:
{"message":"<message>"}
The wallet must display at least the first 80 characters of the message field to the user if it is included in the response.

So, you can send your error message in this format.
However, this is local to the wallet. There is a redirect field in the newer spec, but only for successful transactions:

Redirect URLs should only be followed if the transaction is successful.

Another problem: I don't know how widespread the adoption of this spec is. Note that v1 didn't include it.
My approach here would be to do all the checking on the server (custom checks or with simulateTransaction) and possibly inform other components if there's an error. You could send a dummy transaction in return, possibly using the message field for the error (even if it's meant for something else -- we've all been there).
Comment: thanks , I'll try that

Handle error on transaction request


Can I have 10.10 with a 3.x kernel?

Question: I would like to know if I can run Ubuntu Maverick Meerkat 10.10 version with the new kernel ver. 3.x. I'm asking because my the 10.10 DVD installer seems to have problems detecting hardware in my new Asus motherboard; the 11.04 DVD installer runs ok.
Personally, I do not like the Unity interface, and do not want to be forced to use later versions than 10.10.
Your help is very much appreciated.
Comment: You are not forced to use Unity in later versions, and using a later one may be a good idea as 10.10 support will run out soon.  If you want a gnome2-esque DE, you can try Cinnamon, or gnome-fallback
Comment: have you tried 10.04? it will have longer support than 11.10...
Comment: 11.04 also have the classic desktop as a pre-installed alternative.
Answer: Going with an older version of Ubuntu is many times a bad idea. First because of the hardware support. Older versions have less hardware support and even less for newer existing hardware. Second is the security for it. Third the performance, stability and you can see where I am going with this.
Jump all that you will be happy to know that 12.04 will have Gnome Classic. You will be able to install it from one single package. It will look like the older version but enhanced with all the new updates for each app that Gnome Classic uses.
Just to add that the latest will receive more up to date stuff than an older version. This includes the kernel because 10.10 I think uses the 2.6.35 Kernel and ends on April 2012. The same date that 12.04 comes out with the 3.2 Kernel (Awesome version) and better support for Gnome Classic. Besides compiling the 3.x kernel to an older Ubuntu version includes having to start a domino effect of compilations between all apps to get them all working correctly at the end.
So for my suggestion. Stay with the one you are using until 12.04 comes out. Then install 12.04 and apply the Gnome Classic package. Logout, select Gnome Classic. Enjoy. You would get an updated Ubuntu with the Gnome Classic.
Here is some info about it:
http://www.webupd8.org/2012/02/more-classic-gnome-session-lands-in.html
http://jeremy.bicha.net/2012/02/11/ubuntu-classic-now-with-indicators/

Can I have 10.10 with a 3.x kernel?


Seeking point statistic tool in QGIS?

Question: Does anyone know if there's a tool in QGIS that is equivalent to ArcGIS Point Statistics?
I need to create a raster with values from an attribute in a Point layer.
Answer: There is a sample for the same at https://docs.qgis.org/2.2/en/docs/training_manual/vector_analysis/spatial_statistics.html
7.4.7. basic Follow Along: Spatial Interpolation
Let's say you have a collection of sample points from which you would like to extrapolate data. For example, you might have access to the random_samples dataset we created earlier, and would like to have some idea of what the terrain looks like.
To start, launch the Grid (Interpolation) tool by clicking on the Raster ‣ Analysis ‣ Grid (Interpolation) menu item.
In the Input file field, select random_samples.
Check the Z Field box, and select the field srtm_41_19.
Set the Output file location to exercise_data/spatial_statistics/interpolation.tif.
Check the Algorithm box and select Inverse distance to a power.
Set the Power to 5.0 and the Smoothing to 2.0. Leave the other values as-is.
Check the Load into canvas when finished box and click OK.
When it's done, click OK on the dialog that says Process completed, click OK on the dialog showing feedback information (if it has appeared), and click Close on the Grid (Interpolation) dialog.
As you can see, 100 sample points aren't really enough to get a detailed impression of the terrain. It gives a very general idea, but it can be misleading as well. For example, in the image above, it is not clear that there is a high, unbroken mountain running from east to west; rather, the image seems to show a valley, with high peaks to the west. Just using visual inspection, we can see that the sample dataset is not representative of the terrain.

Seeking point statistic tool in QGIS?


Scraping information from within multiple search results

Question: TL;DR I can get the URL for each profile but I can't figure out how to scrape from each profile and put the information into a table
I am new to web-scraping, and I am trying to scrape information from profile from this website
This does not violate their Terms of Use, but the website also doesn't have an API. I am able to extract the URL for each profile from all the pages of search results, and then paste them to the domain name. However, I can only do this for one page of results, and I am unable to then follow those URLs to scrape information from the actual profiles.
My code looks like this:
#Scrape the profile URLs
profile_url_lst <- list()
for(page_num in 1:73){
  main_url <- paste0("https://www.theeroticreview.com/reviews/newreviewsList.asp?searchreview=1&gCity=region1%2Dus%2Drhode%2Disland&gCityName=Rhode+Island+%28State%29&SortBy=3&gDistance=0&page=", page_num)
  html_content <- read_html(main_url)
  profile_urls <- html_content %>% html_nodes("body")%>% html_children() %>% html_children() %>% .[2] %>% html_children() %>%
    html_children() %>% .[3] %>% html_children() %>% .[4] %>% html_children() %>% html_children() %>% html_children() %>%
    html_attr("href")

  profile_url_lst[[page_num]] <- profile_urls
Sys.sleep(2)
}
#Bind into list and combine with domain name
profiles <- cbind(profile_urls)
complete_urls <- paste0('https://www.theeroticreview.com', profile_urls)
complete <- cbind(complete_urls)
complete

#Scrape information from each profile
TED_lst <- list()
base_url <- "https://www.theeroticreview.com"
completed <- c(profile_urls)
for(i in completed) {
  urls <- paste(base_url, i, sep = "")
  pages <- read_html(urls)

  TED <- pages %>% html_nodes(".hidden-sm , .td-date .td-link , #collapse3 .col-sm-6+ .col-sm-6 .row:nth-child(5) .col-xs-6 , #collapse3 .row:nth-child(3) .col-xs-6 , .col-sm-6:nth-child(1) .row:nth-child(1) .col-xs-6 , .col-sm-6+ .col-sm-6 .row:nth-child(3) .col-xs-6 , .col-sm-6:nth-child(1) .row:nth-child(2) .col-xs-6 , #collapse1 .row:nth-child(8) .col-xs-6 , #collapse1 .col-sm-6:nth-child(2) .row:nth-child(5) .col-xs-6 , #collapse1 .col-sm-6+ .col-sm-6 .row:nth-child(1) .col-xs-6 , #collapse1 .col-sm-6:nth-child(2) .row:nth-child(2) .col-xs-6 , .float-heading-left p , h1") %>% html_text()
  TED_lst <- TEDs
}

When I run this code, I can only generate complete URLs for a single page, and while the code to scrape from the profiles works with one of these URLs and the loop function removed, attempting to run the function above returns NULL and the URL for a single profile. How do I get it to scrape all of the information from multiple profiles, and then bind it into a table to be used in regression analysis?
Answer: If I understand you correctly, you want to scrape each URL listed in complete_urls, right?
In this case, your final for-loop should read:
for(i in completed) {
  pages <- read_html(complete_urls[[i]]) # I changed this one

  TED <- pages %>% html_nodes(".hidden-sm , .td-date .td-link , #collapse3 .col-sm-6+ .col-sm-6 .row:nth-child(5) .col-xs-6 , #collapse3 .row:nth-child(3) .col-xs-6 , .col-sm-6:nth-child(1) .row:nth-child(1) .col-xs-6 , .col-sm-6+ .col-sm-6 .row:nth-child(3) .col-xs-6 , .col-sm-6:nth-child(1) .row:nth-child(2) .col-xs-6 , #collapse1 .row:nth-child(8) .col-xs-6 , #collapse1 .col-sm-6:nth-child(2) .row:nth-child(5) .col-xs-6 , #collapse1 .col-sm-6+ .col-sm-6 .row:nth-child(1) .col-xs-6 , #collapse1 .col-sm-6:nth-child(2) .row:nth-child(2) .col-xs-6 , .float-heading-left p , h1") %>% html_text()
  TED_lst <- TEDs
}


Calculating the pH of Strong Acid Solutions

Question: Calculate the $\mathrm{pH}$ of a $\pu{1.5e–11 M}$ solution of $\ce{HCl}.$ How is the $\mathrm{pH}~7?$
Comment: Whats wrong with the pH being 7? The pH would actually be slightly lower than 7 but I'm assuming it will round to 7.00 as it is standard to give pH to 2 dp.
Comment: What pH would you expect, considering water self ionisation ?
Answer: Pure water dissociate according to the equation:
$$\ce{2H2O(l) <=> H3O+(aq) + OH- (aq)}$$
Assume that $K_\mathrm{w} = 1.00 \times 10^{-14}$ at room temperature. Thus, $\ce{[H3O+]}$ of solution is $\pu{1.00E-7 M }$. Now, if you add a trace amount of strong acid, this equilibrium would be disturbed and backward reaction occur to reduced some of added acid, according to the Le Chatelier's principle.
Suppose you added $\pu{1.5E−11 mol}$ of $\ce{HCl}$ to $\pu{1.0 L}$ of pure water (this means you made $\pu{1.5E−11 M}$ $\ce{HCl}$ solution). Since $\ce{HCl}$ strong acid, it would completely dissociate to $\ce{H3O+}$ and $\ce{Cl-}$. As stated above, the dissociation of water is vary depending on $\ce{[H3O+]}$  concentration of the solution.  If $\alpha$ amount of water dissociates due to addition of $\ce{HCl}$, the total concentration of the $\ce{H3O+}$ in the solution will be $1.5\times 10^{−11} + \alpha$  and the concentration of the $\ce{OH-}$ in the solution will be $\alpha$.
$$\therefore \; K_\mathrm{w} = [\ce{OH-}][\ce{H3O+}]= (1.5\times 10^{−11} + \alpha)\alpha = \alpha^2 + 1.5\times 10^{−11}\alpha = 1.00 \times 10^{-14}$$
Using the solution for quadratic equation,
$$\alpha= \frac{-1.5\times10^{-11} \pm \sqrt{(-1.5\times10^{-11})^2+ 4.00\times 10^{-14}}}{2} \approx \frac{-1.5\times10^{-11} \pm 2.00\times 10^{-7}}{2} \\\approx 1.00\times 10^{-7}$$
Thus, the total concentration of the $\ce{H3O+}$ in the solution is $(1.5\times 10^{−11} + 1.00\times 10^{-7}) \approx 1.00\times 10^{-7}$.
Therefore pH of the solution is 7.00.


Pantheon DE in other distributions?

Question: I like Pantheon, but I do not like Ubuntu. I will use Pantheon if it can be installed on other Linux systems. Now Pantheon is tied to Ubuntu and it's sad. Ported hard and does not work ... Pantheon will be untied from Ubuntu for porting to other distributions? When? On Archlinux it is ported since 2012 ...
Answer: From what I've recently read, Pantheon is able to be installed not only on top of Arch but also Fedora and OpenSUSE with a certain level of success.
The one thing to keep in mind is, that in some cases, the results of installing Pantheon on top of other distros may not give an end-user experience at the same level as using elementary OS. Until a distro like Antergos (Arch based) or Gecko Linux (OpenSUSE based) create an official or community spin, I personally, would stay away. Finding support within a user forum of a distro that does not officially support Pantheon or support it via a community release may prove to be difficult when the time to troubleshoot issues arrives.
If you're thinking of moving forward, doing an internet search using 'Pantheon Desktop Environment' plus the distro of your choice will get you moving in the right direction.
Good Luck!!!
Comment: Users will, I'm sure. Over time, support will appear. But these steps will come with time and will be useless without porting. I think that other DE also went through this. And now they can be installed in any distribution. Pantheon will not be able to jump until he lets go of Ubuntu.

Pantheon DE in other distributions?


How can I play on two Xbox 360s with wireless controllers simultaneously?

Question: We have 2 Xbox 360 consoles in our house. Neither are connected live. For some reason my son and my husband cannot play at the same time. They have wireless controllers and when the controllers seem to try to connect to either one or the other. Is there any way for them to be able to play at the same time?
Answer: Not sure if you have tried this yet, although you could press the sync button on the controller (right by the left bumper.) and then press the sync button on the 360. (It should have the same symbol as the one on the controller.)
Answer: I would try connecting one up and then changing the settings to stop other controllers from being added and the attempt to connect the second one. Also maker sure that only the one you want to connect is in (if only one of them wants to play)
Answer: I am sure this issue is caused by controllers paired with both consoles in your home. Please, check it and if need be, unpair the incorrect controller from one console and do the same thing with another. After that, please verify that the first controller is paired with X360 that you want to be paired with, and check the same with the second controller.
After that, you should not have any troubles like these you described in your question.


Can I bring a small, decorative deer skull from Germany to the US?

Question: I received -- as a gift -- a small skull mounted on a carved wooden background, typical of Bavaria. I've looked online but am confused about US customs requirements. Can I bring this through? If not, and I declare it, will they just confiscate the item or will I just be fined?
Answer: You really shouldn't have a problem.  From the CBP site:

Bones, horns and hoofs that are imported as trophies may be imported without further restrictions if they are clean, dry and free of undried pieces of hide, flesh, or sinew.

For further concerns CBP refers you to APHIS for further information as this is an actual regulatory body responsible for import of animal byproducts:

Many animals, game birds, products and byproducts from such animals and game birds are prohibited, or allowed only restricted, entry into the United States. Specific requirements vary according to the country of export. For more information about importations by country, please call the USDA, Animal and Plant Health Inspection Service(APHIS), the National Import-Export Center, tel. (301)851-3300, fax (301)734-8226. Since hours of service and availability of officers from the other agencies involved may vary from port to port, you are strongly urged to check with your anticipated port of arrival before importing a pet or other animal. This will assure expeditious processing and reduce the possibility of unnecessary delays.

However if you are concerned about it still you can ship it to yourself and avoid bringing it over the border on your own.
Comment: I would just add to make sure you declare it. DO NOT TICK NO where it asks about animal things, just because you consider it an ok animal thing. Tick yes and explain to the agent.
Answer: Hopefully you were able to bring your deer skull home safely but if anyone else was wondering...here is a comprehensive list of sports equipment that you can and can't bring on airlines based in America.
(Technically a deer skull would be sports equipment b/c it is a product of hunting.)
Tld;r: While a part of it is based on international regulations, most likely it depends more on the airline and its policies.
Comment: I don't think this answers the question, as the OP is asking about customs and not airline regulations. Furthermore I think those fees only apply to very big antlers, which cannot go into the normal luggage, as the OP mentions a 'small' skull. On a unrelated note, I think it's rather amusing that this counts as a sports equipment.
Comment: Antlers includes bagpipes unless they have plastic parts.


What is this goodbye hand gesture called?

Question: I've seen this gesture in movies and my friends use it sometimes. You use it when you say goodbye to someone and you kinda tap on the side of your forehead with two fingers. I've attached an image with Brad Pitt doing this in once upon a time in Hollywood. Does anyone know what this gesture is called? Where it comes from, and what it means? Thanks!
Answer: I've never actually heard a name for it. Broadly speaking, I would just call this a kind of salute, and, specifically, a two-finger salute. Wikipedia has an entry for this:

The two-finger salute is a salute given using only the middle and index fingers, while bending the other fingers at the second knuckle, and with the palm facing the signer.
Answer: It looks like he is performing a humorous salute.
It is difficult to say from a motionless picture, but judging by the proximity of the middle and index fingers I would suggest he is giving a tongue-in-cheek salute, like these other actors:

Usually, a salute is a sign of respect and/or acknowledgement of orders from a superior, but in casual settings it is sometimes used humorously as a farewell gesture. It is very common in the military.
As for its origins, this Wikipedia page states the following:

According to some modern military manuals, the modern Western salute originated in France when knights greeted each other to show friendly intentions by raising their visors to show their faces, using a salute. Others also note that the raising of one's visor was a way to identify oneself saying "This is who I am, and I am not afraid." Medieval visors were, to this end, equipped with a protruding spike that allowed the visor to be raised using a saluting motion.
Comment: @Nathan There are many variants of all hand gestures. I wouldn't call it a military salute but it is undoubtedly called a salute.
Comment: Yea the one harrison Ford did is exactly what I was thinking. A military salute does seem very different from what he did though. You usually don't move your hand and your fingers are fully extended. From my experience the gesture with only two fingers seems to be mostly used for saying goodbye.

I just thought something so common would probably have a name that I can just google. But I've tried a bunch of keywords and none of them lead to anything similar to what harrison ford was doing.
Comment: They look as though they are miming doffing the hat (though Johnny Depp leaves his on).
Comment: @KateBunting From the linked Wikipedia page on the origins of the salute, it appears they are essentially the same concept.
Comment: I would say "informal" or "casual" rather than "humorous"


How does the Prism rune for Diamond Skin interact with spells that have a continious cost?

Question: Diamond Skin (Prism)
Ray of Frost
If you had Diamond Skin active with Prism, how does that affect the upkeep cost of channelling Ray of Frost?
Answer: Channeled spells use up the listed AP cost per "tick". The amount of time each "tick" takes depends on your weapon speed.
So in this case, each "tick" will cost 13 AP (7 less than normal).
Comment: Can you cite a source?
Comment: @hkf - This is what I've picked up from a number of forum discussions, but I don't have any good links on hand. I'll try to find an authoritative source.


why the disciples of the buddha introduced the buddism?

Question: I read that the buddha had not wrote anything. He was used to speak Magadha language. Then sanskrit and pali language appeared when his disciples wrote down his life & experiences. I have already asked a question on language. This time i have a question that states 'why buddha didn't wrote anything ?'.
Comment: Very clearly i wish to say that 'i do not allow myself to follow any priest or disciple of any orientation 'until unless i find the basic of the orientation calling me in for it'. It may appear rude but i have a question to all the available disciples on this site that 'why they are teaching me or answering my questions when they are not a buddha (they can never be).
Comment: I want someone to turn my disbelief into a belief with any known/available logic.
Comment: Can you edit your question to clearly state what you want to ask?
Answer: (I'll assume the actual question is in the body, not in the title).
Naturally, no one can answer why someone didn't do something but that specific someone (but if you really wanted to know from the Buddha, you wouldn't be asking this here...). But there are practical reasons that could explain.
Writing is not teaching.
While you are writing, you are not doing anything to anyone. Being in a cave for years writing a lot about something, and then having a flood take all your sheets away can render all those years useless.
Writing is not teaching, and it is visible that the Buddha was primarily interested in helping the actual people he actually met and guiding those interested to become masters of the subject, and then, teachers themselves. As any educator can attest, this is the highest form of education.
There wasn't a broad "reading culture" -- though there were written texts -- at that time and place. Thus, there were not many readers.
To be of great value, writing requires an author who knows how to write and many many readers who were trained to read certain language(s). Moreover, writing is taking a chance that not only someone trained to read that language will meet your texts, but also that he will be interested and he/she will understand as it is -- an unreasonable expectation -- since there is no possibility of real dialogue.
Not only that wasn't common as it is today (nor there were any alphabetization goals that I know of), but understanding (and teaching) the dhamma is hard as it is. It is even harder if, before teaching dhamma, one would have to teach how to read. So, it's just a major distraction and the benefits were hardly guaranteed.
Instead he advised people to memorize discourses (real discourses, to real people with real problems) and always welcomed any questions they had -- the suttas are full of FAQs from disciples to disciples, and disciples to the Buddha. That's a real learning setting. And the discourses were texts, though not in written form. Orality, in any case, is not a poor-man's "literacy".
Comment: 'Naturally, no one can answer why someone didn't do something but that specific someone (but if you really wanted to know from the Buddha, you wouldn't be asking this here...).'. Actually i wonder that why i put my questions here. Very true.


Why did God say יִקָּווּ הַמַּיִם, it should happen by itself naturally

Question: In Bereishis 1:9 it says וַיֹּאמֶר אֱלֹהִים יִקָּווּ הַמַּיִם מִתַּחַת הַשָּׁמַיִם אֶל מָקוֹם אֶחָד וְתֵרָאֶה הַיַּבָּשָׁה , And God said, "Let the water that is beneath the heavens gather into one place, and let the dry land appear". Rashi explains: שהיו] שטוחין על פני כל הארץ והקוום באוקינוס], They were spread out over the surface of the entire earth, and He gathered them in the ocean. Why did the water need this special prompting from God? Why didn't the water simply follow the laws of nature, and flow down to the lowest place (the seabed)?
Answer: Tol'dos Yitzchak (by Rav Yitzchak Karo, uncle of the Bes Yosef) suggests that the water and continents were combined at first as a muddy slush, and this command separated them, with the land portion coming together (and rising) to form the continents and the water portion coming together (and sinking) into the space between the continents. In his words:

נאמר שלפי שהיה התהום שהיה מים ועפר כמו מים עכורים גזר השי״ת שיקוו המים שהם גבוהים אל מקום שפל למטה ושיעלה העפר למעלה ושניהם הפך טבעם זה עולה וזה יורד
Answer: the vilna gaon says this is a remez to kriat yam suf (splitting of the red sea) where the waters retreated and the "dry land" appeared. i.e. the wet ground became dry as the midrash says. forgot the exact source.
pshat could also mean some of the water retreated to the tehom (deep) as we see regarding the flood that the tehom opened up and flooded the world along with the rain (Genesis 7:11 "on that day all the springs of the great deep burst forth, and the floodgates of the heavens were opened")
Comment: The source is actually R' Itzele Volozhener, son of R' Chaim Volozhener, who answered the question when it was asked by his father to the Gaon.  The Gaon confirmed it.
Comment: Was the GRA (or his student) actually saying that these words are referring to events that happened thousands of years later? It's hard to believe that's the peshat, at least.
Comment: The tehom idea doesn't seem to fit with the language of the pasuk, and certainly not with the language of Rashi - "והקוום באוקינוס" - "He gathered them in the ocean."
Comment: @IsaacMoses the Gra is a remez not pshat. 2. could be the verse is not saying the whole story. i.e. the water was gathered to the ocean and at the same time the existing water over there went down under. would be better with a source though. right now just a suggestion.
Answer: Perhaps the land mass was completely covered by water and after the command the land mass rose up and differentiated itself from the water that previously covered it.
Or, the water had a significant amount of turbulence such that the land mass was regularly covered by the water. After the command the waves calmed down and the land mass was visible.

Why did God say יִקָּווּ הַמַּיִם, it should happen by itself naturally