How do I become a veteran in Bad Company 2?

Question: How do I become a veteran in Bad Company 2 and what does it do for me?
Answer: As Andy says, your veteran status is determined by the number of previous Battlefield games you've played that you link to your account. To become a veteran, follow the steps listed on this site:

You need to link your Gamertags, PSN IDs and old EA master accounts to your current EA account for the Veteran's Program to have the most information possible to find your Battlefield games. You can do the steps below to link your accounts.
Step 1: Link your Xbox Gamertags, PSN IDs and old master accounts to your main EA account that you will use for the Veteran Program.

Start linking your accounts here.

Step 2: After linking your accounts, login to the Veteran's site with your EA account to auto-check for your games. If a game isn't found, you may be able to manually enter the details to add it.
Veteran Rank: You will receive Veteran rewards in select Battlefield games if you have a Veteran rank of 1 or higher. You need two full Battlefield games to be rank 1.

The Veteran's site can be found here.
By becoming a veteran, you will get a special in-game rank and unlock the M1 Garand.
Comment: An easy way to get +1 to your veteran status is to register for and play a couple of games of the free web based game - battlefield heroes
Comment: Do I have to own any previous Battlefield games to unlock the M1 Garand?
Comment: Looks like you do.  You have to own 2 or more.
Answer: IIRC, your veteran status is the number of previous Battlefield games you've played. All it gets you is some unlocked weapons - nothing else that I'm aware of.


How to write condition to set free shipping for particular US states in "Shopping Cart Price Rules"?

Question: I want to enable free shipping if the state is Massachusetts and Order Total Amount is <=250$ or if the state is Connecticut and Order Total Amount is <=500$. How to implement this condition in Shopping cart Price Rules ?
Thanks in Advance.
Answer: We can set like this using Table rate. Tablerate Content should be like this:

To set up Table Rates go to System -> Configuration and Select Shipping Methods from the Left Navigation.
Select Your desired website " Current Configuration Scope". I have selected "Main Website".
Make settings like below screenshot:

Upload your tablerate CSV file in Import field.
Then Save Config.
Refer below link for more clarification:
http://www.magentocommerce.com/knowledge-base/entry/how-do-i-set-up-table-rate-shipping
Comment: Normally a link and one line of text is not the best answer as links can go bad. Maybe you could write a small note on how the csv file should be formatted.
Comment: @David, Thanks for your info. I'll improve my answer.


Scopus: Inclusion of papers

Question: I have some papers published in journals that are approved by Scopus. But these papers are not included in Scopus. How can I get get them included?
Answer: Once the articles are accepted by a journal, it takes time for coming online. Moreover, your question is unclear and lacks further details such as the following:

Are you sure the journal is indexed by Scopus (have you verified by from Scopus site?)
Whether the article has been published as "online-first"?
Has it been indexed at the least by 'Google Scholar'? -- Usually, Google Scholar is fast in indexing as it directly captures the metadata from the journal site.

For the articles to appear in Scopus page, it will take some more time than Google Scholar takes. There are internal steps that are taken care before indexing the articles in Scopus. It usually takes 3 weeks to 2 months for an article to appear in Scopus (from my own experience), I can't provide data points. Also visit a similar question here.

Scopus: Inclusion of papers


Why are metal halide bulbs always ~130V?

Question: I noticed that - even though the local voltage is 240V - metal halide bulbs are always sold as 130V bulbs, and their product sheets list the maximum voltage as 130V. Do perhaps all flood lights that can accept metal halide bulbs have an in-built transformer?
Answer: Metal halide bulbs are discharge lamps that require a ballast or other kind of power supply to control the discharge current and a high voltage (kV) to strike the discharge.
Here for example is a bulb that is 95V.
Answer: Metal Halide Lamps are classified as Gas Discharge Lamp, like fluorescent lamps too.
The Ignition required a high voltage, easily going to KVolt level.
As gas discharge starts, current starts to circulate and the thermionic effect heats the gas and increases its conductivity.
This results in smaller voltages needed to maintain the discharge in the bulb.
For smaller lamps (lower Wattage) the effective operating voltage in the lamp is lower than 130V RMS - see next section.
The lamp shows a negative resistance behavior and will need an adequate device to operate it.
Ballast is not a Transformer, as those used for 12V incandescent/halogen lamps - It is a device used to operate a discharge lamp (including metal halide) with this dual behavior:

High voltage delivered during startup (lamp ignition).
Current limiting under a lower voltage (lamp operation).

Several gas discharge lamps consume more current during their warm-up time than their stated operating wattage when fully heated. This results in a temporary lower operating voltage until fully heated.
Ballast types are inductive (like those early ones for fluorescent lamps) or electronic.
Examples of voltages:
from an excellent compilation here:
ARC VOLTAGE IN NORMAL OPERATION:

Mercury and metal halide, 50 watt: 95 Volts.
Mercury and metal halide, 100 watt: 115 V.
Mercury and metal halide, 175-400 watt: 135-140 V.
35 Watt automotive headlight Xenon Metal Halide: approx. 80-90 V.

MINIMUM VOLTAGE ACROSS THE LAMP IN EARLY WARMUP:

Mercury and metal halide 70 watts or less: 11 V.
Mercury and metal halide 100-125 watts: 12 V.
Mercury and metal halide 175-400 watts: 13 V.

PEAK VOLTAGE NECESSARY FOR STARTING:

Mercury 400 watts or less and the H34 1000 watt mercury: 250 V, and 220 V usually works.
Metal halide 175-400 watts: 500 V, 450 usually works.
Metal halide 1000 watts or more: 600 V?
Metal halide under 175 watts and other pulse start models: At least 1500 V, possibly as much as 2500 V.
High pressure sodium 35-100 watts: 2500 V!
High pressure sodium 150-1000 watts: 4000 V!
High pressure sodium mercury retrofit 150-360 watts: 300 V

OPEN CIRCUIT OUTPUT VOLTAGE of ballast, besides peak of starting pulses:

Mercury 400 watts or less as well as H34 1000W mercury: 180 V, preferably 200 Volts RMS, maybe 220 V sustained at least a couple milliseconds with substantial current.
Metal halide 35/39 to 400 watts: May need to be as high as 280 V RMS with peaks possibly 450-500 volts sustained at least a millisecond or two with substantial current. Maybe a little less for lamps 100 watts or less.
1000W or higher metal halide: probably about 400 V RMS AC with 525 V sustained a couple milliseconds with substantial current.
High pressure sodium 35-100 watts, most models: 110 V RMS AC.
High pressure sodium 150-400 watts, most models: 220 V RMS AC.
High pressure sodium 1000 watts: 400 V AC.
35 Watt automotive Xenon Metal Halide: over 300 V with a substantial current for cold start, 400 maybe 450 V with a substantial current for hot restart.
Comment: Aha, thank you! I think this: `Mercury 400 watts or less and the H34 1000 watt mercury: 250 V, and 220 V usually works.` answers my question. So if I understand correctly, even though the supply voltage to the external floodlight is 240V, that 240V is required to start the MH bulb which will generally run at ~130V? Great. I was concerned that inserting a 130V bulb into a 240V supplied floodlight would ruin the bulb.
Comment: @RoelVandePaar, ALL Discharge Lamps need an appropriate Ballast. Don't waive this.  Connecting one Lamp Without a Ballast, could be dangerous: In an eventual occurrence (lightning storm, etc)  that could reach a transient high voltage or ionize the gas, the existing lower voltage would continue to maintain the lamp energized, but without any current limiting feature.
Comment: So, that mentioned Metal Halide lamp at 130VAC rms and *without a ballast* most probably will not turn on (+ 99% chance), but if it does by any odd, the overcurrent may be enough to overheat and explode the lamp bulb. A Fuse may protect the wiring from further damage, but would not be difficult to fine tune it to protect from such uncontrolled overcurrent.
Comment: In 240V countries, often the ballast is connected as an auto-transformer. It is both. It acts as a ballast, and it acts as an auto-transformer to efficiently change the supply voltage.
Answer: Driver-wise, metal halide bulbs behave like thermionic LEDs: they are current driven.
Nobody particularly cares about the exact forward voltage of a LED in most applications: you just stick a ballast resistor or a current source to drive it and call it a day.
Same with metal halide bulbs: you use a ballast that regulates the current. There's also a high voltage pulse needed to ignite them.
Comment: All voltage-triggered negative-resistance arcs have a current density that increases with current and thus lower negative resistance according to geometry.  Faraday discovered and recorded that. Current thus affects both negative incremental resistance and heat losses in positive resistance. Any trigger must exceed inception voltage (IV) for Partial Discharge (PDIV)  and sufficient number or duration to raise temperature to sustain the arc.   But to my knowledge all the arc bulbs discussed so far are bipolar until you mentioned "thermionic LEDs". Did you make this up? are there real examples?


NotePad++ shortcut for selecting whole word

Question: I know in notepad++ i can use mouse doubleclick to select whole word, but i want to use some keybord shortcut. For example in visual studio it's ctrl+w by default and it's very useful. Can i specify shortcut for that action in notepad++ or does it exists?
Answer: I couldn't find a built-in command to do this, but I found a way to replicate this functionality.

Open or create any text file with more than one word in it.
From the Macro menu, select Start Recording.
Press Ctrl+← Left.  The caret (insertion point/I-beam) will move to the beginning of the word.
Press Ctrl+Shift+Right →.  The word will be highlighted.
From the Macro menu, select Stop Recording.
Again from the Macro menu, select Save Current Recorded Macro.
In the box that appears, assign any name you would like, and select a keyboard shortcut for it.  Then click OK.

