Use SSD as RAM?

Question: How can I use SSD disk space as RAM to run large-memory jobs on the Raspberry Pi? Is this the same in Linux as creating "ramdisk" as per this Q&A?
Comment: Short answer is: It is not possible! You can use it as a swap disk or keep temp files on there but you cannot extend your RAM using the drive. It is just not possible.
Comment: Try using GParted to format your SSD with a `linux-swap` partition, then run `sudo swapon /dev/sda1` (or whatever the swap partition is.) Ramdisk uses your RAM as storage, swap space is basically the opposite - use storage as RAM.
Answer: I assume you mean SD instead of SSD?
Creating an Swap partition on the SD card should work as a kind of RAM for the drive.
If you mean SSD there is no true way of connecting an SSD drive to the Pi in the first place. If you are connecting by USB there will be no big increase, not even an normal HDD attached externally can run at full speed.
Answer: This is not possible.
The memory for the Raspberry Pi is fixed on the board and there is no interface to extend it or replace it.
I think the confusion comes from the fact that SSD (Solid State Disk) is using memory chips to store the data. But that's where the similarities end. The memory chips on the SSD are very much different than normal RAM. It is not possible to replace one for the other.
The SSD has a SATA disk interface. The RAM has a memory bus interface. They are so different, that the best analogy I can offer is like comparing a gas cooking oven to a microwave.
I tried to simplify the information that follows, so for anyone reading this with deeper understanding, please bear in mind this is only a very high level summary:
The SSD chips are Flash Memory and have a non-volatile storage ability, similar to the USB thumb disks. This means they can retain their data even without power. They also need a special controller chip to talk to them. This chip is connected to a SATA disk interface and follows the SATA protocol. In my analogy, the SSD is the gas cooking oven and the SATA bus is the gas supply to the house.
The typical RAM chips are known as DRAM, i.e. Dynamic RAM (also known as DDR SDRAM, etc). They store data for a very short time, which makes it necessary to take them off-line (disconnect these chips from the rest of the circuits)  to refresh their stored data. This happens several hundreds or thousands of times per second and it is transparent to the user. If the power goes off then this refresh stops and their data are lost for ever. Dynamic RAM chips follow a completely different protocol from Flash Memory chips and they connect to a Dynamic Memory Controller, who in turn, connects to a very high speed memory bus. This memory bus goes directly into the heart of the CPU chip. In my analogy the Dynamic RAM is the microwave oven and the high speed memory bus is the electricity mains supply.
The Rapsberry Pi CPU has a special connection for the RAM and nothing but Dynamic RAM can connect there. SATA and USB connections are kept separately.
So although they both do the same job (SSD and RAM store code and data, gas cookers and microwaves cook food and warm up meals) they do this job in completely different and incompatible ways. One can not be substituted for the other.
Finally, the RAM Disk is a trick of the operating system that pretends that some of the available RAM is actually a storage disk. This reduces the available RAM as very correctly lenik points out in his reply.
Comment: What about when Windows (Ready Boost) allows you to use Flash Drives as extra RAM, could that work? Or is it like trying to add SWAP which won't make the difference hoped for in performance?
Comment: ReadyBoost on Windows doesn't work as RAM, see Wikipedia: https://en.wikipedia.org/wiki/ReadyBoost . In summary: ReadyBoost is a disk caching solution to speed up slower disks. Typically this involves copying data from spinning disks to flash drives to reduce data access times.
Answer: Adding swap to the Raspberry Pi
You can either use a swap file, or a swap partition.  If you decide to use a swap partition, be sure you read carefully, as you do not want ruin any important data.
Creating swap file

dd if=/dev/zero of=/SWAPFILE bs=1024 count=524288

This will create a 512MB blank file.
Change the count= to your preferred size.

chown root:root /SWAPFILE
chmod 0600 /SWAPFILE
mkswap /SWAPFILE
swapon /SWAPFILE

Creating swap partition

dd if=/dev/zero of=/dev/sdXN bs=1024

This will fill the entire partition of /dev/sdXN

mkswap /dev/sdXN
swapon /dev/sdXN

Persistent at boot (add to /etc/fstab)

vim /etc/fstab
Add either:

/SWAPFILE swap swap defaults 0 0
/dev/sdXN swap swap defaults 0 0

Test if it's active

free -m
Comment: While SSDs are fast and might be good for swap space, be warned that data can only be written to them a limited number of times.
Comment: Don't forget you are throttled through the USB2 interface, so the SSD will be less than 10% of it's native speed. I really don't think you need to worry about wearing the flash out by accident.
Answer: RAM disk is totally opposite of what you want to do. it creates disk in the RAM, when you need extra speed and don't care about the memory.
using SSD as RAM... dunno, maybe create swap partition on SSD and let it swap there.

Use SSD as RAM?


How do I fix stain after sanding drips in polyurethane?

Question: I applied the first coat of polyurethane after staining and the polyurethane ran. I sanded the runs and it is slightly lighter in color. Should I reapply stain at this point?
Answer: Many finish coats, including polyurethanes, can slightly darken a finish when applied. Your sanding, if it did not cut into the stained surface, may have just removed that darkening poly layer.
You should try applying a coat just to the area you sanded, feathering the edges with a nearly dry brush. Let it dry and see if the color has evened out.
If not, I would recommend sanding the whole side. If it has lightened significantly, re-stain the side and then re-poly. If not, just re-poly.
You may want to look at some of the wipe-on finishes. These are satin finish (not high gloss) and go on easily with much less chance of runs.
Answer: You can try adding stain. Its hard, because PU (PolyUrethane) seals the wood surface.  You might have luck with a gel stain or make a glaze overcoat, which will overcoat onto lighter area. Glaze would be my preferred technique, as you can 'play' with the effect, because of the extended drying time.
You would then overcoat with a new (lighter) coat of PU.
Tinted polys are another route (so called all-in-one stain & PU).


What is morality according to Buddhism?

Question: What is good and bad according to Buddhism? Is there good and bad? What is it's cause? What defines good and bad? Why some people think "this same X is bad" and others think "this same X is good"? What's the cause of this difference in thinking "this same X is bad" and "this same X is good"? Are there any suttas talking about all this?
Answer: The respective key words for "good" and "bad" in the suttas are "wholesome" (kusala) and "unwholesome" (akusala):

kusala (adj.) [cp. Sk. kuśala] 1. (adj.) clever, skilful, expert; good, right, meritorious.
akusala : (nt.) demerit; sin; bad action. (adj.), unskilful.

"Wholesome" and "unwholesome" here are qualifications for action/kamma. Keeping in mind that, to the Buddha, volition is kamma (see AN 6.63) manifested by body, speech and mind.

"And what, friends, is the unwholesome, what is the root of the unwholesome, what is the wholesome, what is the root of the wholesome? Killing living beings is unwholesome; taking what is not given is unwholesome; misconduct in sensual pleasures is unwholesome; false speech is unwholesome; malicious speech is unwholesome; harsh speech is unwholesome; gossip is unwholesome; covetousness is unwholesome; ill will is unwholesome; wrong view is unwholesome. This is called the unwholesome.
"And what is the root of the unwholesome? Greed is a root of the unwholesome; hate is a root of the unwholesome; delusion is a root of the unwholesome. This is called the root of the unwholesome.
"And what is the wholesome? Abstention from killing living beings is wholesome; abstention from taking what is not given is wholesome; abstention from misconduct in sensual pleasures is wholesome; abstention from false speech is wholesome; abstention from malicious speech is wholesome; abstention from harsh speech is wholesome; abstention from gossip is wholesome; uncovetousness is wholesome; non-ill will is wholesome; right view is wholesome. This is called the wholesome.
"And what is the root of the wholesome? Non-greed is a root of the wholesome; non-hate is a root of the wholesome; non-delusion is a root of the wholesome. This is called the root of the wholesome.
-- Sammādiṭṭhi Sutta, MN 9

(the causes are also repeated and further explained in the Nidana sutta (AN 3.33)).
The above definitions are more general, based on the 3 defilements (greed/lobha, hate/dosa, delusion/moha) but the list of mental states can expand to more specific ones. For example, any of the five hindrances are also understood as unwholesome. In Theravada tradition, the Abhidhamma and Visuddhimagga lists 10  defilements.
In another exposition, the Buddha further distinguishes between four kinds of kamma (see AN 4.235):

"Monks, these four types of kamma have been directly realized, verified, & made known by me. Which four? There is kamma that is dark with dark result. There is kamma that is bright with bright result. There is kamma that is dark & bright with dark & bright result. There is kamma that is neither dark nor bright with neither dark nor bright result, leading to the ending of kamma.

Thus, generally speaking, it is said that wholesome actions are those that lead to a favorable rebirth and lead to nibbāna, whereas unwholesome actions are those that lead to suffering, perdition, hell.

For an interesting read in this subject, see The Roots of Good and Evil by Nyanaponika Thera.
Answer: Conceptions of what is good and evil are depend on what frame of reference you apply. Certain religious traditions that sprang up in the Middle East, the earliest of which was Zoroastrianism which most probably influenced all that followed, see life as a battle between the fundamental and external forces of good and evil:

Zoroastrianism states that active participation in life through good deeds is necessary to ensure happiness and to keep chaos at bay. This active participation is a central element in Zoroaster's concept of free will, and Zoroastrianism rejects all forms of monasticism. Ahura Mazda will ultimately prevail over the evil Angra Mainyu or Ahriman, at which point the universe will undergo a cosmic renovation and time will end. Wikipedia

In Buddhism there is no cosmic fight between good and evil. Buddha pragmatically lays the origin of good and evil at the door of each persons individual actions. Greedy, hateful and delusional actions lead to bad results 3 Unwholesome Roots AN 3.69; Generous, compassionate and wise actions lead to good results - for you and the people around you.

In Buddhism, there is no fight between good and evil—that is the most wonderful thing in the Buddhist practice! There is no fight between good and evil. Good and evil are both organic matters. If you have understanding and wisdom, you will know how to handle both the flower and the garbage in you, you can make the Buddha be born every moment of your life, and peace and happiness will be possible. Thich Nhat Hanh

