"Good states" in degenerate perturbation theory

Question: So, we recently covered degenerate (time independent) perturbation theory in my quantum 2 course (undergrad). I feel pretty ok about obtaining the energy correction values (find the eigenvalues of $H'$ from the "secular equation" is at least how I understood it in a procedural sense). However, I'm really having a problem understanding what Griffith's (textbook for class) and a vast majority of resources I have found mean by "good states". So, supposing a first order energy correction "lifts" a doubly degenerate eigenvalue into 2 different eigenvalues, how do I go about finding the wavefunctions for the system with the hamiltonian $H=H_0+H'$? I understand that the "good states" are the eigenvectors/eigenfunct.s/eigenstates of $H'$, and, since they are linear combos of the eigenstates of H0 then they are also an eigenstate of H0. What I don't understand, is what this means/how it can be used/ what the significance of these "good states" are. I'm under the impression that they have something to do with finding the first order approximation of the eigenfunctions for the H=H0+H' system, but, other than that I'm fairly lost on how this is actually carried out. To rephrase... consider a doubly degenerate energy level of some system with hamiltonian, H0, where |n,k>=|k> (only considering a single n/energy level so can just use k) for all k=1,2 are the eigenstates of this level/energy eigenvalue. Now suppose we have a system with hamiltonian,H=H0+H', where H' is a small perturbation. Now say we find the first order energy corrections to the energy eigenvalue of H0 which, upon correction, gives us the energy spectrum of the corresponding states for the H=H0+H' system post-perturbation. (maps E for this level in unperturbed system to two E levels in the perturbed system). Now, suppose I want to find the wavefunctions for these definite energy states in the H=H0+H' system. How is this done?
Answer: Zeroth order in perturbation theory
The starting point for perturbation theory is zeroth order, when we ignore the perturbation and we focus on the free Hamiltonian, $H_0$. In order for degenerate perturbation theory to be relevant, it must be the case that the free Hamiltonian has at least one degenerate energy level. Any remnant symmetry can be used to classify the states after the degeneracy is lifted.
To make this concrete, suppose at energy $E$, there is a 2-dimensional degenerate subspace. Let's say that $|a\rangle$ and $|b\rangle$ form a basis for this subspace. Then, there are an infinite number of states that have energy $E$, of the form $c_1 | a\rangle + c_2 |b\rangle$, where $|c_1|^2 + |c_2|^2 = 1$. More concretely, for all pairs of complex numbers $c_1$ and $c_2$ obeying the normalization condition,
\begin{equation}
H_0 \left(c_1 | a \rangle + c_2 | b \rangle \right) = E\left(c_1 | a \rangle + c_2 | b \rangle\right)
\end{equation}
In other words, all states in this two dimensional space have the same energy $E$, and all of them are eigenstates of the free Hamiltonian.
First order in perturbation theory
Now, we go to first order in perturbation theory, and add the perturbation Hamiltonian, $H_1$. Typically, the result of the perturbation is to lift the degeneracy of the states with energy $E$. This means that the energy level $E$ will be split into two energy levels, one with energy $E + \delta E_1$ and one with energy $E + \delta E_2$, with $\delta E_1 \neq \delta E_2$.
As a result, general state of the form $c_1 |a \rangle + c_2 | b \rangle$, which was an eigenstate of the free Hamiltonian $H_0$ with energy $E$, will not be an eigenstate of the full Hamiltonian $H_0 + H_1$.
However, there will be a special pair of eigenstates of the free Hamiltonian, which we will call $|A \rangle$ and $|B \rangle$, which are also eigenstates of $H_0 + H_1$, with energies $E+\delta E_1$ and $E + \delta E_2$, respectively. These are the so-called "good states." Let me go through some properties of them, and then talk about how to find them.
Properties of "good" and "bad" states
Let's write out some properties of these special states $|A \rangle$ and $|B \rangle$, as well as the not-so-special states $|a\rangle$ and $|b\rangle$, in equations.

First, since $|A\rangle$ and $|B\rangle$ are members of the degenerate subspace of $H_0$ with energy $E$, they can be expanded in terms of $|a\rangle$ and $|b \rangle$
\begin{eqnarray}
|A \rangle &=& \alpha_1 | a \rangle + \alpha_2 | b \rangle \\
| B \rangle &=& \beta_1 | a \rangle + \beta_2 | b \rangle
\end{eqnarray}
where $\alpha_{1, 2}$ and $\beta_{1,2}$ are complex numbers (you can think of them as specific choices of $c_1$ and $c_2$). You can also express $|a \rangle$ and $|b\rangle$ in terms of $|A\rangle$ and $B\rangle$
\begin{eqnarray}
|a \rangle &=& \gamma_1 | A \rangle + \gamma_2 | B \rangle \\
| b \rangle &=& \lambda_1 | A \rangle + \lambda_2 | B \rangle
\end{eqnarray}
Second, $|A\rangle$ and $|B\rangle$ are eigenstates of the free Hamiltonian $H_0$ with energy $E$, meaning
\begin{eqnarray}
H_0 | A \rangle &=& E | A \rangle \\
H_0 | B \rangle &=& E | B \rangle
\end{eqnarray}
Of course, $|a \rangle$ and $|b\rangle$ are also eigenstates of $H_0$
\begin{eqnarray}
H_0 | a \rangle &=& E | a \rangle \\
H_0 | b \rangle &=& E | b \rangle
\end{eqnarray}
Third, $A\rangle$ and $|B\rangle$ are eigenstates of $H_0 + H_1$, but now with different energies
\begin{eqnarray}
\left(H_0 + H_1\right) | A \rangle &=& \left(E + \delta E_1\right) | A \rangle \\
\left(H_0 + H_1\right) | B \rangle &=& \left(E + \delta E_2\right) | B \rangle
\end{eqnarray}
However, $|a \rangle$ and $| b \rangle$ are not eigenstates of $H_0 + H_1$, since
\begin{eqnarray}
\left(H_0 + H_1\right) | a \rangle &=& \gamma_1 \left(E + \delta E_1\right) | A \rangle + \gamma_2 \left(E + \delta E_2\right) | B \rangle \\
\left(H_0 + H_1\right) | b \rangle &=& \lambda_1 \left(E + \delta E_1\right) | A \rangle + \lambda_2 \left(E + \delta E_2\right) | B \rangle
\end{eqnarray}

Since we want to find eigenstates of the full Hamiltonian, $H_0 + H_1$, we clearly are going to want to work with $|A\rangle$ and $|B\rangle$ instead of $|a \rangle$ and $|b\rangle$ (or any of the other infinite number of states that are eigenstates of $H_0$ with energy $E$). However, finding $|A\rangle$ and $|B\rangle$ can be tricky.
Finding good states
I won't attempt to give a general algorithm for constructing the good states (although, it can be done). Instead, I will just point out that often, degeneracies in the spectrum of the free Hamiltonian arise because there is a symmetry. The perturbation Hamiltonian tends to break symmetries.
To be concrete, let's suppose that $H_0$ is rotationally symmetric. This means that it commutes with all three components of the angular momentum, $L_i$, where $i=\{x, y, z\}$. We have
\begin{equation}
[H_0, L_i] = 0
\end{equation}
This is the origin of labeling states of Hydrogen by $|n, \ell, m \rangle$; the $\ell, m$ quantum numbers are eigenvalues associated with $L^2$ and $L_z$, respectively.
Now, typically, the perturbation Hamiltonian breaks the symmetry, so some of the symmetry operators will not commute with $H_1$. Let's consider the Stark effect, where we add an electric field in the $z$ direction. Then $L_x$ and $L_y$ will not commute with $H_1$. As a result, we expect states with different $\ell$ values (the eigenvalue of $L^2$) to have different energies -- the loss of symmetry has lifted the degeneracy that was previously present. However, $L_z$ does commute with $H_1$ (since the system is still symmetric with respect to rotations about the $z$ axis). This means that $L_z$ satisfies the property
\begin{equation}
[H_0, L_z] = [H_1, L_z] = 0
\end{equation}
This means we can simultaneously diagonalize the free Hamiltonian, $H_0$, the full Hamiltonian, $H_0 + H_1$, and the $z$-component of the angular momentum operator $L_z$. Eigenstates of $L_z$ are easy to find. And, since these states are eigenstates of both $H_0$ and $H_0+H_1$, they will satisfy all the properties of the $|A\rangle$ and $|B\rangle$ states given above -- the eigenstates of $L_z$ are the good states.
In general, if we can find a Hermitian operator $O$ that commutes with $H_0$ and $H_1$, then eigenstates of $O$ are good states for degenerate perturbation theory.


Bad blocks detected by fsck. SMART says disk is good

Question: Using Ubuntu 12.04, I booted into maintenance mode and selected fsck from the menu. This ran a filesystem check on all my volumes (all ext2), mounting them read/write by default. After the tests completed it said there were bad blocks detected and that the filesystem had been written to. I immediately rebooted and ran smartmon tools (full tests) on the disk. The SMART information showed the drive to be perfectly healthy (no re-allocated sectors, no pending re-allocations). I then ran the badblocks utility on all my volumes with absolutely no errors. What is going on?
Answer: Google published a report about 5 years ago basically stating that the SMART attributes in modern hard drives were not generally predictive of drive failure or useful for diagnostics. Which is unfortunate, because we generally want this kind of thing to be useful.
I suggest using the -c switch twice on fsck to force a read-write test of the sectors. This invokes the badblocks program. It it accomplishes roughly the same thing that GRC's SpinRite does. (SpinRite will work on any linux formatted drive, btw.) Example fsck invocation:
<code>fsck.ext2 -fycc /dev/sdb1
</code>
I have seen ext2 formatted drives with errors rapidly decay into trashed filesystems when plied with fsck, so before invoking badblocks on the disk, if you can still mount the partition, back it up. When running the check, make sure you have good ventilation across your disk(s) because this will turn up the heat.
Comment: `fsck.ext2` or `e2fsck` with `-cc` will take LOTS of time. Expect to wait for a day per TB with a modern HDD. SMART is no good for this accoding to Google and personal experience.
Comment: Perhaps it might depend on HDD manufacturer but rest assured that at least SATA Western Digital Green series requires writing over whole a physical 4KB block at once to fix a sector with a read error (UNC). Trying to write only 512 bytes to a broken sector will result in write error. Read does nothing. You could do read-only-testing with `-c` to get a list of bad sectors and then selectively overwrite only broken blocks. However, that does not guarantee that the whole disk is okay because some errors show up only after first writing to the block.
Comment: from what I've heard from the Security Now! podcast, writing the data doesn't stimulate error correction, but reading it does. So, a single `-c` switch might be as effective and faster.


Encryption algorithm where proving the decryption is equal to spoiling the key?

Question: Is there an encryption algorithm or MAC algorithm for which NO zero-knowledge-proof exists, provably? I want people who want to prove that a ciphertext decrypts into some plaintext to have to spoil the key for decryption, or if they want to prove that message's MAC is some given MAC then they have to spoil the key for MAC.
Answer: Every NP statement has a zero-knowledge proof, so there will always be a proof of decryption or MAC that doesn't reveal anything new.
But notice that doesn't prevent the statement itself from leaking the key!
Case in point: For the one-time pad, a single plaintext-ciphertext pair reveals the secret key. In a very similar way, a set of two message-tag pairs can leak the secret key in some one-time MACs. Perhaps these are the primitives you are looking for?
For just slightly less primitive ciphers and MACs, preventing zero-knowledge proofs is impossible: IND-CPA security implies that even many plaintext-ciphertext pairs must not leak the encryption key. Similarly, UF-CMA security implies that many message-tag pairs must not leak the MAC key.
Comment: If a single message-tag pair leaks the key, it's not a secure one-time MAC. *Two* message-tag pair can (and generally do) leak the key.
Comment: Thank you for answering! Thankfully, no, I am not looking for anything that is one-time. So, that weakness would not affect my particular application (this time!), but thank you for pointing it out!
Comment: @Maeher Indeed, that didn't make any sense at all. Thanks for pointing it out.
Answer: Wel.. NO. I just learned that any PSPACE problem has a ZKP.


How do I edit email template for Events confirmations

Question: I am trying to override the default email template for civicrm Events, which will be sent when registration is complete. I made changes on this file CRM/Event/Form/EventFees.tpl but the changes are being shown on email. I tried clearing cache but this doesn't help. Am I doing something wrong here?
Answer: You can customize the style and wording of events email messages in workflow messages here civicrm/admin/messageTemplates?reset=1
Comment: Thank you for the help. It was this template `Events - Registration Confirmation and Receipt (on-line)`


implicit conversion of objective c type pointer 'CFDataRef' is disallowed with ARC?

Question: I have a UDP type socket that I created last summer that worked fine, and still runs fine if I open the project file. However I have imported the .h/.m files into a new project, which does have ARC.
ARC does not like the following command(used in an if statement);
CFSocketSendData(WOLsocket,
                   address,
                   Data,
                   0) < 0)