Your assigned shortcut will now highlight the word the caret is currently inside, except for when the caret is immediately to the left of the first letter of the word, in which case it will select the previous word.
If you need to be able to select a word when the caret is immediately to the left of the word, perform the above steps but alternate the left and right keys, so the caret moves to the right of the word and highlights to the left.  In that case it would select the following word if the caret is immediately to the right of the word.  You can create shortcuts for both if you desire.
I would hope there's a better way, but I couldn't find one.  If someone else knows of one, feel free to provide it and downvote this answer.
Comment: ctrl + [shift +] left|right work in many applications, it's a good idiom to use through-out your computer.  Its awesome in addressbars that support it.  Additionally, ctrl+del or ctrl+backspace do something similar.
Comment: This is really good! thank you so much, would you have any idea as to how to mark the next block after marking the word? similar to how many ide's do?
Answer: Might be a better way (and there may be unintended side-effects of this), but from poking around a bit:
Settings, Shortcut Mapper, Plugin Commands, 49 Q:Mark Word or Find Reverse, Modify, then Choose your Shortcut Combination.

Note that Ctrl-W is close by default in Notepad++, so unmap that first (Shortcut mapper, Main Menu) if you want to use that.
Edit: After ten more seconds of poking around, the crippling unintended side-effect of this solution is somewhat obvious. Namely, try this is a test test and then try select test. ;) Sorry.
Comment: Mark Word or find Reverse not anymore available there...
Comment: That works fine for me
Comment: I've read about test test(think it's regex problem ot something) and now don't know what better macro or that decision :(
Comment: @florian.isopp I think the command might be found in the "Scintilla" tab of the Shortcut Mapper. Here is a page that presents those commands: http://docs.notepad-plus-plus.org/index.php/Moving_And_Selecting_Around
Comment: I think @Patches answer should be marked as the accepted answer, anyone else agree?
Comment: I don't have this "Q:Mark Word or Find Reverse" in plugins tab.
What plugin this command comes from?
Answer: I use autohotkey to achieve the same goal.
The combination was Ctrl+F+Esc
Ctrl+F select the current word for you, Esc dismiss the Find window.
And it did the trick.
(In SourceInsight there was a default action for this, very useful :)
Answer: My autohotkey solution, mapping Ctrl-click to select word:
; Allow Ctrl-Click to select current word in notepad++
#IfWinActive ahk_class Notepad++
; Note from Help: The hotkeys Shift::, Alt::, and Control:: fire upon release of the key unless they have the tilde prefix such as ~Alt::. By contrast, a specific left or right hotkey such as LAlt:: fires when it is pressed down.
~Control::
KeyWait, LButton, D T0
if ErrorLevel = 0
{
    Click 2
}
return
#IfWinActive

Comment: I ran into some issues with this. Has it been updated since Sept of 2012? Thanks.
Answer: This can be done using Scintilla's SCI_MULTIPLESELECTADDNEXT
I've tried to hack PowerEditor\src\Parameters.cpp by adding a line to scintKeyDefs[] as follow (I prefer Ctrl-W):
static const ScintillaKeyDefinition scintKeyDefs[] = {
{TEXT("SCI_MULTIPLESELECTADDNEXT"),SCI_MULTIPLESELECTADDNEXT,true,false,false, VK_W, 0},
    /* ... */
}


How to setup dual-monitors?

Question: I can't get my second monitor to work.
It's detected but black. A screenshot captures both desktops.
They work fine in Windows.
I want to span the desktop, I tried a 'new screen config' in Nvidia panel and then enabling Xinerama but it didn't do anything.
I also couldn't find an option for TwinView.
I can get the other (right) monitor working if I set that as default and switch monitors on/off but then left monitor is black.
Specs: i7 5820k, GTX 970, 32gb ram
OS: Ubuntu 16.10
Driver: Nvidia 367.57
Monitors: Dell U2715H (1440p) x2 connected via DP daisy chain
# nvidia-settings: X configuration file generated by nvidia-settings
# nvidia-settings:  version 367.57  (buildmeister@swio-display-x64-rhel04-13)  Mon Oct  3   21:41:11 PDT 2016

# nvidia-xconfig: X configuration file generated by nvidia-xconfig
# nvidia-xconfig:  version 367.57  (buildmeister@swio-display-x64-rhel04-13)  Mon Oct  3 21:42:19 PDT 2016

Section "ServerLayout"
    Identifier     "Layout0"
    Screen      0  "Screen0" 0 0
    InputDevice    "Keyboard0" "CoreKeyboard"
   InputDevice    "Mouse0" "CorePointer"
   Option         "Xinerama" "0"
EndSection

Section "Files"
EndSection

Section "InputDevice"

    # generated from default
    Identifier     "Mouse0"
    Driver         "mouse"
    Option         "Protocol" "auto"
    Option         "Device" "/dev/psaux"
    Option         "Emulate3Buttons" "no"
    Option         "ZAxisMapping" "4 5"
EndSection

Section "InputDevice"

    # generated from default
    Identifier     "Keyboard0"
    Driver         "kbd"
EndSection

Section "Monitor"
    Identifier     "Monitor0"
    VendorName     "Unknown"
    ModelName      "DELL U2715H"
    HorizSync       30.0 - 113.0
    VertRefresh     56.0 - 86.0
    Option         "DPMS"
EndSection

Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
   VendorName     "NVIDIA Corporation"
    BoardName      "GeForce GTX 970"
EndSection

Section "Screen"
    Identifier     "Screen0"
    Device         "Device0"
    Monitor        "Monitor0"
    DefaultDepth    24
    Option         "Stereo" "0"
    Option         "nvidiaXineramaInfoOrder" "DFP-2.8"
    Option         "metamodes" "DP-0.8: 2560x1440 +0+0, DP-0.1: 2560x1440 +2560+0"
    Option         "SLI" "Off"
    Option         "MultiGPU" "Off"
    Option         "BaseMosaic" "off"
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection

~

Answer: Best solution was this command:
xset dpms force off
You run the command, screen goes to sleep/black, move your mouse and both monitors work. I added it to startup applications to make things easier.

How to setup dual-monitors?


240V circuit connection

Question: I currently have a 30Amp CB connected to 10 Gauge wire (Red, Black & White - no bare ground wire).  I am about to connect a window AC unit that is compatible with a 20 Amp plug.  My first question is this: can I replace the 30 Amp receptacle with a 20 Amp receptacle.  Second question, since this system requires a ground would I need to connect the white wire to the ground bus in my panel instead of the Neutral bus?
thanks in advance for your assistance
Comment: What are the voltages of the existing circuit (120V single breaker or 240V dual breaker) and required by the new AC?
Comment: both 220V dual breaker
Comment: Is this 10 gauge wire coming from a NM cable, some sort of metal-sheathed cable, or a conduit?
Comment: Is this in North America?
Answer: Yes, you can replace the 30A breaker with a 20A breaker so long as you change the receptacles to 15-20A.  The breaker must match the receptacles.  The only exceptions are 15A receptacles are allowed on 20A breakers (and 50A receptacles on 40A breakers, not relevant here).
It's OK to use oversized wire.  It's not OK to undersize wire.  If it doesn't fit on the receptacles, use a short pigtail of a smaller but still appropriate wire size.
It is illegal to re-designate a neutral (white or gray) wire to be a ground,  say, by taping it with green tape or painting it green.  NFPA's logic is that a future repairman might get confused, and wire is cheap so why not use the right colors in the first place.  A wire which is bare its entire length can only be a ground.  I'm just gonna leave that there.
NEMA 10 receptacles are obsolete and dangerous.  The correct receptacle for "240V, ground, no neutral" is NEMA 6.
Comment: A bit confused with your response, but think I understand...my question was can I keep the 30 Amp breaker and put a 20 Amp receptacle on. Not can I change the CBs.  It's your examples that confuse me:I can undersize the receptacle (15 Amp receptacle/20 Amp CB) in one case and in the other I can undersize the CB (40 Amp CB/50 Amp receptacle) is that correct?  Also, is there any allowance for the existing wires, or do I actually have to rip out the original wiring and replace it?
Comment: Because they're not EXAMPLES, they are EXCEPTIONS.   An example shows how the common rule applies.  An exception is a very specific case where the normal rule does not apply, and there's some very peculiar reason behind that.  No wonder you'd be confused trying to fit it to the normal rule: it doesn't fit, it's an exception :)   You cannot use the 30A breaker for a 20A outlet.  Changing a breaker is not that big a deal.  Either skill up or hire help, but be safe.
Comment: Appreciate the information.  I agree, changing the CB and receptacle is a piece of cake - just trying save a dime or two and trying to keep a bit more Amps available in case something changes along the way.  The hard part will be pulling 50ft of wire through the walls/ceiling just to go from a neutral to a ground...might be easier just to run a completely new circuit altogether using 20 Amp components and 12 gauge wire and just having an extra (the original 30 Amp) circuit available if needed at a later date.  Thanks again
Comment: The 10AWG wire will give you a practical amps boost over 12 AWG wire as you will have less wiring loss.  If you want even more total power, make it a MWBC, that will give you 40A to common NEMA 5 receptacles.  You won't need to pull a whole new cable to get a ground. Under NEC 2014 you can retrofit grounds simply by running a ground wire to the nearest circuit whose ground is thick enough for your circuit (ie breaker).  Its breaker must be in the same panel. The ground wire does not need to stay with the conductors.
Comment: That's good news...so if I just change my CB and Receptacle to 20 Amps I can just tie into the ground of my nearest 20 Amp 110V circuits (which are all individual circuits- one for each of my shop tools) and I should be good to go.  That will save a tremendous amount of work...Thanks again!

240V circuit connection


which device had the best Average coherence time?

Question: These are the IBM backend overview, do: Avg.T1/T2: here stand for the Average decoherence time or coherence time?
Answer: Quantum decoherence time is the amount of time that the qubits preserve its quantum properties. so, the decoherence time is measured by T1 and T2.
You can imagine coherence as heating up a cup of water, and decoherence is mean how fast the cup of hot water cools down.
For more detail  answer:https://quantumcomputing.stackexchange.com/a/9632/20884
Answer: Both T1 and T2 are quantum decoherence times.
T1 relaxation time is the time taken by qubits to decay from |1> to |0> while
T2 dephasing time is where a qubit dephases from |+> or |-> into a mixture of phases such that the phase cannot be accurately predicted