Why some people think "this same X is bad" and others think "this same X is good"?
They are applying their frame of reference to the world. For Buddha even if they think X is good but this belief leads to suffering then they are delusional.
An interesting and related topic worth mentioning here is the role of Mara. In Buddhist stories, that have their origins in the Pali Canon, relate how Buddha was tempted by Mara (a kind of demon figure) - Maara Legends in Canonical Texts. You could equate the temptation of Buddha by Mara to the temptation of Christ by Satan. The two stories are very similar. However, without the underpinnings of a cosmic battle between good and evil, Buddhism's view of what Mara is, or represents, in these stories is much more nuanced than Christianities concept of the devil. In Buddhism the general consensus is that Mara is merely the personification of all the unwholesome (akasula) qualities and so ...

Mara is not very pleasant, but if you know how to help Mara, to transform Mara, Mara will become Buddha. If you don't know how to take care of the Buddha, Buddha will become Mara. Thich Nhat Hanh
Answer: i think Ambalatthika-rahulovada Sutta is a good sutta for this question.
from my study of Buddhism, what is good and bad can be determine by:
1) determine the intention.
2) Results.
3) compare it with the wise (is it blameless?).  Tons of sutta about who is wise and who isn't.

What is morality according to Buddhism?


Line-to-Line Voltage Reads 0V (or low, 15V at most) on Primary of Main Breaker (L-N both read ~120V)