With the error:

implicit conversion of objective c type pointer 'CFDataRef'(aka 'const struct__CFData' is disallowed with ARC

The error is repeated, once for WOLsocket, and once for address
where WOLsocket is created as follows;
WOLsocket = CFSocketCreate(kCFAllocatorDefault, PF_INET, SOCK_DGRAM, IPPROTO_UDP, 0, NULL, NULL);
int desc = -1;
desc = CFSocketGetNative(WOLsocket);
int yes = 1;
setsockopt (desc, SOL_SOCKET, SO_BROADCAST, (char *)&yes, sizeof (yes))

(There is error checking code, this is the bare basics!)
and address is created as so;
memset(&addr, 0, sizeof(addr));
    addr.sin_len = sizeof(addr);
    addr.sin_family = AF_INET;
    addr.sin_port = htons(PORT); //port
    addr.sin_addr.s_addr = ad;
    address = [NSData dataWithBytes: &addr length: sizeof(addr)];

I am very confused as to why this is happening, all other ARC errors seemed to be solved by lossing the 'dealloc, release' statements!
So my question is, How do I get ARC to stop complaining about my use of CFData? (What modifications do I need to make?)
Thanks,
Alex
Answer: Both the question and chosen answer to ARC and bridged cast should answer your question pretty well.


Is $3^{\log_{10}(3)}$ irrational?

Question: After looking at it for a while it seems quite a hard problem. I am not an expert in the area, but I have the impression that it might me an open problem.
Comment: You might think, absurdly, that $3^{\log_{10}(3)}$ is a rational of the $m/n$ type.
Comment: Where does the problem come from?
Comment: @saulspatz just a friend of mine posing the question, it seems a rather natural/well-known type of question.
Answer: This would follow from Schanuel's conjecture.  It implies in particular that there are no "non-obvious" algebraic relations between logarithms of algebraic numbers.
Assume that $3^{\log_{10} 3}= r$, with $r$ algebraic. Then we would have
$$\frac{\log r}{\log 3}=\frac{\log 3}{\log 10}$$
that is,
$$(\log 3)^2 = \log r \log 10$$
Now, $\log r$ would have to be a rational combination of $\log 3$, $\log 10$, so this implies an algebraic relation between $\log 3$ and $\log 10$, not possible.
Answer: According to Alan Baker (A concise introduction to the theory of numbers), Lindemann proved in his proof of the trascendance of $\pi$, several other facts, in particular the trascendance of $\log(\alpha)$ for algebraic $\alpha\ne0,1$.(this theorem says: For algebraic numbers, distinct, $\alpha_1,\alpha_2,\cdots,\alpha_n$ and arbitrary algebraic numbers $\beta_1,\beta_2,\cdots,\beta_n$ distinct of zero, one has $\sum\beta_ie^{\alpha_i}\ne0$).
Taking this into account $\log 3$ is trascendent and to
$x=3^{\log(3)}$ does not apply Gelfond-Schneider theorem. As far as I know $x$ can be rational (even integer) or irrational algebraic or trascendent if we want to apply the known theory.

Is $3^{\log_{10}(3)}$ irrational?


Replace xscreensaver locker with a better tool (sddm, gdm3) on Lubuntu (LXQt)

Question: Upon logging in on Lubuntu 19.04 it is using sddm, but when the computer is idle too long and it goes into idle, when I go to log back in it is using xscreensaver(which I can't stand the look of). I installed gdm3 in an attempt to change both over to a single interface, but all it did is replace sddm leaving xscreensaver as my login after idle. How can I replace xscreensaver in Lubuntu?
Comment: Why didn't you just disable screensaver (https://manual.lubuntu.me/3/3.2/3.2.20/screensaver.html?highlight=screensaver)  ; Lubuntu uses it as it's locker  (so whilst disabling it will disable all screensaver functions, the locker will remain), so switching to `gdm3` I wouldn't have expected to have impact on xscreensaver locking.
Comment: You should clarify the question:  do you want your system to lock when idle or not? do you dislike xscreensaver or any locker? (do you dislike the fact that locking is made by a separate tool than the logging-in, or do you dislike locking as such? what about lock after suspending? do you want that?); if you do want a locker, which one exactly  would you prefer?
Answer: Why your solution didn't work
LXQt uses xdg-screensaverlock to handle locking. This tool generally chooses the screensaver based on the desktop environment but xscreensaver takes precedence so that eliminates some other options, including gnome-screensaver¹.
The real solution
Luckily, there are others that take precedence over xscreensaver, including the one that trumps them all: xautolock. Technically that's not a locker, so you'd need something else. Something light like xtrlock would do the trick (and it's super light).
Make sure you autostart xautolock -locker "xtrlock -b" (remove the -b if you don't want the screen blanked) and keep xscreensaver from starting:

Navigate to Menu » Preferences » LXQt Settings » Session Settings » Autostart
Uncheck the check box next to Xscreensaver
Click the Add button
In the Name field add something like "xautolock xtrlock"
In the Command field add xautolock -locker "xtrlock -b"
Click OK
Click Close
Log out and back out again

You can fix xscreensaver, too
Since your primary issue is looks, You might want to look into theming xscreensaver's lock dialog. This is arguably a much wiser solution as xscreensaver is really notable for its commitment to security, i.e. to actually work under any conditions as a locker.

¹ …which is not included with gdm3, so you didn't install another lock mechanism. If you did want this single interface, you'd need to install the screensaver as well. You'd also have to do the above except instead of xautolock you could use gnome-screensaver. I wouldn't recommend this any more than I would recommend trying to use KDE's locker (which is not sddmas it seems) since they are tightly integrated into the desktop environment and kind of useless outside of it.
Comment: I'm not talking about the screen saver, I have the screensaver disabled so I will just get a blank screen. But when I wake the computer from idle it asks for my password using the xscreensaver interface instead of the seem interface.
Comment: Ah misunderstood the problem. Revised the answer entirely.


SciFi book where machine invented to allow viewing into the past?

Question: What is the name of the SciFi book where a machine was invented that allows people using it to view into the past? I believe it used Tachyons or neutrons that would pass through matter, so it could view through solid rock, walls etc. Initially used to record war battle scenes that were sold to movies to generate capital to improve the machine, it was later discovered to allow viewing almost real-time anywhere causing complete lack of privacy for everyone. I thought it was Macroscope but after I found a copy it was a different story. I read it probably in the 60's or 70's.
Comment: too lazy for full answer, but Orson Scott Card's Pastwatch partially fits the machine viewing the past thing.
Comment: @yochannah: I immediately thought the same, but that was published in 1996, so far too late to have been read in the 70's.
Comment: @yochannah There are *lots* of stories about machines for viewing the past, so-called "time viewers" or "chronoscopes". Fortunately the OP has provided further detail to narrow the search.
Comment: probably the same as https://scifi.stackexchange.com/questions/171918/1950s-short-story-about-using-radar-to-see-into-the-past-and-filming-historic-ev (which is newer but has an accepted answer)
Answer: Asimov's "The Dead Past" (mostly) fits your description:

Tachyons or neutrons (check): The chronoscope uses "neutrinics" as the basis of time viewing. In the story, neutrinos move both through space and time, and can be focused to observe the past.
Battle scenes (not quite): The protagonist wants to use the chronoscope to research ancient Carthage.
Lack of privacy (check): Quoting the story, "If
you focus the chronoscope in the past of one-hundredth of a second
ago? Aren't you watching the present?"
Comment: The WIkipedia article also has similar works listed in case this isn't the one you're thinking of.
Answer: It's probably E for Effort, a 1947 novelette by T. L. Sherred.

Taking place at some time in the near future (relative to when it was written), the story is briefly framed as a manuscript delivered to a civilian by the military under circumstances of great tension.
The manuscript is a long letter to "Joe", apparently a bartender, by Ed Lefko. He describes seeing a silent but color movie aimed at Mexican-Americans in a run-down theater in Detroit. The movie recounts Cortés's conquest of Mexico with remarkably realistic sets and acting and a huge cast. The projectionist, a World War II veteran named Miguel "Mike" Laviada, tells Ed that he made the movie using a time viewer he invented, which he demonstrates. However, Mike has not been able to raise the capital needed to shoot the picture on high-quality film, add sound and other improvements, and get it distributed and advertised. He and Ed become partners, and at Ed's suggestion, they raise money by using the machine to blackmail wealthy people.
They spend a year making most of a new film out of time-viewed footage of Alexander the Great. They take it to Hollywood, where the high quality of the film easily convinces a producer and his associates to finish it, including using actors for scenes that appear in Alexander's biographies but did not really happen, and market it. The film is a great success with critics and viewers.

....

Ed and Mike admit the machine's existence to their associates and persuade them to join in their plan to expose the corruption of many famous people involved in the wars. The film causes riots in many countries and greatly increases international hostility.
Comment: +1 I bet this is the right answer, it's the best fit to the OP's description. Naturally the Asimov yarn gets more votes because Asimov is a more popular writer and that's how people vote here. I bet the Clarke story gets a lot of votes too.
Comment: Interesting about the international hostility...  In Orson Scott Card's much more recent novel, _Pastwatch: The Redemption of Columbus_, the builders of a similar machine intentionally disable it from viewing any event more recent than some hundreds of years in the past for precisely that reason; and they have all sworn a solemn vow never to reveal the secret of how it works.
Comment: I forgot the blackmail angle.  I'll have to re-read this one.  I agree that this is likely the correct answer.
Answer: The Light of Other Days by Arthur C Clarke
https://en.wikipedia.org/wiki/The_Light_of_Other_Days
"The wormhole technology is first used to send digital information via gamma rays, then developed further to transmit light waves. The media corporation that develops this advance can spy on anyone anywhere it chooses.
When the technology is released to the general public, it effectively destroys all secrecy and privacy"


Complete regularity of locally compact Hausdorff spaces with functions vanishing at infinity?

Question: Let $X$ be a locally compact Hausdorff space ; then I know that $X$ is completely regular i.e. for every closed set $F$ in $X$ and $y\in X\setminus F$ , there is a continuous function $f: X\to [0,1]$ such that $f(y)=1$ and $f(F)=\{0\}$ . My question is , can we find such a continuous function in $C_0(X)$ i.e  for every closed set $F$ in $X$ and $y\in X\setminus F$ , does there exist a continuous function $f: X\to [0,1]$ such that $f(y)=1$ , $f(F)=\{0\}$ and for every $\epsilon >0$ , there exist a compact $K \subseteq X$ such that $|f(x)|<\epsilon , \forall x \in X\setminus K$ ?
Answer: Yes. In Aleksandrov compactification $\alpha X=X\cup\{\alpha\}$ of $X$ there exists a
continuous function $\bar f: X\to [0,1]$ such that $\bar f(y)=1$ and $\bar f(F\cup\{\alpha\})=\{0\}$. Put $f=\bar f|_X$.
Comment: Beautiful..................
Answer: Use the results that  a compact subspace of $X$ is a normal space (because  a compact Hausdorff space is normal) and that disjoint closed subsets of a normal space are functionally separated.
Notation: The closure bar denotes closure in $X.$
Let $U_1,U_2$ be open subsets of $X$ such that $$y\in U_2\subset \bar U_2 \subset U_1\subset \bar U_1\subset X \setminus F$$ and such that $\bar U_1$ is compact.
Now $C=\bar U_1$ is a normal space, and  $\bar U_2,\;  (\bar U_1 \setminus U_1)$ are disjoint closed subsets of $C,$ so take a continuous $f:C\to [0,1]$ with $f(\bar U_2)=\{1\}$ and $f(\bar U_1 \setminus U_1)\subset \{0\}.$
Extend the domain of $f$ to $X$ by letting $f(x)=0$ for $x\in X \setminus \bar U_1.$ (Check that $f:X\to [0,1]$ is continuous.)
Let $K=f^{-1}[0,\epsilon].$ Then $y\in K=\bar K\subset \bar U_1.$ Recall that $\bar U_1$ is compact  and disjoint from $F$, so $K=\bar K$ is compact and disjoint from $F$. And (of course) $f(y)=1$ while $$f(F)\subset f(X\setminus \bar U_1)\cup f(\bar U_1\setminus U_1)\subset \{0\}.$$ And $f$ is $0$ except on the compact set $\bar U_1$ so $f\in C_0(X).$


Combination for safe in Dishonored The Royal Physician mission

Question: Where can I find the combination for the safe behind the painting on the wall of the ruined building in The Royal Physician mission?
Answer: The combination is 294 and it is given to you if you disable the wall of light for the prisoners.
Comment: You must get rid of the guards first, and then when you release the prisoners the woman will thank you and tell you the combination for the safe behind the painting.
Comment: I did that by removing the whale oil but don't recall seeing 294 anywhere.  Does it matter if the prisoners get killed by guards?
Comment: @Pyritie There is no need for spoiler tags here, since there is just no way to accidentally find this answer and still be surprised about spoilers. Also, spoiler tags are useful only if the answer can stand on its own without the spoiled text.
Answer: Disable the wall of light for the prisoners. You can do this quite easily by disconnecting the whale oil tank. Afterwards, a person will thank you and give you the code 294.


new users can't log in via GUI

Question: I have added 3 new users to the system via a terminal session and defined their password. However at the GUI logon screen when I click on their account and put in the password I get the spinning wheel then it goes right back out to the login screen. No errors or nothing. What could be wrong here? I can get in with the account that was created at OS installation is there a log I can look at perhaps in /var/log?
Comment: Which front end display manager are you using, `gnome`, `kde`, etc.? What tool or command did you use to add the users? Can you login as the new user from the terminal?
Comment: Similarly the log from /var/log/auth.log at the time of login will be helpful, assuming you are using Ubuntu as you had mentioned in your last question. Please provide  such information in the question itself.
Answer: Yea the new users can log in via SSH but I got it sorted - the new users did not have access to their own home DIR's. Once I ran chown and chgrp to grant them access, they were able to log in from the GUI. problem solved. thanks!
Answer: Here is some more info and potential problems when loging in via GUI or something else.

If the home directory of a user does not exist, or the user has no permission to access it,

login via GUI tends to fail;
while login via su or ssh succeeds, complaining cannot chdir to home directory.

If the login shell of a user does not exist, or the user has no permission to access it,

login via GUI succeeds, using sh as the shell;
while login via su or ssh fails.

Both the home directory and login shell of a user is specified in /etc/passwd. Refer to man 5 passwd for more info.
You may use chsh to change the login shell, and usermod to change home directory and login shell as well. You may also choose to edit /etc/passwd directly, but always be careful.

new users can't log in via GUI


How to add custom filter to the existing ones?

Question: I'm really new on Magento and I've to implement a custom filter on numeric value that involves more than one attribute. In other words, if a product have attributes A and B, I need to add filter on something like (A + arg1)*(B+arg2) < arg3, where arg1, arg2 and arg3 are input numeric values. I found the addExpressionAttributeToSelect to apply the filter expression to the product collection, but I'm not able to retrieve and take into account the already applied filters, e.g. the selected attributes in the Shop By section, returning the complete filtered product list as in normal layered navigation. What are the steps in the backend to implement the function?
I'm using Magento 184.108.40.206 CE.
Comment: I'm not sure this is a solution, but to avoid this issue I always do this. Create a new attribute (C), and have a cron that updates the value of attribute C with (A+arg1)*(B+arg2). This way I am able to take advantage of the default filtering system. The downside is that until you run the cron you might have false data in your filters. But I can live with that. If you don't like downside, you can add an observer that updates this attribute (C) when the product is saved or when an import is finished.
Comment: Instead of a cron job you could also use the eav backend_model function to update the value of attribute C before save based on the other attributes. This way the value for attribute C is always available at every update of the product.
Comment: Thanks you very much for your answer. It just be noticed that the arg1 and arg2 are values provided by the user that want apply the filter. So, is it possible a batch calculation using a cron job?
Answer: I agree with the comment from Marius that precalculating C is probably a good idea.
Also, calling $collection->addAttributeToFilter() on a collection will add to existing filters, it won't replace them.
Nevertheless, if that isn't possible, you can inspect the collectios' select instance, to read already declared filters.
Please be aware that this would be a rather hackish approach, but since the collection interface doesn't give access to those protected properties, you have to either rewrite all product collection classes, or use this hack.
Check the three Mage_Catalog_Model_Resource_Layer_Filter_* classes applyFilterToCollection() methods on how the filters are applied to the collection's Zend_Db_Select instance.
use $collection->getSelect()->getPart($part) to access the relevant information.
Check the part constants in Zend_Db_Select for available keys.
Comment: Thanks you for your contribution.
I tried to use addExpressionAttributeToSelect on the collection with other filters applied and them are lost. I'm not sure to have selected the right collection. The code is like this:

      $filteredCollection = Mage::getModel('catalog/product')
            ->getCollection()
            ->addExpressionAttributeToSelect('expr', …, …)
            ->addFieldToFilter('expr', array('lteq'=>$value));

Where expr is calculated as (A + arg1)*(B+arg2) and $value= arg3.

I'm not sure to understand completely your other comments. Please, let me study them ...


What do I do after I defeat the Wall of Flesh in the Mobile edition of Terraria?

Question: In the mobile version there is no hard mode... Have I 'beaten' the game?
Comment: +1 for accomplishing this on a mobile device. I tried it and gave up after a few minutes. Possibly playing on PC first didn't help
Comment: @Kecoey to be fair I own a Nook HD and play it on that, the tablet's screen is reasonably large, I couldn't imagine playing it seriously on a phone.
Answer: With the release of the 1.2 patch to mobile versions in December 2014, there is now a huge amount of content post-Wall of Flesh to be experienced (to be honest, the quantity of post-Wall of Flesh content is probably greater than the pre), as well as some new pre-Wall of Flesh content as well. The mobile release as of December 2014 is roughly equivalent to the PC's 184.108.40.206 patch, but as more patches are released you should be able to find a summary of the changes here. Hardmode and the 1.2 patch add an extraordinary amount of content to Terraria so a comprehensive list of changes would be far too long for this format, so instead I'll do a brief run-down of some of the more important changes. For more information, your best bet is to surf through the Wiki.
NOTE: You will need to create a new world in order to experience much of the new content.
Half-blocks
Hammers have a new purpose: making half-blocks. These allow you to create slopes instead of blocky stairs, and also allow you to create Waterfalls. While visually it's not always that noticeable, they have been included into the terrain generation algorithms and will result in a "smoother" world that's easier to travel across. They also have huge potential for new building designs.
Making the World bloody...
The second major difference you might run into is The Crimson, which is a new biome that has a 50% chance of being created at world generation, and replaces the Corruption. This brings with it a host of new crafting materials, items, monsters and a new pre-Hardmode boss: The Brain of Cthulhu.
Of Pyramids and Giant Trees
The next few differences you might encounter are changes to existing biomes. Deserts now have a chance to contain a Pyramid structure, which will contain a treasure room containing some brand new loot. You might very well also notice Giant Trees scattered around the landscape. Some are just big trees, while others are hollow inside and generally have a chest containing some more brand new loot.
A Bee in your bonnet
The Jungle has also undergone a few changes. When exploring the Underground Jungle you may now run into a Bee Hive microbiome which will allow you to summon and defeat another new boss; the Queen Bee.
Ice, Ice Baby
You may have had some worlds previously that contained a Snow Biome.  These have been drastically changed and now each world is guaranteed to generate a large one, with a larger Underground Snow Biome beneath it.
The ancient spirits of light and dark have been released
Defeating the Wall of Flesh will activate Hardmode, beefing up the difficulty of pretty much every biome in the game and giving you access to all of the Hardmode-only content. Of which there is lots.
Lihzahrd is hard to spell
Delve deep enough into the Underground Jungle and you'll find the Lihzahrd Temple - although you won't be able to enter it until you have defeated one of the new Hardmode bosses: Plantera. In the PC version, all three 'original' Hardmode mechanical bosses, The Destroyer, The Twins and Skeletron Prime must be defeated before Plantera can be summoned. This is not the case on the mobile and console versions. On the console and mobile versions, only one mechanical boss must be defeated before Plantera can be summoned. Once inside the Lihzahrd Temple, you will be able to find an altar that allows you to summon another new boss, the Golem. The Hardmode Jungle is also the only place you will find naturally occurring deposits of Chlorophyte Ore.
Friendly Automated Characters
There are also a bunch of new NPCs for you to acquire for your village. With the exceptions of the Stylist and the Angler, which are (currently) exclusive to the PC version, you should be able to find all of the NPCs listed there in-game.
This is Halloween
Craft yourself a Pumpkin Moon Medallion and you'll be able to start the Pumpkin Moon event (but be warned: it's hard). Your world doesn't need to be in Hardmode to use it, but two of the crafting materials are only found in Hardmode.
Have you been Naughty or Nice?
Craft yourself a Naughty Present and be prepared to have hordes of Christmas-themed enemies try their hardest to end you when you kick off the Frost Moon event. This event is even harder than the Pumpkin Moon and is the current end-game content for the Mobile Edition. Don't expect this to remain the case however.
Mobile Exclusive Content
As a mobile player you will have exclusive access to certain content, such as Oktoberfest and Thanksgiving seasonal events with the latter having a boss: Turkor the Ungrateful.
Answer: Essentially, yes, you have. There are a few other things that it's possible you haven't done yet, such as find all of the possible town NPCs, but unless you plan on sandboxing, there's no real reason to seek them out, either.
If you choose to be optimistic about the possibility of a future Hardmode update to the mobile version, you could farm the Wall of Flesh to prepare yourself with the best gear possible, but as it is, you've more or less "won."
Comment: Well... that bites.
Comment: care to update this answer? It's no longer correct due to updates.
Answer:
Defeat all bosses
Get all armor possible
Get all statues and spawn mimics with chest ones (they're hard)
Play multiplayer and have a death match
Get all possible weapons
Answer: I've beaten the wall of flesh on IOS as well, and i do agree this is beating the game. I recommend fighting it until you get all it's drops, and then prepare yourself for when hard mode IS implimented. Also, if you don't have nights edge, full hell stone armor, and a molten pickaxe, get those, as they are very important.
Answer: There is some overhacked worlds which you can download from links in Youtube videos, you can some weapons, tools and materials from hardmode since it is not available. Unless you don't want to, you have to wait for the legit hardmode in the next updates. And if you download the worlds you can't defeat the bosses (The Twins, the Destroyer and Skeleton Prime) because it makes your game crash sometimes.


Windows Event Logs: Task Category

Question: I have been scouring the internet for a formal definition of this piece of the Windows Event Logs. How is the category determined? Is there a set of standard values for this field? Can an application create its own Task Category?
Answer: Looking into .NET's EventLog and EventLogEntry classes should give you a clue, especially the latter's Category property:

Each application (event source) can define its own numbered categories and the text strings to which they are mapped. The Event Viewer can use the category to filter events in the log.

Additionally, as the page on Event Categories states:

Categories help you organize events so Event Viewer can filter them. Each event source can define its own numbered categories and the text strings to which they are mapped.

The page shows you how your app (which would be the Event Source) can define its own Event Categories. You can get some useful tips about getting that example to work on Win7 and Server 2008 R2 here. This Dr. Dobb's article about Customizing Event Log Categories might also be useful. I'm sure there are many more tutorials available, and if you need help with the code Stack Overflow would be the place to turn to.
Note: AFAIK there's no set of standard values for this field, since an app can use its own custom strings. Of course if you want to use the ones Windows itself uses, I'm sure they must be defined in some resource/header/message file somewhere.
Answer: Applications can create their own task categories. It works just the same way that applications create their own event message texts: You put them in a .mc file, use the Message Compiler to compile that to a .rc file, use the Resource Compiler to compile that to a .res file, and use link.exe to compile that to a DLL.
If you've never done that before, there is a first-class tutorial at http://www.eventlogblog.com/mt/mt-search.cgi?search=python&IncludeBlogs=1 -- I've tried it recently and it still works for the current versions of the Platform SDK and Visual Studio Express, though you do have to set up additional folders in the PATH, for the executables and DLLs.
The category texts can be in their own DLL but you can also put them in the same DLL as the messages. If you do that, the categories should be at the beginning of the .mc file and numbered up from 1 with no gaps. In the registry entry for your DLL you tell Windows how many of the messages are categories, say 5, and it then treats the first 5 messages as categories.

Windows Event Logs: Task Category


Creating a node using Services 6.3 REST

Question: I am trying to create a node using the rest service. I am hitting /myendpoint/node using a post. My header is application/json. I am not sure what I need to post as the data.
Answer: Something along the lines of this, &node[title]=testnode&node[type]=story&node[field_test][0][value]=testtting
Also, if you are ever unaware of what to send, just look at the tests.
Comment: `406 Not Acceptable: Missing required argument node`
Comment: look at which tests?
Comment: Kyle, what test were you referreing to in your answer and are there such tests for a D7 Services beginner to take advantage of?
Comment: The tests are in the test folder for the services module.
Answer: This might give you some ideas: https://gist.github.com/affc9864487bb1b9c918.
I assume you have Content-Type: application/json in your header.
Example curl call with session authentication:
curl -X POST "http://example.com/endpoint/node" -H "Content-Type: application/json" -H "Accept: application/json" -H "Cookie: {session_name}={session_id}" -d '{"type":"story","title":"Test Title","body":"Test Body"}'

Basically you have to post data in JSON format, that maps to the fields of the content type you want to create. If you have custom fields it is just a bit more tricky. See: http://drupal.org/node/1354202.

Creating a node using Services 6.3 REST


How many areas are there in Brodmann map?

Question: I read Wikipedia claiming 52.
I heard that this can be extended to 54.
I see there is no limit of having more areas - just better understanding of the neuroblast migration and fibroblast too, probably.
How is this newer classification of Brodmann map done?
Comment: Bowmann or Brodmann map?
Comment: @potterbond007 Thank you for pointing out the mistake in the body! Brodmann map. I apparently have read too much about kidneys.
Answer: I am no expert on the topic, but according to an article published on the centenary of his study, it states that the microscopical structure and classification of these areas are in parallel to the evolutionary distinction between old and new cortical subdivisions. So as and when new subdivisions are deduced (based on its function, cytoarchitecture or the structure and organisation of cells) the map can be extended to include them. There was no upper limit to the number of divisions set in any article I read so it would be nice if you could provide some reference to where it says that the extension can be done to 54. If you are interested, you could have a look at the map published by Constantin von Economo in 1925.
Comment: @Masi basically with the advance of research, even minute differences in any part of an area currently designated due to structural differences or some new functional properties, the map can be further extended to include them as a new subdivision. Rest, I believe it is left to the discretion of the researcher as there is no definite compulsion to map new areas unless significant differences are found. That is my understanding on the subject
Comment: Yes, I agree with you. This is just research talk where I heard people talking about more than 52 areas. I have no idea how they are doing the division. Probably, like you describe, by thinking parallel processes at some point at a particular point in time. I think the amount of these areas i.e. processes vary between different points under considerations.


Short story about a crew finding an ancient alien ship filled with tons of artifacts from their society

Question: Read it in an old collection that I can't recall.  Ultimately, a crew of astronauts find an empty alien structure/ship, and it is filled with tons of artifacts from their society.  There is some duplicity among the astronauts. I feel like its a Clarke story, but maybe not?
Comment: Does "their society" mean the astronauts' society, or the alien society?
Comment: Hi, welcome to SF&F!  Do you recall when you read this?  Where is the structure?  (On a planet, hollowed out of an asteroid, floating in space...)  Does "from their society" mean the _astronauts'_ society?  Does duplicity mean theft, or outright murder?  This could use more details; check out the [suggestions](https://scifi.meta.stackexchange.com/a/9337/101407) to see if they help you recall anything else.
Comment: What does "their" refer to? The ancient aliens or the astronauts?
Comment: Is is something like "Rendezvous with Rama" or something very different ?
Answer: Jupiter Five by Arthur C. Clarke. Note the author.
A space archaeologist deduces that the origin of an alien race who left traces on Mercury and Mars was from the innermost moon of Jupiter, Jupiter Five. As it turns out, the entire moon is one giant spaceship, thirty miles in diameter.
Inside they find lots and lots of artifacts from their society.
While they are there, a sleezy science writer shows up in his own space ship. While the archeologist's back is turned, the writer steals the most valuable alien artifact, a statue depicting an alien.
In order to rescue the statue for science, the archaeologist and his crew have to engage in some duplicity.
Comment: FYI -- this story is available via Internet Archive at https://archive.org/details/1953-05_IF/page/n5/mode/2up
Comment: Yes! It was "Jupiter Five". Thank you so much. I had an inkling it was Clarke, and I also had an inkling it involved a statue (but I didn't want to include the latter as it may have been a misremembering or red herring).
Answer: The plot you describe is practically a small sub-sub genre in the subgenre of outer space stories.  For example, that describes much of the plot of the second episode of Lost In Space, "The Derelict", September 22, 1965.
So here are some more stories you might remember.
It is possible that you remember "The Plague Star" by George R.R. Martin, Analog Science Fiction and Fact, January/February 1985.  In that story several human characters in a small spaceship find a giagantic long abandoned ship of a former empire which fell long ago.
I think that the empire was a human one, but otherwise the story matches.
There are countless artifacts aboard the ship, including a lot of functioning technology, including technology to create and modify life forms.
There is conflict among the characters.  As I remember, one of the interior illustrations showed one of the characters alongside a dinosaur they had created and controlled to deal with the other characters.  It was a large carnivorous dinosaur.  That type of conflict among the characters.
"The Plague Star" has been reprinted several times.
You might also remember the famous Arthur C. Clarke novel Rendezvous with Rama, 1973.  I don't remember reading it, but it involves human astronauts boarding a vast alien spaceship which has entered the solar system.  There are artifacts in the ship.  However, I don't know if there is much or any conflict among the human characters.
You might also remember James White's novel All Judgment Fled 1967, 1968.  I have not read it but it has a similar plot to the later Rendezvous with Rama, with humans boarding a vast alien ship which has entered the solar system.  I think there may be some conflicts in the story among the humans and/or with aliens aboard the ship.
Comment: Have always wanted to read Rendezvous with Rama, but I still haven't had the chance.  Turns out this story was "Jupiter Five".  And ya -- the alien megastructure trope certainly is in a way its own genre.


What are the uses of an iPad for an academic staff?

Question: As a new academic staff, I received an iPad from my department. I have never owned nor used an iPad before, so it is still in the box for the past week or so. I am a bit reluctant to open it, as I am not sure if it would be useful, and I have actually been thinking of returning it to the department. But to be sure I won't regret it, is there anything particularly good about an iPad that it would be nice for an academic staff to have it?
Comment: I do hope that your University or Department  has special softwares developed for iOS (i.e. the operating system of the iPad). If not, well, just enjoy your iPad!
Comment: Did they give you this instead of giving you a more traditional computer?  So you would use it for email, web browsing, preparing lectures/presentations, etc.?
Comment: Could you elaborate on what your job looks like? Are you teaching? Visiting conferences? Preparing or correcting exams or tests?
Comment: @clueless, I am not teaching, not preparing nor correcting exams or tests, and rarely visit conferences.
Comment: @GEdgar, it was given in addition to a more traditional computer, which I always use.
Answer: I don't think that an iPad does anything magically different for academic personell than for anybody else. Some of my colleagues review papers on them, some use them as a very small laptop while travelling, and (I presume) most just use it to read the news, play games, or slack off otherwise while in the train or plane.
In summary - if you have no idea what you would use it for then you probably don't need it.
Comment: But there is always a room for improvement...
Answer: Whether a tool works for you or not depends on your work style, so general recommendations are difficult.
However, you can use it for example

to read digital articles. There are some literature management tools that work well with iOS devices, and you can read any PDF with readers like GoodReader. With the later you can, for example, highlight text and export the highlighted text (and any notes) via eMail.
You can also directly access your files if you use, e.g., Dropbox (can be helpful in meetings).
There are also apps available for classroom management, if you do a lot of teaching.
You can use it for presentations (Keynote on iOS is okay).
It's nice if you travel to conferences (for emails and the like).

In short, there are many uses, but it depends on your work style. Question I'd have would be how your colleagues use the iPad (if it's an department wide thing). Also: That's a nice problem to have. :-)
Comment: In addition to this, I've had professors teach their entire course using their tablet. They would project the tablet to the screen and used the stylus to draw over their presentations (or on a separate notepad they kept up).
Comment: I've seen my colleague using it at the end of a meeting to take a snapshot of the whiteboard where the minutes were scribbled, and then to scribble some notes on top of the picture.
Comment: Good point, there are some note-taking apps which allow you to take notes via a pen and still have them available digitally.
Answer: An iPad connects to HDMI, so you don't need to bring your laptop to class (for slides).
With an added keyboard, and access to a remote server, you can work seamlessly from everywhere (on whatever OS you prefer). If you live in Europe you probably have, at least, 3g mobile access everywhere. Depending on your circumstances, this might even eliminate your need for a regular laptop.
A decade or more ago, everyone had papers everywhere. Then we started the  paper less office, and an iPad works well here. Save all documents in some online drive, and you have access everywhere. Put the iPad next to your desktop keyboard, and you will never have to print anything ever (mostly).
The iPad is a decent, but not perfect, replacement for taking notes on paper. Snap a picture, and start chopping away.
There are many great apps you could use, for instance for people in math there's an app that converts hand written equations to fully valid LaTeX. You can easily sketch concepts and forward by mail.
Of course all of these apply to other tablets equally.
Answer: I use a tablet (not an iPad) for reading articles when traveling, having copies of articles and open-source books available, and generally having all my course documents stored there for easy access at any time.
A new use has come in the last year: I may have a particular slide on the overhead, and students working exercises based on that slide while I circulate and give personal feedback. I have my tablet with me, both to (a) check the answer, and more importantly (b) have the same slideshow available to flip back to any prior topic if an individual student doesn't remember or was previously absent.
And finally: All my role-playing books for when I master events at gaming conventions.
Answer: It's fantastic for projecting slides while being easy to carry around.  Just put a lecture into a slideshow app, plug it into the projector, and put it down.  Control with a remote as needed.  No need to fiddle with getting it to mirror the screen.
Answer: ZotPad in combination with Zotero and Dropbox is useful to keep track of all articles you've read.
Comment: This is a little overly specific and doesn't really discuss the iPad, but rather discusses Zotero's iPad app. Do you have anything to add specific to the iPad?


how to set threshold for anomaly detection

Question: I read one research paper and they said that they are using a threshold for anomaly detection. The threshold is determined to make some proportion of data of the validation dataset labeled as anomalies. how does this concept make sense
Comment: This is only half the story, as using a , say, 95% threshold naively will always (!) Label 5% of data as outliers ... Even if the system you monitor is behaving perfectly normal.  You should look into false discovery rate (fdr) solutions
Answer: When your algorithms creates an anomaly detection model, it will create a set of expected values that represent normal value behaviours.You can then use this models to either alert based on the expected values with out a static threshold, or you can overlay this to some graph as a band.  Ideally you need a considerable deviation from your expected values to trigger an alarm. Here the thresholds are calculated as error, or deviation from the expected and real values. You can apply a scaled min max threshold to this to have a good inference to the problem.When your data points are large in numbers, you cannot be able to determine the thresholds, here  Thresholds may induce false positives but the outcomes are mostly better. You can make find the ideal thresholds by plotting an RC curve with TP and FP rates.
Answer: The way to tune the anomaly detection threshold is as follows:

Construct a train set using a large sample of observations without anomalies.
Take a smaller sample of observations containing anomalies (manually labelled) and use it to construct a validation and test set.
Now train your anomaly detection model while tuning the threshold using the validation set and additionally using the test set to evaluate your model.


Why are main runnable Python scripts not compiled to pyc files like modules?

Question: I understand that when you import a module, that file is compiled into a .pyc file to make it faster? Why is the main file also not compiled to a .pyc? Does this slow things down? Would it be better to keep the main file as small as possible then, or does it not matter?
Answer: When a module is loaded, the py file is "byte compiled" to pyc files. The time stamp is recorded in pyc files.
This is done not to make it run faster but to load faster.
Hence, it makes sense to "byte compile" modules when you load them.

http://docs.python.org/tutorial/modules.html#compiled-python-files

[Edit : To include notes, references]

From PEP 3147 on "Byte code
  compilation":

CPython compiles its source code into "byte code", and for performance reasons,
it caches this byte code on the file system whenever the source file has changes.
This makes loading of Python modules much faster because the compilation phase
can be bypassed. When your source file is foo.py, CPython caches the byte
code in a foo.pyc file right next to the source.

How byte code compiled files are
  tracked with respect to Python version
  and "py" file changes:

It also inserts a magic number in the compiled byte code ".pyc" files.
This changes whenever Python changes the byte code format, usually in major releases.
This ensures that pyc files built for previous versions of the VM won't cause problems.
The timestamp is used to make sure that the pyc file match the py file that was
used to create it. When either the magic number or timestamp do not match,
the py file is recompiled and a new pyc file is written.
"pyc" files are not compatible across Python major releases. When Python finds a pyc
file with a non-matching magic number, it falls back to the slower process of
 recompiling the source.
Thats the reason, if you simply distribute the ".pyc" files compiled for the same platform will not work any more, if the python version changes.

In Nutshell

If there is a byte compiled file ".pyc" and it's timestamp indicates that it is recent then it will be loaded up other wise python will fallback on the slower approach of loading the ".py" files. The execution performance of the ".py" file is not affected but the loading of the ".pyc" files is faster than ".py" files.
Consider executing a.py which imports b.py
Typical total performance = loading time (A.py) + execution time (A.py) +
                            loading time (B.py) + execution time (B.py)

Since loading time (B.pyc)  <  loading time (B.py)

You should see a better performance by using the byte compiled "pyc" files.

That said, if you have a large script file X.py, modularizing it and moving contents to other modules results in taking advantage of lower load time for byte code compiled file.
Another inference is that modules tend to be more stable than the script or the main file. Hence it is not byte compiled at all.

References

http://effbot.org/zone/python-compile.htm
http://www.network-theory.co.uk/docs/pytut/CompiledPythonfiles.html
Answer: Compiling the main script would be annoying for scripts in e.g. /usr/bin. The .pyc file is generated in the same directory, thus polluting the public location.
Comment: However as the docs state "Thus, the startup time of a script may be reduced by moving most of its code to a module and having a small bootstrap script that imports that module" but unless you have a *large* script this is likely overkill
Comment: If speed was an important factor, then should I have the main script be as simple as possible (so that most of the code would be compiled)?
Comment: @George41 : As per the python doc reference, execution speed is not a factor. It is faster loading time.
Comment: @matt b: Yes true and still only loading time is reduced and this does result in reduced startup time.


Can I install games from Steam while my computer is off?

Question: I know this sounds kind of nooby, but I got my computer a day ago and tried installing CS:GO from Steam, but my internet speed is very slow. I just wanted to know if I could install it while my computer is off, as I don't really want to be sitting here staring at a bar all day.
Comment: I don't think that you can play csgo with "very slow internet". While internet speed doesn't make a big difference on ping, if it is low enough (lower than csgo packet size), you are guaranteed to not be able to play csgo with an acceptable ping.
Answer: You can't.
If you want to save energy, just turn off your LCD.
Don't wait until the download is complete, just do your daily life as usual and let your PC do it`s job.
Answer: You can't install it if your computer is off, but you can download them in the background while you play other games on Steam.
Go to Steam>Settings>Downloads and check Allow downloads during gameplay.
Here are some pictures to guide you.

I hope this helps you.


there are other or there are others

Question: What is the most correct way to say:
1 there are other job positions -
2 there are others job positions -
3 there are others jobs positions -
4 there are other jobs positions -
5 there are others jobs positions -
?
Answer: 1 - "there are other job positions"
In this sentence, both "other" and "job" are adjectives connected to the noun "position." In English, you don't change the adjectives when the noun is plural, so the "-s" suffix is only added to "position."
It may be confusing that "job" is acting as an adjective here, since it's normally a noun. See noun adjunct for more examples of this. If you look at the sentence with that word removed, it might make the grammar of the sentence easier to understand: "there are other positions."
Answer: Out of your five examples, only the first one is grammatical. That's because you generally can't have a plural noun, the pronoun others (which is just the plural version of the pronoun other) or anything at all that's plural used as a noun adjunct (also known as an attributive noun) or an adjective. Descriptive words describing nouns are usually in the singular in English (that's probably true 99.9% of the time). So, only this one is correct:

There are other job positions.

But let me say that gain: that rule is only true in general. There are situations where a plural noun can be used as an adjective. For example:

My university's Foreign Languages Department.
the cars database
sports medicine

The formation of attributive nouns like those above is really done on a case by case basis as there are no clear rules as to how to do that for any word or phrase in general. This is something that only comes to you as your English-learning experience grows.

there are other or there are others


Why is loitering punishable by death?

Question: I always found it rather odd that just sitting in a station for too long was a death sentence. Can anyone give me good in-world reasoning behind the rule? I understand the game design reason, but I really don't get why it's explained like that in the game.
Comment: Loitering is not sitting in a station to long. Loitering is taking off from the pad and then sitting there basically blocking the entrance and exit for every ship that wants to enter/exit the station.
Comment: Still, how is that a death sentence? Normally when I get blown up I'm stuck due to my dumb ass missing the mail slot.
Comment: @Twinleaf if you are stuck in the mail slot, try lowering your landing gear fully and then folding it back up. That usually solves the issue.
Answer: It's a harsh and unforgiving galaxy where death isn't very permanent. Loitering inside a station blocks the entrance or a landing pad, impeding commerce. Stations live on imports and exports and a blockade would kill residents. The easiest way to clear that blockage and keep commerce flowing is to destroy the ship that's in the way.
I think the game design reason is to help make stations a relatively safe place for "innocent" players, to make it harder to blockade stations, and to give you an automatic escape if you get stuck in some part of the station (like the rack around the slot).
Also, the voice message in stations is pretty funny and really sets a nice "harsh galaxy" vibe.
Comment: What do you mean by death not being permanent? I don't think I've seen any in-lore explanation about why that is. Appreciate the detailed answer though!
Comment: I don't know of any in-lore explanation, but no matter where or how you die, you're quickly resurrected.
Answer: I'm not aware of an explanation for it in the text of the game, but I think the logic is there. It's not an analog to like, blocking the entrance to a parking lot. It's probably more like trying to blockade a bay city, or yelling "bomb" in an airport. Stations are cities, economic centers and military bases all rolled into one, and there's a lot that makes them vulnerable to aggression. "Loitering," or interfering in any small way with the traffic or operation of regular station activities by misusing your armed spaceship can be treated as hostile, even terroristic activity if it means the station is less able to defend itself.
Perhaps in-universe this lesson was learned early when some supposedly harmless, innocent citizen floated inside the entrance and blocked fighters while his pirate buddies buzzed the station and attacked civilians.
Comment: That really makes a lot of sense actually. Stations really are just huge cities in space so I get why they'd defend them against any percieved threat!
Answer: I don't think I've ever seen an in-world reason for the penalty for loitering.  It seems to be designed out-of-game to prevent griefing of the landing areas (by blocking access to them).
The speeding penalties are the same way.
Comment: speeding doesn't accrue a penalty - speeding and then colliding inside a station safe zone accrues a penalty, speeding and cause another pilot's destruction inside the safe zone gets the death penalty.
Answer: Lore-wise, it's not a death sentence. In fact, nobody ever really dies in Elite: Dangerous. So they're really not killing you, they're just getting you out of the way and making you pay your deductible. Still feels a little harsh, but it's not as bleak as it appears.

Why is loitering punishable by death?


How many people use their mountain bikes for road riding?

Question: In March 2012 I purchased a Cannondale Synapse Alloy 6 road bike. I put around 2100 miles on it during the year. This year I'd like to do a bit more mountain biking, but not any real hard-core mountain biking. It will be for trail use and light off-road riding. The area where I live, NW Ohio, doesn't have a large number of off-road riding trails. The more I test ride some of the bikes in my LBS, the more I wonder if I would enjoy riding one of these for road use as well (30 - 50 miles at at time). It got me wondering how many people use their mountain bikes for road riding as well as off-road riding, and why?
FWIW, I'm looking to get a 29er, probably a Cannondale of some sort.
Thanks very much.
Comment: Is the question here how many people use their MTBs on pavement? Or what bike should I get if I'm going to use my MTB on the pavement?
Comment: Oh, Lord!! Don't **ever** use a mountain bike for road biking.  It will lead to the end of the universe as we know it!  (IOW, a bike is a bike.  What's the issue?)
Comment: @DanielRHicks Although I agree with you, a bike is just a bike, there seems to be way too many people riding mountain bikes exclusively on the road.  Also, most department stores seem to sell exclusively mountain bikes, or at best, hybrids.  I think people would enjoy biking a lot more if they had a road bike, even a cheap one, because they are so much more efficient.
Comment: @Kibbee - Department stores sell bikes for sex (though kiddie style sex, for those who don't know what sex is).  In that context how well a bike rides or how appropriate it is for the rider in not important -- it's how it looks on the showroom floor.  (And this is even true to an extent in "legitimate" bike shops, where bikes are set up with the handlebars too low, et al, because that looks "meaner".)
Answer: In my experience, the majority of hardtail mountain bikes and short travel full suspensions are used both on and off road. Only the truly specialty machines, whose riders have multiple bikes will be only used off road.
It's anecdotal, but out of my friends and MTB cycling acquaintances, if you have multiple bikes, you generally have a hardtail, which is used for commuting, casual neighborhood use and light trail use, a fully which is your primary off road bike, and a road bike which is used for sport road riding.
If you only have one bike, you use it for everything, to include commuting/neighborhood use.
If you do not identify as a "cyclist", and yet ride a bike with any regularity, it is likely a basic mountain bike, and it is likely used primarily on the road and in the neighborhood, because there is the perception that mountain bikes are stronger, safer, more stable, more comfortable, and have better traction.  People use mountain bikes on pavement because they have them, because it is convenient, and because they are comfortable. But mostly, because that is what they have, and most people don't see a need for more than one bike.
Even hard core roadies tend to have a casual use bike which, if it's not a mountain bike, is a hybrid based on designs evolved from converted mountain bikes.
It is a rare cyclist who only ever uses their bikes exactly as the designer intended them to be used.
Answer: I would say it depends on the bike. About ten years ago I was riding a cross-country MTB with rather slim tires (1.95" I think) and it was fun also on paved roads, even with knobby tires. Its handling wasn't comparable with a road bike but it was okay to ride on roads also for some longer rides. Now I ride a more all-mountain like bike with fatter and quite knobby tires and compared to the other bike it feels like you are pushing all your energy into the rolling resistance of the tires when biking on paved ground.
On both bikes I wouldn't go on 30-50 mile road rides if I could avoid it. As you say you have rather light terrain in your area, if you maybe choose a bike with rather cross-country like geometry, suspension lockout and rather "fast" tires (maybe semi-slicks) you could be OK with it. From my personal opinion it is OK to go on such along ride with a MTB if you have to get from A to B and have no other bike at hand, but I wouldn't go on such a long road trip for fun or if I had a more appropriate bike at hand.
Comment: 10 years ago 1.95" was pretty standard fro a MTB......
Comment: 1.95" is still standard for normal, consumer mountain bikes.
Comment: @mattnz yes it was, 2.1 was already considered heavy freeride stuff ;-) but compared to todays tire sizes it was slim.
Answer: Part of this is going to depend on what you consider to be a mountain bike and what types of trails you are looking to ride. You said you you plan on mostly using it for trail use and light off-road riding so I would say take a look at some of the hybrid bikes out there and see if they might not meet your needs better than a true mountain bike.
I've put about 2,800 miles on a Trek Dual Sport sport over the last 5 months with about 1/4 of that on the road, 1/4 on gravel trails/roads (some of it quite rough) and the rest on paved bike paths. So far I have had no problems with 30 to 50 mile rides on any of those different surface types. Some of the most fun rides I take are actually longish (60-100 mile) rides with a mixture of paved roads, gravel trails and bike paths.
I know many of them won't do this, but once you've narrowed your choice down to a couple bikes will your LBS let you take them each on an extended (90-120 minute) test ride? If so take a nice long ride on pavement and you'll have the best answer possible.
Answer: The standard route I take for commuting has only few asphalt kms, most of it is gravel or worse. A road bike wouldn't be as suitable (fun, enduring, ...), even though it is not a problem to use one for this route.
Personally, I would never consider a road bike because I like the versatility of biking. In summertime, I might change the route to one that leads through the woods, in the wintertime, my standard route can require spike tires. Somehow, using spikes, to me, corresponds with using a MTB and not a road bike.
IMHO, if you want to bike on roads only, a road bike is OK. In all other cases you will end up with a non-road bike. I cannot imagine a biker who would stop riding a MTB because she's on a road, whereas most road bikers would rarely use their bike off road.
Hence, this "sort of" answers the quantitative part of your question: the percentage of MTBers using their bike on a road is higher that the percentage of road bikers using their bike off road :D


Is setting php.ini's session.auto_start to 1 considered bad practice?

Question: I was playing around with php.ini's session.start_auto and tried setting it to 1. The site I am building requires session management on every page anyways and the server only contains the one site. Is this considered bad practice (like having globals turned on - which I dont BTW!) - php.net doesn't say a lot about it.
Comment: or simply use `if (ini_get('session.auto_start') == 0) session_start();` to prevent Notices
Answer: Nah, why should it be? In principle, its the same as having session_start(); as the second line in every page.
Comment: You are assuming that putting session_start() on every page is not a bad thing. If someone enters your site, reads some pages and then leaves, why would a session need to be created? It's pretty rare that ALL your pages needs a session.
Comment: @DanieleTesta, yes, but the question explicitly said that his every page indeed uses the session. (Otherwise yes, there are good reasons to avoid the default PHP session setup, e.g. if you need to customize properties of the session cookie.)
Answer:
IMO relying on php.ini settings can be tricky if people deploying your app don't have control on the php.ini (e.g. shared hosting). And even if the php.ini can be changed, understanding a problem due to a php.ini configuration problem may be difficult to understand (you may have to write a script allowing to check if config is Ok, etc.).
As an alternative, you can create a unique "controller" script (e.g. /index.php), which will call and output different pages depending on parameters sent to it (e.g. yoursite.com/index.php?page=12 or even better yoursite.com/page/12 with routing & URL rewriting). And in that index.php file, put your session_start() once for all pages.
Comment: I'd have voted this up for the first point, but voted it down for suggesting a front controller as a solution %) (you could get the same benefit by using an auto-prepend without having to rewrite the entire site - and if you are rewritnig the entire site, wouldn't it be simpler to just add session_start()...not to mention all the other issues with FC)
Comment: @symcbean `auto_prepend_file` relies on `php.ini` too. IMO using a FC is preferable to repeating `session_start();` on every page: pros  look far stronger than cons, see http://stackoverflow.com/questions/121849/pros-and-cons-of-using-one-file-for-entire-webpage http://stackoverflow.com/questions/3538242/what-are-the-pros-and-cons-of-specifying-a-controller-class-via-url-vs-having-a http://css.dzone.com/books/practical-php-patterns/practical-php-patterns-front
Answer: To be honest, I would consider it BAD to turn auto_session on. Like other people said, it is the same thing as putting a session_start() on ALL your pages.
Imagine all people that enters the main page of your website. A session will be created even before they tried to login or anything else. All spam-bots, all search engine bots etc will all create a session when entering your page. This is usually a bad thing as it will create TONS of files on your server (if session is file-based) or fill your ram cache (if session is memcache based).
It's much better to simply run session_start() only when you actually NEED a session. You can just create a "session class" or simple functions like session_get() and session_put() which will run session_start() for you. Then use those instead of $_SESSION directly.
Answer: I would say the answer is "yes, it is bad practice."
[disclaimer: I started building web pages in 1997 -- when you coded everything by hand, so I have developed my own way of doing things.]
In my world, I have a MySessionHandler which extends SessionHandler.  It pulls in an INI file that contains all of the ini_set commands needed.  I note that I am not the only one who does this.  If you auto-start the session (which happens before the code gets executed), then a number of the frameworks also have issues.
The first line of executable code in my PHP scripts is a require of MySessionHandler.php, which starts off by checking the values of auto-start and use_strict_mode, optionally dying with an error if they are not set properly.
Answer: As you can start session in read-only mode to gain better performance and avoid session file locking, I prefer manually start sessions.


Is prosecutorial discretion subject to the public sector equality duty?

Question: The Equality Act 2010 creates a duty on public sector entities to have consideration for equality in all decisions they take. Does this bear on prosecutorial offices and their exercises of prosecutorial discretion?
Answer: Yes, decisions must not be contrary to section 149 Equality Act 2010, which defines "Public sector equality duty" to mean:

(1)A public authority must, in the exercise of its functions, have due regard to the need to—

(a)eliminate discrimination, harassment, victimisation and any other conduct that is prohibited by or under this Act;

(b)advance equality of opportunity between persons who share a relevant protected characteristic and persons who do not share it;

(c)foster good relations between persons who share a relevant protected characteristic and persons who do not share it.

...
(7)The relevant protected characteristics are—

age;

disability;

gender reassignment;

pregnancy and maternity;

race;

religion or belief;

sex;

sexual orientation.

(8)A reference to conduct that is prohibited by or under this Act includes a reference to—

(a)a breach of an equality clause or rule;

(b)a breach of a non-discrimination rule.

(9)Schedule 18 (exceptions) has effect.

And as long at the Crown prosecutor exercises discretion by deciding to / not to, for example charge a suspect based on a subjective reading of the evidence etc, and not one of the above protected characteristics, then the prosecutor has complied with the equality duty.
Comment: When does the prosecution service perform a judicial function?
Comment: @Seekinganswers It was only intended as a footnote to supplement s.149's reference to Sch 18. With hindsight, para 3(2) is more appropriate but off the top of my head I can't readily find a usable example, so I've taken it out until (or if) I can.
Comment: Okay but the question still stands. Perhaps it is worth its own question but I really just intended it as a commentary one.


Is it possible to obtain a CPL without a PPL?

Question: I've overheard that trainee pilots hired by airlines are not required to pass the PPL exam before attempting the CPL exam. Is this allowed by regulation?
Comment: Because the answers can be significantly different between different sets of regulations (and there are major differences in pilot licensing rules in this case), this should **really** be three different questions.  Already, we have two different answers from two different people covering the different aspects, and both cannot be accepted as "correct".  I suggest that you narrow the scope of this one and ask two more questions if you want a definitive answer for each.
Comment: Some countries have multi crew competency(?) certificates for pilots who only have airline training.  They can fly an Airbus, as SIC, but can't fly a small airplane.
Answer: You've tagged your question with 3 different sets of regulations, I can't answer all of them but here are the FAA ones.
The answer depends on what you mean by "exam". If you mean the written test, then anyone can take it if they have a graduation certificate or a logbook endorsement:

An airman applicant may present one or more of the following
  acceptable forms of authorization for all tests listed above [...]

Certificate of graduation or a statement of
  accomplishment certifying the satisfactory completion of the ground
  school portion of a course for the certificate or rating sought. The
  certificate or statement may be issued by an FAA certificated pilot
  school or an agency, such as a high school, college, adult education
  program, Civil Air Patrol, or Reserve Officers Training Corps (ROTC)
  flight training school.
Written statement or logbook endorsement
  from an authorized ground or flight instructor certifying that the
  applicant completed an applicable ground training or home study course
  and is prepared for the knowledge test. (AC 61-65E) (14 CFR § 61.35)

At least in theory, you could get a certificate or endorsement to take the commercial written test without ever having taken any other FAA test. But in practice I suspect that it's very unlikely: why would an organization or CFI endorse you as ready for the commercial written if you haven't already done the private one?
However, if "exam" means the actual checkride then the situation is much clearer: it isn't possible to do it unless you already have a private certificate, at least for civilian pilots. 14 CFR 61.123 says:

§61.123   Eligibility requirements: General.
To be eligible for a commercial pilot certificate, a person must:
  [...]
  (h) Hold at least a private pilot certificate issued under this
  part or meet the requirements of §61.73

61.73 lets you use military experience to apply for a civilian certificate.
Finally, some people use the term "commercial pilot" when "ATP" would be more accurate. I'm not saying that you're using it incorrectly, but since I have no idea how EASA and CASA define a CPL it may be worth mentioning. In the US, ATP multi-engine candidates need a certificate for the written exam, and a commercial certificate with instrument rating (or military equivalent) for the checkride. See 61.153.
Answer: For EASA, having a PPL is not required, however having an ICAO compliant PPL allows 50% of previously logged hours—up to a limit—to count toward the EASA CPL.
Source: CAA

For CASA, having a PPL is not required, however PPL experience will count toward the required hours—depends on the type of hours.
If you only have CPL and want to exercise PPL privileges, you only need a Class 2 medical certificate—my interpretation: say after retiring.
Source: CASA


What is the difference between a MSc in Mathematics, a MSc in Applied Mathematics, and a MSc in Applied and Computational Mathematics?

Question: I'm interested in how a MSc in Mathematics, MSc in Applied Mathematics, and MSc in Applied and Computational Mathematics compare in terms of content, but also in terms of how they are perceived and the opportunities they create. Can all three make you a qualified candidate to teach math at the community college level? I would like to keep open the possibility of one day getting into a PhD program in mathematics, how would having a MSc in Applied and Computational Mathematics affect one's chances of being accepted as compared to the other MSc programs?
Comment: What matters more than the title of the degree is the content. What topics are you interested in studying? For example, when you say you want to have a chance to do a PhD in mathematics, are you considering applied or pure mathematics? Do you know which specific area or areas within those broad categories you are most interested in?
Comment: @Andrew I like the core subjects, but I do like the applied stuff a little more. The content in the applied and computational program looks interesting, but I noticed it's often offered by engineering departments, and I'm afraid that if someday I want to teach at a community college they will say that doesn't count as a math degree. I'd also like to keep open the possibility of applying for a PhD program (mathematical physics or differential geometry type stuff). I'm worried that a MSc in Applied and Computational Math isn't respected in the same way as the others?
Comment: What country are you intending to study and work in? I can add additional advice with that information.
Comment: @Buffy thank you very much for your answer. I tried to upvote it, but it says I need more experience to do that. I'm an experienced high school math teacher in the United States. I have two goals (a) become qualified to teach community college and dual credit courses, and (b) Keep open the possibility of being accepted into a mathematics phd program in the future.
Comment: @Buffy (continued from above...) I would mainly be pursuing the PhD for my own satisfaction, probably in an area adjacent to mathematical physics. So I'm looking at two options with the aim of opening the right doors -- I could enroll in a very affordable MSc Pure Math program at a lower ranking regional school, or I could enroll in a much more expensive MSc in Applied and Computational Mathematics program at a higher profile school. I don't mind the extra cost if it better advances the goals. I could also do neither of these and keep looking for something else. What do you think?
Comment: In the US, if you want a doctorate, apply for that. There is no need to do a masters first. And a doctorate opens many more doors. See: https://academia.stackexchange.com/q/176908/75368
Comment: @Buffy well I think you need to have a record of success and some connections for letters of recommendation if you want a chance to be accepted into a PhD program so that's why I was planning to get a Masters first. Also it's the secondary goal. The first goal is to become qualified to each community college and dual credit classes.
Answer: Here is my perspective as someone who was the Graduate Coordinator in my mathematics department (at University of Georgia), hence principally involved in graduate admission.  It is:
I am rather clear on the distinction between mathematics and applied mathematics: the latter is a subset of the former; its complement is "pure mathematics." However one could point to some disputed territories here.  I am less clear on the difference between applied mathematics and "applied and computational mathematics."  In some areas of mathematics, if you put "computational" in front of it, it need not be applied: this tends to be true in more algebraic areas, e.g. computational number theory.  In other areas of mathematics, appending "computational" does seem to make it applied: e.g. computational PDEs is usually considered applied mathematics.  In my opinion, this again serves to illustrate that the pure/applied distinction may not mean as much as we think.
How does a master's degree in one of these three areas look?  I think all three master's degrees look virtually identical, in particular for trying to get a job at a community college but also for every other purpose I can think of.  The distinction between one institution versus another is more important than the name of the degree...and what you actually learned is much more important than both of these.
Answer: Mathematics (pure math) implies that the study is to advance mathematics itself. New theories, new areas of study, etc.
Applied mathematics implies that mathematics is being used to solve problems in other domains, business, biology, astronomy, whatever. The list is long and varied. Such study might occasionally lead to advances in math, but that isn't normally the intent.
Computational applied mathematics is like applied math, but uses a fusion of ideas from both math and computing for the solution of problems from, usually, other domains. That might be something like machine learning, for example.
There is a fourth possibility, actually, which is the use of computational techniques to solve problems within math itself. A couple of important theorems were solved at least partially in this way: The Four Color Theorem and work related to Fermat's Last Theorem.
For later doctoral study mathematics itself would probably be best, though there are some departments/universities that have a combined faculty so you can choose. For industry, computational applied math would probably be best since you learn a lot of useful tools for industrial application.
At the community college level any will probably do fine, since the coursework of students in introductory.


Why does Cobalt have different coordination numbers in its complexes with water and thiocyanate?

Question: I'd like to know why does cobalt(II),  $\ce{Co^2+}$, form $\ce{[Co(H2O)6]^2+}$ complex with water while  it forms $\ce{[Co(SCN)4]^2-}$ with the thiocyanate? Why is there $\ce{6H2O}$ but only $\ce{4 SCN-}$? And is the cobalt's  coordination number 6 in these cases?
Thanks.
Comment: Welcome to chemistry.SE! Please take some of your time for a visit at the [help center](http://chemistry.stackexchange.com/help) or take a look at [this page](http://chemistry.stackexchange.com/help/notation "LaTex intro") to enhance the formatting in your future posts.
Comment: the coordination number is the number of coordinate bonds to the metal ion: six for the hexaaqua complex and four for the tetrathiocyanate complex. as for why I too am dying to know as I haven't been able to find any good explanations on the internet
Comment: Water, being neutral, has a stabilizing effect on positive ions, such as $H^+$. Thiocyanate has a negative charge. I think that after 4 ions have clustered around the cobalt, that the charge repel more thiocyanates from bonding to the cobalt.
Comment: That's a good thought @LDC3, but if that were all there was to it, wouldn't you expect the thiocyanate complex to have two water ligands as well?  However, when you add $SCN^-$ to a solution of hexaaquo cobalt (II), you get $[Co(SCN)_4]^2-$, not $[Co(SCN)_4(H_2O)_2]^2-$.  I am still scratching my head on this one .. water and thiocyanate are both weak field ligands, so I would expect the same coordination geometry for both of them.  I must be missing something.
Comment: Maybe you need to take into account the geometry in addition of charge stabilisation. $\ce {H2O}$ is bended while $\ce {SCN-}$ is linear. I'm not sayin' that's the answer but maybe it should be taken into account :x
Comment: It seems coordination number changes because $\ce{SCN-}$ i weak ligand in spectrochemical series and water isn't, but I don't understand this.
Answer: Firstly, in water Co(II) is not exclusively $\ce{[Co(H2O)6]^2+}$, there is also a small amount of tetrahedral $\ce{[Co(H2O)4]^2+}$, 0.08% at room temperature increasing substantially at high temperature. Canadian Journal of Chemistry, 1980, 58(14): 1418-1426.
According to Greenwood's "Chemistry of the elements" 2nd edition page 1131, the more polarizable the ligand, the more the tetrahedral form of Cobalt (II) is preferred since fewer ligands are required to neutralize the metal ion's positive charge.
Answer: I don't know whether it's correct or not but what I think is due to steric factors .
Given the SCN- is pretty large ligand as compare to H2O .
Also there might be some additional stabilisation in water as ligand due to intra atomic hydrogen bonding.


Develop iphone or ipad application on ipad?

Question: I am very interested in developing iphone or ipad application. As far as I understand, I need a mac to develop iphone or ipad application.
I just wonder if I can develop ipad or iphone application on ipad with keyboard.
Answer: To develop an iOS application you need Xcode (the Apple IDE) and the iOS SDK for the latest version of iOS you intend to target with your app. Those can only be installed on a Mac running Mac OS (unless you count "Hackintoshes"). Get them both at Apple's developers' site.
Answer: No you can't, except if you count remote control software accessing a Mac.
Answer: YES, you can.
You can create a web application with javascript, html, css ... It runs much slower then native application and is generally not in the same class as native app, but you still have many options, such as saving app to home screen, saving app data to device, defining your own gestures, working without internet connection (if app is saved), accessing accelerometer (on iOS 4.2), ...
So basically you need a text editor which uploads files to server (at minimum), Gusto is one such application.
There are also other differences between native and web applications.


How can I printscreen in X11 Environment?

Question: I use Wireshark and it runs under X11 environment I want take some screenshot from wireshark windows but
cmd + shift + 3  or cmd + shift + 4 or ... didn't work there is there any way that I could take some screen shot in X11 environment?
Comment: What do you see when you cmd shift 4 and selected the region?
Comment: @hobs when I press cmd+shift+4 it types $ in wireshark search box.
Comment: Is Aqua window manager still running or are you in a non-default X11 mode different than simply firing up the standard X11.app after a normal user log in to OS X?
Comment: @bmike I don't know what you mean by Aqua windows manager, if you mean the X111 grey windows, yes it runs and wireshark run within it.
Answer: Click to the desktop or any other application, and then press ⌘ + ⇧ + 3.
With this method Wireshark will loose the focus and you can grab the whole screen.
Comment: If you're seeing "a grey environment" whenever X11 starts up, then X11.app is running in full screen mode. Press Cmd-Opt-A to toggle that, then you should see Wireshark running as a regular window on your desktop, and the other screen grabbing suggestions here should work fine.
Comment: there is no desktop when you cmd+tab to wireshark you go to another envirinment (X11) and if you want click desktop must switch to another application then your solution is useless for my case.
Comment: Not true, resize your wireshark window to have a little smaller and then you can click on the desktop, or use Expose to show the desktop click on it and use Expose to show your application again. I did it and it worked.
Comment: I don't know how you can do it because when I want run wireshark first it rum X11 (a grey environment) then run wireshark into X11 so when I minimize or resize wireshark I just see X11 Grey environment and can't resize it (or minimize)
Comment: On the download page you can download Wireshark images for OSX which starts X11 automatically and runs almost like a normal application.
Comment: Tanx @Calum this is work for me.
Answer: Have you tried using Grab.app? It supports a "timed screen" capture mode. You'd switch to Grab.app, select "Timed Screen..." then switch back to X11. After 10 seconds it will do a screenshot.
Answer: According to @calum-benson's hint, I found what my problem was. I must un-check 1Full-screen mode1 in X11 Preferences.


Prove the geodesic on 2-sphere is the great circle

Question: I want to use the Killing vector fields to prove the geodesic on the sphere is the great circle. First of all, the given metric is $$ds^2=d\theta^{2}+\sin^2\theta d\phi^{2},$$ where I set the radius to be $1$. By Killing equation, $$\nabla_\mu K_\nu+\nabla_\nu K_\mu =0,$$ and some computation, I have the following three Killing vectors:
\begin{align*}
K_1 &= \partial_{\phi} \\
K_2 &= \cos\phi \, \partial_{\theta} - \cot\theta \sin\phi \partial_{\phi} \\
K_3 &= -\sin\phi \partial_{\theta} - \cot\theta \cos\phi \partial_{\phi}
\end{align*}
I want to use the fact that
$$\frac{d}{d\lambda}\left\{K_\mu \frac{dx^{\mu}}{d\lambda}\right\}=0,$$
where $x$ is the curve and $\frac{dx^{\mu}}{d\lambda}$ is the tangent vector. However, as everyone knows, the geodesic is the great circle. Therefore, I thought the final equation would be of the form,
$$aX+bY=0,$$
where $a$ and $b$ are some constant, while $X$ and $Y$ are positions on the sphere. The equation passes the origin. But I can't see how to get the desired results, please give me some help.
Answer: This should probably be a comment, but I do not yet have the reputation to make a comment. However, I believe your final form of the solution is incorrect. A great circle does not pass through the origin of a sphere: the center of the circle does, but the center of the circle does not belong to the curve. If $X$ and $Y$ are positions on the sphere, then you should have the final form
$$X^2+Y^2=R^2$$
where $R$ is the radius of the sphere. However, I do not think this will tell you much because $X$ and $Y$ can be arbitrary, so long as they belong to the sphere: it is not necessarily true that three points on the sphere can be connected by a great circle. I suggest working in spherical coordinates, and from there, you expect that at the equator of the sphere, a geodesic follows the equator.


Git pulling changes between two local repositories

Question: I have two clones of same remote repository. I have made some changes to one local repository, how can I pull these changes to the other local repository without pushing it to the remote?
Comment: Relevant documentation: https://git-scm.com/book/en/v2/Git-Basics-Working-with-Remotes
Answer: You can treat the second clone the same way you treat a remote respository on another system. You can perform all of the same operations, e.g.
<code>~/repo1 $ git remote add repo2 ~/repo2
~/repo1 $ git fetch repo2
~/repo1 $ git merge repo2/foo
</code>
Comment: If you are trying to fetch and merge in an unrelated repository, make sure to pass `--allow-unrelated-histories` to the merge command.
Comment: What is `foo` supposed to be here?
Comment: The implication here is that you may have a branch in your fetched repo2 that contained changes (perhaps that you made) that you now now to merge into repo1.  You could have performed a 'git checkout repo1' just to make sure that is where your current HEAD state is.  The last line would then attempt a merge from repo2/foo to repo1.  You would then resolve conflicts, commit, and potentially push repo1 updates.  repo2 will be unaffected because the fetch is a detached copy from the origin.
Answer: To add to djs response. After you add the local repo you can treat it as master, so all the other git commands work as normal.
For example if you have made some changes in directory A and save it in commits. To retrieve those changes in directory B (same computer) you simply open a terminal in that directory and you git pull
<code>git pull
</code>
This will copy any changes in directory A. I use this system so that I can have a "development" environment (dir A) and a "production" environment (dir B). I only git pull in dir B
Answer: For one-time pulling
<code>~/repo2 $  git pull </path/to/repo1> <branch> --allow-unrelated-histories
</code>
That will pull from repo1/branch to repo2/HEAD