Estimate number of cards needed to be drawn from deck before full house

Question: Imagine we have a well-shuffled deck of cards and we keep drawing cards until there is at least one full house in the drawn cards. How many cards will we draw on average? I would be interested in both the exact solution (which is something around 12) but, more importantly, in a good quick way of estimating this value.
Comment: If this is too hard, I would be interested in the same question but for other simple poker hands like a single pair or a three-of-a-kind
Comment: And the value of 12 quoted above comes from my computer simulations.
Comment: My computer simulation gives an average of $13.9$ with a standard deviation of $3.7$.
Comment: @Jens Indeed. The exact expectation I got is $13.893157\dots$, which is amazingly close to your simulation result. The interesting question is how to get it with a back of the envelope calculation (I just honestly wrote the combinatorial sum and told my PC to compute it)..
Comment: How do you guys simulate this? My simulation gives 13.55 after 1 million runs. Do you also actually simulate a deck of cards, or do you calculate the probability somehow?
Comment: I simulated a deck of cards. But fedja apparently calculated the exact expectancy. If you want to know how he did it, use @fedja in your next comment to alert him of your comment.
Comment: @fedja I am indeed interested :)
Comment: I know I'm three years late, but, @fedja, how did you get the exact result?
Comment: @BenjaminWang Have you read the sentence in parentheses in my comment? :-)
Answer: A simpler question to address is, having drawn n cards, what is the probability of having a full house. Calculating this is equivalent to counting the number of possible hands with a full house, and then dividing my total possible hands.
To get this, we can count the invalid hands through casework, and then subtract this from the total possible hands:
Case 1 - no doubles/ triples:
$$ 4^n \cdot \binom{13}{n} $$
Case 2 - a triple/quadruple:
$$ 13 \cdot \left(4 \cdot 4^{n-3} \binom{12}{n-3} + 4^{n-4} \binom{12}{n-4}\right) $$
Case 3 - having k doubles:
$$ \binom{13}{k} \binom{13-k}{n-2k} \binom{4}{2}^k 4^{n-2k} $$
Thus, the chance that we get a straight flush drawing n cards is:
$$ \frac{\binom{52}{n}- \left( 4^n \binom{13}{n} + 13 \cdot \left(4 \cdot 4^{n-3} \binom{12}{n-3} + 4^{n-4} \binom{12}{n-4}\right) + \sum_{k=1}^n \binom{13}{k} \binom{13-k}{n-2k} \binom{4}{2}^k 4^{n-2k}  \right)}{\binom{52}{n}}$$
Putting this into WolframAlpha, we get these values:

Now, this doesn't account from when it happens, only how likely it is to happen after a certain number of draws. To get a closer number on that, you'd have to do some stricter case work, involving ordering.
Essentially, just calculate the number of ordered decks which will has a royal flush at exactly the $n$-th card.
Let $f(n)$ be the number of orderings of $n$ cards containing a royal flush. Using the methods of before, but not diving by $\binom{52}{n}$ we get $f(n)$. From here, we can calculate exactly how many decks get a royal flush in exactly the $n$-th draw. We shall denote this number as g(n).
$$ g(n) = f(n)(52-n)! - g(n-1) $$
Then, simply take the sum:
$$ \sum_{n=1}^{52} \frac{n \cdot g(n)}{52!} $$
Which, unfortunately, I am too lazy to evaluate... consider it an exercise :)


A question regarding excitation of electrons in atomic orbital

Question: In Bohr's model of an atom, the formula used to find the energy between the 2 orbits and wavelength of emitted photon was valid only for single electron species like hydrogen.In the case of a multi-electron system like in the picture given above will the electron absorb a photon to go from 2s to 2p and also remitt a photon while dexciting from 2p to 2s.There are also elements like sulphur with two excited states thus showing variable covalency but how do the electrons not dexcite from higher energy orbital in a short time but give enough time gap to show two excitation states?Is the dexcitation and remission of photon a phenomenon which can only be seen when an electron goes from one shell to another like from n=1 to n=2 or can it also be seen when electron goes from orbitals and sub shells like 2s to 2p?Since there is an energy difference between the 2s and 2p sub shells there must be remission of photon on excitation but I did not find any online sources to verify this, so I need help.
Comment: Is there something you are looking for aside from what I answered? Except for the long dead and totally obsolete and incorrect Bohr theory for the hydrogen atom (and atomic ions having only 1 electron), the 2p level is not the same energy as the 2s level, so a photon can be absorbed, if an electron is promoted from the 2s level up to the 2p level. And vice versa: a photon can be emitted if an electron drops down to the 2s level from the 2p level. In my answer, I show that yellow light from excited sodium atoms arises when electrons drop from the two 3p levels to the 3s level.
Comment: You have merged all types of atomic theories. What is meant by two excited states and variable covalency.
Comment: Imagine an isolated sulfur atom, it will be one excitation/emission at a time. One cannot have multiple excited states and multiple photon emission at the same time. Search Grotrian diagram of simple atoms first.
Comment: Like how in sulphur an electron is excited from 3p to 3d and 3s to 3p thus showing two excited states
Answer: The OP asked

Is the dexcitation and remission of photon a phenomenon which can only be seen when an electron goes from one shell to another like from n=1 to n=2 or can it also be seen when electron goes from orbitals and sub shells like 2s to 2p?

A simple answer can be provided by examining the 3s and 3p levels of sodium atoms. As is well known, adding a little table salt (sodium chloride) to a flame causes the flame to emit fairly intense yellow light that is characteristic and diagnostic of sodium. This photograph shows the sodium emission from my homemade alcohol burner, with the fuel (70% isopropanol/30% water) 'salted' with two pinches of salt.

In the flame, sodium ions get their electrons back and some of the resulting sodium atoms get excited by energetic collisions. This results in some sodium atoms having electrons in their 3p levels, as per the following simplified Grotrian diagram:

Figure source: http://hyperphysics.phy-astr.gsu.edu/hbase/quantum/sodium.html
An excited sodium atom cannot stay excited indefinitely: it must de-excite and return to the ground state. The next figure shows that sodium de-excites from the 3p levels to the 3s level by emitting the famous yellow sodium D lines:

Figure source: http://hyperphysics.phy-astr.gsu.edu/hbase/quantum/sodium.html
How do we know that the yellow light is actually two slightly different colors (wavelengths) of light, as in the above figure? The answer is that we perform spectroscopy on the light: we send the light to an instrument that disperses light, similar to how a simple prism or grating disperses sunlight into a rainbow of constituent colors.
To do the necessary spectroscopy, we first need a source of excited sodium atoms. There are numerous ways to get excited sodium atoms and a particularly useful and convenient method uses a sodium hollow cathode lamp (HCL). My photograph below shows a sodium and potassium HCL with neon fill gas. (The red color is intense and is due to the neon, similar to a neon light.) The photograph shows the light being collected by a lens, to focus it on the end of an optical fiber at the left. Note in the first figure that the optical fiber also appears just to the left of the flame. So the optical fiber can be used to collect light from the flame, as in the first figure, or from the HCL, as in the figure below.

The other end of the optical fiber serves to provide light as the input to a spectrometer or spectrograph. The next figure shows my homemade echelle spectrograph, with the optical fiber at the upper left.

Input light from the optical fiber is collimated and sent to the echelle grating. Diffracted light from the echelle grating is then cross-dispersed by the prism and the camera records the resulting spectrum, called an echellogram. The next photograph is a composite of two echellograms I obtained with the HCL setup shown in the previous figure.

The pair of sodium D lines are indicated in the echellogram. All the rest is mostly due to neon, with potassium also contributing some emission lines.
Finally, the next composite photograph compares the sodium D lines obtained from echellograms with HCL and flame emission sources. The D lines are narrowest in the HCL and are somewhat broadened in the flame.

Added echellograms, to illustrate how they show spectral content.
White LED echellogram:

Shorter wavelengths are at left and, for a given grating order ("arc") at bottom. This is a continuum spectrum: there are no atomic lines in an LED.
Echellogram of the sun:

showing Fraunhofer lines in absorption, e.g., H alpha (the red Balmer line), sodium D lines, the magnesium triplet, etc. This is a continuum spectrum with missing dark spots due to absorption of specific wavelengths: the Fraunhofer lines.
White compact fluorescent lamp:

showing mercury atomic emission lines and the red and green broad bands due to the rare earth-doped phosphors on the lamp's glass. This is a continuum spectrum with some  mercury atom spectral lines.
A longer exposure echellogram of the sodium and potassium HCL emission, showing the very bright (very over-exposed) red neon spectral lines. I suppressed them in the previous composite photo by using a blue filter. This is a discrete line spectrum due to sodium, potassium and neon. Maybe also impurities: the HCL is old.
Comment: Sorry. I have not understood what are the eleven curved red lines, and the same number of double yellow lines. Why eleven, why curved, and why are they separated by the same distance ? I had always believed that in a spectroscope, the light ray is decomposed into one optical spectrum, and only one. It is even worse for the last picture, where the colored curves contains now bright spots. Please explain ! I am lost !
Comment: @Maurice In an ordinary spectroscope, things are exactly as you say: a long spectrum of intensity versus wavelength (or wavenumber). But the echelle spectrograph achieves high resolution by using an echelle grating in high orders and then cross-dispersing the otherwise overlapped orders. So it is kind of like having sentences on a page rather than one very long sentence. It would take **many comments** to explain this in detail, so I will add some echellograms of other light sources, e.g., LEDs, a white compact fluorescent lamp, etc. I will link to a physics SE answer as well.
Comment: @Maurice Here is a link to the answer by someone who knows what they are talking about: https://physics.stackexchange.com/a/515156/313612. The "curves" are grating orders. The "spots" are atomic emission lines, though maybe a couple are ion emission lines: I have not done line assignments yet. The non-spots are broad emissions of some sort. The curving is due to the diffracted rays traveling through different thicknesses of the prism (it is 50 mm on edge). One neat thing about this is I can remove the camera, put my right eye as close to the prism as possible and see the D lines! Exquisite!
Comment: @Maurice Maybe my answer at https://astronomy.stackexchange.com/a/49116/45954 will help clarify how echelle spectrographs are used for high resolution spectroscopic work.
Comment: I am sorry ! I do not understand the beginning of the beginning of all you are talking about. I don't know what is an echelle, a broad emission, a curving, a dekker, etc. I guess it has not too much to do with chemistry. And here we are supposed to discuss about chemistry
Comment: @Maurice Well, as a lifelong chemist, who did analytical laser-based spectroscopy and is now an emeritus chemistry professor, I think chemistry is a pretty broad field. Chemists use whatever tools they think most effective, regardless of whomever invented them, to address chemistry problems and solve them. People have been doing spectroscopic analysis since before Bunsen and Kirchhoff and they started off with simple prisms. In the case of Fraunhofer, he used a modified theodolite and a prism. I illustrated this answer by showing that the sodium D lines can be observed spectroscopically.
Comment: I perfectly green about all you are saying. And I perfectly know spectroscopic analysis before and after Bunsen and Kirchhoff, with prisms or diffraction gratings. I am even teaching it at the high school level. But I have never seen these "echelles", "dekker", high order diffraction, not to speak of *cross dispersing the otherwise overlapped orders*. Sorry !
Comment: @Maurice    Fair! So echelle gratings are simply gratings designed to work in high diffraction orders, to achieve high spectral resolution. But the high orders severely overlap, so cross-dispersion saves the day. No need to worry about that. A dekker is just a thing that allows a user to alter the length of a slit in a spectrometer or spectrograph. Please look at this [link](http://www.astrosurf.com/buil/echelle/first.htm) showing a little of what French expert Christian Buil does with his echelle spectrograph. No need to deal with details: it is simply beautiful science!


Best resources on imputation in R

Question: This is my first question at stats.
I need to impute some factors and numbers in my data set in R. What are my best options regarding packages and also a source to read more about the theory.
Comment: mice package and anything by its author Stef van Buuren.
Comment: Possible duplicate of [Good references on learning how to deal with missing data/imputation](https://stats.stackexchange.com/questions/219863/good-references-on-learning-how-to-deal-with-missing-data-imputation) Note that Amelia II has documentation that explains what imputation is and how it works in addition to the fact that it is R software.
Comment: Definitely needs a new question and I'm sure there are already tonnes of well-answered questions on the site already. Winsorizing works well. But you should always approach removing outliers with extreme caution, unless you have strong evidence the observations are illegitimate in some way you may be removing data that is part of the process you are trying to model, however extreme they are.
Comment: @llewmills great thanks!  Maybe it requires a new question but I also want to know how to handle "extreme outliers".
Comment: @Sycorax : This is not a duplicate; this is about software packages in R.
Answer: My Master's thesis revolved around the use of the mice package in R and I have only good things to say about it. I tried to use Amelia II but it just wasn't well suited to my data so I can't comment too much on that. The approach of the two packages does differ though so you may want to research which is better suited for your data.
If you do end up taking the MICE route, here are some papers I would recommend to get you off to a running start:

Azur, M. J., Stuart, E. A., Frangakis, C., and Leaf, P. J. (2011).
  Multiple imputation by chained equations: what is it and how does it
  work? International Journal of Methods in Psychiatric Research,
  20(1):40–49.
Buuren, S. and Groothuis-Oudshoorn, K. (2011). mice: Multivariate
  imputation by chained equations in R. Journal of Statistical Software,
  45(3):1–66.

I also really liked the following textbook,

Enders, C. K. (2010). Applied missing data analysis. Guilford Press.
Comment: Thanks. My data is mostly administrative data from the health sector ( e.g. electronic patient journal) and mostly timestamps or character/factors. E.g. sometimes I don't have a timestamp or missing the factor (emergency vs routine).
Answer: I found Chapter 3 in Regression Modeling Strategies by Frank Harrell to be a good overview. It covers types of missing data, strategies for imputation, and discusses simplistic and advanced methods. The packages recommended in that chapter are MICE and aregImpute in R.

Best resources on imputation in R


Entity Framework - what's the difference between using Include/eager loading and lazy loading?

Question: I've been trying to familiarize myself with the Entity Framework.  Most of it seems straight forward, but I'm a bit confused on the difference between eager loading with the Include method and default lazy loading.  Both seem like they load related entities, so on the surface it looks like they do the same thing.  What am I missing?
Answer: Let's say you have two entities with a one-to-many relationship: Customer and Order, where each Customer can have multiple Orders.
When loading up a Customer entity, Entity Framework allows you to either eager load or lazy load the Customer's Orders collection. If you choose to eager load the Orders collection, when you retrieve a Customer out of the database Entity Framework will generate SQL that retrieves both the Customer's information and the Customer's Orders in one query. However, if you choose to lazy load the Orders collection, when you retrieve a Customer out of the database Entity Framework will generate SQL that only pulls the Customer's information (Entity Framework will then generate a separate SQL statement if you access the Customer's Orders collection later in your code).
Determining when to use eager loading and when to use lazy loading all comes down to what you expect to do with the entities you retrieve. If you know you only need a Customer's information, then you should lazy-load the Orders collection (so that the SQL query can be efficient by only retrieving the Customer's information). Conversely, if you know you'll need to traverse through a Customer's Orders, then you should eager-load the Orders (so you'll save yourself an extra database hit once you access the Customer's Orders in your code).
P.S. Be very careful when using lazy-loading as it can lead to the N+1 problem. For example, let's say you have a page that displays a list of Customers and their Orders. However, you decide to use lazy-loading when fetching the Orders. When you iterate over the Customers collection, then over each Customer's Orders, you'll perform a database hit for each Customer to lazy-load in their Orders collection. This means that for N customers, you'll have N+1 database hits (1 database hit to load up all the Customers, then N database hits to load up each of their Orders) instead of just 1 database hit had you used eager loading (which would have retrieved all Customers and their Orders in one query).
Comment: @Bugeo Are you sure about that? I haven't tested it, but I'm pretty sure an eager load will perform a LEFT OUTER JOIN against the Orders table to retrieve all Orders for a Customer. Otherwise, eager loading wouldn't be very worthwhile.
Comment: Your response is not clear. You can't use eager loading to load with one query the customer and all the orders related to the customer.
With eager loading you can retrieve the order and the related customer.
Comment: @Bugeo it was clear enough to me. Granted, I know the difference already. But still, this is the way it works imo.
Comment: @Erik please read the secon pharagraph. Ther is a mistake in the response. "Customer out of the database Entity Framework will generate SQL that retrieves both the Customer's information and the Customer's Orders in one query" is false. It will retrieve only one order not all the orders.
Answer: If you come from SQL world think about JOIN.
If you have to show in a grid 10 orders and the customer that put the order you have 2 choices:
1) LAZY LOAD ( = 11 queryes = SLOW PERFORMANCES)
EF will shot a query to retrieve the orders and a query for each order to retrieve the customer data.
Select * from order where order=1
+
10 x (Select * from customer where id = (order.customerId))

1) EAGER LOAD ( = 1 query = HIGH PERFORMANCES)
EF will shot a single query to retrieve the orders and customers with a JOIN.
Select * from orders INNER JOIN customers on orders.customerId=customer.Id where order=1

PS:
When you retrieve an object from the db, the object is stored in a cache while the context is active.
In the example that I made with LAZY LOAD, if all the 10 orders relate to the same customer you will see only 2 query because when you ask to EF to retrieve an object the EF will check if the object is in the cache and if it find it will not fire another SQL query to the DB.
Answer: Eager loading is intended to solve the N+1 Selects problem endemic to ORMs. The short version is this: If you are going to directly retrieve some number of entities and you know you will be accessing certain related entities via the retrieved entities, it is much more efficient to retrieve all the related entities up-front in one pass, as compared to retrieving them incrementally via lazy loading.
Comment: A use case scenario that I could see using Lazy loading would be if you're loading related data that contains BLOB data.  You may not want to load all that at one time.
Answer: An important issue is serialization.  Microsoft recommends NOT using the default lazy loading if you're dealing with serialized objects.  Serialization causes ALL related properties to be called, which can start a chain reaction of related entities being queried.  This really comes into play if you're returning JSON data  from a controller.  JSON data is obviously serialized.  You'd either want to return data immediately via Eager or turn the lazyloading off in the context and employ Explicit Lazy loading.


What format to use when recording music to a CD?

Question: I have a bunch of mp3 files I'd like to record to a CD. However, I'm not sure if the CD player can read MP3. What format should the music be in to ensure that it will be read correctly? And does it even matter or do CDs use an "internal" format?
Comment: CD's do use an internal format, called "Redbook Audio".  Many CD burning programs have a destination to burn to named "CD Audio" or similar, as opposed to a "data CD" which is what you'd burn it as if your player could read .mp3 files off the disc.  Redbook Audio limits you to 80 minutes of music encoded at 16-bit PCM at 44.1KHz.
Answer: The music should be in WAV format to be readable from most CD players.
MP3 CD Maker is an easy program with which you can put your MP3's as WAV's on a CD.
Update
As pointed out by @Vdex in the comments, the format is actually RAW audio format which is comparable to WAV without the header information.
Even more specifically it is CDDA, as pointed out by @Joakim.
That's why you need software to create an audio CD from single audio files.
I think if you already have WAV files, you can do this with most CD recording software (choose for create audio or music CD in the first step of the wizard mostly, and then select your WAV files), but MP3's need to be converted to WAV first. That's where MP3 CD Maker comes into play.
Comment: To be pedantic, WAV files have extra header information and Audio CDs use RAW (http://en.wikipedia.org/wiki/Raw_audio_format). WAV files on a data CD format for instance won't work.
Comment: @Vdex: I know "WAV files on a data CD format" won't work, that's why I suggest using software for that ;-)
Comment: Just thought I'd point it out in case somebody else reading it decides to burn WAV files directly :)
Answer: To be playable in any CD player one need burn in Audio CD Format (CD-DA). This is not the same as a data CD with a filesystem (iso9660) where music (mp3 or anything) can be represented as files. Audio CD Format don't have a filesystem nor a fileformat, music just sits directly on the CD in RAW format track after track.
any isn't fully true as really (really) old Audio CD players might have problem with burned media.
Answer: Some CD players can play mp3 files (most new ones do), there is usually a sticker that says "mp3 compatible" or something similar, and if that is the case you shouldn't need to convert them, not all mp3 cd players can handle sub-folders, so you might need to place all the mp3s in the root folder. If it can't handle mp3s you have to write the CD in a special way (audio cd format), for that you will need special software, I have used Nero in the past - you just drag and drop the mp3's and it converts it for you.
For me a CD player that can't handle mp3s would be a deal breaker, considering that raw audio CDs store about 75 minutes of music per disc, compared to the ~700 minutes you can achieve with mp3s.