Question: My neighbor has a hot water tank that quit working earlier this week. I checked the breaker - looked good. I measured the voltage at the hot water tank; it read ~15Vac. I checked the double breaker for the hot water tank and it also measured ~15Vac. One step further, the line-to-line voltage coming into the main breaker read ~15Vac. Both 120Vac L-N branches give a voltage but one is at ~118Vac (good) and the other is around ~105Vac (hence my ~15Vac differential, it appears on the surface). When I open the main breaker, both L-N at the main breaker primary read ~120Vac. The hot water tank is the only 208/220 circuit in the house (and the only double breaker). Any idea what could be causing this suddenly? It looked to me like both branches were being fed, in phase, and that is why the difference between them is literally the difference between them. I had read that an open circuit on one of the main lines could cause this (the open line being backfed by the good line through the double breaker). But I'm not sure why the hot water tank would have worked up until this point.
Answer: I am not sure if this all adds up but maybe you lost a leg, and one leg is backfeeding the other through the water heater, you're seeing voltage drop from 118 to 105 across the water heater.  (I'd have guessed a bigger voltage drop but still...)
With the water heater breaker off, do you lose power anywhere?
Comment: Nice, you filled in the missing piece of the equation.
Comment: I actually tried that yesterday, as well, and yes, a handful of outlets went out but not as much as I would have thought (I didn't map out their entire house wiring, though). I guess what got me was that I measured the same discrepancy on the primary/line side of the breaker, even with the main breaker open (that is, both L-N measured ~120, not with a ~15V difference, but L-L was still ~0V). Everything leads me to believe they are tapped off of the same line/same phase but I don't know why the problem would just now show up if that were the case.
Answer: Probably the two phases are taken from same 'tap' at the transformer (or at the meter), one leg is more loaded than the other hence the 15V difference between the two.
If system used to work and suddently had problem, probably an utility's tecnichian  miswired something during a maintanance.
My suggestion is to call your utility and have it fixed: tell them you have 15V difference between the legs.


Thickening Mars's Atmosphere

Question: if we were to send a mission to mars (unlimited budget WE WISH!) to explore different methods that would enable us to thicken the martian atmosphere, what different types of data should this mission capture and how could this help is in exploring potential methods to thicken the martian atmosphere.
Comment: Despite this site being called Earth Science, some question about planetary science & other planets can be on top here. You may want to see what information is available on SE Space Exploration looking at questions that ask about Mars' atmosphere & terraforming, such [*Would Terraforming Mars Be Possible*](https://space.stackexchange.com/questions/634/would-terraforming-mars-be-possible).
Comment: On the impossibility of releasing enough CO2 for a noticeable pressure change of the Marsian atmopshere, even if all reservoirs (including crustal) are being released (which we can't): https://www.nature.com/articles/s41550-018-0529-6.
Answer: We are already knowledgeable about some aspects of the requirements needed to terraform Mars & the Moon. As @David_Garcia_Bodego mentions in his comments, gravity is a major factor in celestial bodies being able to retain an atmosphere.
This is because the gravity of a celestial body affects the escape velocity  of that body. The other important factor is the surface temperature of the celestial body. This is why Titan, a satellite of Saturn, has a thick atmosphere, despite having a similar escape velocity to the Moon (Luna), it is much colder and has a thick atmosphere.
Another factor that assists Titan in maintaining a thick atmosphere is its distance from the Sun and the weaker effect of the solar wind at that distance. Also, Titan is protected by Saturn's magnetosphere.
I recommend reading:

What will happen to the air released from the Moon's Surface?
Could the Moon keep an atmosphere?

and the links contained within those questions.
Yes, these questions discuss the Moon and not Mars, but the information provided in those questions is applicable to Mars.
The graph below provides a visual of the gases a celestial body can retain in a atmosphere based on escape velocity and temperature.

Factors that act in favor of Mars being able to have a thick atmosphere are:

Mars is farther away from the Sun than Earth & Luna so it experiences
a weaker solar wind.
The surface temperature of Mars is cold, which reduces the energy of
atmospheric molecules.

Factors that act against Mars being able to have a thick atmosphere are:

The gravity of Mars and subsequently the escape velocity of Mars is small.
The lack of a magnetosphere to shield the atmosphere from solar wind.
Answer: This is an Earth Science site, not a Mars Science site. However, there will be a manned expedition to Mars within the next 25 years provided a world war doesn't throw a spanner in the works. They won't be exploring methods of thickening the Martian atmosphere, partly because it is impossible to thicken it to any useful degree, by which I mean to a degree which would enable astronauts to wander about in the open without wearing pressure suits.
Even if you  could find a way to melt all the $\small\mathsf{CO_2}$ in the polar caps (mainly the south pole), there isn't enough to create an atmosphere as substantial as you would find at the top of Mount Everest. There might be enough to raise average temperatures by a few degrees, but what use would that be? The  first astronauts will be doing the usual things. mainly geological exploration, particularly with a view to establishing whether there was ever any primitive, unicellular life on the planet.
Another task will be to find sites which might be suitable for establishing a permanent base, one of the main requirements being a good water supply. They might also experiment with ways of using local materials for building purposes, in preparation for future expeditions building a permanent base. The fact that liquid water can't exist in the open might be a problem when it comes to making cement. The Romans made an excellent cement out of volcanic tuff, so in the right place there could be plenty of that. Measuring the effects of the Martian environment on their bodies will take up much of the astronaut's  time. They will not be exploring methods of geo-engineering.
Comment: Main problem is not the gasses themselves, it is gravity! The gravity on Mars is 3.711m/sg2, so a third that the one we have on the Earth. That one is not enough to keep one breathable atmosphere. Even if we try to Earth-form it, the gasses on the artificial atmosphere will be lost due to the low gravity.
Comment: That´s why I am saying `"Even if we try to Earth-form it..."`. [Gravity of Mars](https://en.wikipedia.org/wiki/Gravity_of_Mars), [Gravity of Earth](https://en.wikipedia.org/wiki/Gravity_of_Earth), [Mars Terraforming](https://en.wikipedia.org/wiki/Atmosphere_of_Mars)
Comment: Martian atmosphere is mostly CO2 ,so whatever you do to it,  it won't be breathable however high the pressure. In small quantities the astronauts can refine it to make it breathable, but only in small quantities.
Comment: Can you edit your questions to add some supporting sources for your claims?
Comment: Terraforming Mars is for science fiction. This site is supposed to deal  with the real world. I say again: the expedition to Mars will  not  be carrying out any activity connected to terraforming.
Comment: @DavidGarcíaBodego pretty sure the gravity of Mars _would_ be strong enough to keep a useful atmosphere for at least several thousand years, if we could create it in the first place. And even an unbreathable atmosphere of e.g. sulfur hexafluoride would be useful indeed, as it would allow using much less difficult construction (only _reasonably air-tight_, not 100% pressure-tight), simple breathing apparatuses rather than much more awkward pressure suits, and the atmosphere would provide thermal insulation and radiation shielding.

Thickening Mars's Atmosphere


Easterly Jet Stream

Question: If most of jet streams are westerly, that is to say, they blow from west to east, why does the tropical/equatorial jet stream blow from east to west?
Answer: Looking at the annual climatology of the 200 hPa winds as shown below from NCAR NCEP reanalysis it is noted that the mid latitudes have by and large westerly winds (for a planet that rotates west to east). On the other hand averaged over a latitude circle(zonal average) the low latitude tropics and equator have by and large easterly winds. The reference Annual cycle of equatorial east-west circulation over the Indian and Pacific Oceans argues that tropical upper level divergence over the Central Pacific is the reason for the upper level equatorial easterlies present over the Indian Ocean and West Pacific Ocean. On the other hand annual mean upper level equatorial winds over the East Pacific and east Atlantic are by and large westerlies(if one were to perform zonal regional averaging).

The upper level equatorial easterlies never quite approach the definition of a "jet" on annual scales except during the boreal summer period. So one needs to look at seasonal scales to explain the formation of the so called Tropical Easterly Jet Stream.
From these two pioneering papers Koteswaram TEJ  and Raghavan K TEJ 1973 (available behind a paywall, reproduced here - Origin of Tropical Easterly Jet), there exists at the upper levels an anticyclone over the Indian subcontinent, also known as the Tibetan anticyclone. The Tropical Easterly Jet(TEJ) is believed to be connected with the Tibetan anticyclone. The Tibetan anticyclone is present in the upper troposphere (100 to 150 hPa).

In the above image derived from NCEP NCAR reanalysis data the June through September climatology of the 100 hPa geopotential height is presented and one can clearly see the Tibetan anticyclone as part of the broader monsoon anticyclone.
So the location of the Tibetan anticyclone is in accordance with seasonal shifts. In winter the Tibetan anticyclone is further south (around 10 N) and during summer it moves to warmer latitudes.
Lower levels of the anticyclone is tilted equatorward during the boreal summer and poleward during the winter. However the upper levels of the anticyclone are tilted poleward during all seasons.
Koteswaran and Raghavan have calculated the zonal component of the equatorward outflow from the anticyclone and there appears to be no comparison with the upper level easterlies associated with the Indian Summer Monsoon(ISM). But there appears to be strong comparison with the winds derived from thermal gradient over the Tibetan Plateau. So it appears that the winds are originating due to thermal reasons alone. The TEJ is to a large extent influenced by the temperature distribution in the upper levels as a result of vertical motion associated with ISM. The Tibetan plateau comes under the influence of both sensible and latent heat and leading to the formation of a surface heat low
Given  the climatology of the observed surface pressure(this surface pressure has not been extrapolated to sea level pressure) during the June through September period this data indicates that the mean value is around 500 hPa it might be helpful to look at the temperature of the 500 hPa climatology.

Why should one want to look at the 500 hPa temperature surface ? it is because 500 hPa is the average surface pressure over the Tibetan Plateau(which is an elevated plateau). Normally the 500 hPa pressure surface over sea levels is found at a height of 5 kms.
Once again one can clearly see from the 500 hPa temperature surface that the Tibetan plateau provides for an elevated heat source.
Krishnamurti in the book Monsoon Models offers a detailed explanation

the southerly outflow of the subtropical jet provides a mechanism where eddy kinetic energy is converted into kinetic energy of the mean flow and all this happens above 250 hPa. Stratospheric easterly winds penetrate downwards into the northern branch of the TEJ. Above all the conversion of available potential energy into kinetic energy above 250 hPa in the region of increasing pressure gradient caused by the proximity of the Tibetan anticyclone as well as the Coriolis force convert the diabatic heat into kinetic energy of the TEJ.

The above image provides a visual representation of the explanation provided in the quoted text i.e. southerly outflow of subtropical jet + Coriolis force.
Comment: "The reason is beyond the scope of this answer and is due to mid latitude origins." Nonetheless you go into much detail, maybe too much... can you post a TLDR? Is it not simply a coriolis driven vs. thermal wind phenomenon?
Comment: Woops, sorry for the necromancy, didn't notice. Nonetheless, I didn't understand a single word in your answer and your comment. Can you boil the difference in OP's question down to a finite number of physical reasons and not an infinite number of pressure maps?
Answer: Because the tropical easterly jet is formed as a result of warming over the Tibetan plateau leading to rising motion and finally the Easterly maxima due to corriolis effect
Comment: Yes, this hints at a useful answer to the question.  It'd be great if you could explain how this warming produces such wind, especially in a fairly approachable way for a variety of people.  If you're up to it, a question like this could greatly use such an answer, as there are kids and people throughout society who likely have this question :-)  But either way, I'd think you could give a more thorough answer of the thought process and any references/graphics/etc to support your answer.  Thanks :-D
Answer: I'm guessing here, but there are two things that seem to mechanically form the organized concentrated air rivers that are jet streams.  I've despaired to find no good meterologist site or link that goes beyond grand vague hand waving gestures that mostly over-explain Coriolis Forces and irrelevant complexities.  Here's how I think the actual organized streams are formed.
We need to be careful about postulating that different temperatures cause the actual streams.  I don't think that's a useful perspective.  Certainly, different temperatures are required to set up organized Polar, Ferrel and Hadley cells, but the heart of the explanation for the actual stream formation is looking at only momentum and drag.
If the surface wind of a Ferrel Cell (not the somewhat opposite flowing high altitude wind of the same  Ferrel Cell) blows northward, it's earth-based radius decreases.  It's becomes closer to the spin axis of the earth.  That means that its relative velocity is always more eastward than that of the air it is joining.  That's the Coriolis Force. Ok, so we get northeastern lower winds throughout the band of that Ferrel Cell, progressively becoming more eastwardly farther north.  But why the sudden discontinuous increase in velocity at the northern edge of the Ferrel Cell that produces a jet stream?  Well.  Because all throughout the transit that those low level winds negotiated on their northward trek within that Ferrel Cell, they had to gently push more eastward for every inch north they moved against the drag of the atmosphere they encountered. Their acceleration to the east was limited by atmospheric drag.
But suddenly these northward winds are stopped from going further north when they encounter the Polar cell and are forced to deflect directly eastward. They are no longer dragged down by the slower rotating atmosphere north of them because they are moving only eastward.  This means that the atmosphere that would normally drag down these northeastward tending winds is mostly made of their neighbor Ferrel Cell winds, that had been northeastwardly parallel to them for a while, that are similarly suddenly deflected due east by encountering the obstruction of the Polar Cell.  Now, at the northern border of the Ferrel Cell, these winds all line up moving east as they begin to rise up towards the top of the Ferrel Cell and turn around back to the south to continue their cycle in the Ferrel circulation Cell, their eastward momentums now all lined up together fully aligned with each other along the lines of latitude (parallel to the equator) and pushing forth with their excess momentum in line concentrated in a much smaller area (than the circumferal distance of the Polar Cell and Ferrel Cell border).  The eastward change in momentum has been concentrated at this border by having the Ferrel Cell winds line up trying to accelerate each other because they are forced to suddenly turn east.  A visual picture of a similar idea is five people thrashing through a forest line abreast - like the low level northeasterly Ferrel Cell winds.  Then, suddenly they turn 90º and have a lot less thrashing to do to get through the forest because of their alignment - like those Ferrel Cell winds when they turn to line up behind each other at the circulation cell boundary.  The atmosphere these winds encounter that would normally limit their eastward acceleration is now made up of similar Ferrel Cell winds trying to accelerate eastward during the big turn back to the south.  The result is a reduction in atmospheric drag in relatively short distance.  Boom:  Jet stream.
You may wonder why it would be that at the northern border of, say, the Ferrel Cell where there is no longer a northward component of velocity would still provide an eastward force to prople the jet stream since the eastward component of the Coriolis Force disappears when the northward velocity goes to zero.  It's because of lag.  The eastward pressures are not fully equalized instantly when the air stops moving northeastward and is deflected due east.
If all this is the case, then why does the subtropical jet also move east?  Only air that is approaching a cell border can produce a jet; not air that is retreating from such a border because of the mechanism described above.  So only the upper air of the Hadley cell can contribute to a jet stream  at the border between the Ferrel and Hadley cells.
Finally, why doesn't the southern flowing air in the upper reaches of the Ferrel Cell create a westward moving jet?  If you examine the profile view of the circulation cells, notice the altitude where the reversal from north/south occurs.  In the both the Polar and Hadley cells, due to the odd sloped frontal border of the various cells, the reversals that should spawn westward blowing jet streams happen at low altitude where too many disturbances prevent organized flow.  Remember even the low altitude portion of the Ferrel Cell can't form a jet stream until it has shifted up into the high region of the cell at the turn reversal. Furthermore, the Ferrel Cell runs backwards.  That is, it is thermally indirect, so not driven by disparities in surface heating like the Polar and Hadley Cells, hence it is weaker, driven by its neighboring cells, which are thermally direct.  Occaionally, a west flowing subtropical jet forms from these normally turbulent regions if conditions are just right, but not normally.
It should be remembered that on a planetary scale these jets are rather weak, broken, discontinuous, and easily disrupted.  For example, if global warming reduces the sharpness of the temperature variation between the Polar Cell and the Ferrel Cell, that border becomes less defined and can undulate down into the central US in what the news calls a Polar Vortex.
Alas, I can't back any of this up because I've not seen it anywhere.  This could all be wrong, but it seems straight forward enough to be plausible.
Answer: Are you asking about the energy from the sun causing the circulation cells to circulate?  If so, that's the easy part.  I sound like I know what I'm talking about, but I'm not really a reliable source.  But here's my analysis:
Sun heats the earth at the equator at steep angles, thus providing a lot of heat to the air at the equator.  This air expands and grows like a mountain over the equator.  Since the air in the mountain has the same mass as before (same number of molecules), its weight on the ground would be the same.  But it is not.  The mountain of expanded air in the high atmosphere above the equator spills downhill northward because the top of the less expanded atmosphere to the north is lower.  But as this downhill falling air moves north its time spent at cool altitudes and the less direct rays of the sun at higher latitudes cause it cool and become more dense.  It becomes more dense than the air it falls over on the north edge of the Hadley Cell, so it sinks down.  Why does it move south to complete the cycle? Because the continually rising column of air encircling the equator causes a constant low pressure condition on the ground as it rises up and spills off the mountain.  If the air spills off the equatorial mountain of air, the mountain is lighter than it was before.  That the mountain got high to start with would not change its weight or the pressure at the equator.  The pressure at the equator is always low because the rising mountain of expanding air is forever spilling downhill to the north and causing fewer molecules and atoms of atmosphere to occupy that mountain that sits on the equator.
Note, the the Polar Cell functions just like the Hadley Cell.  But you might notice that the Ferrel Cell runs backwards against the dynamics I just described.  That's because both the Hadley Cell and the Polar Cells are "thermally direct," or run the right way.  The Ferrel cell is not run by the dynamics I just described because it is "thermally indirect," powered and supported by the boundary effects of bumping up against the Hadley and Polar Cells.  I don't have a good grasp on the thermally indirect cell being driven by its neighbor cells, but I have a feeling it has to do with atmospheric lifting at the north edge of the Ferrel Cell caused by the Polar cell ( and the converse at the border with the Hadley Cell), perhaps encouraging upper atmospheric southern downhill flow, but boy that's a reach.

Easterly Jet Stream


the uncertainty of initializing new landmark in EKF-SLAM

Question: In EKF-SLAM (based-feature map) once the robot senses a new landmark, it is augmented to state vector. As a result, the size of the state vector and the covariance matrix are expanded. My question is about the uncertainty of the new landmark and its correlation with other pairs of the covariance matrix. How should I assign them? When I assign them to be zero, the error of the estimation this landmark won't change as time goes. If I assign them with very large value, the estimation is getting better every time the robot reobserves this landmark however, the error approaches to fixed value not to zero. I assume the problem id with assigning the uncertainty. Any suggestions?
Answer: You can use the Jacobians of the inverse observation model to initialize the new row/column of the covariance matrix.
Suppose your observation model is $g(\mathbf{x})$, which maps your state $\mathbf{x}$ to a predicted observation $\hat{\mathbf{z}}$. The inverse observation model $g^{-1}(\mathbf{x}, \tilde{\mathbf{z}})$ maps an observation $\tilde{\mathbf{z}}$ to a new entry of your state. For example, if $\tilde{\mathbf{z}}$ is a range and bearing measurement, $g^{-1}$ might determine the global $(x,y)$ coordinates of a newly observed landmark given your current state estimate.
Let $\mathbf{P}$ be the covariance of your state and let $\mathbf{G}_x$ and $\mathbf{G}_z$ be the Jacobians of $g^{-1}$ with respect to $\mathbf{x}$ and $\tilde{\mathbf{z}}$. Then the updated state and covariance matrix after adding the new entry is
$\mathbf{x}\gets \begin{bmatrix} \mathbf{x} \\ g^{-1}(\mathbf{x}, \tilde{\mathbf{z}}) \end{bmatrix}, \qquad \mathbf{P}_{k+1} = \begin{bmatrix} \mathbf{P}_k & \mathbf{P}_k\mathbf{G}_x^\top \\ \mathbf{G}_x\mathbf{P}_k & \mathbf{G}_x\mathbf{P}_k\mathbf{G}_x^\top + \mathbf{G}_z\mathbf{R}_k\mathbf{G}_z^\top \end{bmatrix}$,
where $\mathbf{R}_k$ is the variance (1D) or covariance of observation $\mathbf{z}$.
Comment: thanks for the answer. I found the solution actually in here http://www.joansola.eu/JoanSola/eng/course.html. I think your answer should be modified to coincide with the pdf that is stated in the aforementioned link.
Answer: I don't have experience with SLAM specifically, but I do have a lot of EKF experience so here's my input.
Stick with your second approach. It is normal for the error to approach a non-zero steady-state value. This number can be calculated analytically for nominal cases, but I don't remember the math right now and would probably be too complicated anyhow once you start to include the covariances with all the other landmarks.
Don't worry too much about what specific value you should initialize the covariance to. In the simplest case, just set the variance to some nominal value based on your sensor noise level and use 0 covariance with the other landmarks. Over time the EKF update steps should adjust things to their "proper" values (assuming your initial values were at least in the ballpark).


Absorption of light by matter

Question: What determines whether or not photons can be absorbed by matter? Intuitively, the answer is that a charged particle can absorb photons (whether it's positively or negatively charged), and neutral particles can't. But light is often absorbed by atoms in bulk matter, increasing their thermal motion. The problem with this is that atoms are neutral, and so you wouldn't think that they could absorb light.
Answer: It is the other way around.
An isolated, point-like charged particle like an electron cannot absorb a photon. It is forbidden, because energy and momentum cannot be simultaneously conserved. Only scattering is permitted in such circumstances.
However, a charged particle that is within the electric field of another (e.g. an electron in the electric field of a nucleus) can absorb (or emit) a photon.
The way to think about this classically is in terms of electric dipole moments. An atom has no net charge but is can have an electric dipole moment, because the positive and negative charge are not in the same place. This electric dipole moment can interact with incoming electromagnetic waves and can be made to oscillate by extracting energy from the incoming wave.
In the quantum mechanical extension to this picture, the electric dipole will only oscillate in certain modes with discrete energies. Only photons within a certain narrow range of frequencies/energies will be able to excite (or de-excite) these oscillations.
The extension to bulk matter (and by that I assume you mean solids) is that the atoms themselves are arranged into lattices and other structures. These have electric dipole (or higher order multipole) moments that can be excited into oscillation by electromagnetic waves/photons in a similar way. i.e.  They offer further vibrational modes that act as a pathway to the absorption and emission of photons.
PS.
Nuclei themselves can have electric dipole or higher order multipole moments and are able to directly absorb (or emit) gamma rays.
Comment: Thanks for this answer, I was indeed suspecting that it had something to do with electric dipoles. But there is one thing I still don't understand. The reason I started thinking about this is that I read somewhere in my astronomy book that interstellar gas clouds can absorb light from stars, increasing their temperature, which makes them emit IR radiation (which we can detect). But gas molecules are not arranged in  lattices, and they are generally not polar, so how can they absorb light, increasing their kinetic energies? And how can they emit radiation (IR in particular) in the first place?
Comment: Also, isn't scattering just absorption and then re-emission in some random direction? So how can an isolated electron scatter, but not absorb, photons? What's the difference?
Comment: Why do you say molecules are not polar? The fact that molecules emit and absorb radiation must be familiar to you. Electrons can scatter, because scattering isn't absorption.
Comment: Yes, but I was wondering how they could do that, if they are neutral. But Ithink you have cleared it up. Thanks for the help.
Comment: And the example with the cloud turned out to be a dust cloud, not a gas cloud. The main thing that was othering me was that I imagined that an incoming photon basically collided (and got absorbed) with an atom, like a billiard ball colliding with another. This didn't make sense, if the atoms were neutral. But as you said, it is rather the vibrational energy that is increased. I was thinking that the solution really did have something to do with vibration and electric dipoles, but I wasn't sure. But you now convinced me that this was indeed the case. Thanks for the help.
Answer: It's the electrons of an atom that absorb the energy of the photon, not the nucleus. The frequency of the incoming light wave is at or near the energy levels of the electrons in the matter. The electrons will absorb the energy of the light wave and change their energy state.
Atoms are perpetually vibrating at any temperature above zero Kelvin. Some of those atoms vibrate sufficiently vigorously that their vibrational energy is roughly equal to the electric energy absorbed from the photons (essentially, they are in resonance with the photon energy). Those atoms then make a quantum transition from electronically excited to vibrationally excited, meaning that the energy causes the whole atom to move. We feel that motion as "heat." The atoms which make the jump to vibrational excitation soon collide into neighboring atoms, dissipating their vibrational energy.
Answer: As @Codosaur mentioned earlier, it is the electrons that absorb the the energy of the photon and not the Nucleus.
Let's take a theoretical example to see how this works.
Imagine an atom without any disturbances. It's electrons are in a relaxed state. That is, the electrons are stable in their orbits.
Now, a photon's energy is absorbed by the atom. This can possibly lead one (or more) electrons of the atom to get excited and go to a higher energy level.
When the electron goes to this excited state, it is unstable.
To those who don't know, when an electron goes from one energy state to other (higher or lower doesn't matter), it is called a transition.
In order for the transition to happen, the energy that is already present in the electron should be greater than or equal to the difference between the 2 energy levels.
The part after this is only if you are interested. It is not directly related to the question.
After becoming unstable, the electron will soon come back to it's normal stabilised state and will also give out a Photon with an energy of the difference between the 2 energy levels of the electron.
Hope this helps,
P.S. This Link has some really nice visualisation of the same.
Comment: I knew all of this. My question was more like how an atom as a whole can absorb a photon, increasing its total kinetic energy/thermal motion, since an atom is neutral. Rob Jeffries cleared that up really well.
Answer: I think it's related to resonance phenomena ..as two bodies who share same natural frequency of oscillation when come near to eachother shows increase in their frequency of vibration.. like that when radiation of frequency equals to frequency of electron come near to each other the frequency of vibration of electron increase by which it collide with nearby atoms and it's oscillations converts into heat

Absorption of light by matter


Is there any difference in meaning between the ~더라도 and ~도 verb endings?

Question: I think the ~더라도 and ~도 endings both mean 'if' (roughly speaking). Are there any differences in meaning? If they're not interchangeable, when would I use one or the other?
Answer: This answer comes from Korean Grammar in Use: Advanced:

Both expressions can be replaced with each other, however the following difference is noted:
어/아도: Used when hypothetical meaning is relatively weak and the possibility of the statement becoming a reality is high
더라도: Used when the hypothetical meaning is relatively strong and the possibility of the statement becoming a reality is relatively low.

Basically, while both expressions can mean "even if", the chance that the situation preceding 더라도 will happen is relatively lower than that preceding 어/아도.
Here's an example:

저 학생이 완전 천재래. 지금 수업에 다 떨어져버리더라도 아직도 하바드를 입학할 수 있는 정도.. They say that guy's a genius. That, even if he fails all his classes, he'll still be able to go to Harvard.

The chance of a genius failing is low, but even if he does, he's too smart to not be accepted.
Hope this helps!
Answer: These aren't exactly the same.
더라도 is a combined form of the retrospective verb ending 더라 with 도.  Retrospectives usually refer to something the speaker observed or otherwise perceived in the past.
When using this clausal conjunctive, the speaker is acknowledging the (observed or understood) first clause but emphatically states that something different (usually contradictory) must be true.  Usually translated as "even though" or "no matter (how)" or even "I don't care if/how/…"


Shortcut for opening applications stack on dock bar

Question: Is there any keyboard shortcut to open applications stack on dock bar?
The idea is I want to be able to open any app without using mouse.
Answer: ctrl+fn+F3
..selects an item of the dock. You can navigate using the arrow keys. The selected item is the one that will be selected first the next time you use this shortcut.
Once you've selected the Applications folder, the shortcut becomes for the next time:
ctrl+fn+F3+↩

BTW:
You can also use ctrl+fn+F2 to access menubar items.
Answer: Maybe you should try Alfred or QuickSilver. Both of them give you the ability to open any applications quickly, not just the applications on dock.

Play around with them and I am sure you will find your workflow on Mac more efficient.
Comment: And it's so much faster than spotlight.
Answer: The fastest way (that I can think of) to open the Applications folder is the following:
Press ⌘ + ⌥ + Space. (This is the fastest way to open a new Finder window from within any application.)
Then, browse to the Applications folder by hitting ⌘ + Shift + A.

The idea is I want to be able to open any app without using mouse.

I have ⌘ + Space mapped to Spotlight, so I can just use that keyboard shortcut, then start typing the name of an app, hit Enter, and that's it.
Answer: Why not to use Spotlight? It's fast and doesn't require any other software installed. By default it has a shortcut ⌘ cmd + space (you can set this shortcut in System Preferences).
Spotlight quickly finds the application (or file) as you type.
Answer: There is a trick for switching application windows including the minimised ones in MAC OS X.
After choosing the app by pressing CMD + tab, hold press option key and release other keys. Minimized window will be opened.
Source
Comment: OP is referring to the Applications **stack** in the Dock, not a minimised application…


Solitary wasp larval behavior

Question: Once placed in proximity to its future meal, how long does it take for the larva of a solitary parasitic wasp to begin feeding? I have several books on wasp behavior, but none address the time involved. An internet search also proved fruitless. I am asking out of curiosity and also to ensure accuracy in a story I am working on. I am sure it varies, I am just trying to get a general idea. For example, is it possible for larvae to begin feeding as soon as they are deposited?
(Edit: I added details to this question thanks to the first answer I received on this question)
(Edit: I've spent some more time looking into this and thought I'd share some information, should anyone be interested. Indeed, larvae can begin feeding within two days of being deposited. The larvae of Cicada-Killer Wasp (Sphecius speciosus), for example, begins feeding in 2 to 3 days, according to "The Strange Lives of Familiar Insects" by Edwin Way Teale. In "The Hunting Wasp" by John Crompton, the introduction sets a general range of 2 to 3 days, although I have read online of some wasp larvae taking longer.)
Answer: It depends on species and situation.
There are a lot of different solitary wasps, the kind you are referring to are parasitic wasps, that lay their eggs in or on a host for the larvae to feed on before they pupate to reach the final stage of their lifetime.
Some larvae that consume a host in groups take as little as twelve days to consume their host and eat their way out.
However, this wasp species can even have their larvae remain in the larval stage through winter and adapt through seasons. it's entirely dependent on what sort of wasp you're asking for what the time span would be for a larva to mature.
Comment: Thank you for your answer! I tried to upvote it but am too new.  What I'm wondering is when the larvae might begin eating. Could they start as soon as they are deposited by a wasp? I understand it will vary.
Comment: @AdamOrth They could indeed start eating fairly soon after the wasp has deposited them, the eggs do have to hatch first but that could be a matter of hours.
Comment: Thank you, I suspected this but was not sure.

Solitary wasp larval behavior


How to get Python to work with Lighttpd?

Question: I've got Lighttpd setup on my Raspberry Pi, but I'd like to get server-side code working now. I'm familiar with PHP, but I figure I should try Python as it's supposed to be the "go to" language for the Raspberry Pi. How can I get Python handling server-side code via Lighttpd?
Comment: http://www.penzilla.net/tutorials/python/cgi/ link is broken but thanks for the great writeup. My Pi arrives tomorrow!
Answer: What you need is CGI support for lighttpd.
Open the lighttpd configuration file (/etc/lighttpd/lighttpd.conf) and uncomment the "mod_cgi" line (remove the # from the beginning of the line if one exists) or add this line if not present.
server.modules = (
            "mod_access",
            "mod_alias",
            "mod_accesslog",
            "mod_auth",
            "mod_ssi",
            "mod_cgi",
            "mod_compress",
            "mod_fastcgi",
            "mod_rewrite",
            "mod_magnet",
)

Add the following to the bottom of the file:
$HTTP["url"] =~ "^/cgi-bin/" {
        cgi.assign = ( ".py" => "/usr/bin/python" )
}

Restart the lighttpd daemon:
sudo service lighttpd force-reload

Then create a cgi-bin directory under your webserver's root directory. Any files ending with .py in this directory will be processed by Python.
You can now write Python scripts to handle web requests. You may want to read this tutorial on writing CGI programs with Python.
If on the other hand you would rather use a framework to handle some of the low level details and improve developer productivity, I suggest checking out web.py. You can install it using apt:
sudo apt-get install python-webpy

Lucas at the Cloud 101 Blog has posted a great tutorial on writing web pages using the webpy framework.
Comment: @576i Rather than continue this discussion in the comments of another question, Please open a new question and include what works and what you have tried. I will then delete these comments. BTW any reason why you can't just go with the .py extension, which you said works?
Comment: Is this FastCGI or CGI?
Comment: Note that plain CGI requires starting the python interpreter for every request so it is only well suited for the occasional request.
Comment: Alas this only worked partially. I can now run python by calling "http://(IP)/cgi-bin/test.py?parameter=xxx" but not "http://(IP)/cgi-bin/test.cgi?parameter=xxx" - the later gives a 404 error...
Comment: @576i Try changing this line cgi.assign = ( ".py" => "/usr/bin/python" ) to cgi.assign = ( ".cgi" => "/usr/bin/python" )
Comment: @Steve. Alas this does not work. I still get the 404 error, but now  "http://(IP)/cgi-bin/test.py?parameter=xxx" will just offer me to download the file.
Comment: 404 is returned when the alias definition is missing. Please see my post below.
Answer: The accepted answer did not work for me and it also ignores the pre-configured packages that are available for Lighttpd.
The correct way to install Python on Lighttpd for the Raspberry is:
First enable cgi by
sudo lighttpd-enable-mod cgi
This creates a new configuration file for Lighttpd:
/etc/lighttpd/conf-enabled/10-cgi.conf
Edit the configuration file nano /etc/lighttpd/conf-enabled/10-cgi.conf, to look similar to this
server.modules += ( "mod_cgi" )

$HTTP["url"] =~ "^/cgi-bin/" {
        alias.url += ( "/cgi-bin/" => "/var/www/cgi-bin" )
        cgi.assign = (
                ".py"  => "/usr/bin/python",
        )
}

Make sure python 2 is installed by executing:
/usr/bin/python --version
Now, restart
sudo /etc/init.d/lighttpd force-reload
Good luck!


Oil Leak from drain plug but not sure why

Question: I changed my oil a few days ago and there is a leak coming from around the drain plug. When I first did the oil change I only screwed in back in by hand so I wouldn't strip the thread. The next day I saw it was leaking so I tried tightening it by hand more and then used a wrench the rest of the way. It is still leaking and I don't know why. I am 99% sure it is coming from the drain plug so could it be its not on the threads correctly? Please help.
Comment: Did you use the old washer or a new one?
Comment: Welcome to Motor Vehicle Maintenance & Repair! What is the year/make/model/engine of the car in question?
Answer: Multiple causes are possible:

If there's a gasket or washer between the drain plug and the engine sump, the gasket or washer may have been deformed or damaged.
If there's no gasket or washer, and one is supposed to be there, whatever's supposed to be there is missing.
If no gasket is required, the face of the drain plug and/or the face of the sump  may have been damaged, such that oil can seep through what should be flat, mating surfaces that seal.
You may have cross-threaded the drain plug, and the resulting damaged threads do not now seal.

In any case, remove the plug (catching and saving the oil for reuse), clean and dry things off, and examine the pieces. Serious cross-threading may have damaged the threads sufficiently to require a threaded insert to repair the female threads in the sump, and/or replacement of the plug.


Why didn't Imperial Japan attack the Soviet Union during World War 2?

Question: Japan and the Soviet Union shared a common border in Manchuria and the German invasion of the Soviet Union weakened the Soviets greatly. In view of the advantages to Japan in seeing the Soviet Union defeated (not to mention the resources available in Siberia) and the fact that Japan had large Kwantung Army stationed there essentially doing nothing, why didn't Japan attack?
Comment: @Sam: wtf.  That's the most insane thing I've ever heard
Comment: Hawaii was slightly more attractive than Siberia.
Comment: when winning isn't a viable option, the best you can achieve is an honourable loss.
Comment: What puzzles me is why Japan didn't declare war on Russia to honor their commitment to the Axis, just like Hitler had to declare war on the US after Pearl Harbor (at the insistence of the Japanese)?
Comment: Because the Japanese knew they were going to lose, the only hope for the Asiatic races to escape European imperialism was to create Chinese nationalism by any means possible, hence the massive atrocities committed by Japanese forces were designed to unite the Chinese against them. The mantle of looking out for the Asiatic races passed from Tokyo to Beijing. The international borders are just illusions for the show. War doesn't care about arbitrary political delineations.
Comment: cont'd... and that's why the Japanese soldiers of WW2 are not judged as war criminals by those in the know. Hence the controversy everytime a Japanese PM visits that shrine. Yeah, it's a disgusting world isn't it.
Comment: @rotard "what's really going to bake your noodle later on" is thinking about whether the Japanese wanted to lose on purpose! "Here, have a cookie. You're in control, remember!" http://www.youtube.com/watch?v=i3WBWgYKC_E
Comment: It attacked, twice, and got decimated.. they learned their lesson.
Comment: @Sam Well I don't understand your comment : are you trying some analogy between 1940  Japan and today's China?
Answer: We have to delve into two spheres to address this question, the political and the military.
Militarily, the Japanese fought a series of border skirmishes with the Soviet Union at Khalkhin Gol (located along the Manchurian - Mongolian border, Mongolia then being a "People's Republic" and puppet of the Soviet Union) through early summer to early autumn 1939, with the main battle happening on August 20th-31st. Georgy Zhukov (who later went on to lead large formations in Europe, but then a Corps Commander) launched a coordinated combined arms attack which stunned the patently inferior Japanese, leading to a prompt ceasefire and cessation of hostilities on September 15, 1939.
Politically, the Japanese military cadres were always divided along two opposed doctrines: the Northern Expansion Doctrine (in which the Japanese Empire would expand north into Siberia) and the Southern Expansion Doctrine (in which the Japanese Empire would instead focus on South-East Asia and the greater Pacific) favored by the Army and Navy respectively. The thorough paddling that the Imperial Japanese Army and the Kwantung Army received at Khalkhin Gol discredited the Northern Expansion Doctrine.
There are indications that the Japanese would have struck the Soviet Union had Operation Typhoon succeeded and Moscow taken by the Germans, but this obviously never materialized. What a difference 50km can make!
Comment: Excellent answer, only one addition to make: while Siberia was underdeveloped and underpopulated, most of the places along the Southern expansion route were already sufficiently developed to be readily exploited, and certainly sufficiently populated to make up a market for certain types of goods. This fact should be explored, but it proved to be more time consuming than I can afford. Perhaps somebody more into Japan(ese)?
Comment: technically moreover the fighting was not between the USSR and Japan but between the USSR and Manchukuo (which was a Japanese satellite state set up in NE China). Of course in reality it was Japanese, but in literature it might be listed as Manchukuo
Comment: Molotov Ribbentrop pact also added to the situation. After it was signed, the party that was for the land warfare with ussr resigned.
Answer: Japan was interested in extending its influence in Asia and for that it had to confront either USSR or USA. While I don't think that the exact reason for choosing USA is known, Japan was at a clear disadvantage when battling USSR: while the Soviet Union had established overland supply line for its troops in the far east (Trans-Siberian Railway) the Japanese had to supply their troops and transport reinforcements by sea. This already proved fatal for Japan in the Russo-Japanese War and only the civil unrest in Russia that eventually led to the 1905 Russian Revolutiоn saved Japan from a defeat. The history repeated itself in the Battles of Khalkhin Gol in 1939 and I guess that the Japanese learned their lesson.
The United States on the other hand could only defend their interests in Asia and Pacific by sea, same as Japan itself. So the chances here were equal and the attack on Pearl Harbor temporarily gave Japan a significant advantage - something that they couldn't achieve against Soviet Union.
Comment: What evidence do you have that "only civil unrest in Russia ... saved Japan from defeat"? Russian navy was thoroughly trashed by Japanese before the 1905 Russian Revolution. In fact, the shame of defeat and resentment of the impotent government led to the civil unrest you mentioned.
Comment: Sorry to downvote.Simply saying, thanks to the U.S oil, iron embargo, the Imperial Japan chose to go south.
Comment: *This already proved fatal for Japan* .  LOL.  You do know who lost that war, right?  @Wladimir Palant
Answer: One important reason that Japan chose to go to war with the United States rather than the Soviet Union was because its navy was the stronger of its two arms.
The Japanese navy was quite competitive with the U.S. navy, even before Pearl Harbor (until the 1943 U.S. shipbuilding program kicked in). Not so the Japanese army, which had been defeated by Soviet forces on the Mongolian border in 1938, and lacked tanks and other heavy equipment.
Furthermore, Japan didn't have the logistics to fight a "two front" war, one on land and one at sea.
Answer: The Soviets kept a strong army in the Far East at all times, in case of Japanese attack, and the Japanese had come out a distinct second best in earlier battles.  Opening up a front meant committing the Kwantung Army to battle, with all the logistics (never Japan's strong point) that implies, and a battle that the Japanese could not necessarily pull back from.
Further, there weren't all that many resources being exploited in Siberia, and Siberia's a very big place.  After what was available near Manchuria, it was a very long trip to the Irkutsk area, the next place worth conquering.
Comment: True, the Soviet Army stationed in Far East was very strong in 1939-1941. However, most of it was withdrawn in October-November 1941 to defend Moscow from German. It was the last desperate attempt to defend the capital, and most of the troops stationed elsewhere were pulled into that defense.
Comment: I think they would rather go for Kolyma River and these gold mines, if anything. But as you say a big place with not so many resources close to Japan. Anyone can check on the map where were Norilsk nickel mines, or where was Chelyabinsk with all the tank factories. Long long way from home.
Answer: They had a treaty beginning in 1941, after a few skirmishes along the area in question. They were also a member of the Tripartite Pact, which they remainded a member of even after Germany attacked the Soviet Union
references: Wikipedia
Answer: US oil sanctions were crippling Japan and they came after the US to try and force FDR into negotiations and cripple our Navy that he had moved from San Diego to Honolulu, the only force capable of stopping the Japanese from taking the oil fields in the Indies. In other words they were desperate for oil and had to remove the threat of the US Navy before they could think about war with Russia.
Comment: I think your answer covers a really interesting aspect of the problem. However I strongly suggest to add references. Upvoted answers *always* have references. And welcome to history@se!
Comment: except that even at the time it was well known that there was oil in Siberia... So saying that they didn't strike north because there was oil to the south is incorrect. Of course the oil to the south was more easily extracted and transported, which may have played a part.
Answer: In August 1939, while Japan and the USSR were skirmishing, Germany and the USSR signed a Non-Aggression Pact that allowed Stalin to put some more focus on Japan (among other things). By early 1941, Japan decided it was time to focus on securing its oil supply in Indonesia and so shifted to its Pacific strategy. Hence they signed a neutrality pact with the USSR in April 1941. Germany showed no signs of a policy shift until June 22, 1941, when it abruptly attacked the Soviet Union.
With regard to the USSR, Germany was like "we got this." All through 1941 while Japan was prepping Pearl Harbor, Germany was wailing on Russia. When Pearl Harbor happened, the Wehrmacht was at the gates of Moscow. The Nazi leaders were debating whether to start killing the Jews right away, or "in the spring, after the war" meaning 1942. Likewise, Japan expected its expansion in 1941-42 to present the West with a fait accompli, that the USA would have neither the resources nor the willpower to fight, and that if they did, it would take several years to recover from Pearl Harbor and present a new threat in the Pacific. In other words, they could focus on China, and the USSR if they wanted, later. It did not work out that way.
Answer: They did attack the USSR a few times, but lost badly and decided to sign a treaty with the USSR. They quit with Russia because they wanted to expand farther into the Pacific to which Russia wasn't a threat to that goal. That's perhaps the biggest reason for the Raid on Pearl Harbor, Japan was worried that America would intervene and cause issues to the plan. They decided to launch a first strike to neutralize the possibility, by destroying the American fleet and holding us off for awhile. This however didn't happen because the main targets being our aircraft carriers were out to sea at the time of the attack.

The Invasion of Pearl Harbor ,History Channel
Answer: As was stated in another answer, there were a number of skirmishes/battles that occurred in 1939, such as the Battles of Khalkin Gol, but it essentially concluded when it became apparent that Japan was not a military match against the Russians. This basically guaranteed that Germany and Japan would never link up as allies on land.
For more information about the battle, I'm going to forward you to the Wikipedia article on Battles of Khalkhin Gol.
Comment: @canadiancreed: Actually, Japan's (and the Axis') best chance to win World War II was for Japan to launch an amphibious invasion of India, followed by a link up with Germany in the Middle East, not Russia. http://seekingalpha.com/instablog/399221-graham-and-dodd-investor/83925-how-japan-tried-to-win-world-war-ii
Comment: I don't know, if they could go after one of the strongest navies in the world at the time, they could have probably fended off the Russians...if they had dedicated the manpower to it. the logistics would have been easier at least. An interesting what-if question for sure.
Answer: Imperial Japan  WOULD have declared war on USSR had it been successful at Midway, as it was successful at Pearl and in invading Philippines. The US essentially kicked in the door to Japan at Midway. US had agreed to a "Europe first" policy with its European allies upon declaring war against both Japan and Germany. The problem is that European theater was simply not ready to utilize American forces.
After Midway, Japan was no immediate threat to the US, and US could have delayed further action against Japan for a considerable time, had we still had an essentially isolationist sentiment, simply because Europe wasn't prepared for US the brunt of US effort. That brunt most immediately went to the Pacific War. Had it not, Japan could have and may well have moved against the USSR. This was particularly opportune when the manufacturing capacity of USSR was packed up and moved by Stalin east, away from Moscow, and re-assembled closer to the eastern front.
An attack by Japan in the fall of 1942 was quite possible, since the USSR essentially had no defenses deployed on its eastern front, and the destruction of its mfg capacity would have doomed the USSR to the residual Nazi attack, and would have cost Japan very little, assuming the US had not advanced in the Pacific after Midway. Because the US did advance with all its might, Japan simply could never have mounted an attack on the USSR, even had it weakened or diminished its efforts in Burma, the Malay Peninsula, etc.
It has become popular in the past 20-30 years to credit USSR with defeating the Nazis, but this disregards the effect of the US' offensive against Japan in keeping the Japanese from opening a front against the USSR.
Comment: Lots of assertions; can you cite any sources/references?
Answer: The Japanese primary strategy was to create an East-Asia Prosperity sphere of influence, including SE Asia, parts of China and Indonesia.  This also fit in with their desperation for resources, especially oil (see, for instance, the book The Prize by Daniel Yergin).  SE Asia also had bauxite for Aluminum refining (as did the Caroline Islands, see Aluminum Ore: The Political Economy of the Global Bauxite Industry) and Japan was also desperate for Aluminum imports, which had come from the U.S. but were cut off due to the bad press from Japanese atrocities in China.  In many ways, the attack on Pearl Harbor was a distractions and disaster, and an attack on Russia would have been, also.
Comment: What nonsense! The Zero was made of aluminium-7075 alloy, not magnesium.
Comment: Navy use of magnesium in planes, article from 1950: http://onlinelibrary.wiley.com/doi/10.1111/j.1559-3584.1950.tb02840.x/abstract
Comment: @PeterDiehr: That article dates only to 1950, and speaks very much in the present tense about the great **upcoming** potential for magnesium alloys in aeronautics. Do you have anything dating to WW2?
Answer: Japan and Germany had a political and military alliance during World War 2, as Japan was part of the Axis powers. When Japan attacked Pearl Harbor on December 7th, 1941, the U.S. declared war on Japan the following day. As you would expect, Germany (Japan's faithful ally) then declared war on the United States on December 11th, 1941. So yes, when Germany invaded the Soviet Union, it's puzzling that Japan did not honor its alliance by attacking the U.S.S.R. Such an arrangement would have divided the Soviet military in two and assured a victorious invasion for Hitler.
So, why on EARTH would Japan cross the Pacific to fight a neutral United States when its own ally was at war with neighboring Soviet Union?
Recent details have come to light that finally answer the question. In the mid 1990's, after the collapse of the Soviet Union, certain KGB archives revealed that Soviet spycraft actually engineered the war between the United States and Japan. This new information, stemming from the Venona Project, shows that Soviet penetration of the U.S. State Department and Treasury Department played a key role. Specifically, Harry Dexter White, a senior economist at the U.S. Treasury, was instructed to author key conditions during diplomatic exchanges between the U.S. and Japan. The key conditions were designed to start a war. The main condition was the demand that Imperial Japan withdrawn from all occupied territories This condition in particular convinced Japan that the U.S. was committed to war in the Pacific. In essence, Japan felt that they HAD to fight the United States. (Check out 'The Venona Secrets' by Herbert Romerstein & Eric Breindel as well as 'The Battle of Bretton Woods' by Benn Steil).
Once the Soviet Union was assured that their American agents had issued the hardline conditions, the Soviets could confidently focus on a one-front war instead of a two-front war. On December 4th, three days BEFORE the attack on Pearl Harbor, the Soviet Union confidently moved nearly all of its eastern land forces...forces that would have fought against Japan...into the western front to counter Hitler's fast-moving invasion. From a military standpoint, its dangerous to turn your back on the ally of your enemy (Japan) unless you are absolutely certain they will not attack.
Militarily, Japan had MUCH better chances fighting a country that was right next door and already heavily engaged in fighting Nazi Germany, which happened to be Japan's military ally. It is truly a miracle of statecraft that Japan was tricked into attacking a neutral nation nearly 3,000 miles away.
Also of interest...the Soviet Union, who was supposedly an ally of the United States in fighting Hitler...never declared war on Japan until AFTER the atomic bomb was dropped in 1945. After that, the Soviets moved their forces back to the east and promptly invaded Manchuria. Pretty nifty spycraft.
Comment: what does "two-thirds of the Japanese military units be leased to the United States" mean?! how do you lease a battalion to another country?!
Comment: your answer makes no sense. Japan certainly had its sights on Siberia, they just had a longer time scale in mind, wanting to pacify China first (which of course never happened).
Comment: Also check out 'Operation Snow: How a Soviet Mole in FDR's White House Triggered Pearl Harbor' by John Koster. Harry Dexter White was known as 'The Jurist' in Soviet cables and was acting in accordance in NKVD [pre-KGB] designs to trigger a war between Japan and the United States.  The U.S.S.R. obviously benefitted the most since it prevented a war with Japan, while attacking the U.S. was strategic suicide for Japan. The bizarre choice to attack the U.S. instead of the U.S.S.R. is the very reason this question exists on this website in first place. It's fascinating.
Comment: @sds the employment of mercenary batalions rented out by one nation to another is well known, in fact the US supplied such to China during WW2 in the form of the "flying tigers". To claim that the Japanese military during WW2 was actually fighting FOR the Americans however is utterly ludicrous.
Comment: @Doug - WRONG! The Russians moved 70 Siberian divisions from the East to defend Moscow from the Germans, that part you got right. But, the move actually began in August. To even think that you can move 70 divisions of military personnel and equipment in three days is laughable. That couldn't even be done today, let alone 1941 in Russia. Also wrong in your answer is why it was moved. Stalin finally relented to military requests after he was assured by his top spy in Japan that the Japanese were looking south, not east for their next move.


What to buy for my Pi to connect to my old laptop?

Question: Hey guys I hope that this question has been asked so many times.Live in India & I am new to Raspberry Pi hack. All I have is an old laptop of mine, HP DV6700 to be precise. It doesn't have an HDMI port (It has a VGA port, some long hdmi like port & a S-video port)  & I don have a TV which has an HDMI port. I want to connect my Rpi to my laptop to use it. What are the things that I should buy? Thank you.
Comment: In that case it depends on what you want: 1. command line control, or 2. full graphics X. Those connectors you describe are useless for the Raspberry Pi, they are all output. So if you want option 1, you have 2 choices 1a: serial or 1b: ethernet, if you want X you don't need to buy anything just configure the RPi and the laptop.
Comment: Connect with ethernet. Then you can access the pi using ssh on the laptop. Setting up and running the pi without a screen, "headless", may be a bit harder than with a screen, but it is definitely possible.
Comment: Your TV also does not have a external input using Cinch aka [RCA connector](http://en.wikipedia.org/wiki/RCA_connector) that you can use as monitor?
Comment: Lets say I don have a Tv. Its very old and barely runs the cable. I want to use it for my laptop. Thank you @ikku.
Comment: Thanks for commenting ikku & Frepa. I need a full graphics X type of output.
Answer: This is not possible to connect your laptop as a screen. It has video out ports (whatever it is hdmi, VGA or so). You need to have some video input ports (as most of TVs has).
The only way is to use SSH as mentioned in some of the comments.
Comment: @thanmai: No, you can't. As codewarrior said, your VGA and S-video port are outputs. Your laptop needs a video input port to display the video emitted by the RPi's HDMI output. The cable your described can be useful if you want to display your laptop screen on a TV for instance. You can also get an external video capture card connected to a USB or the PCMCIA port. To control your RPi with your laptop keyboard, you will need SSH.
Comment: Okay i was going through few of the sites, and found that there is a cable which has VGA at one end & HDMI on the other. Can i use that to connect to my laptop & get video o/p. Also can i control it through my keyboard at the same time? Thanks for helping
Comment: @Morgan +1 for the detailed explanation...
Answer: You could use VNC on your RPi and on your laptop to have a remote access visually. Just search the internet for a good VNC client, I personally use TightVNC.
Also if you'd prefer to use the Remote Desktop Protocol (this could be useful if your working at a company that blocks VNC's ports, most companies at least allow outgoing RDP connections) then use XRDP on the RPi and just normal Remote Desktop on your windows machine.
Answer:
An ethernet cable.  Apparently, the Pi has a built-in feature called auto-MDIX that allows you to directly connect it to your laptop with an ethernet cable, no router/hub/switch/modem required.
A mini-usb cable.  Of course, chances are that if you have a Pi and are planning to use it, you will have this already, but I am including it just for completeness' sake.
A power source.  The Raspberry Pi Foundation does not recommend using your laptop (or desktop, for that matter) as a power source (500-700 mA is a lot to source from a USB port intended for data), so it would probably be best to use a dedicated power supply.  When shopping, look for a USB power supply that sources at least 700 mA for the model B and 500 mA for the model A at 5V.

Finally, this link gives you everything that you need to know to start getting the Pi's GUI running on your laptop using VNC (Linux and OS X only, if you don't have Linux then grab Ubuntu and install it on your laptop).
Answer: As others wrote, ssh is probably the simplest you can do. If you run an X server on your laptop, you get graphics, too. But it will not be accelerated by the graphics hardware of the PI, I think. The hardware you'll need to buy are: 2 Ethernet cables and a switch, or one cross-over Ethernet cable. Maybe one normal Ethernet cable works, too. If you've got a router for internet access, maybe you can use that instead of the switch (if it has a builtin switch and multiple ethernet ports).
Comment: You don't need a crossover cable with the raspberry pi (or most other recent (last 10 years) devices since it implements Auto-MDIX (http://en.wikipedia.org/wiki/Auto-MDIX#Auto-MDIX)
Comment: @thanmai: connect the pi to the wireless modem with an ethernet cable. Then connect the laptop to the modem either by ethernet or by wireless, either should work. If your TV has a composite (RCA) input, this could be useful while testing, for example to see that the Pi gets an IP address while booting.
Comment: Thank you @sebastian. I have a wireless modem & 4 ethernet ports. Should i connect my laptop to modem via ethernet or connect to my modem via ethernet?
Answer: Well since the question is "What to buy?" here's one answer: Get a TV card (or a dedicated video capture card, but TV cards are more common) for the laptop with S-Video input. Such cards exist in USB, PCMCIA and ExpressCard formats and will allow the laptop to capture input from S-Video and display it on its screen. The main (and possibly only) advantage of this method compared to methods shown in other answers is that other devices with S-Video output could use laptop's screen too.
Comment: Ok will try that AndrejaKo. I will do one more thing i will post a picture of the slots that i have in my laptop so that it would be easier for you to visualize, I am new to all these connecting & Rpi. Thank you everyone.


How does exciting an electron's surrounding electromagnetic field cause 'electron excitation'?

Question: In more meaningful words than the ones above, how does adding energy to the EM field cause the electron to to change orbitals or oscillate in a different pattern.
Comment: Are you asking for a description of what happens when light causes an electron in an atom to change energy levels?
Comment: For the hapless future grad student reading this, here's a reasonably complete demonstration of how Rabi oscillations happen when you apply an oscillating force to an electron: http://physics.stackexchange.com/q/138765/
Answer: In the semi-classical approach you treat the electromagnetic field of the incoming light as a (sinusoidal, with angular frequency $\omega$) perturbation $H^{\prime}$ in the Hamiltonian of the atom. The wavefunction of the atom can be expressed in terms of a linear combination of its eigenstates, each with a multiplying coefficient. If we start on the ground state, then $c_1 = 1$ and all the other coefficients are zero.
You then apply time-dependent perturbation theory to calculate the time dependence of the $c$ coefficients and the transition probabilities between the eigenstates.
The probability per unit time of a transition is
$$ p_{fi} = \frac{4\pi^2}{\hbar^2 T} | H^{\prime}_{fi} (\omega_{fi}) |^2,$$
where $\omega_{fi} = (E_f-E_i)/\hbar$, and
$$ H^{\prime}_{fi} = \frac{1}{2\pi} \int^{T}_{0} \int \phi^{*}_{f} H^{\prime} \exp(i\omega t)\phi_i\ dt\ d^3x,$$
where $\phi_f$, $\phi_i$ are the final and initial eigenfunctions and $T$ is the time over which the perturbation is applied.
What one finds is that the probability of a transition being made is maximised when $\omega = \omega_{fi}$.
Answer:
how does adding energy to the EM field cause the electron to to change orbitals or oscillate in a different pattern.

Here one is using two frameworks, the classical and the quantum mechanical. The classical electromagnetic field is composed by an enormous number of photons each with energy=h*nu, nu the frequency of the electromagnetic field.
The electron is an elementary particle, a quantum mechanical entity. It interacts with photons via a well prescribed mathematically calculational mechanism ,   the Feynman diagrams.
The electron may be free, and then it can scatter with a photon and take part of its energy or have even more complicated interactions, but since you are framing your question in EM fields , this is another story.
Electrons bound in free atoms can be kicked up to higher energy levels by a photon with the correct energy. Electrons in a solid are also bound but complicated potentials exist which may allow many energy levels common to the solid to the point of seeming continuous.
An EM field with the appropriate energy may  move the electrons around in allowed orbitals for the solid which may have different manifestations in the solid than it had before being exposed to the said EM field, as oscillations because of different collective orbitals


What should you look for in a testing manager?

Question: In some organizations, individual contributors have the opportunity to interview their prospective manager.  What should testers look for in a testing manager?
Answer: A good test manager has a number of key attributes. I tend to think that the best managers are like good, professional sports coaches.

They have played "the game", at the highest levels, they know what is required to be successful and achieve the results you are after. Translated, they should be a great tester themselves and be able to test hands on if required.
They should inspire others to greatness. A good manager should be able to motivate and inspire the team to function as a team, as opposed to a group of champions.
They should provide the best equipment. A good manager will ensure that the team has the tools that it needs to do the job, and do whatever is required to buy, build, beg, borrow or steal them. (Stealing not recommended).
They need to protect the team from outside influences. A good manager will act as a proxy for the team, and be their voice or fight the fight on their behalf, to clear any obstacles, allowing them to just get the job done.

So I would ask the question, "If you had to say you were a sports coach, or a military leader or politician, which would you pick and why?"
Comment: I agree with all of your points except the first, Bruce.  Managers need to be able to manage, just as testers need to be able to test.  If the Manager knows what is required to be successful and achieve the results you are after, there's no need for them to also be a great tester.  If your team is looking for occasional help, it's up to the Manager to *find* that help, not necessarily to *be* that help.  (Know of any great sports coaches that aren't also the best athletes?  I do.)
Comment: @Joe Strazzere  My experiance is the Test Manager is typically more Tester than Manager.  So I think having solid experiance in the domain of testing is a must.
Comment: I would add that they also need to be detail oriented, have really thick skin, strong personality (stands firm on what has to be done), very good communication skills and discipline
Answer: I envy those organizations!
First, I'd think a testing manager would need to have experience working with a testing group - not necessarily as a manager, but certainly with some level of administrative experience.
I'd look for familiarity with a range of software development methodologies, particularly how the methodologies impact testers.
Willingness to advocate for the testing team even in the face of hostility from other aspects of the organization is a big plus - in a developer-centric organization, someone who's willing to fight for the need to test and to schedule regression is a massive plus (this kind of situation tends to be kind of rough on the poor sod who ends up there, though).
Flexibility about how things are done is essential: testing is one of those "there is no one, true way" kind of things where the right answer is the one that best fits the situation at the time - a person constantly trying to push those square pegs into every hole regardless of what shape the hole is isn't going to do well.
Technical expertise is nice-to-have, but without it a willingness to listen to the people who do have the technical knowledge (be it domain knowledge, tool knowledge, current skill-sets, or anything else) is essential. It's essential anyway, but becomes more important when the manager doesn't have the expertise themselves.
Probably the most important thing I'd look for is the ability - and willingness - to say to the team "This isn't working. I'm out of ideas. What do you all think?" And then listen to the responses and act on them. Because sometimes no matter how good someone is, they get it wrong.
Comment: Yes to add few are team handling exp., superior thoughts in tackling things respect to QA. Ability to handle client pressure.
Answer: I would look for a leader rather than a manager. A leader who can inspire me and others on my team by sheer weight of his knowledge and work.
I agree with whatever has been said by Bruce and probably some of points below might look like rephrased sentences (still I would give it a shot)

One who enables the team to realize
its potential by providing the
support it takes
Someone who is like a breath of fresh
air; bringing new ideas,insights and
ways of working and thinking.
One whos is not afraid of getting his
hands dirty with the real job every
now and than.
Who can exert influence not only on
the team but across the organization.
Who not only solves a problem for the
team but puts in place
proceses/systems which prevent
similar situations in future.
Answer: Agree with the above answers few more points based on my experience.A manager should be like a role model in every aspect. I would want the manager,
1. To be more patient and understand our problems.
2. Take good suggestions from the team members and implement the same.
Answer: Picking the right answer from the excellent advises given here also depends on the size of the team, a manager for a 2 person test team is different than a group of 300 testers.


How to remove comment section from page only , not from posts pages?

Question: How to remove comment section from page only , not from posts pages?
Answer: If you want to display comments and the comment form on posts but not on pages, you need to split up the logic in your template file to call comments_template() depending on the type of the item displayed (post or page). There are two ways to do this: either you keep one template file for both items, and use conditional tags:
if (!is_page()) {
     comments_template();
}

The other option is to use both a single.php template file for your posts and a page.php for your pages (see the Template Hierarchy for more information). Just leave out the call to comments_template() in the page template. If there are no other differences between a post and a page layout, one combined template file with conditional tags is probably better for maintainability.
If you want to do this "from a distance", so where the template file already includes a call to comments_template(), you can create a plugin that hooks into the comments_template filter and redirects it to an empty file in the directory (well, it could even be the plugin file itself - since it only contains PHP code, it won't display anything - but this will be confusing to others).
add_filter('comments_template', 'no_comments_on_page');
function no_comments_on_page( $file )
{
    if ( is_page() ) {
        $file = dirname( __FILE__ ) . '/empty-file.php';
    }
    return $file;
}

Comment: Hi Jan, Thanks for the answer. Is there any plugin to do this without going into code?
Comment: @metal-gear-solid: I updated my answer with an example to do this from a plugin. I don't know whether a plugin exists that does this, but it's really easy so you can place it in a plugin file yourself.
Comment: Manually I can remove comment section for each page to uncheck these options http://farm2.static.flickr.com/1280/5179502796_b9e09c10ba.jpg. And i just found this plugin which will keep these checkboxes unchecked for all pages, but not for posts http://wordpress.org/extend/plugins/page-comments-off-please/
Answer: I like a lot this snippet from Hybrid theme at start of comments.php template that will flexibly disable comments if they are not supported or disabled on per-post/per-page basis:
if ( !post_type_supports( get_post_type(), 'comments' ) || ( !have_comments() && !comments_open() && !pings_open() ) )
    return;

Answer: depending on the theme.
check pages.php code and remove stuff related to comments
be careful not to break the design.
If you can post the code of pages.php here, hope we can help tell u modifications that need to be done


Finding audio data in recording

Question: I am trying to find a specific block of data that should hold valid audio data that I want to process. For instance, I record at 44.1kHz, but I only transmit a .5s of content. Since the buffer I store the recordings in contains both the recording as well as background noise, is there a way to isolate the sample I desire? Is this a simple filtering problem? I know the range of frequencies I need in the sample, so would a bandpass filter solve this issue? My ultimate goal is to run the time series data through an FFT to see which of the desired frequencies were transmitted. Note that this is being done in software. Thanks for any help!
Comment: What is the nature of the wanted signal? What is the nature of the background noise? What is roughly their frequency bandwidth? And what is roughly the signal to noise ratio? I'm asking as there are various methods to approach this depending on your particular circumstances.
Comment: I'm not sure how to find signal to noise ratio, but the nature of the noise should be arbitrary (ie should be able to find signal in any condition where the range of frequencies I want are mostly untouched).
Answer: Knowing the range of frequencies is a good start and yes a bandwidth filter will certainly help you isolate them but you must consider the overall level of background noise vs signal noise.
Performing an FFT on filtered (bandwidth or otherwise) data will only yield results on the frequencies that are left over! This will either be of use to you or not.
If the number of frequencies that you are after are not that numerous, a collection of IIR (infinite impulse response) filters might be a better choice.
Consider DTMF tones used by telephones and cellphones, typically IIR filters have found their way in software based detection of these dual-tone based signals. There are online resources for calculating each of the  filter's co-efficients. You must use one filter per frequency that you are after.
Here is an iPhone version of source code for DTMF decoding using IIR filters
The file DTMFDecoder.m contains the bulk of the code with the co-efficients defined near the top.
Without knowing any further detail, this is all I am able to help you with.
Comment: The range of frequencies I am targeting are a bit numerous (160 or so) all above 14khz. What exactly is an IIR?
Comment: My comment was too long, so I had to respond as a new answer (see below).
Answer: An IIR is an infinite impulse response filter. If you are monitoring 160 or so frequencies don't use IIRs. FFT will be more suitable for your purposes. Recording at 44.1KHz (CD quality) will allow you to record frequencies of up to a theoretical limit of half of this, so frequencies up to 22.05KHz. However, the closer you approach this limit, the more poorly represented the frequencies will be. You will need to choose an appropriate bin width to be able to discern each frequency accurately. For example, an FFT width of 1024 @ 44.1KHz will give approx 21.53Hz resolution: 22050 / 1024. This means that the FFT can yield information on your frequency range, in 21.53Hz steps. If you then consider your range of interest, 14KHz and above, then this yields the following: 22050 - 14000 = 8050Hz bandwidth; 8050 / 21.53 = 373.9. So you would be able to detect the amplitude and phase of about 373 frequencies between 14KHz and 22.05KHz using an FFT with a width of 1024. Frequencies that fall between these discrete steps of 21.53Hz will muddy your results and may appear to be two neighboring frequencies instead of the one clean frequency. You can increase the FFT width to give you more finer results but it does come at a computational cost. Modern smart phones are able to do an FFT at a width of 1024 in realtime. If you can, I suggest recording the signal at a higher sample rate to give you better signal accuracy first, then pick an FFT width with sufficient resolution for your needs. If the desired signals are pure enough, then the FFT should give you clear results that you can work with. Also my favourite windowing function is: Blackman-Harris, I find it gives the best main lobe to side lobe compromise but you may have to experiment here depending on the results you get. Good luck!
Comment: Current smartphones can do many thousands of float FFTs of length 1024 in realtime, so longer ones are quite reasonable if necessary.
Comment: Thanks, this was my current approach, but I guess my issue was that you would need to slide the FFT over the data to find the specific start and end points of the data in the recording. Is this true, or can you just send all your data through the FFT and it should yield the same results? Thanks.
Comment: As you increase your FFT resolution (single frame) you actually decrease your temporal information of the frequencies identified by the FFT. So yes, sliding the data as you refer it to can strike a balance between knowing 'what' and 'when'. Windowing your data becomes crucial to yield better results when doing this.
Comment: You will need to decide how much FFT overlapping is necessary to yield enough temporal information for your purposes.

Finding audio data in recording


Is it haram to accidentally make an oath to my husband that I did not do something I actually did?

Question: I accidentally made an oath to my husband. I told him 'I swear to you, I didn't do it' (even though I had done it) without even thinking twice. I want to undo this. I have heard that swearing on someone is forbidden. I need help to undo this act.
Answer: Hoping this will help as additional insight into what you swore about as I have no details and would not like to know.
From an IslamWeb fatwa:

Whoever takes a false oath commits a grave sin. To make a false oath means to swear to a lie to prove or deny something. ...
As for the expiation of a false oath the Muslim Scholars have two different opinions:

Majority of the Muslim Scholars say that there is no expiation for such an oath since it is greater than any expiation. ...

One should pay the expiation stated in the Saying of Allah in Qur'an {Allah will not punish you for what is unintentional in your oaths, but He will punish you for your deliberate oaths; for its expiation (a deliberate oath) feed ten Masakin (poor persons), on a scale of the average of that with which you feed your own families; or clothe them; or manumit a slave. But whosoever cannot afford (that), then he should fast for three days. That is the expiation for the oaths when you have sworn. And protect your oaths (i.e. do not swear much). Thus Allah makes clear to you His Ayat (proofs, evidences, verses, lessons, signs, revelations, etc.) that you may be grateful.} [5:89]. These scholars believe that the person who swears deliberately while he is lying has to expiate for his oath, then the one who does a false oath has also to expiate for it in the same way.

In general, I think giving out charity is a good way of expatiation, besides seeking Allah's forgiveness constantly.
Comment: do not you suggest her to say truth?
Answer: False oath is a grave sin. You should tell the truth to your husband and repent to Allah for your sins. You can't undo what you did but you can ask for repentance and prevent yourself from doing it again. This is the view of the majority of the Muslim scholars. See this fatawa for more information.