Windows Azure Centos image: Cannot upgrade to 6.4

Question: I am using the Openlogic Centos image provided by Windows Azure. I have tried many times but when I run yum update it always said no packages marked for update, and the centos version is still 6.3. I have another machine set up much earlier and I am not sure why but if in fact update itself to 6.4.
I guess it is problem with the in build repo? Does anyone know the right way to update to 6.4? Thanks a lot!
Answer: The people who built that virtual machine image disabled updating it by the simple expedient of running their own CentOS mirror, which they don't keep in sync with upstream, and then altering the yum configuration to only use their mirror.
You can replace their yum configuration files with ones from a standard CentOS system, which is what I did.
Keep in mind that if you do this, you will no longer get updates to the Hyper-V Integration Services package that is in their repository; you'll have to update that yourself manually. You also will need to update the Windows Azure Linux Agent yourself from Microsoft's github.
Comment: Thanks a lot! This is immensely helpful, as I helplessly trying all those disableexclude or removing packages and installing raw rpm. I would rather Azure just provide the native Centos image. May I ask is there a way to add the Hyper-V Integration Services updates in the repo?
Comment: You would have to make your own repo.


How much does earth's core temperature affect earth's global surface temperature

Question: Has anyone managed to read the (latest) full IPCC-report and do you know whether they have taken into account the Earth's core temperature in their models. Besides the IPCC-report, do we know how much the climate and temperature on Earth's surface is effected by it? As I'm guessing, the core temperature of the earth is an very important variable that the climate-models need to have.
Comment: @Jean-MariePrival It also does not change much in time, so it can be neglected in climate *change* calculations. I could not find an estimate of how many degrees warmer it makes the surface. [Saturn is 32C warmer due to internal energy flux!](https://en.wikipedia.org/wiki/Planetary_equilibrium_temperature#Internal_energy_fluxes)
Comment: The internal heat flux is, on average, about 0.1 W/m$^2$, while the incoming solar radiation is about 340 W/m$^2$. So internal heat is not an important variable for climate models. See for example this answer: https://earthscience.stackexchange.com/a/431/18081
Comment: To be an important variable it needs to be shown it is varying; it is not ignored or neglected - just known to be both relatively small in total amounts of heat flow and known that the rate of heat flow hasn't been increasing. And a whole lot of valid science would have to be ignored or neglected or overturned for the causes of global warming to still be considered an unexplained mystery.
Comment: I have designed fracture stimulation treatments for 31 years and been involved in many very complex by nature jobs with data acquisition analysis from microseismic evaluation that I can say fracing has nothing to do with anything regarding heat transfer from the earths core! Every single description of fracking here is so off track it needs to be disregarded!
Answer: It's not the earth's core temperature per se that matters, but rather the amount of heat that flows from the core to the surface. Just like holding a cup of hot coffee - if the mug is insulated, it's fine, but if it's just thin metal, then your fingers will get burnt. The flux of heat through the surface of the solid earth is less than ~0.5 W/m$^{2}$. The sun heats the surface of the earth at an average rate of ~200 W/m$^{2}$ (which varies with latitude). We can therefore conclude that the heat coming from the centre of the earth isn't a big factor for the surface temperature of the land.
But, what about the ocean?
This paper from 2001 discusses the impact of the geothermal heat flux on the ocean. They use an approximation of the coupling between the atmosphere
$$\frac{\partial T_{ocean}}{\partial t} = \lambda (T_{ocean} - T_{0})$$
that relaxes the ocean temperature, $T_{ocean}$, back towards a set temperature, $T_{0}$, at a rat of $\lambda$ W m$^{-2}$ K$^{-1}$. They use a value of 32 W m$^{-2}$ K$^{-1}$, so an extra heat flux of 0.5 W m$^{-2}$ leads to a change in surface temperature of $1.5 \times 10^{-3}$ K. Not really noticeable.
If we look at the deep ocean, 3,000 m and below, then their results suggest that this heat flux can make a small but discernible difference; in their model the deep ocean is about 0.2-0.3°C warmer because of the heat flux coming through the sea floor.
Comment: This is a great answer. It's worth adding that the heat flux from core to surface is whatever it is. It doesn't lead to a heating or cooling of the atmosphere, it would simply contribute to keeping the temperature at the earth surface where it was historically. In other words, it's a *constant contribution*, unrelated to the *climate change* that the IPCC reports address.
Comment: @NaturalNumberGuy - estimates of geothermal heat flux includes heat from volcanic eruptions.
Comment: Rather than just passing it off by relative scale, I'd think the Stefan Boltzmann Law may offer a fair thought of what small factor 0.5 $\frac{W}{m^2}$ really has, given its 4th root relationship from radiation to temperature?
Comment: Thank you for the answer. Then what's the heat flux from a volcano since I guess molten lava comes from the core from there? Are these volcanic things implemented into the average-computation of the total heat that flows from core to surface? Thanks.
Answer: This Skeptical Science article explains that geothermal is very small, $0.09W/m^2$, compared to radiant heat flows. It also does not change much in time, so it can be neglected in climate change calculations.
For an airless planet the equilibrium temperature $T$ can be calculated from
$$ F=\sigma T^4$$where $F$ is the average absorbed heat flux at the surface and $\sigma$ is the Stefan-Boltzmann constant. If there is an additional internal flux $I$,  the equilibrium temperature is increased by $\Delta$:
$$F+I=\sigma(T+\Delta)^4$$
For small $I$ this leads to
$$\Delta \approx  \frac{TI}{4F}$$
Without the atmosphere, $I$ is three orders of magnitude smaller than $F$, so $\Delta$ is a fraction of a degree. I don't think the atmosphere would amplify this effect.
Answer: There is no evidence of long term change to the rate of flow (flux) of Earth's internal heat to the surface; without evidence of variability it doesn't get treated as a variable. It doesn't get included in climate models because there is no evidence it is a climate forcing over the time scales for anthropogenic global warming, not because it has been overlooked.
Scientists have given consideration to every conceivable cause for climate to change, both in long term paleoclimate terms and specific to current observed warming. That includes use of temperature data from boreholes - which show warming (change) currently occurring from the surface down, diminishing as depth increases.
Climate scientists have looked at estimates and quantification of heat fluxes and evidence of underlying change, found them to be inconsequential to observed and predicted climate change.
Answer: I would like to give some food for thought here. I live in Louisiana where fracking is causing cracking deep below the surface of the earth. If you look at a map of fracking locations in the US you will be shocked at the number or amount of red dots that pinpoint fracking locations. One state is almost completely filled with red dots. There are hundreds and hundreds of thousands fracking locations from north to south part of the central US. While fracking miles below the earths surface then horizontally for over 5 miles in some cases fracking technique uses 6 explosions of like dynamite every 1' of cutting into the rock. Yes, 6 dynamite explosions every 1' in order to break the rock for the drill bits to drill through. Now use that calculation 6 explosions per foot along with the depths of the explosions times the number of the hundreds of thousands of fracking locations to determine how much the rock miles below ground that is closer to the earths core has been loosened. The broken and cracked rock below the earths surface that is an insulating factor that helps protect the earths surface has been broken and cracked in hundreds of thousands of locations due to fracking. The insulating rock below, the insulation, that protects the earths surface is being destroyed and weakened therefore heat from the earths core will find the path of least resistance and that my friends is through the broken and cracked rock caused by fracking miles below the earths surface.
Mixed toxic chemicals and fluids are made and concocted by non scientist that are used in fracking to cool down the fracking drill bits. It is very hot below where fracking takes place and the toxic chemicals being used may also be a contributing factor to the earths surface heating up.
Comment: While it is true that the crust is insulating the surface from the heat of the mantle (which is why heat flux is higher where the crust is thinner, i.e. under the oceans), I don't think fracking can improve significantly the heat transfer from the Earth's interior. Heat will go through the crust by conduction anyway, regardless of the presence of faults/fractures. Moreover, most fracking is done at relatively shallow depths (< 5 km), while continental crust is 30 km thick on average. Such shallow fractures are far from reaching the mantle, thus cannot be used to transport its heat effectively.
Comment: (I'm not defending fracking, which clearly presents some environmental issues, but I don't think it can be responsible for heating the surface.)


What is the official difference between a planet and a dwarf planet?

Question: I'm trying to understand how objects are classified as planets, moons, or dwarf planets. Can someone please explain the differences between them? I'm really curious about why Pluto is a dwarf planet, for example.
Comment: Related: [How many planets are there in this solar system?](http://astronomy.stackexchange.com/questions/539/how-many-planets-are-there-in-this-solar-system/) at astronomy.SE.
Comment: Related: [Planets and Pluto? Neptune?](http://physics.stackexchange.com/questions/141504/planets-and-pluto-neptune) on the issue of planethood for the two objects.
Answer:
The definition of planet set in 2006 by the International Astronomical Union (IAU) states that, in the Solar System, a planet is a celestial body which:

Is in orbit around the Sun,
Has sufficient mass to assume hydrostatic equilibrium (a nearly round shape), and
Has "cleared the neighbourhood" around its orbit.

A non-satellite body fulfilling only the first two of these criteria is classified as a "dwarf planet".

(from http://en.wikipedia.org/wiki/IAU_definition_of_planet)
The IAU has come up with this definition. It probably won't be revised for quite some time. The reason that Pluto fails as a major planet is because it has not "cleared its neighborhood."  Pluto's orbit crosses that of Neptune, a vastly larger body. Pluto also shares its orbit with the Kuiper belt, a swath of small icy bodies beyond Neptune.
A moon is usually understood to be a natural body that orbits a planet, be it major (e.g. Earth), minor (e.g. Pluto), or extra-solar (although no extra-solar moons have been detected at the time of this posting).  However, the IAU has not yet formally defined a moon.
Sticky situations and possible future revisions/extensions for the definition of a planet-

Binary planets- Pluto and Charon are so close in mass that it is more accurate to say that they both more orbit a point in space between them, rather than Charon strictly orbiting Pluto. Put more technically, the barycenter of the Pluto/Charon system lies outside the most massive body. The term binary planet is now informal, but could become official some time in the future.
How round? The second bullet point in the IAU definition of a planet is that a planet must be in hydrostatic equilibrium, but at the smallest end of the planet spectrum, this gets a little bit blurry. They may have to attach some kind of number to it someday.
Exoplanets As of right now, this only applies to our own Solar system, with "exoplanet" being an entirely separate category. Aside from human prejudice for good ol' Sol, this is silly. There should be one, universal definition. (IMHO)
Brown dwarfs New observations are making it clear that objects may exist ranging smoothly from Jupiter, an undisputed planet, right on up to objects that are indisputably stars. Where do we draw the line? Nowhere is that mentioned. Transitional objects are fuzzily known as brown dwarfs.
Trojan asteroids If you want to get really finicky about it, even Earth, Mars, Jupiter, and Neptune might not qualify as major planets, either. They all have a significant number of asteroids orbiting the Sun locked into orbital resonances at their orbital radii- they may be dominant at their radii, but some people grumble at the wording of the "cleared their neighborhood" criterion.
[Note: a previous edit cited the 3:2 resonance between Pluto and Neptune as evidence for why Pluto is not a planet; however, the IAU definition does not list a secular orbit (i.e. lack of resonance) as a criterion for being a major planet, so an orbital resonance per se is not disqualifying.  In fact, many known planets and other bodies in our solar system are in or have been in similar orbital resonances. Jupiter and Saturn are thought to have been in resonance in the past, and Jupiter's Galilean moons are in a 1:2:4 resonance.  Additionally, we know of extra-solar planets in multiple systems, such as the Kepler-11 system, that are in resonance.]
Comment: I was taking *Neptune* as evidence that Pluto has not cleared its orbit; the 3:2 resonance was merely supporting evidence for that. I'm sorry if that was unclear. However, considering the fudge factors regarding space debris as mentioned in point 5, I think Kuiper belt objects are a lesser argument against Pluto maintaining its previous major planet status.
Comment: Pluto's orbit crosses Neptune's only in the sense that it comes closer to the sun than Neptune does.  Pluto's orbit is tilted enough that it never actually comes very close to Neptune.  In fact, Pluto's closest approach to Uranus (11 AU) is closer than its closest approach to Neptune (17 AU) according to [this Wikipedia article](http://en.wikipedia.org/wiki/Pluto#Relationship_with_Neptune).
Answer: Planets are define as gravitationally round bodies that orbit the sun and have cleared their orbital region. In other words, the only bodies that will cross a planet's orbit are temporary transits (i.e. comets) or bodies that are gravitationally controlled by the planet (moons & smaller bodies in orbital resonance with the planet). This resonance requirement includes trojan asteroids, so the previous answer is incorrect in this regard.
Pluto is locked into a 3:2 orbital resonance with the far more massive Neptune, as are other nearby objects in the Kuiper Belt.
This is why Pluto is not classified as a planet, but rather as a dwarf planet.
Please note that the IAU classification of planets applies only to our Solar System as not enough information was known in 2005 about the orbital dynamics of other planetary systems.
Answer: A dwarf planet is a minor planet that is round, so it does not dominate its orbit like a real planets do. If an object is more massive than other objects near its orbit and it is gravitationally dominating, then it is called a planet. Otherwise it is a minor planet, if it is not a comet (comets do follow orbits that make their surface ices sublimate when they are close their stars). Round non-dominant objects orbiting a star are called dwarf planets. Actually a dwarf planet is any minor planet or comet that is round. It can also be said that a dwarf planet is any round object that is less massive than other objects near its orbit combined. Round moons are not dwarf planets, because they do not orbit star directly. IAU only wrote about objects orbiting the Sun, but I'm trying to write more generally.
Comment: Asteroids and trans-Neptunian objects are minor planets.


Is the position of content questions in sign language due to articulary or syntactic reasons?

Question: In sign languages, the position for content questions is clause-initial, clause-final or both. For instance; TİD (Turkish Sign Language) licenses both.
   When there is topicalization in the sentence, the content question occurs post-topic position in some sign languages; like Finnish Sign Language. Zeshan (2004) points that one of the proposed explainations for this post topic position is ease of articulation.
   Is there any other reason for this change when there is topicalization? Is there synactic reason for it along with articulatory one?
Comment: By saying "content question" you mean wh-questions, in contrast to yes-no questions?
Comment: yes, I mean wh- questions, but some sign languages do not have a manual for this questions but they mark the question sentences by nonmanuals, so I prefer to say content questions.
Answer: There is a theory in American Sign Language Syntax (proposed by Neidle et al 2000) that one of the doubled wh-phrases might actually be a topic (dubbed a wh-topic) in which case it follows the syntactic rules for a base generated topic. One of these rules is that if the wh-phrase occurs with a moved topic, it must precede the moved topic, just like any other base generated topic would. So in American Sign Language anyway the wh-phrase is actually first, followed by the other topic. And since you mentioned the articulatory demands/conflicts, it should be noted the that one of the prominent non-manual markers for wh-questions is brows furrowed, and one of the prominent non-manual marker for topic marking is brows raised, obviously there is a conflict, which is one of the reasons that this theory is up for debate (although there is some evidence that the topic+wh marker is slightly different from just the wh marker)


Acoustics; Distance Law

Question: If you measure the sound pressure level from a certain distance, you can recalculate them to another distance. But what is, if a noise is generated directly on your membrane (microphone membrane or eardrum for example). How is the sound pressure calculated in this situation? Because the distance from the "sound level meter membrane" is zero in this case.
Answer: You can't. For the calculation of pressure anomalies you need a volume of a medium in which the sound propagates. Apart from that you need a non-zero distance to apply the inverse-distance-squared law.
If you generate the sound on the microphone, you don't have to calculate the intensity. You can simply read the oscillations from the sound generator...and buy a new microphone.
Comment: @J.Scott The point of the answer is that you can't apply the law with no distance.  It doesn't hold under that condition.
Comment: But how loud would it be approximately in comparison to a very very short distance? Because if I go for the distance law it would be infinite :)
Comment: Ok thank you all. But I have just one more question: What is, if I measure a sound from a normal distance (in the free field). Can I than calculate it back to the near field (0.025m)? Does the assumption 1 from @D. Betchkal only refers to a measurement in the near field or also for calculations to the near field?
Comment: To clarify the inverse distance law... You can use it only in the far-field (pressure and particle velocity are in phase) otherwise (near field) you could get different results for the same distance from the source for different coordinates of measurement (there can be cancellations due to different parts of the source moving in different phases). For a simple case, you can consider an ideal dipole source and search for the "acoustical short-circuit" term.
Answer: I'd like to add to Aziraphale's answer by describing the assumptions that must hold for the most basic spreading loss equations to be effective in predicting Sound Pressure Level (SPL).
Because SPL is a field quantity, the assumptions are spatial, but they cannot be crisply defined for the general case. They'll depend on the physical system in question.
The following diagrams shows the two assumptions that must hold to predict SPL with a simple spreading loss equation:

Assumption 1:
(To answer your question) the plot shows that if you get really close to a source the Far Field assumption starts to break down. The simple way to say this is the relationship of SPL to distance is complex.
The more technical answer is that the Far Field assumption breaks down when acoustic pressure $p$ and acoustic particle velocity $v$ are no longer in phase with each other.
In practice the near field boundary is generally "2 - 3x the wavelength of interest". If you start to think about it, if you make measurements of sound pressure level close enough to a source such that you're less than two wavelengths for audible sounds you'd be somewhere between 8 meters (80 Hz) and 0.04 m (17150 Hz) away from the source. It should be apparent that the physical form of the source will begin to have important influences on the sound field when you're that close.
More simply put, it's harder to assume the sound field is perfectly spherical (or plane).
I want to point out that it is useful to measure sound intensity $I$ in the near field, and in fact, it's one of the main ways scientists estimate the sound power of a source (pg 14).

Assumption 2:
 The plot also shows that if you get really far from a source the Free Field assumption starts to break down.  In other words we can no longer assume
$$p_{direct} \gg p_{reflected} $$
Such that reflections are no longer a negligible part of the overall acoustic field. You can see that depending on the physical form of the reverberant space you can have a variety of rates of fall off, with the most extreme example being something like a Reverberation Room, where the sound field becomes essentially constant after a certain distance away from the source.

tl;dr

if you're too close or too far from your source the basic spreading loss equations no longer apply
Comment: Nope, sound Intensity is **not** independent of distance from source: https://physics.stackexchange.com/questions/387138/relation-of-power-and-intensity-of-sound-point-source-wave-with-distance-travell/387277#387277  Intensity is the _energy flow per unit surface area_, and so as the wavefront spreads out with distance, the total amount of energy stays the same but the area increases.  Sound power level is independent of distance.
Comment: Thank you very much for your answer. So, i can assume, that the distance law does not fit for very short (<0,04m) and very long (>8m) distances? One example: If we have a broadband noise, that is 120 dB SPL loud from a distance of 20 cm. How loud would it be approximately, if the same noise would be generated directly on the microphone membrane, which measures the noise? Can we estimate the sound intensity from the given sound pressure level?
Comment: D. Betchkal, can I write you a PM, please. I need some help in acoustics. I would be very grateful for that.
Comment: Sound intensity is independent of the distance, right? But why is it the same as the sound pressure level in 0,2821m, according to this link: http://www.sengpielaudio.com/calculator-soundpower.htm

Acoustics; Distance Law


Two Different materials in One Object

Question: In the İmages you can see the vase has a 2 different colours. The top is white and opaque, and the bottom is transparent and dark blue (thanks to my webcam you'll see it as black). My question is how can I colour my model vase like the real one?
Comment: For cycles: and  https://blender.stackexchange.com/questions/50360/smooth-transition-between-glossy-and-color-material
Comment: @tahs.  Please note the difference between renderers.  Blender Render vs Cycles Render.  In the images above you are using Blender Render.
Answer: Blender Render Material, Texture, UV
Not Cycles

UV Map Vase in Edit Mode .. Project from View Bounds
Material Panel.  Transparency On. Alpha Zero.
Texture Panel using UV,  Color Ramp with Colors and Alpha indicated
Texture Panel Influence Affect Color 1.0 and Alpha 1.0 as depicted
Texture Settings shown in 2 Panels to Save Vertical Space
No emphasis on Artistry. You Can do better.  Suit to your taste.

Emphasis on UV Map.  Pay no attention to the man ... rather the image behind the Vase.
Same Material and Texture Panels
Comment: How can I change interface like you did ?

Two Different materials in One Object


Copy Exchange calendar into local calendar in Thunderbird

Question: To view an Exchange calendar, I use the lightning plugin for Thunderbird. Now I want to copy all entries from that Exchange calendar into a local calendar in Lightning, because the Exchange Server will be shut down in the next time. Is that possible? I have found some nasty possibilities, e.g., working with txt-files. Is there a handy way to do this?
Answer: First of all, it seems you'll need the Lightning add-on for Thunderbird. With that, you can connect to the exchange server (if available) to fetch the calendar. You simply create a new calendar, choose "on the network" and then "exchange", and add the calendar with the following syntax:
<code>https://domain\email@example.com/EWS/Exchange.asmx
</code>
Comment: Thank you very much for your answer, I have updated my question...


Why wont Coda 2 save passwords for ftp access?

Question: I have recently switched to Coda 2 on Mac (OSX 10.8.2) and under site definitions the host, username and all other information save fine. It will not, however save my passwords. I DO NOT have "ask each time" checked (preemptive answer). Any help would be greatly appreciated.
Answer: Found a solution for this. If you open up Keychain Access, find the key that is named after your site so for example ftp.sitename.com. Double click it and go to access. Make it so that any program can use it. Then if you go back to Coda, enter the password once and d/c. It should be saved when you re-open the program :)
Comment: Excellent workaround… functioned just as you described. I feel like that is a fault on Panic's behalf. A bit of a timely workaround (moreover if you work on lots of different sites often) but is FAR better than having to remember and supply credentials constantly. Thanks you for your help!
Answer: Great! But the only thing is missing, that you didn't mention how or from where to open KeyChain access. I used mac spotlight to find it.
Actual location to open Keychain access: under Applications > Utility > KeychainAccess
Just select the ftp.yourwebsiteurl.com
Doubleclick on it
There will be two tabs. Click on AccessControl tab
Select the radio button option : Allow all applications to access this item.
It will ask your system admin password to allow.
Go back to Coda > right click on your website > click Disconnect
Now reenter your password > Connect.
That's it. Your password will be remembered for further connections.
Answer: Coda 2.x has built in FTP, git, SSH, and more.
Coda's way of dealing with FTP is to have you set up your files as a "Site"
Once you set it up this way, it saves FTP logins, git logins, ssh logins, etc for all aspects of that site.
Do this:

Open Coda - Coda should automatically open at the 'sites' page. If not, press Command-1 to go to sites.
Right-click, and select 'add site'.
Fill out the details for the site, and save.
Whenever you open that site, Coda will automatically connect to the server.

It's pretty easy to walk thru the dialog options.


Could you say what is the core, 1-3 main meanings for 'to put'?

Question: Once one Englishman said me 'to engage' means – 'get into contact' in any its meanings and after that I began using it easier. Unfortunately dictionaries give dozens meanings for a word and learners get stuck to memorize a lot of different meanings for one word. In this system could you say what is the core, 1-3 main meanings for 'to put'.
Comment: Most dictionaries give the core meanings first.  So unless you have a historical dictionary such as the full OED, or a badly edited dictionary, this is just the first three definitions of put from the dictionary.
Answer: The primary meaning of put is "to move into a certain position".

He got home and immediately put his wallet and his keys on the small table by the door, where he wouldn't forget them.

As with "get" there are many phrasal verbs and idioms that use put, but (to some extent) all rely on this basic underlying meaning.  For example:

As the clock struck nine, the children obediently put away their toys and took out their schoolbooks

Put away means "place an object in its proper location", or "place into storage".

At the meeting, the young manager put forth a bold plan to reorganize the production line, in a way that he said would increase efficiency by twenty percent.

Put forth means to "offer for consideration".  Figuratively, the image is like placing some object in front of the intended recipient.

Arthur wouldn't stop putting down his boss, saying he was completely incompetent and didn't deserve the job.

This meaning of put down is to "belittle", "criticize", or "humiliate".  Figuratively it is like placing that person in a lower or reduced position, so that you can "look down" on them.
And many other phrasal verbs and idioms.  Of course, there may be a few expressions where the connection to "place" is more tenuous -- such as put up with -- but for the most part this should be a good guide.
Comment: put on the milk, put on a look of concern, put on display, put on an act, put on an accent, put on hazard etc  All they are very figurative and cause difficulties to understand.
Comment: @Vitaly  Not really.  All are related to what I said, "to place something into position", either *on the stove*, *on one's face*, *out for people to see*, etc.

Could you say what is the core, 1-3 main meanings for ‘to put’?


Why I can't run/install g.rename.many?

Question: https://grass.osgeo.org/grass78/manuals/addons/g.rename.many.html "command not found".
I want to rename a huge amount of raster maps in GRASS as I need them to mask the region where I will run r.stats on a loop of another stack. Names of the two stack need to have a common string to make the loop run correctly. Pattern are absolutely similar now, but a very small difference make me need to rename them all:
raster to use as mask are: raster_species_1
whereas raster for which to run r.stats are: raster_species1
I have to change first stack, removing the "_" character, only solution seems, from my knowledge, using r.renmae.many, that I founded here https://grass.osgeo.org/grass78/manuals/addons/g.rename.many.html
but my bash tells me "command not found".
Any help about r.rename.many? should I install it somehow?
Answer: The addon is called g.rename.many (r.rename.many does not exist...). You have to install it with g.extension g.rename.many or via the graphical user interface.
Comment: Please edit your questiion and add the full error message plus operating system information.
Comment: it does not work. Where can I find specific instructions? Or how can I do it trhought the graphical interface?
Comment: FileNotFoundError: [Errno 2] No such file or directory:
'svn' this is what it tells me

Why I can't run/install g.rename.many?


Paired or unpaired non-parametric 2 sample test?

Question: I've got a relative simple question. I'm doing an imaging study with a phantom. I've run the same phantom through the MRI scanner 5 times, each time running the same scan twice and only varying one parameter. I am trying to assess if varying this parameter (independent variable) changes my response variable (dependent variable). Do I assume this is a paired measurement because both tests were conducted sequentially in the same session? I get a p value of 0.0625 running the Wilcoxon matched-pairs signed rank test (a function of a low sample number I assume), vs 0.008 when the Mann-Whitney U test is run. Thanks for your help!
Comment: Although perhaps intuitively puzzling, your results are not at all surprising. See my Answer for an explanation.
Comment: Think about quantifying measurement agreement rather than doing formal tests.  See for example [this](https://hbiostat.org/bbr/obsvar).
Answer: A paired approach seems appropriate because of the
way data were collected. A paired
Wilcoxon test is essentially the same a one-sample Wilcoxon Signed Rank
test on the differences.
Unfortunately, assuming no ties among
the five differences, the smallest possible P-value $1/16 = 0.0625$
for a 2-sided test occurs when all differences have the same sign. (By chance
alone there is 1 chance in 32 that all five differences would be
positive and the same that tall five would be negative: $1/32+1/32 = 1/16.)$
Here are computations in R statistical software, based on some
hypothetical data:
x1 = c(1,4,5,7,8)
x2 = c(12,18,17,20,23)
d = x2-x1; d
[1] 11 14 12 13 15

Identical P-values of $1/16$ for both versions of the Wilcoxon signed-rank test, using paired data:
wilcox.test(x1, x2, pair=T)

        Wilcoxon signed rank test

data:  x1 and x2
V = 0, p-value = 0.0625
alternative hypothesis:
   true location shift is not equal to 0

wilcox.test(d)

        Wilcoxon signed rank test

data:  d
V = 15, p-value = 0.0625
alternative hypothesis:
    true location is not equal to 0

Doing a 2-sided Mann-Whitney-Wilcoxon two-sample rank sum test,
there are ten observations altogether, then if (as for my illustrative hypothetical data) all observations in one group are larger than any value in the other a smaller P-value is possible. Specifically, the P-value for
a complete separation assuming the null hypothesis of no difference
between groups is $2$ chances in ${10 \choose 5} = 252$ or $2/252 = 0.00794.$
wilcox.test(x1, x2)

        Wilcoxon rank sum test

data:  x1 and x2
W = 0, p-value = 0.007937
alternative hypothesis:
   true location shift is not equal to 0

From what you say about your data, I suppose you have a complete
separation. That provides clear evidence that something has
produced a significant effect.
However, if 'treatment' runs always followed 'control' runs (or always preceded them), then you need to mention the that the
difference might somehow be partially due to order of scanning
in addition to your 'treatment'. It's a good idea to get statistical
advice about experimental design, including randomization, before
you begin to collect data.
Comment: Thanks for your answer, BruceET. You are correct that all "pairs" have a positive response when the IV is varied.


Why would a dryer take 4 hours to dry after we cleaned out the vent?

Question: Our place is 17 years old and apparently no one had cleaned out the dryer vent before now.  It was extremely clogged up.  While the vent was clogged, the dyer worked great - dried an average load in 45-60 min.  Ever since we cleaned out the vent it takes 4 hours to dry a load.  Coincidence? What could cause this?  Any tips of suggestions greatly appreciated.  Thank you
Comment: Sounds like you might have blocked up the vent while cleaning it. I'd remove the vent from the dryer and see if it's clogged anywhere.
Comment: or you've somehow disabled the heating method.  Is it getting hot?
Comment: I hope you found the information provided for your answer helpful. If so, as per Stack Exchanges instructions to all new members.."Voting is central to our model of providing quality questions and answers..". So it would help others whom might have a similar question if you voted for any answer you found helpful.
Answer: After cleaning the dryer vent you should be seeing shorter drying times per load. A restricted dryer  vent limit's (reduces) the amount of warm, moist air being exhausted; slowing drying time. As already mentioned check again for lint blockage. If the thermostat is defective it will not fully heat-up. Put your hand on the exhaust duct; it should  be warm. Dryers employ a blower to circulate the warmed air. If the blower's drive pulley is loose it can't blow air. If the dryer uses electricity to dry clothes the heating element could be damaged.
Answer: I will second the theory that the vent, while caked with lint and restricted, was never fully obstructed anywhere; by clearing most of the vent, you've inadvertently created a complete blockage somewhere that your cleaning tools didn't reach.
To diagnose this, start the dryer on any cycle (air fluff is fine), then check the airflow at the exhaust vent. If there is none, or very little, you still have a blockage, or else your cleaning efforts have poked a hole or disconnected a length of the dryer vent.
First, make sure you haven't damaged anything, by visually inspecting as much of the dryer line as you can access. Plastic or foil dryer vent line is practically worthless; it'll become very brittle with the constant heat of the dryer exhaust and will get torn to shreds by most of the available vent cleaning tools. If this has happened you'll have to replace it. Even semi-rigid aluminum ducting can relatively easily be damaged by cleaning tools; these tools are designed for use with rigid galvanized duct line.
Assuming you haven't damaged anything, the remaining problem is a leftover blockage. Repeat the vent cleaning, making sure to run the tool to the maximum depth you can reach (most flex-rod type systems will extend to the maximum code-compliant length for the vent itself). If it's possible, try running your cleaning tool in from the outside, with the dryer running; this will give you a pretty obvious clue if and when you clear the obstruction (you'll be showered in lint when the brush breaks through and the dryer's airflow clears out the loosened obstructing debris). Also check the dryer itself; a substantial length of exhaust venting is within the dryer itself, along with some tight corners which are often the first to fill up with the gunk that the lint screen doesn't catch.
If the airflow is good but the drying time is still terrible, it's likely the dryer's heating system; with the dryer set to high heat, make sure the exhaust air feels nice and hot after a couple of minutes. If that isn't happening, the restricted airflow through the clogged vent may have tripped a thermal fuse or caused a short in the heating coil very close to the time you cleared the vents. Those problems also have DIY solutions but will require more information, and you would have been more likely to see a severe dropoff in drying effectiveness before you cleaned the vents.
If the heat's good and the vent's clear, it's down to user error; make sure you're not overloading the dryer with clothes (the best advice I can give starts way back when sorting clothes; never put more than one loose, level basketful of clothes in the washer even if the tub looks like it can take more), and if your dryer has a dryness sensor system, make sure the sensor's clean and that you fill the dryer with clothes of similar material; a cotton terrycloth towel in a load of synthetic fabrics will never dry completely before the sensor determines the majority of the load is done.


MainMenu = [[back alloc] initWithNibName: @"back" bundle: [NSBundle mainBundle]]; gets an "expected identifier or '(' before '=' token

Question: <code>#import "gameOver.h"
#import "MainMenu.h"

@implementation gameOver
@synthesize paButton;

-(IBAction) playAgain
{
 playagain = [[game alloc] initWithNibName: @"game" bundle: [NSBundle mainBundle]];

 [[self view] addSubview: [playagain view]];
}

-(IBAction) goBack
{
    MainMenu = [[back alloc] initWithNibName: @"back" bundle: [NSBundle mainBundle]];

 [[self view] addSubview: [MainMenu view]];
}
</code>
Answer:
<code>#import "MainMenu.h"
</code>

From this, I infer that MainMenu is a class.

<code>MainMenu = [[back alloc] initWithNibName: @"back" bundle: [NSBundle mainBundle]];
</code>

You can't do that. You can only assign to a variable, or a member of a structure stored (at some level) in a variable; you cannot assign to a class.
These look like view controllers. Is this Cocoa or Cocoa Touch? If it's Cocoa Touch, I'm pretty sure you would be better off to let the view controllers manage the view stack for you, rather than trying to munge the view hierarchy yourself. (In particular, adding each controller's view to your view will only work once until you take the view back out of your view.)


What is the basic difference between Migrant and Immigrant

Question: Can anyone tell me what is the difference between Migrant and Immigrant . This is a hot topic of today news. I hear and read those terms  almost interchangeably. Searching  in google and it give me the result that both meanings are same. Then where should I use immigrant and  where should I use migrant?
Comment: Any half-way good dictionary or search engine should have told you that "migrants" includes both "emigrants" and "immigrants" and that "emigrants" *go* from here to there while "immigrants" *come* from there to here.
Comment: Unless these have become 'fake words', I think each retains the same meaning on both sides of the Atlantic - no need for the AmE tag.
Comment: [Related](https://english.stackexchange.com/q/5734/2303).
Comment: @KJO Thanks to sharing your story. Actually this words are very confusing and I think don't have good definition.
Answer: In terms of American English, "migrant" has also been associated with temporary or seasonal agricultural workers. Perhaps first widely used in the 1930s when native-born Americans fled the Dust Bowl states of Oklahoma, Kansas, and Texas for western states like California, "migrant" has more recently been identified with Mexican workers (as well as those U.S. citizens with Mexican and other Hispanic ancestry) who follow seasonal crop harvests around the (mostly western) United States. Notice that with both of these meanings a "migrant" doesn't have to be from another country.
Comment: There is nothing about immigrant...
Answer: An immigrant is specifically coming in/into a country, usually as perceived by the inhabitants.
Migrants, on the other hand, are just generally migrating from place to place. For example, some birds migrate to warmer areas in the winter...
Comment: @RobbieGoodwin You've got them reversed, I think.
Comment: can you give a example for immigrant? Both are coming to the country right? So immigrant come to a particular country they cannot rome place to place. Like Carlos come from Italy to USA ,so Carlos is immigrant. If Carlos 1st go to Rome then USA where his home country is Italy then he is migrant. Am I Right?
Answer: The main difference between "migrants" and "immigrants" is that "immigrants" is a tighter description than "migrants" since it refers specifically to people who enter a country on a more or less permanent basis having left another country where they were resident. Of course "immigrants" had first to be "emigrants" since "emigrant" means one who leaves a country where they are resident on a more or less permanent basis. The difference between an "emigrant" and a "migrant" is the point of view of the person using the term. In the nineteenth century many Irish people left on "emigrant ships" and arrived in the US as "immigrants". The people were on the same journey, it was only the perspective which changed their classification.
To be "migrants", on the other hand, people do not need to move from one country to another or to move on a permanent basis. A good example of internal migrants were the Scottish Herring Lasses who used to move up and down the British east coast in the late 19th and early 20th centuries from Shetland to Yarmouth via many ports in between following the activity of the herring fleets during the herring fishing season.
These girls were British citizens who followed this way of life for a number of years, travelled only within the Uk, still regarded their town of birth as home and usually returned there when the herring were out of season.
All "immigrants" and "emigrants" are "migrants" but not all "migrants" are either "immigrants" or "emigrants". As I said above "immigrant" is a specific form of "migrant". You could also say that "immigrants" are a subset of "migrants".
Comment: I think "migrant" implies recent activity, while "immigrant" indicates whether someone has ever moved. So one could be a non-migrant immigrant.
Comment: @Accumulation Your first sentence captures a hint of the nuance. Your second sentence however does not follow at all. One might be a non- _migrating_ immigrant in the sense that they've finished all the moving about. But an immigrant is a kind of migrant.


Taxes on an NY summer internship

Question: I am a TN resident who will be doing a 12 week internship this summer in upstate NY. My salary is around 2.3k every two weeks. What would this be after taxes? Would my company take care of state and federal taxes?
Comment: Will you have any other income this tax year? Your company will withhold state and federal taxes at a standard rate, but your total income for the year will affect the size of any tax refund / bill.
Comment: Just ask your company :)
Comment: Your company will probably withhold NY state taxes; it will *not* withhold any TN state taxes. What taxes you will own for each state depends on any agreements between TN and NY regarding taxation. (You may be double-taxed, or you may receive a credit in one state for taxes paid to the other.)
Answer: That's just over 12K. You will probably get around 1k taken out for the whole year.
Ask your employer for the State tax income form and there is an option to add an additional amount on to take out for state taxes.
I used to have the state take an additional $5 out for taxes each check just to be safe.
Also claim 0 for dependents
The good news is most likely you will end up getting around $300 back when you claim your taxes.

Taxes on an NY summer internship


Install VLC on offline ubuntu

Question: i have 32 bit ubuntu 12.04 on an offline computer. I can access the internet using a different windows 7 computer and i have a memory key. How do i install vlc on my offline ubuntu computer?
Answer: You can download it to your windows 7 computer using Cube, it is a portable package manager capable of downloading packages from any computer with internet connection (e.g your windows 7 computer) and install it back to your linux computer.
Here is the complete tutorial on how to use it : http://community.linuxmint.com/tutorial/view/1583
Answer: You must download a deb package from http://www.videolan.org/vlc/download-debian.html move it to ubuntu and run this by clicking two times
Or use dpkg in terminal.

Install VLC on offline ubuntu


Windows Server 2008 R2 RDP login paste password

Question: Is there any utility out there that allows me to paste the password in my clipboard to Windows Server 2008 R2 RDP login screen as if I'm typing the characters directly from the keyboard?
I login a lot to different servers and use ClipMate to manage and pull up historical clips.
Comment: I will leave this as a comment instead of a answer as it does not provide a solution, but the reason you can not paste in rdp is copy and paste is handled by `rdpclip.exe` which is run in your user context. If you have not logged in yet, rdpclip has not started yet. However there may be client side solutions to this, and I look forward to watching this question.
Comment: Have you tried saving the credentials in an RDP file?
Comment: If anyone feels that this is unfair (like me), and that CTRL+V should work here as well – consider up-voting this item on Windows Feedback Hub: [for normal users](https://aka.ms/Kru273) / [for insiders](https://aka.ms/Mesall).
Answer: Actually, yes.
As pointed out by @ScottChamberlain, the reason you can't do it with the clipboard is that the program responsible for copy and paste in Windows is run in a user context.  Until you log in, you have no user context, and it's not running.
However, that's not the only way to "copy and paste" text or access the clipboard.  The password vault I use has a "paste into current field" option, and (to my surprise), it actually does pass this to the password field at the Remote Desktop login screen.  Likewise, VNC and OoB-management technologies allow cutting and pasting into the login screen, because they don't use the unlogged-into RDP session's context to try to pass the clipboard contents.
Having said that, I don't find this feature particularly useful.  Use a connection management program that lets you save your RDP sessions with username and passwords, and all you have to worry about is double clicking the connection.
I use mRemoteNG, which is freaking awesome.  All my RDP, VNC, SSH, telnet, and even http/https connections are saved in there.  Free and I'd pay hundreds of dollars for it, straight up.  Got thousands of connections saved in there, and never have to type a password for any of them.  (And before anyone says it, yes, my connections file is kept in a small Truecrypt container.)  Yum, FOSS.
Answer: Contrary to what the other "answers" for this question say (including the accepted one), there is indeed an easy way to do this, also if you (like me) for different reasons (most likely security related) don't want to save the password in the RDP connection shortcut/file on your computer.
In the RDP connection dialog (i.e. pre-connect), enter the username, and also put the checkmark in the option "Allow me to save credentials" (don't stop reading here, we will NOT actually save the credentials after all!).
Now when you press connect, you will be presented with a system-local credentials dialog, where the username is pre-filled, the password box is empty but possible to paste right into without any fuss at all, and the option "Remember my password" is pre-checked.
Now, simply paste your password, and also UNCHECK the checkbox for "Remember my password", then click the "Connect" button.
Bam, you're in, and the password will NOT be saved locally after all!
Please accept this as the real answer for this question, instead of the currently selected non-answer.
Answer: mRemoteNG is a life saver, but when you have to change a password over RDP the lack of copy/paste is a huge hassle of you want to use a really strong password.
For this, I use the "auto type" feature of KeePass: https://keepass.info/help/base/autotype.html
(Note that the default sequence is for auto type to enter username & password then hit enter. This isn't what you want if you're trying to change a password. In that case, change the autotype value to {PASSWORD})
Comment: This is genius! You're my today's hero ;-]
Comment: This works for me, with the caveat that the system-wide hotkey for Auto Type doesn't work when RDP is active. So I select the entry, press Ctrl+V to activate Auto Type and then *immediately* click the RDP window to have the key strokes be redirected to that.
Answer: Install and use a newer RDP client.  Windows 2008 supports NLA.  With NLA you can provide your credentials to the RDP client before the RDP session starts.  Copy and paste works fine in that case.
Or you could even just save an RDP file per host with stored credentials.
Comment: The RDP client does allow the storing of passwords, however if the remote machine locks due to inactivity you are left with a password dialog you can't paste into. You therefore have to disconnect and reconnect to the machine to use the password saved for the RDP.
Answer: In my case the underlying problem was that even though I had the correct credentials saved, it would still not log me in automatically. Updating the saved credentials would not make any difference, and it wouldn't show a message saying the credentials were wrong but just take me to the user select screen.
To solve this, I just deleted the old credentials (rather than updating them) and tried to connect again. When it prompted me for the password I entered it and told it to remember my credentials. For some reason when doing it this way its now remembering my credentials correctly again.


What is the difference between 踊り and ダンス

Question: Is there a difference between ダンス and 踊り? They are both defined as dance in the dictionary.
Answer: ダンス(dansu) is a Loanword from English. A word borrowed from English into Japanese (Anglicism, English Garaigo). Derived from the English word "Dance".
ダンス is more used to refer foreign dance styles as Waltz, Hip-Hop, Ballet.
踊り(odori) is the traditional native japanese word with same meaning. An inflexion of the word "踊る(odoru)" meaning "to dance".
踊り is more general, referring also to the traditional Japanese dance. As 盆踊り(Bon-Odori) performed on お盆祭り(O-Bon Festival)(O-Bon Matsuri).
舞踊(buyou) and 舞踏(butou) are loanwords from Chinese, with same meaning. As in 日本舞踊(nihon butou) or the George R. R. Martin book "竜との舞踏"(Dance with dragons)(ryuutono butou) title.
舞い(mai) is also used, coming from the verb "舞う(mau)" also meaning "to dance".
"踊り" is also spelled "躍り" or "踴り".
Synonyms exists in any language. It's why 'Thesaurus' exists for the English language too.
Comment: So all those 6 words meaning dance are nothing more than synonyms (except ダンス)? When I use each one? The one I like more?
Comment: @Yuuza `舞い` has a nuance to it; and other than that, yes, you use the one you like the best.
Answer: Re.日本舞踊/nihon buyou:  Perhaps because this term dates only to the late Meiji and Taisho eras, it seems to be used in confusing ways. According to https://nihonbuyou.or.jp and Sensational Knowledge: Embodying Culture Through Japanese Dance by Tomie Hahn (Wesleyan University Press, 2007), this art form is dance drama that, beginning in the Taisho period, evolved from both kabuki and popular dance techniques to become an independent form. However, others say that it can refer to any form of classical Japanese dance; still others, that it refers to kabuki dance. Currently, most people seem to subscribe to the following:
While nihon buyou translates literally as "Japanese dance," the term indicates a specific genre performed in theaters although, according to Hahn, Japanese performing arts as different as noh, bunraku, and popular arts have so influenced each other over time that defining 日本舞踊 is as difficult for scholars as the cross-pollination is appealing to viewers.
The term 舞踊 was coined by the prominent literary figure Tsubouchi Shōyō (1859-1935) in the late Meiji period as a general term for "dance," which previously had been referred to using the names of particular genres, e.g. mai (舞) and odori (踊). Combining those kanji he created 舞踊 (the on reading of 舞 is bu, that of 踊 is yō). Tsubouchi is said to have been the first person to use「日本舞踊」, in 1907. At about the same time he was proposing a major change in Japanese theater: dance drama (舞踊劇 buyo geki) that would incorporate both the traditional performing arts and new Western influences, in order to reflect the society of that moment and, perhaps, to calm vehement disagreements about whether and how much Japan should adopt Western ways.
Tsubouchi's idea inspired the Taisho-period Shin-buyo Movement, which created dance works different from the classic repertoire and included many female performers. During the Showa period, it became possible for children from ordinary homes, not just patrilineal 家, to become professional 日本舞踊 performers. In 1955 the 日本舞踊協会 was established to foster the art form.
In contrast to all-male kabuki companies, 日本舞踊 uses both male and female dancers; is practiced by professionals and amateurs; and incorporates elements of other dance forms (e.g. ballet, folk and geisha dances), modern theater, and Western music as it continues to respond to changing times. New choreography may be based on literature that is very old or contemporary, retelling themes in versions that range from slapstick comedy to gripping drama, all while retaining a recognizably Japanese aesthetic of distillation, subtlety, and refinement.
The basic movement elements are odori (踊り), mai (舞い), shigusa (仕草), and furi (振り). 踊り emphasizes energetic movements emanating from/responding to rhythm; 舞い dancing is reserved and refined to express internal emotions; 仕草 are the movements dictated by kimono; ふり is pantomime. Like other Japanese theater arts, intoned verse lyrics narrate the dance, accompanied by music which is usually played on traditional instruments. Numerous "schools" (流派) operating by the hierarchical iemoto (家元) system practice many subgenres of 日本舞踊.


How do you check to see if a sprite collides with any other object (Android AndEngine)?

Question: When the user touches the screen, a sprite is created and is able to be dragged around until the user lifts his finger. At this point, a physics body is then attached to the sprite so that it will fall to the bottom of the screen. However, when the sprite collides with another sprite/body I need it to stop being able to move. How do I check for a collision  between the sprite created and any other body/sprite (the walls and any others created)?
Comment: calculate the size and then see if it overlaps with another object's size?
Comment: I'd have to set up an array to calculate every objects position and size then, right?
Answer: You are looking for information on Collision Detection.
It's relatively simple to implement depending on your situation.
The simplest way would be to hold all your objects in an array/list and every time you move it you need to calculate its current position + area vs every other object.  This will be very inefficient, but if you have a small number of objects you are probably ok.
Here is the first collision detection tutorial I did.  It is for C, but the concepts are what you are looking for.
Answer: There is a rather simple collision detection implemented in AndEngine. See method collidesWith(IShape pOtherShape) Someone improved it so that it works with transparent areas, search for pixel perfect collision detection.
You can also make use of the physics engine, see sensor.
Comment: The problem with this is that collidesWith() detects a rectangle.
Answer: Although calculating the area would have worked, I was dealing with so many collisions that I needed a better way. It took quite a bit of time, but I finally figured out how to use a ContactListener (which was really what I was getting after. Why do these kinds of questions always get down voted when all someone really has to do is explain a bit to a novice???) Anyway, for reference to anyone else that might see this question, in your ContactListener, you can use code like this:
public void beginContact(Contact contact) {
            if(fillerNum>-1 && contact.getFixtureA().getBody().getUserData()!=null && contact.getFixtureB().getBody().getUserData()!=null){
                String x1 = (String) contact.getFixtureA().getBody().getUserData();
                String x2 = (String) contact.getFixtureB().getBody().getUserData();
                if((x1.equals("fill")&&!x2.equals("dest"))||(x2.equals("fill"))&&!x1.equals("dest")){ //If a filler hits a stationary
                    //Log.e("Contact",x1 + " " + x2);
                    createStationaryFiller();
                }
                if((x1.equals("dest")&&x2.equals("fill"))||(x1.equals("fill")&&x2.equals("dest"))){ //If a destroyer hits a filler
                    destroyFiller();
                }
            }
        }

Set growing bodies to have the user data "fill" and stationary ones to have the user data "stat". I also had some other bodies with the user data "dest". This way, you can see which two collides and react accordingly. Message me if you don't understand. I have no problem helping people new to this kind of thing.


Interpolating 2D data with missing values

Question: I have a list (21 x 21) containing values. I want to eliminate slots containing zeros by interpolating the nearest values and overwriting the zeros. How do I use the Mathematica's ListInterpolation function to do that?
Comment: You should post your code.
Comment: Related question: http://mathematica.stackexchange.com/questions/4776/improved-interpolation-of-mostly-structured-3d-data
Comment: And ... what have you tried?
Comment: @belisarius I tried using ListInterpolation, using the list as parameter, but doesn't work.. comes up with error
Comment: @belisarius ListInterpolation allows me to input an array of values from which it interpolates the data. But is there a way of interpolating the data based on the nearest values? the top, bottom, side values? Thank you
Answer: You have to use Interpolation because there it is possible to give values which do not lie on a structured grid. Let's create some test data which has zeroes in it
data = Table[ Sin[x] + Cos[y], {x, 0, Pi/2, Pi/2/29.}, {y, 0, Pi/2, Pi/2/29.}]*
   RandomInteger[{0, 1}, {30, 30}];
ListPlot3D[data]

Now you attach the position of every value to it so you get tuples of the form {{x,y},value} and Select only those, where value is not zero. This can then be interpolated
data2 = Select[Flatten[MapIndexed[{#2, #1} &, data, {2}], 1],
   Last[#] != 0 &];
ip = Interpolation[data2];
Plot3D[ip[y, x], {x, 1, 30}, {y, 1, 30}]

Note, that with such data you always have an InterpolationOrder of 1.
Update regarding your comment
Yes, this is indeed a problem and you have to decide what to do. First you have to understand the issue. Let's assume the following grid with values, where all white cells are zero and have to be interpolated

When you look at cell {3,1}, you see that such a situation is not a problem, because the value can be interpolated since it is place in between the cells {1,2} and {1,4}.
On the other hand, the cell {5,5} is a problem, because no surrounding cells with values are left which can be used for interpolation.
Therefore, what you have to ensure is, that you have values on all 4 corners of your matrix. When they got selected out because they were zero, then you have to fill them with values. When they are indeed zero, and got kicked out accidentally, then you have to fill them back in.
You can ignore the corners when you Select non-zero values by changing the condition in the end
{ny, nx} = Dimensions[data];
data2 = Select[Flatten[MapIndexed[{N@#2, #1} &, data, {2}], 1],
   Last[#] != 0 &&
   (First[#] =!= {1, 1} || First[#] =!= {1, nx} ||
    First[#] =!= {ny, 1} || First[#] =!= {ny, nx}) &];

Comment: @Mun See my update in the post.
Comment: thanks for the answer. I have one slight issue. When I remove the zeros and interpolate, I get some errors; More precisely: if for example the position {1,1} had a zero, I get an error message saying "{1,1} cannot be interpolated, so extrapolation is used" And I get a fairly higher value than the surroundings. Also after a few of these errors, it says "Interpolation output suppressed". Any idea how to fix that?
Comment: that's a very good remark. Thanks for that. I'll have a look at it
Comment: When I use the method above to do interpolation, I get errors: Unstructured grid interpolation order reduced to 1 and coerced to machine precision. In version 9, it seems to do it but when running the code in version 7, I get an error message and stops. Can you please help me in finding out how to interpolate unstructured data properly?


Split a large mailing list into 2

Question: I see the "Split Group" extension isn't available anymore.  I have a group that I am mailing to that has 74,000 emails.  My team would like to split this into 2 mailing lists due to how long it takes us to send this many emails.  Any ideas?
Answer: Simplest is just to do an A/B test, set both to 50% of the total and then pause the second one and restart it whenever you want.
If you really need to split the group, I use SearchKit to create two smart groups, both with members of whatever group you want the email to go to, then also one with Email (Primary) matches pattern something like <code>^[AC457JMSOWZL]</code> and the other doesn't match pattern with the same pattern. This is a regular expression that matches any email that starts with one of those characters, so you can adjust the exact pattern to get closer to half, but that's fairly close on our list.
Bit awkward, but it works. Using the email to split the list should avoid double-emailing issues if you have two contacts who share an email, so they won't end up in different groups. You can also exclude the first mailing recipients from the second one, just as a belt and braces approach to make sure you aren't emailing anyone twice.
If it's just the time of day when these are delivered that's the issue, you can also send the mailing and just pause it and restart the next day or whatever you want to do.

Split a large mailing list into 2


I would like to automate the reading of PDF documents into R using pdf_text

Question: I currently have a code to extract certain details within a PDF document. However, as i have thousands of other PDF documents to extract information from, I would like to automate this process. I am using the pdf_text option to read PDFs into R. My code looks something like this:
library(pdftools)

x <- pdf_text("Test.pdf")
y1 <- str_split(x, "\r")

#pdf output contains a total of 7 lists

a <- y1 [[4]]
b <- c(a[4],a[11:13]) #Obtain only rows 4, 11 to 13 from list 4

n2 <- y1[[3]]
n3 <- c(n2[3]) #Obtain only rows 3 from list 3

n <- y1[[5]]
n1 <- c(n[3]) #Obtain only rows 3 from list 5

c <- y1[[6]]
d <- c(c[4:18]) #Obtain only rows 4 to 18 from list 6

e <- c(n3,b,d,n1) #Combining all necessary information into one list

z <- substr(s[1:21], start = 15, stop = 200) #to remove white spaces between quotes

Name <- z[1]
InterestedParty <- z[2]
TotalOwnBefore <- substr(z[11], start = 97, stop = 120)
Ownership <- list(NM = Name, Party = InterestedParty, OwnBefore = TotalOwnBefore)

write.csv(Ownership, file="MyData.csv")

The above code allows me to output a file for a single company. However, I have thousands other PDFs ("Test_1.pdf" to "Test_1000.pdf") to be read. Is there a way to automate the reading of the PDF files into R with pdf_text? Would also be great if there's a way for me to store all results into a single file instead of one firm per file.
Answer: I have since managed to automate the process using a for loop as follows:
for (i in 1:1000){
    x <- paste("Test_",i,".pdf", sep="")
    y <- pdf_text(print(x))
    total <- strsplit(y, "\r")
    print(y1)
}


Is it possible to build electrical space engine based on Electromagnetic induction

Question: Electromagnetic induction means magnet convert it momentum to an electrical current.  So I wonder if it possible to use this phenomeno for making an enigne which will accelerate a magnet And  the magnet will push the spacecraft but some sort of coil will slow doen  the magnet on when it getting back so it won't push the aircraft back
Comment: See this book: Kaku, Michio. *Physics of the Impossible*: A scientific exploration into the world of phasers, force fields, teleportation, and time travel. Anchor Books, NY. 2008. There is a discussion of similar magnetic craft (Part I, Sec. 9) "starships"; which uses harvested primordial magnetic monopoles to power a craft via galactic fields. Interesting and fun read!
Answer: Assuming radiation losses are negligible this will not provide any net propulsion. The momentum gained by pushing the magnet will be lost by stopping the magnet. And the distance moved will be reversed by recovering the magnet.
Comment: I dont see why momentum being converted to electricity
Comment: The idea is that the magnet will move in circle and then will slow down in one side also this loses will happend due radiation between the coild and the magnet
Comment: @daniel the reason why is that momentum is conserved.


Why is the flag of Prague yellow and red?

Question:
Wikipedia's flag for Prague shows red and yellow. I think that the red comes from flag of Bohemia and yellow from flag of Habsburgs, but that is just a hypothesis.
Comment: [This link](http://[http://www.praguetourist.com/tinfo/index.php?id_s=1&id_k=2&jazyk=aj) says that "the combination of red and yellow colours is derived from the coat of arms."
Comment: You could probably include a picture in your question to make sure everyone knows which one you are talking about.
Comment: @taninamdar I would believe it if [they were reversed](https://en.wikipedia.org/wiki/Coat_of_arms_of_Prague#/media/File:Praha_CoA_CZ_small.svg), but as they are, it's not an explanation.
Comment: [Might this page](http://www.loeser.us/flags/czech_note1.html) help?
Answer: I would like to try answer this question. According to this article which is unfrotunately only in Czech:
From the main colors of the emblem, the colors of the Prague battalion were derived in the 19th century. In the following years only the accompanying pieces of the emblem change, the shield itself has remained unchanged up to the present.
The reason why it was chosen by Prague's mayor in 1991 is because the red and yellow flag can be use for free, without of permission from the Prague town hall.
The historical flag is much more interesting. The appearance come out from attributes from 14th century. There are three turrets with gate and wall. The colour of the turrets was silver but for the help Frederick the third it was changed to gold. Only the battlements stay silver.
The hand with sword was add by Ferdinand II as acknowledgement for Prague to successful defence against the Swedish army in Thirty Year War.
So this possibly can answer this question. The colors is really common in Bohemia country attributes.
Comment: I tried made an extensive pass over the English, but frankly I don't really understand. Can you perhaps elaborate a bit on how/why the current flag was chosen, or add some more relevant sections from that article if you don't mind translating them?
Comment: I tried  just  say that the colors represents most common colors of the historical attribut of Prague. The main reason for that was just make flag which can be used without permit of city hall.
Comment: But i dont know how to differentiate the citation... Nevertheless is it enought? I really want to make it clear buddy.
Answer: It seems somewhat coincidental. According to this page about Prague flags:

Historic City of Prague Flags
In 1784, the Austrian Emperor Josef II by Imperial decree incorporated
  the four separate towns of Prague ( Old Town, New Town, Lesser Town
  and Hradschin-Castle ) into one city ruled by a single Magistrate. The
  Magistrate offices were located in the Old Town hall and the arms and
  flag of Old Town became those of a new capital. The Old Town flag then
  consisted of two horizontal stripes, black and yellow, which were the
  colors of the municipal arms in 1622. Unfortunately, they were
  identical with colors of the Habsburg dynasty which made the Prague
  "landesfarben" not very popular among Czech citizens.
In 1886, the Municipal Council asked the painter B. Wachsmann to paint
  new municipal arms, colors and seals for Prague, which he did making
  the new colors of Prague yellow and red. Since that time, a
  horizontally divided flag of yellow and red has been considered the
  official municipal flag of Prague. The new flags in those colors
  became symbols of Prague and were first used extensively for the
  Jubilee Exhibition of 1891.
This flag is sometimes confused with the traditional flag of Moravia.
  The colors used on the flags are simply "coincidental" and based on
  the heraldic rules used when making flags from the colors of
  coat-of-arms. Other than the colors, they are not related.
The City of Prague is actually made up of almost 100 small towns that
  were absorbed as the city grew. Today, the towns have become
  districts, each with their own unique flag.

I take it that by "based on the heraldic rules used when making flags from the colors of coat-of-arms" the page's author means the heraldry rule whereby you're supposed to interlace colors (that is, green, red, blue, etc.) with metal (gold or silver) so that colors only touch metal and vice versa. If memory serves, black and white could be used as either color or metal.
There's a bunch more historical flags on this other page from the same site, which notes in passing on the 1477 old town flag's entry that:

In 1477, the Bohemian King Vladislaus II divided the flag of Old Town into three stripes of red, yellow, and white replacing the older black and yellow of the Hapsburgs.

Put another way, and as you'll see viewing the flag pictures, the gold/red theme in the flag has been around since the middle pages and doesn't seem to be tied to the Habsburgs outside of not wanting to use the latter's black/gold theme. And the current pick of flag in 1886 appears to be a simple matter of an artist applying heraldry best practices.
There might be more/better sources in Czech that go into the precise meaning of the gold/red pick, why this design in particular, etc. Be wary if look outside of Prague for explanations if you research this deeper, because one locality's explanation for a pick of color and design often is different from another's.
Comment: Its actually pretty same as mine but ok. Its larger and gather more informations.
Comment: @L.Dodo: yeah, it was a bit too long to post as a comment, and it seemed like a good idea to throw in an answer with an English source. :-)


How to Enable Einstein Case Classification in developer org

Question: Could anyone please help me in order to let me know how could I enable Einstein Case Classification in my developer org. I read a lot of documents, Salesforce help page, Release notes but didn't get an appropriate path. Do I need to contact Salesforce support team for this?
Answer: On a DEV SandBox in order to be able to do this, you can follow the steps below

Be sure you are using Lightning
On Settings > Company information match production licenses
Activate ECC here, Feature Settings > SETUP > SERVICE CLOUD EINSTEIN > Einstein Case Classification
Comment: That would be applicable for a sandbox. The post suggests that they are using a Developer Edition, although it's not entirely clear.


Permission issue with PHP on Windows share

Question: Here's my setup. I've got a linux box running Apache and PHP. I have a folder mounted on my linux box that points to a directory on my windows server where my HTML files are stored. My virtualhosts file points to the mounted folder, so Apache is getting the files from the Windows share.
I'm having some issues with fopen. When I run this:
<?php

    echo 'cwd is: ', getcwd(), "
\n";
    echo 'target should be: ', getcwd(), "/data.txt
\n";
    echo 'file already exists: ', file_exists('data.txt') ? 'yes':'no', "
\n";

    $file = fopen("data.txt", "a");
    if ( !$file ) {
      die('fopen failed');
    }
    $c = fwrite($file, "\n$name,$lastname,$email");
    fclose($file);
    echo $c, ' bytes written';
?>

I get the following back:

cwd is: /home/brian/website/googlecalendar/html
  target should be: /home/brian/website/googlecalendar/html/data.txt
  file already exists: no
  Warning: fopen(data.txt): failed to open stream: Permission denied in /home/brian/website/googlecalendar/html/testfopen.php on line 7 fopen failed

On Windows, I've checked the permissions on the "html" folder, and everything is set to allow everyone to write. I'm not sure what else I need to change. It should work, right?
Comment: i have the same issue here :/ did you manage to fix it?
Answer: Hi
Try,Change the sub directory and files to be in the group "www"
Comment: assuming his apache user is "www"
Comment: I created a new user on my Windows server called "www-data" (since that's the apache user) and gave it all permissions on that folder, but still no luck.


What do the curly brackets in equivalence relations signify?

Question: Consider the set of words {one, two, three, four, five, six, seven, eight, nine, ten}. I want to write the associated partitions of this set under the relation R where two words are equivalent if they have the same number of letters. It's obvious one, two, six, and ten are all equivalent but I'm not exactly how to write the partitions with the curly brackets... Would it be {{one, two, six, ten}, {four, five, nine}, {three, seven, eight}}? Or would I write these partitions separately like {{one},{two},{six},{ten}}, {{four},{five},{nine}}, and {{three},{seven},{eight}}? What do the curly brackets actually say and what's the difference between the two ways I just wrote them?
Comment: The curly braces define a set. The first way you wrote it is closest to correct. You have broken your original set into three partitions. Each one of those is a set and the union of all three of the sets equals the original set. Therefore, your first partition would be $\{\text{one}, \text{two}, \text{six}\, \text{ten}\}$.
Comment: @JohnDouma So what is the second way I wrote it saying? From what you said I would guess it means {one}, {two}, {six}, and {ten} are each their own equivalence classes. But what does it mean when I group them into curly brackets like this: {{one},{two},{six},{ten}}?
Comment: The last thing you wrote is a set of four one element sets.
Comment: A partition of any set $S$ is just a collection of subsets of $S$ such that the union of the collection is equal to $S$ and none of the individual subsets in the collection intersect. There is no special notation needed for this.
Comment: @JohnDouma Ah, okay. I think that kind of makes sense. So when I wrote "{{one},{two},{six},{ten}}, {{four},{five},{nine}}, and {{three},{seven},{eight}}", would this imply that these are three different ways to partition the set? But basically all three partitions are equivalent because the elements inside would be the equivalent classes under the same relation R? Obviously this is wrong but is this what it would be saying?
Answer: Curly brackets are used to specify sets. For example, the set of days in a week is {Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday}.
The partitions of a set under an equivalence relation are called the equivalence classes of the relation. These equivalence classes form a partition of the set. And the partitions too are sets. So if you have to write the set of the partitions, you would write them as your first notation. Your second notation doesn't make any sense in regard to equivalence classes.


Is there any case you can't switch Could with 'Was able to'?

Question: For the simple past (and also positive) Could, would there possibly be any sentence that you just can't simply replace Could with Was able to or Managed to?
Comment: @dolco No, jmoreno means that you can't replace "could" with "able to" because A) it's too many syllables, and B) it doesn't rhyme with "wood".  So it would mess up the silly little poem, *How much wood would a woodchuck be able to chuck if a woodchuck was able to chuck wood*   :-)
Comment: How much wood could a woodchucker chuck if a woodchuck could chuck wood?
Comment: @jmoreno I guess that's the conditional Could rather than simple past.
Answer: In general terms, such a switch should be okay. But here are two caveats:

It's not always easy to tell if what you have on your hands is a simple past without sufficient context, and as you know, you would completely change the meaning if you replaced the wrong kind of "could".
The precise meaning of "can/could" does not have perfect overlap with the notion of possibility. Sometimes it expresses permission.

— When you worked at Acme, were you given frequent smoke breaks?
— Yeah. I could step outside and have a smoke whenever I wanted.

If you replace this "could" with "was able to", you get a slightly different meaning than if you replace it with "was allowed to". Of course, there is overlap (you're able because you're allowed), but it depends on how nuanced you want your meaning to be. No doubt there are other cases where the difference betwen possibility and permission is starker.
Comment: Thank you for the answer :) I have one more question though. How would it sound to natives' ears if I rewrite "I did all I could" into "I did all I was able to"?
Comment: @dolco Good question. I answered this in terms of meaning and grammar, but not style. "Was able to" will usually not sound as nice — longer, harder to say — but sometimes it's good to avoid ambiguity with the hypothetical "could". For your specific example, I recommend sticking with "could". No one would think it was wrong, but "all I could" is so common it's almost a fixed expression. Here's an [Ngram so you can compare](https://books.google.com/ngrams/graph?content=all+I+could%2Call+I+was+able+to&case_insensitive=on&year_start=1800&year_end=2000&corpus=15&smoothing=3).


Why not "Big yet small"?

Question: I'm confused that people use "big and yet small" rather than "big yet small." The reason I find this confusing is that but, which kind of resembles yet, is used differently--"big but small." Why can't I just say "big yet small?"
Comment: Nothing is stopping you.  But "big and yet small" probably conveys more of the intent of the superficially oxymoronic phrase.
Comment: I'm confused about your confusion. Clearly you understand it, [and] yet you say it confuses you.
Answer: There is no harm in saying 'big yet small' but bear in mind that one is trying to emphasize the oxymoron, and this purpose is better served by using slightly more colourful and detailed differentiation between the 'big' nature and the 'small' nature of the object/subject in question.
For example, 'big and yet somewhat small' sounds more dynamic and compelling than 'big yet small', despite the latter being shorter and grammatically correct.

Why not "Big yet small"?


What could artificially increase the bounce rate reported in Google Analytics?

Question: Since deploying Janrain Engage to our website, which includes a javascript snippet that is loaded from their servers, I've noticed about 10-15% increase in our bounce rate. I think this is artificial and does not represent a true 'bounce'; what sort of factors might have caused this?
Answer: This will ultimately be an issue for your script provider to debug, (would recommend you contact them directly) unless you have implemented any customizations to their scripts or the Google Analytics tracking code.
Look for:

Scripting errors which prevent the analysis of cookies after they are set
Variables in the Janrain script which conflict with Google Analytics variables (particularly variables named utm or _gaq)
Extensive use of cookies for storage which may overflow the allowed cookie size (and flush out the cookies set by Google Analytics)
Answer: You're looking at the overall bounce rate, but you should drill down to see if there are any specific pages that are showing an increase in bounce rate.

Set up 2 comparison date spans - 1 from before the JS deployment and 1 after.
Go to Top Landing Pages and compare the bounce rates
Is one page showing a significant increase (above 15%) which is raising the average? If so, this is the troublesome page.
If not, and the increase is evenly spread across all pages, you'll have to do some more digging.


Marriage between Shifcha and Kohanim

Question: I know Kohanim have certain restrictions on whom they may marry. My question is, are Kohanim restricted onto a Shifcha?
Comment: Shifcha kenaanit?
Comment: https://judaism.stackexchange.com/a/22496/759
Comment: @JoelK I quite puzzled what else would it be?
Answer: Rambam Hilchot Issurei Biah 12:11:

הָעֲבָדִים שֶׁהִטְבִּילוּ אוֹתָם לְשֵׁם עַבְדוּת וְקִבְּלוּ עֲלֵיהֶם מִצְוֹת שֶׁהָעֲבָדִים חַיָּבִים בָּהֶם יָצְאוּ מִכְּלַל הָעַכּוּ''ם וְלִכְלַל יִשְׂרָאֵל לֹא בָּאוּ. לְפִיכָךְ הַשִּׁפְחָה אֲסוּרָה לְבֶן חוֹרִין.
Servants that have been immersed for the sake of servitude and accepted the mitzvot in which servants are obligated, have departed from the category of gentiles, but have yet to enter the category of Jews. For this reason, a maidservant is forbidden to a free Jew.
(Touger translation)

So not only kohanim, but any free Jew (i.e. one who is not an eved ivri) is forbidden from marrying a shifcha kena'anit.
As is clear from 18:1-3, a kohen would additionally transgress the prohibition against him marrying a zonah; a shifcha retains this status even after being freed, at which point she would be permitted to a non-kohen.
Comment: Does a kohein violate zonah before she is freed? Hmm I guess she was a zonah first, then shifcha is issur mosif because of non-kohanim.
Answer: A convert or a freed Canaanite maidservant are Zonot in all cases because they didn't start out Jewish.
The source for this is found https://judaism.stackexchange.com/a/22496/22145

Marriage between Shifcha and Kohanim


Can an enzyme be activated without allosteric inhibition or activation?

Question: Are there ways by which an enzyme may be activated or inhibited by non substrate molecules other than allosteric activation or inhibition?
Answer: Apart from what Phototroph mentioned in their answer (competitive and non-competitive inhibition), an enzyme can be activated/inhibited via covalent modification of the protein (post-translational modification) such as phosphorylation by protein kinases (phosphorylation is the most common modification).
Answer: Yes, competitive inhibition is another form of enzyme inhibition. The inhibitor binds to the active site here, as opposed to allosteric inhibition, where it binds to a secondary site. An example of an inhibitor would be the cyanide ion (CN-), which inhibits Cytochrome C oxidase, preventing electron chain transport and thus ATP production. Note this ion is different from the substrate, oxygen.


Connecting label and point with line/arrow using QGIS

Question: Is it possible in QGIS to connect labels and points with a line/arrow or something?
In my map it is not clear which label goes with its point. I can't bring it closer because there are many more points to come.
Answer:
First, create labeling fields for X and Y position of your labels in your point table.
Activate the X and Y positionning in the properties of your layer.

Create a new "Generator expression" style in your point style, set it to line type, then use the following formulae :
make_line(make_point($x,$y),make_point( "LABEL_X" , "LABEL_Y" ))

As an enhancement, you can use various fields (or use a plugin to create them all) to control where the align point will be. You could have the use of a rotation field and a vertical and horizontal alignement field.

The line will move accordingly to your label position, as its arrival point is related to the label positon field.
Answer: You could try downloading and installing the EasyCustomLabeling plugin from Plugins > Manage and Install Plugins, this creates a duplicated memory layer of your selected vector layer and contains the same attributes.
(Note that you will also need to download and install the Memory Layer Saver plugin to save the memory layer correctly, this is described in the plugin description).
Once your label layer is created, you can play with the label placement and style of that layer to try and get what you're looking for:
Answer: Concerning the method by gisinside: the first step of manually adding x/y attributes for labels  can be omitted; (maybe since QGIS3?) there's an auxiliary variable for label-positionings already present. The variables ar called accordingly: "auxiliary_storage_labeling_positionx" and "auxiliary_storage_labeling_positiony".
So in Step Nr. 2 you can use this expression to draw lines:
make_line(make_point($x,$y),make_point( "auxiliary_storage_labeling_positionx" , "auxiliary_storage_labeling_positiony"))
Note however, that the auxiliary variables only get a value assigned, if you touch/move the labels with the move-label-tool. Therefore, you only see lines for labels that have been manually moved around.
Answer: If you are using PostGIS for your spatial data, this post https://sigsemgrilhetas.wordpress.com/2015/01/12/etiquetas-com-guias-em-qgis-e-postgis-labels-leading-lines-with-qgis-and-postgis/ by Alexandre Neto explains how leading lines can be added to the points in your database.
Its a well written tutorial worth reading, it also has a movie in the post that shows how it works.


Voltage on analog pin arduino when arduino turned off

Question: So can I put a voltage from 0v to 5v on an analog Arduino pin before actually turning the Arduino on? And still read the analog pin correctly when turned on?
Comment: internal logic can be also configured as high impedance (High Z) - did you consider that?
Answer: All the GPIO pins have protection diodes in them. The are arranged, effectively, like this:

simulate this circuit – Schematic created using CircuitLab
The internals of the ATMega chip can be visualised for this purpose as a small resistor:

simulate this circuit
If you apply a voltage to the input without anything applied to Vcc you effectively connect the input to ground through the diode and the internals:

simulate this circuit
That means that too much current flows through the diode and potentially breaks it. And that's the least of your worries. The rest of the circuitry in the chip is subject to the same rules - any voltages that can flow back up to the Vcc rail the wrong way through parts of the circuitry in order to get down to ground risk breaking things.
It's almost as bad as connecting the power to the chip backwards. In effect your GPIO pin is acting as Vcc and powering the chip - badly.
Comment: If you add a large value resistor between the analog pin an the analog voltage source, not enough current can flow to cause damage. You have to be careful that the resistor doesn't influence the reading. Another option is to have a lower value resistor, but add an external clamping diode that can handle a lot more current.
Comment: The resistor increases the output impedance of whatever you are reading the value from - and yes, if too high it can affect the accuracy of your reading. It does provide some protection though. A better diode will protect the internal diode, but it won't stop the problem of back-powering through the internal logic. The proper solution is to use a MOSFET to isolate the input when there is no power applied.
Comment: An example and explanation can be found here: http://electronics.stackexchange.com/questions/134157/jtag-circuit-to-prevent-back-powering
Answer:
So can I put a voltage from 0v to 5v on an analog Arduino pin before actually turning the Arduino on? And still read the analog pin correctly when turned on?

yes and yes.
Comment: Every AVR datasheet I've read gives the absolute maximum input voltage to a pin as something like Vcc + 0.5V - which in this case would be 0.5V.


Setting up Access Point using Wifi adapter in linux

Question: My router broke so I am trying to setup something temporarily to share internet connection from my main pc (internet comes from modem connected directly to ethernet card) to other devices via an ad hoc network, for that I have a wifi adapter that uses the zd1211rw driver (i also have the alfa rtl8187 but that adapter is not working at all on ubuntu 12.04).
The problem that I am having is that I can't connect to the wifi AP I create, it just stays "acquiring network address" and never finish connecting.
My main computer OS is Ubuntu 12.04, this is what I am doing. First I put the wifi adapter on monitor mode with:
airmon-ng start wlan2

This creates a mon0 interface, then I use:
airbase-ng -e MyNetName -c 11 -v mon0

From here I can already see the MyNetName network using my laptop (with windows), but if I try to connect it stays at "acquiring network address". The tutorials I followed continue with these commands:
ifconfig at0 up
ifconfig at0 192.168.1.254 netmask 255.255.255.0
route add -net 192.168.1.0 netmask 255.255.255.0 gw 192.168.1.254

iptables --flush
iptables --table nat --flush
iptables --delete-chain
iptables --table nat --delete-chain
iptables -P FORWARD ACCEPT
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
echo > '/var/lib/dhcp/dhcpd.leases'

Then I start the dhcp server with
dhcpd -d -f -cf /etc/dhcp/dhcpd.conf at0

The dhcpd.conf file looks like this:
ddns-update-style interim; <- also tried ad-hoc instead of interim
default-lease-time 600;
max-lease-time 7200;
authoritative;
subnet 192.168.1.0 netmask 255.255.255.0 {
  option subnet-mask 255.255.255.0;
  option broadcast-address 220.127.116.11;
  option routers 192.168.1.254;
  option domain-name-servers 18.104.22.168;
  range 192.168.1.1 192.168.1.253;
}

The output looks like:
Internet Systems Consortium DHCP Server 4.1-ESV-R4
Copyright 2004-2011 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/
Not searching LDAP since ldap-server, ldap-port and ldap-base-dn were not specified in the config file
Wrote 0 leases to leases file.
Listening on LPF/at0/00:02:72:69:28:c8/192.168.2.128/25
Sending on   LPF/at0/00:02:72:69:28:c8/192.168.2.128/25
Sending on   Socket/fallback/fallback-net
Can't create PID file /var/run/dhcpd.pid: Permission denied.

The last command:
echo "1" > /proc/sys/net/ipv4/ip_forward

The airbase-ng command output looks like this:
11:34:03  Created tap interface at0
11:34:03  Trying to set MTU on at0 to 1500
11:34:03  Trying to set MTU on mon0 to 1800
11:34:03  Access Point with BSSID 00:02:72:69:28:C8 started.
11:34:10  Client 70:F3:95:B3:27:76 associated (unencrypted) to ESSID: "MyNetName"
11:34:13  Client 70:F3:95:B3:27:76 reassociated (unencrypted) to ESSID: "MyNetName"
11:34:17  Client 70:F3:95:B3:27:76 reassociated (unencrypted) to ESSID: "MyNetName"
11:34:21  Client 70:F3:95:B3:27:76 reassociated (unencrypted) to ESSID: "MyNetName"

So my problem is that I cannot get an internal ip on the laptop that is trying to connect, the windows wifi manager thing just stays at "acquiring network address", airbase reacts by showing more of those reassociated messages while the laptop tries to connect. Another problem is that after running iptables --flush the internet in the main PC stops working, but I want to deal with that once I am able to fully connect to MyNetName.
Does anyone have an idea what am I doing wrong?
Comment: You router had a DHCP server that would provide your laptop with a dynamic IP address.  Easiest thing to do is assign the laptop a static IP address.
Answer: I've never seen this setup using airbase-ng... maybe you could try out hostapd to solve the constant reassociation issue.
Also, this route doesn't make much sense:
route add -net 192.168.1.0 netmask 255.255.255.0 gw 192.168.1.254

Try without it.
Finally, you could try installing tcpdump and monitoring network traffic on at0 while client is supossedly trying to acquire dhcp. Maybe the dhcp request isn't even getting through.
Answer: You could try using isc-dhcp-server. I've currently got a very similar setup to you with that being the only difference.
Install it -> change /etc/default/isc-dhcp-server to serve on at0 interface -> start it using

service isc-dhcp-server start

This will still use your dhcpd.conf file.
Answer: use this command:
sudo dhcpd -d -f -cf /etc/dhcp/dhcpd.conf at0
and then:
sudo /etc/init.d/isc-dhcp-server start