How to wait for a thread to finish in Objective-C

Question: I'm trying to use a method from a class I downloaded somewhere. The method executes in the background while program execution continues. I do not want to allow program execution to continue until this method finishes. How do I do that?
Answer: Here's another way to do it using GCD:

- (void)main
{
    [self doStuffInGCD];
}

- (void)doStuffInGCD
{
    dispatch_group_t d_group = dispatch_group_create();
    dispatch_queue_t bg_queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0);

    dispatch_group_async(d_group, bg_queue, ^{
        [self doSomething:@"a"];
    });

    dispatch_group_async(d_group, bg_queue, ^{
        [self doSomething:@"b"];
    });

    dispatch_group_async(d_group, bg_queue, ^{
        [self doSomething:@"c"];
    });

    // you can do this to synchronously wait on the current thread:
    dispatch_group_wait(d_group, DISPATCH_TIME_FOREVER);
    dispatch_release(d_group);
    NSLog(@"All background tasks are done!!");

    // ****  OR  ****

    // this if you just want something to happen after those are all done:
    dispatch_group_notify(d_group, dispatch_get_main_queue(), ^{
        dispatch_release(d_group);
        NSLog(@"All background tasks are done!!");
    });
}

- (void)doSomething:(id)arg
{
    // do whatever you want with the arg here
}

Comment: Cheers! This method is even better
Comment: @node ninja Would you mind selecting an answer for your question?
Comment: Cool! In my recent interview, they asked me the same concept!
 Thanks for saving my life
Answer: Use an NSOperationQueue, like this
(from memory so forgive any minor errors -- you'll get the basic idea):

// ivars
NSOperationQueue *opQueue = [[NSOperationQueue alloc] init];
// count can be anything you like
[opQueue setMaxConcurrentOperationCount:5];

- (void)main
{
    [self doStuffInOperations];
}

// method
- (void)doStuffInOperations
{
    // do parallel task A
    [opQueue addOperation:[[[NSInvocationOperation alloc] initWithTarget:self selector:@selector(doSomething:) object:@"a"] autorelease]];

    // do parallel task B
    [opQueue addOperation:[[[NSInvocationOperation alloc] initWithTarget:self selector:@selector(doSomething:) object:@"b"] autorelease]];

    // do parallel task C
    [opQueue addOperation:[[[NSInvocationOperation alloc] initWithTarget:self selector:@selector(doSomething:) object:@"c"] autorelease]];

    [opQueue waitUntilAllOperationsHaveFinished];

    // now, do stuff that requires A, B, and C to be finished, and they should be finished much faster because they are in parallel.
}

- (void)doSomething:(id)arg
{
    // do whatever you want with the arg here
    // (which is in the background,
    // because all NSOperations added to NSOperationQueues are.)
}

Comment: I know I didn't ask this question but this was what I was looking for with my app cause I was having race conditions and I knew they were because I could click faster then the code could finish thus a partial load condition on the views. This solved my problem big time. So thank you sir, I feel like this should be marked as the true answer because it is not using a work around and is incorporating thread safe coding with the ios library.
Comment: @AdamM - check out the other answer I posted today.  It's a much cleaner way to do it and GCD is supported for all iOS 4 and up.  One notable benefit of this way is that you will not get crashes when objects are deallocated out from under you because GCD automatically retains and releases all object you reference.
Comment: Second what Rob said, this is exactly what I was looking for too!
Answer: My first inclination is to not do what you are suggesting. The technique I've used before is to give the thread a selector to a method in the originating object (which is on the main thread). When the second thread is started, the main thread keeps executing, but puts up a busy indicator of some sort on the display. This allows user interaction to continue if required.
When the second thread ends, just before it shuts down, it calls the selector on the main thread. The method that the selector references then removes the busy indicator from the display and tells the main thread to update, picking up whatever data the second thread has generated.
I've used this successfully for an app which accesses a web service (on the second thread) and then updates the display once data is returned without locking it. This makes the user experience much nicer.
Answer: For such cases I usually using NSCondition class.
//this method executes in main thread/queue
- (void)waitForJob
{
    id __weak selfWeak = self;
    NSCondition *waitHandle = [NSCondition new];
    [waitHandle lock];
    dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_BACKGROUND, 0), ^{
        [selfWeak doSomethingLongtime];
        [waitHandle signal];
    });
    //waiting for background thread finished
    [waitHandle waitUntilDate:[NSDate dateWithTimeIntervalSinceNow:60]];
}

Answer: Several technical ways to synchronize multi-threads, such as NSConditionLock(mutex-lock), NSCondition(semaphore)。But they are common programming knowledge for other languages(java...) besides objective-c. I prefer to introduce run loop(special in Cocoa) to implement thread join:
NSThread *A; //global
A = [[NSThread alloc] initWithTarget:self selector:@selector(runA) object:nil]; //create thread A
[A start];

- (void)runA
{
  [NSThread detachNewThreadSelector:@selector(runB) toTarget:self withObject:nil]; //create thread B
  while (1)
  {
    if ([[NSRunLoop currentRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate distantFuture]]) //join here, waiting for thread B
    {
      NSLog(@"thread B quit...");
      break;
    }
  }
}

- (void)runB
{
  sleep(1);
  [self performSelector:@selector(setData) onThread:A withObject:nil waitUntilDone:YES modes:@[NSDefaultRunLoopMode]];
}

Answer: I'd suggest wrapping up call to the class method in your own method, and set a boolean once it completes. For eg:
BOOL isThreadRunning = NO;
- (void)beginThread {
    isThreadRunning = YES;

    [self performSelectorInBackground:@selector(backgroundThread) withObject:nil];
}
- (void)backgroundThread {
    [myClass doLongTask];

    // Done!
    isThreadRunning = NO;
}
- (void)waitForThread {
    if (! isThreadRunning) {
        // Thread completed
        [self doSomething];
    }
}

How you wish to handle waiting is up to you: Perhaps polling with [NSThread sleepForTimeInterval:1] or similar, or sending self a message each run loop.
Comment: I did this, and it works, but it also prevents the HUD from being displayed.
Comment: You could use NSTimer to poll and keep UI updates working correctly. It all depends on what you need. For a simple task and then update Derek's answer would be neater and less troublesome.
Comment: For a game engine or something more realtime a timer may already be in place anyway. Then sending off a thread and forgetting about it might be more what you need.
Comment: I'd suggest to use NSThread since it already has isFinished method so you don't need extra flag for that. Also you can use NSCondition (wait, signal methods) so one thread can wait, and background thread would signal when it's close to finish job, so you don't need to re-check what happens every second. If you need to do something when background task finished, then use one more background thread and wait inside of it, in this case you won't block your main thread execution.
Answer: My technique is to check if the task can run (if the background thread is finished), and if it can't run then I use GCD to try again after a delay:
- (void)doSomething
{
  if (/* is the other thread done yet? */) {
    double delayInSeconds = 2.0;
    dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, (int64_t)(delayInSeconds * NSEC_PER_SEC));
    dispatch_after(popTime, dispatch_get_main_queue(), ^(void){
      [self doSomething];
    });
    return;
  }

  // do something
}


What is the difference between Apex:messages and Apex:PageMessages in VisualForce?

Question: I am having some confusion while using PageMessages and Messages in my VF Pages. I'm using an apex controller to pass a message to my vf page but the problem is that if I use PageMessages then it showing the default validation error messages on that page. And if use Apex:messages then the error messages don't show up at all...
Answer: apex:PageMessages is a containing component where any messages that have been added to the page will appear.
apex:pageMessage is a component that adds a single message to the page.
apex:message allows you to associate a message with a component
I've not used apex:messages - I can't see how it particularly differs from apex:pagemessages
ApexPages.Message is the class that is used to model a message.  A message isn't associated with a page until it is added via the ApexPages class.
ApexPages is a class that allows you to access the current page (through ApexPages.CurrentPage()) and manage messages for the current page.
I'd start off adding an apex:pageMessages component to the top of your page and then add some messages in programmatically via the ApexPages methods - that should help clarify things.
You can refer folloing link : http://www.sfdcpoint.com/salesforce/apexpagemessage-and-apexpagemessages-salesforce/
Answer: apex:pageMessages

This component displays all messages that were generated for all
  components on the current page, presented using the Salesforce
  styling.

apex:messages

All messages that were generated for all components on the current
  page. If an <apex:message> or <apex:messages> component is not
  included in a page, most warning and error messages are only shown in
  the debug log.
This component supports HTML pass-through attributes using the
  "html-" prefix. Pass-through attributes are attached to the generated
   tag. (Each message is contained in a list item.)

Functionality is same for both these components. Way of display is different. apex:pageMessages uses salesforce default styling. For apex:messages we need to add custom style using styleClass and style attributes available. Here is detail on apex:pagemessages and apex:message.
Answer: apex:pageMessages is the component where you can add multiple messages and it shows all the errors with formatting i.e. It displays all the messages that were generated for all components on the current page with formatting.
apex:pageMessage is used to display single message i.e. it shows the specified message with formatting.
apex:messages is similar to apex:pageMessages i.e. it shows all of the errors but with no formatting i.e. All messages that were generated for all components on the current page will be displayed without formatting.
apex:message shows only the error for the specified field i.e. it is used to display message for a specific component.


Time Series Analysis and ARIMA

Question: Why it is important to convert any time series problem data to stationary before applying ARIMA .can anyone please tell me intuition behind it ? ( I know if i dont convert it to stationary it will follow same trend but i want to understand how making stationary series is suitable for ARIMA )
Answer: Hi: All of the theory behind arima time series depends on weak stationarity ( there are a few different types of stationarity and weak is the least restrictive. I tend to get confused with the names so check what I say here ) which means that the first two moments of the response, the mean and the variance, are constant.  So, if you have a trending series, then, by definition, the mean of the series isn't constant which implies that all of the arima theory cannot be applied. By differencing, the hope is that the mean becomes constant and, of course, you still need the constant variance also. Note that there are some cons to differencing that other time series fields attempt to deal with. The main negative is that, even if differencing does seem to induce stationarity , it can cause a loss of information.
Answer:
i want to understand how making stationary series is suitable for ARIMA

Here are two somewhat simplified but intuitive explanations of what ARIMA needs stationary data. I will stick to the AR component of ARIMA, because it is easier to explain, but in more general terms, the same considerations are applicable to the MA component as well.
1 - First explanation - What does AR stand for? It stands for Auto-Regressive, meaning that you are performing a regression against the same variable, against passed values of itself, instead of against independent variables. Now remember one of the conditions for being able to perform linear regression: The variance has to remain the same all over the data set. In the case of an auto-regressive process, this means that the variance of the past have to remain the same in the future.
2 - Second explanation -  Consider the most basic AR process possible, $X_{t+1} = aX_t + \epsilon(t)$: what will happen if $a=2$?
After only ten time steps, $X_{t+10} = 1024 × X_t$,  and after 20 forecast steps $X_{t+20} = 1048576 × X_t$ (forecasting 20 steps ahead is not uncommon at all, the business use case I deal with most often involves forecasting 26 or 52 steps ahead). So you see the times series model growing very quickly out of bounds.
The only way to keep the model from growing out of bounds so quickly is to ensure that $|a| < 1 $ in $X_{t+1} = aX_t + \epsilon(t)$. Stationarity requirements ensure that this conditions is satisfied before modeling.
The conditions become a little bit more complex, when multiple lags are included, but the overall intuition is still the same: Stationarity insures that the time series never goes out of bands.
Check the Z-Transform and the concept of Unit Circle to better understand the second explanation.
Comment: You say "The variance has to remain the same all over the data set" .... more precisely "The variance of the error process has to remain the same all over the data set" . The assumptions are all about the error process not the observed Y. for example see https://autobox.com/cms/index.php/blog/entry/u-didnt-need-logs where a few (3)  anomalies cleaned up the variance of the error process.

Time Series Analysis and ARIMA


Buy product in Android Market for some period (In-app Billing)

Question: I have integrated in-app Billing into my android app. And there is one requirement: user should be able to buy (only one existing product) once a year. Is any way to do this? Because now if user have successfully finished purchase process, this product will be available for him forever!
Thanks!
Answer: Why not make a new product for every new year? Then check in your code whether the user has bought the product for the current year, otherwise offer him to buy it.
As far as I know, you can not take a previously bought product away from a user, so you must find another solution.
Answer: You need to use an unmanaged purchase as these can be purchased as often as necessary and are intended to be consumable.
You will also however, lose the convenience of the Android Market handling the license server and you will need to manage that yourself.
Answer: From in-App version 2 Subscription is also available. You just create a subscription product and set frequency as yearly. Google will automatically takes care rest of headache.
Tutorial can be found here.


Android Studio do not sees a Chrome device

Question: I am using a Flutter SDK for building a web application.
In these latter days i am trying to working on Linux, and i ran into a problem: Android Studio do not sees a Chrome in device list.
You can say what Flutter SDK is not properly configured, but no - Flutter seed a chrome device, and also Flutter can run a application in chrome via flutter run -d chrome command.
Has anyone encountered a same problem?
Flutter doctor output:
[urusai@mikhail-pc ka4alka-voting]$ flutter doctor -v
[✓] Flutter (Channel beta, v1.14.6, on Linux, locale ru_RU.UTF-8)
    • Flutter version 1.14.6 at /usr/lib/flutter
    • Framework revision fabeb2a16f (4 недели назад), 2020-01-28 07:56:51 -0800
    • Engine revision c4229bfbba
    • Dart version 2.8.0 (build 2.8.0-dev.5.0 fc3af737c7)

[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
    • Android SDK at /home/urusai/Android/Sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-29, build-tools 29.0.3
    • Java binary at: /opt/android-studio/jre/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b4-5784211)
    • All Android licenses accepted.

[✓] Chrome - develop for the web
    • CHROME_EXECUTABLE = /opt/google/chrome/google-chrome

[✓] Android Studio (version 3.6)
    • Android Studio at /opt/android-studio
    • Flutter plugin version 43.0.2
    • Dart plugin version 192.7761
    • Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b4-5784211)

[✓] Connected device (2 available)
    • Chrome     • chrome     • web-javascript • Google Chrome 80.0.3987.122
    • Web Server • web-server • web-javascript • Flutter Tools

• No issues found!

Comment: Try to invalidate the cache and restart android studio. You can see the option under `File -> invalidate cache and restart`
Comment: Of course i tried
Answer: Try launch Android studio via terminal.
if it the case, that Chrome(web) device is shown only when u run it via terminal. This means if u can copy your bash ~/.bashrc environment variable to user wide variable ~/.profile it can be fixed.
Try set up your environment variable in ~/.profile so it the same in ~/.bashrc


Output of SR flipflop

Question: Why are the 2 outputs of SR flipflop using nor gates considered to be Q and Q'? If we consider them Q and P for eg. The configuration S=1 and R=1 would be valid. So why are they considered complimentary of each other. They are clearly not complimentary since one configuration does not match the truth table of negation
Comment: The outputs are complementary except in the sole "illegal input" case (out of four possible), which you are supposed to avoid using anyway.
Comment: @jonk so today i will write some random circuit which evaluates to A xor B except for 1 case. So i say that case is illegal and my circuit is XOR gate. This is so illogical!
Answer: Except in the case where S = R = 1, the two outputs are opposite. That's why we say the two outputs are Q and Q'. The question then becomes "why is S = R = 1 illegal?"

The picture above shows a NOR SR latch with S = R = 1. Notice how the outputs are both 0 since 1 NOR anything = 0 (the program I am using is Logisim, by the way). If I then set the inputs back to the quiescent state where S = R = 0 (which is supposed to keep the state of the latch since 0 NOR x means the output depends SOLELY on x (0 NOR 0 = 1, 0 NOR 1 = 0, where the first 0 does not give us enough information to determine the output the same way 1 NOR x does)). X in this case is the output of the other NOR gate, so if the two inputs S and R are both 0, they do not affect the outputs, thus the state is "latched."
Anyway, when S = R = 1, A and B (top and bottom outputs) are both 0. What would happen if we switch S and R back to 0? A then becomes 0 NOR B, but remember that B was 0 before we change S and R back to being 0, so A = 0 NOR B = 0 NOR 0 = 1, and B = 0 NOR A = 0 NOR 1 = 0.
But, what would happen if B switched first? Then, B = 0 NOR A = 0 NOR 0 = 1, and A = 0 NOR B = 0 NOR 1 = 0.
The point is that, depending on which output changes first, we can not tell whether A = 1 and B = 0 or if A = 0 and B = 1. It depends on which output, A or B, changes first, and if we reset S and R back to 0 at the same time, it is completely random.
That's why S = R = 1 is illegal in a NOR SR latch, which is why, for all legal inputs, A and B are inverses, or as you'll see it, A = Q and B = Q'.
EDIT: For the sake of completion, I included pictures of all other states:
Answer: The outputs Q and Q' are complementary of each other as long as the configuration S=R=1 is not allowed. This is called a forbidden state as both NOR gates output zeros. This negates the logical equation Q=Q'. Therefore this state is not allowed.

So for a NOR SR latch the outputs are complementary to each other as long
  as the forbidden state S=R=1 is not considered.

Now there is another problem with this forbidden state that makes it even more inappropriate in circuits. When a forbidden to hold transition takes place due to a problem known as race condition the output Q may lock to either 1 or 0, depending on the propagation delays between the gates. So that is one more reason to avoid this situation even if you may be interested in this configuration.
There are some solutions to overcome this problem occurring with SR latch. One is to consider a JK flip flop in which the configuration (J,K)=(1,1) is no longer restricted. There are still other solutions to convert this restricted state to a non-restricted state which I leave it to you as an exercise.

Output of SR flipflop


New ASP.NET MVC 2 ViewMasterPage error

Question: Im trying out ASP.NET MVC 2 and have immediately hit a problem with my first application.When adding a View Master Page I get the following warning in VS 2008:
<code>\Views\Shared\ViewMasterPage.Master: ASP.NET runtime error: The specified module could not be found. (Exception from HRESULT: 0x8007007E)</code>Why is this? The System.Web.Mvc dll
is in the correct place and is referenced properly. I also have MVC 2 RC installed, Anyone have any ideas?
Answer: Check your projectproperties for the targeted .NET framework (under "Compile"->"Advanced Compile Options") and check the web.config values for added assemblies (System.Web.Mvc in version 18.104.22.168)
When migrating our project to MVC2 the wizard did not update these values and I had issues with my views.
Maybe this is what is preventing you from using MVC2?

New ASP.NET MVC 2 ViewMasterPage error


What is the difference between the words "dormant" and "latent"?

Question: It seems that they are interchangeable but I am having a hard time differentiating between the two.
Answer: Here is a brief explanation of the difference between latent and dormant in James Fernald, English Synonyms and Antonyms (1914):

That which is latent (from L. lateo, lie hidden) is hidden from ordinary observation (compare HIDE); as, latent powers; a latent motive; a disease is said to be latent between the time of its contraction and its manifestation. Dormant (from L. dormio, sleep) applies to the winter condition of hibernating animals, when they seem to sleep, or are even apparently lifeless; we speak of dormant energies (which have acted, and may yet again be aroused); a dormant volcano volcano; ...

Webster's Dictionary of Synonyms (1942) places latent and dormant in a larger group of related words that also includes quiescent, potential,and abeyant:

Latent, dormant, quiescent, potential, abeyant (or in abeyance) agree in meaning not now manifesting its existence. Latent implies concealment and is applied to that which is present without showing itself; dormant usually suggests sleeping and is applied to that which is alive without manifesting activity; as, a latent talent; latent energy; a dormant plant or volcano. "The poet's gift of seeing the latent possibilities in everything he touched" ([John Livingston] Lowes). "Which power can never exercised by the people themselves, but must be be placed in the hands of agents, or lie dormant" (Ch[ief] Just[ice John] Marshall).

Fernald's example of a latent disease is apt because, even though the germs may be proliferating madly inside the infected person's body, there are no symptoms yet—and as a result, the presence of the disease is hidden. A dormant disease, in contrast, is one that a person has had in the past but that has ceased (at least temporarily) to be active—and yet may be reactivated under the right circumstances (as when the body's built-up immunity to it breaks down).
Answer: Dormant refers to things not yet active, but with a chance to develop later, so like a bad gene in your body, that is waiting to be triggered by something.

not active or developing now, but possibly active in the future

Latent can be used in the same meaning, but also as something that has been hidden, not just undeveloped.

A feeling or quality that is latent exists now but is hidden or not yet developed.
Comment: Yes, because 'dormant' is derived from the Latin 'dormire' = to sleep and 'latent' is derived from 'latere' = to lie hid.  For some reason, 'dormant' is misderived from the 4th conjugation Latin verb.  Strictly, it ought to be 'dormient'.  But then, derivers do not always follow strict rules.
Comment: So they can be used interchangeably? Can someone use them in sentences? For example: you couldn't say "latent volcano" aka "inactive volcano," because that isn't the correct usage. I'm still pretty confused.
Comment: @Tuffy: "Dormant" was taken from French, not directly from Latin. In French, present participles are formed with *-ant* for verbs of all conjugation classes.
Comment: @sumelic Oops! Of course you are right.  Thanks for reminding me.


What is a hit die, and how do I calculate monster HP?

Question: I'm new and have the AD&D Monster Manual and Fiend Folio. I want to know how to calculate monsters' HP. Does 4 hit dice mean 4 HP, or 4 rolls of a die, and how do I know what die to roll if it is?
Comment: I've edited your question to clarify it - please check to see if it's still asking what you meant to ask. Also, welcome to the site! Please check our [tour] to get an idea of how things work here, we're different to other sites.
Comment: Seriously? This is explained at the very start of the Monster Manual under "explanatory notes" on page 5! This is a "Can someone read the book to me because I can't be bothered" question.
Answer: Hit dice in AD&D are d8 unless otherwise specified. A creature with 4 hit dice would have 4d8 hit points.  That means that you roll a d8 four times and add the results together to generate its hit points.

HIT DICE indicates the parameters of the number of hit points a creature can withstand before being killed. Unless stated otherwise hit dice are 8-sided (1-8 hit points). The indicated number of dice are rolled, and the numbers shown on each are added together to arrive at a total number of hit points. (MM1e p.5)
Comment: I brought in the citation you mentioned--feel free to trim it back; I figured it'd be easier for you to cut than to add.


Does an ability bonus go beyond the maximum listed?

Question: Basically, if I wear something (or get a twist of fate) that gives +1 to might abilities does that give me more of a bonus on any given ability than I would have for maxing it out?
Answer: Skills can go over their max, but only by two points. If you have +3 to might, your maxed skills will only be two over their max, not three.
Some of the skills will only go 1 over max. This includes the might harpoon spell.
The weapon skills that provide new moves will not go over max. Unlike other skills which provide an increasing bonus at each level, like increased greatsword damage, these skills provide a distinct bonus at each level, and there's nothing extra to add at level 4.
Answer: I don't get what you're asking but I'll try to answer your question.
In this instance, yes, it will give +1 to all might abilities that you currently and will have. If you're asking if it will go beyond the max level, then yes, its possible to go beyond the max level of a skill, I once had a 8/6 skill as a finesse/magic character.


Single point Z-correction after 3-point auto-leveling

Question: On my Monoprice Delta Mini, auto-leveling is performed based on three pushbuttons, on which the printer platform rests: The nozzle moves downwards until one of the buttons detects being pushed down. Using the G29 G-code, this is performed automatically at three points close to the locations of these sensor buttons.
However, even after this calibration, the printer expects the platform at one of the test points to be lower than it actually is. Thus, when printing close to the front right sensor button, the printer "smears" the plastic onto the platform. At the other locations, the printing works fine. Therefore, I cannot simply adjust the overall Z-distance. (Multi-point auto-leveling gives even worse results since the platform tilts during the probing.)
Is there a G-code-based option to modify the Z-height of just one of the calibration points of the auto-leveling?
Edit: The bad leveling seems to be a common problem of this printer:
https://www.reddit.com/r/mpminidelta/comments/73xcxg/leveling_doesnt_seem_right/
https://www.reddit.com/r/mpminidelta/comments/6tqe7f/follow_up_on_bed_leveling_issue/
Till now, nobody seems to have a solution.
Answer: There is no "standard" g-code, especially for the auxiliary functions of calibration, and even more so for the calibration of delta-class printers.  I find that the Reprap Wiki includes a fairly comprehensive list: http://reprap.org/wiki/RepRap_Firmware_G-Codes and http://reprap.org/wiki/G-code.  These lists address the RepRap firmware, although they include some g-code functions which are specific to other types of applications.
If the Monoprice Delta firmware is based on the RepRap firmware, the lists might be helpful, although detailed documention from Monoprice would be the best reference.
Assuming there is no available or known g-code to adjust this, you work from the hypothesis that your three switches are not responding identically.  If possible, use a micrometer to measure the difference between the "idle" position of the bed and the point where the switch actuates.  It could be that the front switch requires more travel before actuation, which would then cause the leveling calculation to have a lower point for the front switch.  In the alternative to measuring, it may be possible to exchange the front switch with a rear/side switch and see if the problem moves.
Delta machines are more difficult to calibrate because everything interacts.  The three actuator delta machine is a simplification of a more complex 6-axis Stewart platform.  As I see it, a delta machine is a 6-actuator machine in which pairs of actuators operate "identically", except that minor variations cause unexpected positioning errors.  Sometimes these are modeled as a bowl shape with positive or negative curvature, although measurements I've made on my home-brew delta show an error that looks more like a carpet in a high wind.  Some factors improve the design, such as longer actuator arm pairs and smaller build diameter, which may help you with the Monoprice.


Are length contraction and time dilation physical?

Question: Are length contraction and time dilation real physical phenomena, or are they just a measurement issue?
Comment: Both, but it cannot explain this clearer than Einstein does, see [here](http://en.wikipedia.org/wiki/Length_contraction#Reality_of_length_contraction).
Comment: Lots of info out there if you just google for it. For instance, these Wiki pages: [Length Contraction#Experimental Verification](http://en.wikipedia.org/wiki/Length_contraction#Experimental_verifications), [Time Dilation#Experimental Confirmation](http://en.wikipedia.org/wiki/Time_dilation#Experimental_confirmation), [Tests of Special Relativity](http://en.wikipedia.org/wiki/Tests_of_special_relativity).
Answer: It's unclear what you mean by "measurement issue" here, but my reading suggests that your question is loaded with what most modern physicists would consider a false dichotomy, namely you implicitly differentiate between "real physical phenomena" and "measurement issues."
A modern physicist would view a phenomenon to be "real" precisely when it has measurable consequences.  As a result, we might as well take "a phenomenon having measurable consequences" as the definition of a "real" phenomenon.
Time dilation and length contraction both have measurable consequences, so are they are real by this definition.
For example, if we insist on defining time operationally (namely using clocks which are real physical objects that exhibit repeating behavior), then we find that time dilation has measurable consequences.  See, as a particularly clear example, this experiement.
Comment: @user32280 They are both right.  Spatial lengths are observer-dependent quantities.  On the other hand, there are quantities that are observer-independent.  These quantities are called "invariants."  There is nothing "unphysical" about certain quantities being observer-dependent.  A good analogy in the context of non-relativistic physics would be that you and your friend may not agree on the positions of two buildings (if you have chosen different coordinate axes) but you will agree on the distance between them.
Comment: By "measurement issue" I meant a mathematical correction imposed by the fact that our observation is not instant, but our apparatus is based on the speed of light. By "physical phenomena" a meant, let's say, that you can use length contraction for obtaining a piezoelectric effect.
Comment: "Measurement consequences" strongly depend on available technique. What if weak force, strong force, gravitation, Higgs field or even yet-to-discover bosoms have higher-than-light speed? This may not contradict Lorentz equations, if they refer just to a measurement correction.
Comment: @user32280 I'm having trouble understanding what you mean.  Are you concerned about measurements having errors because information travel is limited by the speed of light?  If so, rest assured that it isn't particularly difficult to take the speed of light into consideration when making measurement.  If not, then I'm really unclear on what you're trying to say here.
Comment: Starting his engine, Captain Picard transmits: "Houston, why do you shrunk the kids?" After a few seconds, the controller's nephew responded: "It's just an optical illusion, you midget!" I want to know who's right and who's wrong.
Comment: @user32280 Put a piezoelectric sensor. Put whatever you want. You and some other person will definitely say they got two different lengths, if they observed at different relative velocities.
Answer: As mentioned by the popular physicist Brian Greene, all objects are constantly moving within that 4 dimensional structure known as Space-Time. The speed of that constant motion is the speed of light, be it motion across space, across time, or across Space-Time in any other possible direction.
If you analyze the outcome of such a phenomena, you end up with Special Relativity and all of its equations.
It also makes it crystal clear as to the relationship between "Actual" and "Measure". If you have some time available, then Go to http://goo.gl/fz4R0I and watch the "KSP Special Relativity" video collection. Its a slow step by step analysis of motion, but it leads you to all the equations, including therefore the Time Dilation equation and the Length Contraction equation, while at the same time reveals the absolute foundation that creates the relativistic outcome. ( Total time of 9 short videos = 1 hour 39 minutes )
If you look at a 2D picture of a thin horizontal wire, you see it's length. But if the wire is then rotated 45 degrees on the Z axis and a new picture is taken, in the new 2D picture of the wire, the wire now seems to be shorter in length. All of this is due to a percentage of the wire now also extending across the Z axis.
In short, objects exist within the 4 dimensional environment known as Space-Time. These objects can be rotated within this 4 dimensional environment. However, we are confined to viewing only 3 Dimensions, and we do so since we can not look across the dimension of time. We are confined to the present time only. Thus when an object rotates within Space-Time it appears to contract in spacial length even though its actual length has not changed at all, just as the length of the wire has not changed at all.
Answer: Length contraction and time dilation is due to one viewing a moving thing from a different frame of reference.  A space-ship that is 1000 feet long, will to its occupants, or even a parallel traveller, remain 1000 feet, but stationary observers might see it contracted at 900 feet.


Would it be safe to install the 11.10 Unity version in 11.04 after adding the GNOME 3 PPA?

Question: I was thinking of installing GNOME 3 in a regular Natty, but I would like to have the option to switch to Unity available. Since building Gnome Shell turned out being quite hard a task, I was considering installing Unity 4.x, the Oneiric version based on GNOME 3, via one of the avilable sources, such as Launchpad. Would this be possibile and safe? Thanks for your advice!
Comment: me too want to know if i can. since i have issues with 11.10 but i like the unity so can i have it on 11.04
Answer: While this might be possible, I would suggest that you rather just upgrade to 11.10. It would not be worth the trouble (and risk of breakage) to compile Unity 4.x on 11.04, while also trying to upgrade to GNOME3 (which will itself make your 11.04 system much closer to instability).
Comment: It would be interesting to try, but it wouldn't be wise (even if it works) to put it out there in the wider community because new users who get curious are likely to try it and break something.
Comment: That's what I thought. I'm curious though, I'll set up a new partition to see if this is accomplishable. If anyone's interested I'll post another comment with the result.


On Maxwell-Boltzmann distribution for unevenly distributed gases

Question: Among the assumptions required for the applicability of Maxwell-Boltzmann statistics, there is one that assumes the particles to be evenly distributed in the volume $V$ they occupy.
Suppose now that they have within the same volume $V$ a density distribution $\rho(\mathbf{x}, t)$ instead. Is there a way to adapt the Maxwell-Boltzmann distribution of velocities
$$
{\displaystyle f(v)~d^{3}v=\left({\frac {m}{2\pi kT}}\right)^{3/2}\,e^{-{\frac {mv^{2}}{2kT}}}~d^{3}v}?
$$
to this specific case?
Comment: I think we can not use Maxwell-Boltzmann distribution of velocities to this specific case for any density distribution $\rho(x,t)$. There must be some reason (interactions or constraints) to make the system have the density distribution $\rho(x,t)$ rather than uniform distribution. So we should deriv the new distribution from the principle of maximum entropy with the constraints of density distribution $\rho(x,t)$. It may be helpful to assume one concrete form of density distribution and get the corresponding distribution of velocities.
Answer: Maxwell-Boltzmann distribution (and a big part of what is studied in introductory statistical mechanics) refers to a gas in equilibrium. Maxwell distribution specifically deals with the case where no external potential is present, in which case the equilibrium distribution of gas has uniform density. Boltzmann generalizes this to the case when external potential is present, and the density might be non-uniform in this case, $$W(\mathbf{p},\mathbf{x})\propto e^{-\frac{H(\mathbf{p},\mathbf{x})}{k_BT}}.$$
However, general non-unform density is not necessarily in thermal equilibrium and thus not necessarily obeys MB. In this case one needs to use non-equilibrium statistical mechanics (kinetic equation, etc.) - although this one also often uses an assumption of local equilibrium.
Comment: What If I have a fixed volume $V$ made of an (initial) unevenly distributed liquid substance in water at a constant temperature $T$?
Comment: @ric.san Generally, the water will flow, the entropy will grow, until it settles in equilibrium. The fact that (local) temperature is the same everywhere does not mean that the system is in equilibrium.
Answer: Yes, you can adapt the Maxwell-Boltzmann distribution to a case of non uniform spatial distribution of particles as long as the process is isothermal. This means that mixing should have no effect on temperature.  This condition is satisfied for ideal gases and also for ideal solutions. In both cases if components start with arbitrary spatial distribution but at the same temperature, temperature will be maintained during mixing and both components will satisfy the same MB distribution.
Comment: Thanks, that is what I was hoping to hear. Can you provide some references that could support what you said?
Comment: I don't have a reference but the proof is simple: imagine that the particles are "black" and "white" but otherwise identical. To a color-blind observer the system is in in equilibrium and obeys the MB distribution. To a color-able observer the particles are distributed non uniformly in space and still obey the MB distribution.
Answer: What is the point of evenly distributed or not, when result is in statistical form then there is variation. This distribution although assume thermal equilibirium to have only one variable as speed or mechanical energy, otherwise this distribution itself meant there is no thermal equilibirium. At equilibirium there is no distribution. But it is hard to have equilibirium if density is more or source has low power.
Comment: You should edit your answer because in its present form it makes no grammatical or physical sense.
Comment: @Themis I think your theory must first have idea of equilibirium. What is equilibirium of particles in closed system, when all particles have that energy. Can you compute total energy with above distribution, what is it. Is it $NkT$, now where is distribution when all particles gained that energy.


What factors are used to determine display order when the "Sort By Relevance" option is used while searching in Magento Connect?

Question: I want to understand the logic or algorithm behind the search functionality in Magento Connect when the Sort by option in Refine search is set to sort by Relavence
Comment: Do you mean the Magento Connect website?
Comment: Yes @sr_magento
Answer: I would suppose that search is implemented using MySQL FULLTEXT index.
Here is a quote from MySQL official documentation regarding to how that index works:

Rows returned are automatically sorted with the highest relevance first. Relevance values are nonnegative floating-point numbers. Zero relevance means no similarity. Relevance is computed based on the number of words in the row, the number of unique words in that row, the total number of words in the collection, and the number of documents (rows) that contain a particular word.

As a proof of that you can try to perform a search on Magento Connect website using the following search terms:

Slider
Order
SEO

For the first term the first results are modules with titles:

I-Slider - Banner Slider
Product Slider Pro | Multiple Sliders | Responsive Slider

For the second:

Order - Order Reminder

For the last one:

SEO ― Advanced SEO Suite

As you can see in all cases the first items have more than one occurrence of search term in the title so relevance of them is higher.
Seems like that is how Magento Connect search works.
Comment: Not a bad guess, Alex.  Though I suppose it assumes connect is built on top of the same underlying stack as Magento, which may not be the case.  Hoping [@BenMarks](http://magento.stackexchange.com/users/5/benmarks) chimes in
Answer: While Magento.com is built upon Drupal, Magento Connect seems to be using Magento itself, at least as foundation.
Evidence:

the search URL magento-connect/catalogsearch/result/?q=TERM
the used JavaScript files:

paths to CSS files such as http://www.magentocommerce.com/magento-connect/skin/frontend/enterprise/connect/css/base.css with license the header containing:
 * @category    design
 * @package     enterprise_connect
 * @copyright   Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
 * @license     http://www.magentocommerce.com/license/enterprise-edition

With this information, we can concur that the search works the same way as in Magento Enterprise. Now there are several possibilities:

MySQL LIKE search
MySQL FULLTEXT search
MySQL combined search
Solr

As you can see if you search for arbitrary search term combinations, it's not the default LIKE search with OR that everybody hates. So either it's the fulltext search that orders by relevance by default, as suggested by @alex_b or the Solr search of the Enterprise_Search module, for which I probably am not allowed to disclose details.


How much disk space does Android OS 4.1.1 take?

Question: I recently received a Samsung Galaxy Tab 2 7.0 with Android 4.1.1 on it. This is the 8GB model. I am curious to know, how much disk space does the Android OS take up? I did not think about 3.5GB was needed for the OS. Is this true? I ask only because my disk space available says I have 4.49GB left.
Answer: There's a difference between "how much the Android OS requires" and "how much the manufacturer reserved". Remember, the OS has its own partition (/system), which is mounted read-only during normal operation (just made writable for OS updates), while the user's data goes to /data. Moreover, most manufacturers add their own "presents" (also known as bloatware) to the /system partition.
So while the actual Android system usually fits into less than 1 GB (considered there are devices shipping with less internal storage), your device's manufacturer might have decided to reserve more space for future updates and his own add-ons.
Comment: Just to clarify, examples of these add-ons are bundled software (facebook, customized calendar app etc.), customized user interface/launcher (TouchWiz) and the whole S Pen software.
Comment: how would I check how much the manufacturer reserved. I'm just trying to figure out why I only have 4.49GB of space left
Comment: Either use `adb shell` or a Terminal app (e.g. [Android Terminal Emulator](https://play.google.com/store/apps/details?id=jackpal.androidterm), and run `df`. The "reserved area" is mounted at `/system`. There are other partitions like e.g. `/cache` which are not directly accessible to you; "userland" is `/data`, where you should find your 4.49 GB.