Cross compiling a kernel module: how to set configs right

Question: I'm trying to cross-compile an external module for the Beaglebone (Linux, ARM).To avoid kernel version issues I grabbed a kernel tarball and cross-compiled for ARM with the CodeSourcery toolchain on the host machine (x86). Then I cross-compiled an external hello-world module with the exact same toolchain against the exact same kernel sources. I used this simple makefile:
<code>obj-m += hello-1.o

all:
   make -C /home/***/****/linux-3.2.0-beaglebone-20120411.00
M=$(PWD) modules

clean:
    make -C /home/***/****/linux-3.2.0-beaglebone-20120411.00 M=$(PWD) clean
</code>
When I copy the ko-file over to target and try to insmod it I get: "insmod: error inserting 'hello-1.ko': -1 Invalid module format" which (from what I learned in this group and elsewhere) usually stems from conflicting kernel versions, and indeed uname -a on the target gives:

Linux beaglebone 3.2.18 #1 Wed May 30 14:21:54 CEST 2012 armv7l GNU/Linux

while modinfo hello-1.ko gives:

srcversion:     140276773A3090F6F33891F
  depends:
  vermagic:       3.2.0+ mod_unload modversions ARMv5 p2v8

So version 3.2.18 vs. 3.2.0+ (why the +?) and armv7l vs. ARMv5!
Does anyone know why I get different versions albeit I compiled against the same kernel-sources (maybe some configs)?
Any suggestions are appreciated!
best,
Chris
Answer: answer is, you should run 'the kernel you compiled on beagle board.
'+' means that you modified your source tree.
And finally make sure that you're using correct defconfig. 'make beagle_defconfig' should work.


Cloudera CDH4 installation

Question: I see the below step in CDH4 MRV1 installation instructions at:
http://www.cloudera.com/content/cloudera-content/cloudera-docs/CDH4/4.2.0/CDH4-Quick-Start/cdh4qs_topic_3_2.html
Step 4: Create the MapReduce system directories:
sudo -u hdfs hadoop fs -mkdir -p /var/lib/hadoop-hdfs/cache/mapred/mapred/staging
sudo -u hdfs hadoop fs -chmod 1777 /var/lib/hadoop-hdfs/cache/mapred/mapred/staging
sudo -u hdfs hadoop fs -chown -R mapred /var/lib/hadoop-hdfs/cache/mapred
But I am not able to figure out where this directories are used. Are these well known locations or these directory paths are configured in some config files. If so can I use any structure I want?
Answer: These directories will be used by MapReduce. They match the value specified in the default configuration. I would not change them unless you have a good reason. But in the end, sure, you can configure a different location once you're up and running.

Cloudera CDH4 installation


Using  PI with cross domain XMLHttpRequest

Question: I'm making a cross domain request in an html file for an xml file using XMLHttpRequest.
I want to use the PI <?access-control allow="requestingdomain.com"?>
as outlined here
http://www.w3.org/TR/2005/NOTE-access-control-20050613/
in the requested xml file, rather than getting into setting headers.
However it seems to have no effect, I still can not retrieve the xml document(using firefox 3.6.15 at least).
Is this not implemented, and there's no getting around having to set Access-Control-Allow-Origin headers etc?  Or am I missing something.
thank you
Answer: here the right code
<?php header('Access-Control-Allow-Origin: http://requestingdomain.com'); ?>

more details https://developer.mozilla.org/En/Server-Side_Access_Control


Create a customized connector line using VISIO 2013

Question: I'm working with Visio 2013 Professional on Microsoft Windows 7, it is my first time using Visio and I need to create a customized connector with automatic arrows in the corners of the line, to indicate the flow, something like the picture attached and I also need to change the flow direction sometimes.
Do you know if it is possible to do it using the developer area, or another trick?
I've checked the default arrow styles and it creates an automatic arrow just in the end of the connection. For now every time I bend a connection I need to insert a triangle manually to indicate the flow.
Answer: IMHO It is impossible because connectors behavior are managed by Visio engine ! Connectors can re-routed and so on


Why does my buffer take up the entire screen?

Question: I am using QGIS. I am aware there is a similar question here but the solution (changing the layer CRS) is not working for me. I cannot change my CRS as I am using information for the entire Asia-Pacific region. Is there another option to create a 1000 km buffer zone from all volcanoes in the region? It is currently projected as geographic coordinates, the default WGS:84.
Comment: What GIS are you using and which solutions have you tried? Are you working with point data? Please edit your question with this information so that we can assist you.
Comment: Is your data in a geographic or projected coordinate system? Also, what is the name of the coordinate system of your data?
Answer: The issue is that WGS 84 is a geographic coordinate system vs. a projected coordinate system. When you are telling QGIS that you want a 1000 km buffer, it is interpreting it as a 1000 degree buffer (an impossibly large amount). This is why it is covering your entire screen. To solve your problem you need to project your data into a projected coordinate system, then do your buffer. (See this link for further information.)
Regarding which projection you should use, since you are doing distance buffering, a hemisphere-wide projection that preserves distance would be most appropriate. An azimuthal distance projection seems like it would work for you.
Comment: I am sure there are continental ones, ie Lambert Conformal Conic and the like
Comment: I understand that, but the projected coordinate systems appear to only be by state or country not regional, which is where I am having problems..
Comment: @lis I have edited my answer to address your issue.


Photon Escape Angle From Black Hole

Question: Consider a photon source emitting photons near the surface of a Schwarzschild black hole.
What angle, as a function of the source's radius from the event horizon, must the photons be emitted at such that they can escape to an observer at infinity?
Comment: when you say the source's radius, are you asking at what angle a photon can be emitted and still escape as a function of distance from the event horizon?
Comment: Yes, with the angle being measured from outward radial direction.
Comment: Comment to the question (v4): The tag [tag:escape-velocity] is usually only for _massive_ particles.
Comment: This is one of the more interesting and challenging homework like question, so I think it should not get closed even though there are some closevotes.
Comment: @Dilaton Agreed, though the OP should show what they've tried and where they are getting stuck.
Comment: @MichaelBrown yeah, that right. However, I think it would be fairer to the OP to make him aware of this in a comment and give him some time to address it, before close voting.
Comment: @Dilaton I agree completely. I'm not one of the close votes.
Comment: @MichaelBrown I know, you are one of the good guys ;-). I am just leaving corresponding comments for other close queue reviewers and mods below question I disagree with to have close votes at all ...
Answer: At the Schwarzschild radius, a photon must be emitted exactly normal to the surface in order to escape. As you travel outwards, the angle of emission decreases such that just above 1.5 times the Schwarzschild radius (i.e. the Photon Sphere) the photon can be emitted parallel to the tangent of the horizon and still escape.
According to this source (which is also a good source for all fun things regarding Schwarzschild black holes), there is a critical emission angle for photons from a stationary source some radius, $R$, from the black hole. Note that this equation technically should work for radii less than the Schwarxschild radius (the event horizon radius, $r_s=\frac{2GM}{c^2}$), but it'll give you negative angles because photons can't escape. Also note that all angles are given relative to the radial direction. $\theta=0$ means directed radially outwards and $\theta=\pi$ is radially inwards.
Inside the photon sphere, $R\le{3\over2}r_s$, the angles at which photons can escape are given by:
$$\theta\le\arcsin\left[\frac{\sqrt{27}r_s}{2R}\sqrt{1-\frac{r_s}{R}}\right]$$
Outside the photon sphere, $R\ge{3\over2}r_s$, the escape angles are:
$$\theta\le\pi-\arcsin\left[\frac{\sqrt{27}r_s}{2R}\sqrt{1-\frac{r_s}{R}}\right]$$
To get correct angles, just assume that arcsin always results in values between $-\pi/2$ and $\pi/2$. You'll note that for $R=r_s$, you find that $\theta=0$, which means only photons directed radially outwards escape. For $R=\frac{3}{2}r_s$, $\theta=\frac{\pi}{2}$ as my first paragraph stated. And that a radially inward photon ($\theta=\pi$) is always absorbed (this angle is asymptotically approached as $R\to\infty$).
Comment: The link is broken (which is why you shouldn't reference a link like that, though I've probably done it myself).
Comment: @ProfRob thanks for letting me know. This is why I always summarize the stuff in a link. Never know when it dies
Answer: As always in GR when you ask questions like this you have to specify who is doing the measuring, or equivalently, just which frame of reference you are using.
For example, if you plot the escape trajectories of light in a Schwarzschild coordinate $r,\phi$ diagram, then it turns out that the angle from the radial direction of the emitted photon (emitted just above $r=r_s$) is $\simeq \tan^{-1} (b/r_s)$, where $b$ is the impact parameter of the light (proof shown in Appendix 1, which also gives a general formula for $\theta(b, r)$, as requested in your question.)
For the light to escape, $b < 3\sqrt{3}r_s/2$, since only if $b$ is less than this value would the light avoid a turning point inside the photon sphere at $r=1.5r_s$. Equivalently you can say this is the maximum value of $b$ which enables light to exceed the effective potential maximum at $r=1.5r_s$.
Putting $b < 3\sqrt{3}r_s/2$ leads to the constraint for escape as
$$\theta(r) < \tan^{-1}\left[\frac{r_s}{r}\left( \frac{4}{27} - \left(1-\frac{r_s}{r}\right)\frac{r_s^2}{r^2}\right)^{-1/2}\right]\ , $$
which approaches $\theta < \tan^{-1}(3\sqrt{3}/2) = 68.9^\circ$ as $r\rightarrow r_s$.
On the other hand, if we define the angle as the angle that would be measured by an observer hovering just above $r=r_s$, then the limiting angle changes because it must be measured in the local inertial frame of reference of the observer. In this case, the limiting angle $\theta_s$ measured in the local frame of the hovering observer approaches zero as $r \rightarrow r_s$ - as demonstrated in Appendix 2. i.e. The light must be emitted almost radially outwards for any value of $b$. More generally, for light to escape from a radius $r$ then
$$\theta_s(r) < \sin^{-1} \left[ \frac{3\sqrt{3}r_s}{2r}\left(1 - \frac{r_s}{r}\right)^{1/2}\right]\ , $$
which becomes arbitrarily close to zero as $r \rightarrow r_s$.
Appendix 1
The equations of motion written in Schwarzschild coordinates are (with $c=1$)
$$\frac{dr}{dt} = \pm \frac{b}{r_s}\left(1 - \frac{r_s}{r}\right)\left( \frac{r_s^2}{b^2} - \left(1-\frac{r_s}{r}\right)\frac{r_s^2}{r^2}\right)^{1/2}\ , $$
and
$$ r\frac{d\phi}{dt} = \pm\frac{b}{r}\left(1 - \frac{r_s}{r}\right)\ . $$
If we construct a right angled triangle then the angle $\theta$ the trajectory makes with the radial direction is given by
$$\theta(b,r) = \tan^{-1}\left[\frac{r d\phi/dt}{dr/dt}\right] = \tan^{-1}\left[\frac{r_s}{r}\left( \frac{r_s^2}{b^2} - \left(1-\frac{r_s}{r}\right)\frac{r_s^2}{r^2}\right)^{-1/2}\right]\ . $$
If $r=r_s$ then the angle is
$$ \theta = \tan^{-1}\frac{b}{r_s}\ . $$
Appendix 2
The equations of motion are given in Appendix 1, but we need to shift into the local inertial frame of a "shell observer" - one who is at a fixed value of $r, \phi$ (which is only possible for $r > r_s$).
If we define a time interval on the shell observer's clock as $dt_s$, then from the Schwarzschild metric we have
$$dt_s = \left(1 - \frac{r_s}{r}\right)^{1/2}\ dt\ . $$
The proper distance in the shell frame is also given by the Schwarzschild metric as
$$dr_s = \left(1 - \frac{r_s}{r}\right)^{-1/2}\ dr\ . $$
Putting these together with the expression for $dr/dt$ from Appendix 1, we get
$$\frac{dr_s}{dt_s} = \pm \frac{b}{r_s}
\left( \frac{r_s^2}{b^2} - \left(1-\frac{r_s}{r}\right)\frac{r_s^2}{r^2}\right)^{1/2}\ = \pm \left(1 - \frac{b^2}{r^2}\left(1 - \frac{r_s}{r}\right)\right)^{1/2}\ . $$
Again, constructing a right-angled triangle in the local inertial frame of the shell observer, we can say that the hypotenuse of this triangle has a length $dt_s$ (recall $c=1$) and so the exression above is equal to $\cos \theta_s$, where $\theta_s$ is the angle from the radial direction measured in the shell observer's local inertial frame.
Using $\sin^2 \theta_s = 1 - \cos^2 \theta_s$, we finally arrive at the equation
$$\theta_s(b,r) = \sin^{-1}\left[\frac{b}{r} \left(1 - \frac{r_s}{r}\right)^{1/2}\right]\ . $$
Thus to achieve any value of $b$ as $r \rightarrow r_s$ requires $\theta_s \rightarrow 0$. Alternatively, we can say that for values of $b < 3\sqrt{3}r_s/2$, then
$$\theta_s < \sin^{-1} \left[ \frac{3\sqrt{3}r_s}{2r}\left(1 - \frac{r_s}{r}\right)^{1/2}\right]\ . $$
Answer: In the Schwarzschild metric, a photon emitted from the event horizon can escape if its impact parameter $ b $ is less than $ b_{crit}\left (=\frac{3\sqrt{3}}{2}R_s\right ) $ with $ R_s $ Schwarzschild radius $ \left (=\frac{2GM}{c^2}\right ) $.
Since its emission direction $ \theta $ is given by $ \tan\left (\frac{\pi}{2}-\theta\right)=\frac{R_s}{b} $, the condition is $\tan\left (\frac{\pi}{2}-\theta\right)\gt\frac{R_s}{b_{crit}}=\frac{2}{3\sqrt{3}} $
which is:
$$ \theta\le\frac{\pi}{2}-\arctan\left (\frac{2}{3\sqrt{3}}\right )\simeq 68.9^\circ $$
(it appears then that it does not depend from the mass of the black hole).
Hoping to have answered the question in a simple way,
Best regards.

Photon Escape Angle From Black Hole


Extract TortoiseSVN saved password

Question: Is there any way to extract credentials saved by TortoiseSVN?
Answer: Short answer: You can use TortoiseSVN Password Decrypter to easily display your cached credentials, including passwords.
Long answer: Here's how the tool works.
The credentials are saved in subdirectories of %APPDATA%\Subversion\auth\. Listed from this previous answer they are:

svn.simple contains credentials for basic authentication (username/password)
svn.ssl.server contains SSL server certificates
svn.username contains credentials for username-only authentication (no password needed)

The first directory is the one of interest.  It appears to contain files with names that look like GUIDs; one for each repository for which you've saved credentials.
The passwords in these files are encrypted by the Windows Data Protection API.  The tool above uses sample code from Obviex to interface with this API and perform decryption.
In order for it to work, you must have access to the same Windows user account you were running under when you checkmarked the "Save authentication" checkbox.  This is because the Windows Data Protection API uses an encryption key that is tied to your Windows account.  If you lose this account (or, I believe, if an administrator resets your password) then you will no longer be able to decrypt the passwords (except perhaps by using brute force / a third party tool).  Having a new Windows account with the same username/password (or probably even SID's) is not sufficient.
Answer: Based on the info below it sounds like you could possible decrypt them locally in some fashion...
UPDATE: Definitive answer from TortiseSVN community

When they're sent over the wire
  encrypted, they're encrypted using a
  handshake and/or agreed-upon key at
  the time of connection.
When they're stored/read locally,
  they're encrypted/decrypted via the
  Windows Crypto API which uses a key
  tied to your Windows account.
The locally-encrypted copy can't be
  decrypted by the server because the
  keys are local to your account.
So when you connect (let's say via
  HTTPS), your client gets the
  credentials decrypted via the
  appropriate Windows API, then includes
  them in the HTTPS transmission. HTTPS
  encrypts the whole communication
  between client & server using SSL
  certificates, not just the
  credentials.
Comment: are you sure that the password is not decrypted at the client end?
Comment: Pretty certain...without posting an explicit question to the TortiseSVN folks, here is what I found...http://tortoisesvn.net/docs/release/TortoiseSVN_en/tsvn-dug.html#tsvn-dug-general-auth In addition if it was decrypted client side, then pushed over in plain text to the server it would defeat the purpose. I guess you could send it over via SSH.
Comment: but then effectively anyone could send the ciphertext to the server and tortoiseSVN does not provide any additional security by encryption.
Comment: True which is why they make it known to delete the auth data from your PC on shutdown or at least in a periodic fashion if that is a concern. If the machine holding the auth data has been compromised then that is not really a TotoriseSVN issue per se.
Comment: Thanks for the work. I was hoping there is already a tool for that.

Extract TortoiseSVN saved password


The sugar mixture of my baklava did not melt

Question: The baklava filling made with sugar nuts and spices, was harder. Why did this happen? I poured on the syrup mixture, hoping this would soften it up.  No luck.  It's like the sugar granuals crunch as your chewing.  Why? Baked at 350 for 45min. It was very brown.
Comment: Can you give a few more details of your recipes?
Answer: There are two types of baklawa. Ones you put the syrup before and after backing, and another one where you only put the syrup after baking.
Put the syrup before and after backing
This is the more uncommon / rare type of baklawa where the nuts resemble almost nut brittle.
This baklawa type is called "asiyyeh" (which translates to "the hard one"). In this method, when preparing the baklawa, you add roughly a table spoon of syrup for every cup of warm/hot nuts. After baking, you still add boiling syrup on top, and then drain it 2 minutes later.
You can see a video here https://www.youtube.com/watch?v=rNOW0Fw4Rpc&t=779s.
Only put the syrup after baking
In this method, you still put sugar in the nuts, or on the sheet that the nuts are going to be placed on. The goal of this sugar is to allow the nuts to stick just a little. This is more of a sprinkle of sugar here.
The difference between this method and the one above is the amount of sugar.
Comment: I don't see how this answers the question asked, though.


Rate of change of current in an Inductor

Question: Considering an Inductor in a DC circuit: when the switch is first closed there is a change in current through the inductor, which induces an emf in the opposite direction (Lenz's Law). My question is why does that emf cause a decrease in the rate of change of current through the inductor? (which would then cause a reduced emf and then an increased rate of change of current?)
Answer:
My question is why does that emf cause a decrease in the rate of
  change of current through the inductor

The emf doesn't 'cause' a change in the rate of change of inductor current but it is, however, consistent with the rate of change in inductor current.
The fact is that the rate of change of current, the associated rate of change of magnetic field, and the associated non-conservative electric field must satisfy Maxwell's equations (the governing equations of classical electromagnetism) at each instant of time.
For the case that there is a constant, non-zero voltage across the inductor, Maxwell's equations are satisfied when

the inductor current changes at a constant, non-zero rate
the magnetic field changes at a constant rate, non-zero rate
the non-conservative electric field is constant and non-zero (which implies a constant, non-zero emf).

So it isn't true that the emf causes a change in rate of change of inductor current since, as pointed out above, there is a perfectly consistent solution in which the emf is non-zero and the rate of change of current is constant.
Comment: Could you please explain why the rate of change of current decreases as the total current in the circuit increases to it's maximum value.
Comment: @BlurryPic, without the complete context, I can only assume that you're asking about a series RL circuit.  In that case, the inductor and resistor currents are identical; as the inductor current increases, the resistor voltage increases which *decreases* the voltage across the inductor which is associated with a decreasing rate of change of current.
Answer: I will describe how to make something that acts the way the inductor acts so then it should be clear.
Imagine you didn't have the inductor and you replaced it with a wire. Then current would flow through the wire.
Now imagine that there are tons of little batteries there not hooked up. Some pointing one way some pointing the other way. Now a battery only has so much energy stored in it, if you run a current through it too long the battery fails and dies.
OK so you replaced the inductor with a wire and a bunch of batteries and we will say that the amount of energy stored in your batteries is proportional to the square of the current going through that section of wire.
Imagine you hired someone to make that happen.  When the current increases that person would have to hook up a bunch of batteries facing the direction where the current flows the wrong way (so the batteries can get energized) and would have to hook up enough batteries so they get charged at the rate that keeps up with how much energy they are supposed to have stored for the increasing current.
And what if the current decreased then the energy stored would have to go down, so the person you hired would have to hook up the right number of batteries in the direction where they lose energy.
That means there are a bunch of tiny batteries pointing one way or another way and the number of them that is hooked up is related to how quickly the current is changing. And they are wired up to gain or lose energy and they gain energy when the current increases and they lose energy when the current is decreasing.
So we know how such a circuit element works. It has a current and it has a bunch of batteries that have a stored energy proportional to the square of the current and that the batteries may or may not be hooked up and different amounts could be hooked up and they could be wired to energize themselves or to energize the charges flowing through them. But you have more of them hooked up the more the current changes. Enough to let the energy always be proportional to the square of the current.
That's what an inductor is. The energy is stored in the magnetic field (magnetic fields have energy and twice the field is four times the energy). And so if the energy of the magnetic field changes that energy must go somewhere or come from somewhere. And it goes to the charges or comes from the charges.
We can represent that exchange of energy by an emf (think of it as power per current). And that it because it literally does do work on electric charges at just that right rate to balance the energy.
So how does the emf work. It works exactly like a bunch of batteries. So you can imagine the inductor is a battery whose voltage is related to the rate of change of the current. Because a changing current means a changing magnetic field hence changing amount of energy in the magnetic field and hence the energy must come from somewhere and the energy comes from the charges (or go somewhere).
You can literally imagine that there is a battery whose voltage depends on the rate of change of the current. And there is a good reason why. When you run current backwards through a battery you energize the battery. And you are energizing the inductor. The larger magnetic field in the inductor literally has more energy.
So circulating electric fields are associated with changing magnetic fields and hence with channeling energy into magnetic fields.
So the battery is energizing charges which flow to the inductor and it is there at the inductor that energy flows into the inductor (into its magnetic field) when the current is increasing (and energy flows from the magnetic field in the inductor to the charges when the current is decreasing).
So magnetic fields have energy and it takes energy to increase them and you get energy when you decrease them. Since the magnetic field is associated with the current, the changing current is associated with a changing magnetic field so energy for that comes from somewhere it comes from the charges.
And how do we quantify energy going to or coming from the charges? With an emf. And the direction is such as to balance the energy. Decrease the energy of the charges (like energizing a battery).
And note that when I say energize a battery I mean like recharging a rechargeable battery I'm not talking about changing the strength. You can imagine that there are tons of batteries each of a fixed voltage and each facing a certain way and they get wired in when current changes, in a way to suck energy if the current increases and a way to give back energy if the current decreases and if the change is more rapid you connect more of them. So they act just like batteries and we put in enough of them to correctly account for the energy that exchanges between the charges and the magnetic field.
In fact you can think of all electrodynamics as the fields having energy and momentum and where there are no charges or currents the momentum and energy flows around as the fields change and even as the fields sit there (and yes energy and momentum can flow even when the fields are static just like electric current can flow even when the electric charge density isn't changing). So normally the energy and momentum of the fields just flows around. But when there is current and there is charge then the fields can lose or gain energy and they can lose or gain momentum and the charges balance it out.
So if your circuit isn't moving an emf is just a power per current so for your given current you can find out how much emf you need to account for the energy exchanging with the magnetic field. A similar thing happens with a capacitor. When it is charged there is an electric field and that has energy. The voltage across the capacitor is exactly that needed to balance the energy taken from the charges to give to the field.
So your real battery energizes the charges and they go around the circuit and as they approach the capacitor the charge already there takes the energy of the charges and stores it in an increased electric field. You can think of it as when a charge feels a force from an electric field where does the energy go to or come from? It goes into the energy of the fields. So if field energy flows into a region then either an equal amount better flow out or else he field energy there must change or else energy must exchange right then and there with a charge.
OK. Let's be honest about why you didn't already know this, because it's not your fault. In electrostatics you had charges exert forces instantaneously on each other and you had potential energy. But all of that is incorrect. It only approximately holds when things don't move. The more complicated reality is that there is energy and momentum in the charges and also in the fields spread throughout space. And it flows around and it can be exchanged between the charges and currents and the fields.
Are the fields changing their energy because the charges are changing their energy? Or the other way around? Neither is entirely accurate. They must happen together. Energy conservation says they happen together. And then we have to make specific laws about how the interaction between charges, currents, and fields. That interaction dictates how they both must change. It isn't one causing the other.
In our example where you paid someone to connect the batteries the changing current it seemed like one caused the other. Imagine you paid them but they didn't do anything because they knew the magnetic field would store the energy for them.
The reality is the charges move in a way to vain or lose energy and the fields are such as to interexchange energy without themselves to have the fields lose energy or gain energy right where those charges are and of the exact right rate to balance out energy conservation
 But each just interacts the way it does.
And momentum does the same thing except current can be involved in momentum exchange without exchanging energy.
Answer: Lenz's Law says that in any conductor the current flows in first cycle it was take more current due to more magnetizing the coil that is before starting the first half cycle , at the same time the flux is again cross over the conductor emf is induced in it (same coil), so induced emf is opposite direction to oppose the current up to half cycle.
After 90 degrees , the same flux is in induced in same direction so that time current is twice up to 180 degrees.
Comment: I tried to edit this to improve grammar and clarity but some of it was tough to parse, especially in the first paragraph...


Facebook Admin Link Missing

Question: I recently created a facebook application for integrating a domain's webpages with facebook.
But I can't figure out why the Admin Link will not show on the webpage whilst logged into fb as the admin.
Reading the developer documentation can be a little confusing since there seem to be various methods of implementing the code required on each webpage. It is difficult to determine which namespace matches with which way to load the SDK and with which markup method.
I am attempting to do this for HTML5.
<!DOCTYPE HTML>

<title>test</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

<meta property="fb:app_id" content="APP ID NUMBER"/>
<meta property="og:type" content="video.movie" />
<meta property="og:url" content="http://www.domain.com/page.html"/>
<meta property="og:title" content="TITLE"/>
<meta property="og:description" content="DESCRIPTION."/>
<meta property="og:image" content="http://www.domain.com/og_thumb.jpg" />

<meta property="og:site_name" content="SITE NAME" />

Whilst logged in as the admin user of the fb app I am able to visit the admin for the page by looking up the page name/id and append them to a url like so:
http://www.facebook.com/pages/TITLE-OF-PAGE/GRAPH-ID-NUMBER
I noticed this bug that seems related:
https://developers.facebook.com/bugs/178579068908181/
I understand that when using fb:admins the admin must "like" a page before being able to see the Admin Link.
However I am assuming that when using fb:app_id that it should not be necessary to "like" the page.
What am I missing to enable the Admin Link for the webpage ?
Answer: You should use both fb:app_id and fb:admins in the OG Markup. Don't forget to use the debug tool to scrape the page again so facebook knows that the details have changes. The admin link will only show if you have the fb:admins on the page.
You don't have to like the page, you could always wait for a user to like the page. Facebook will then create the associated page once it has enough likes and the admin link will appear correctly.
Comment: Sorry for the tardy response. I have tested with fb:admins too + run through debugger, but still no joy. It is a reproducible bug here: https://developers.facebook.com/bugs/312068448887757?browse=search_5031bc5d092e70230154166 which is given "low" priority

Facebook Admin Link Missing


How to view comment revision history

Question: Since comments can be modified, is there a way to view a sort of revision history (with the modifications applied to the comments) like you do on questions/answers?
Answer: Not for us mere mortals.
Only Stack Exchange staff members can see the revision history of comments, but that doesn't include edits made during the edit window (so only changes by moderators are kept in the revision history, which makes it practically useless for normal users)
Related: Let moderators see the original, unedited version of comments
Comment: Moderators can't see revision history either; that's an employee-only power.
Comment: @ShadowWizard There is a five-minute "grace period" in which non-mods can edit their own comments. (Ironically, you've made use of that in the comment you just made, and I'm making use of it right now in this comment.)
Comment: "Moderators can see the revision history of comments" - as far as I know it's not correct, and it's even clearly mentioned in the question you linked to. Also, there is no such thing "grace period" for comment edits. The answer is not totally wrong since the first sentence is correct, but the rest is not.
Comment: Indeed, the 5 minutes from first posting the comment until it is locked. All changes are not kept now.
Comment: @rand but it's not "grace period". It can be called "edit window". Edit grace period is reserved, as far as I know, for post edits, which within the grace period (5 minutes) won't create new revision. If we could edit comments any time, then the term would make sense, but we can't. Proof that it's different is the fact that we can see that comments were edited: we can't see any indication whatsoever that a post was edited during grace period.

How to view comment revision history


Endogeneity coming from omitted variable vs measurement error

Question: Can someone explain more clearly what is a measurement error and how is it different from omitted variable. I know the theoretical implications, but I don't really know how to tell which problem I'm dealing with, in a context, for example, using education to explain wage. We can have ability, which is correlated with education, but it can't be measured. Is this a measurement problem?  Why not omitted variable?
Thank you!
Answer: I don't know if I'm the best to explain this but I'll give it a go. A measurement error is, for instance, when the person was supposed to code you as LFG in a dataset, but coded you as GFL. So then the data does not reflect the true 'value'.
An omitted variable, in a regression is a variable that is important to the equation, but that you've left out. Say you think gender affects wage. If you ran a regression, and omitted (left out) education, you would have an omitted variable bias problem in your estimation.
Granted there are many things in this kind of wage equation that are omitted, perhaps age, your line of work, where you live, etc. Often omitted variable bias refers to something that you can't really quantify. Say motivation also has an impact on your wage. But how would you add motivation?
In your example, ability is something that can't be measured. You didn't measure it, so there was no measurement error. Running the regression to find out what effect gender and education have on wage, without including unobservable variables (motivation and ability) leads to omitted variable bias.
Comment: For OVB, you have to exclude a variable that matters but is also correlated with included variables. Otherwise you couldn't run experiments.


What is the output type of the 74AHC594?

Question: What is the output type of the 74AHC594 IC?
I didn't find the answer in this datasheet. There is stated in some datasheets for the 74594 IC from other manufacturers that the output type is buffered. What does that mean?
Answer: It is a CMOS output. The specifications are in table 6 in the datasheet:

There is stated in some datasheets for the 74594 IC from other manufacturers that the output type is buffered. What does that mean?

The specifications of 74594 aren't relevant. Those are for the original 74xx logic family, which was a TTL family. Your part is in the AHC family, which is CMOS.
If the part had buffered outputs, that meant it was able to drive or sink more output current than un-buffered parts in the same family.
Note: Your datasheet also covers 74AHCT594, which is a CMOS part with TTL-compatible inputs. If you don't want TTL compatible inputs, don't use this part and don't worry about its specs.
Comment: 3-state output means you will have an extra Output Enable (OE) control pin. When OE is in the deasserted state (which might be either high or low), the output pins will not drive any voltage, or source or sink any significant current (they're in high impedance or "high-Z" state rather than 0 or 1).
Comment: Thank you for the answer. What is the difference between buffered output and 3-state output? The 74AHC595 is very similar to the 74AHC594 but it has 3-state outputs in addition.
Answer: Usually, the transistors that are used to perform the actual logic functions on a CMOS logic IC are relatively small. However, these small transistors are not able to quickly change the logic state of the device's physical pin and any wiring capacitance associated with it. So, the internal logic signals are buffered by passing them through a series of inverters where the transistors in the inverters gradually increase in size. Eventually you have an inverter whose transistors are large enough to drive the external pin, so you connect that inverter output to the outside world. As long as you have an even number of inverters in series the internal logic state will be correctly driven onto the external pin.
I would assume that almost any modern logic device would have buffered outputs. In ancient times there were some CD4000 series devices that were available in both buffered and unbuffered versions.


Moto G2 internet connection switch from 3G to 2G network

Question: I am using Moto G2 with Lollipop 5.0.2. And I am having this trouble that whenever I am using 3G service, it automatically switches to 2G and in between it gets back to 3G. This keeps on going and internet speed suffer. Please help if anyone has any clue.
Comment: [This answer](http://android.stackexchange.com/a/28557/96277) is what you need to look and follow. Reverse the condition in step 4.
Answer: The default setting provided in the Phone settings menus is
Setting > More > Mobile Networks > Preferred network type > 3G

Screenshot - Preferred Network Type selection(Click to enlarge image)
This is a WCDMA(3G) preferred setting and that means it switches to 2G network if you have a weak 3G signal recepition in your area.
For enabling 3G only mode follow these steps:
Firstly we need to define in which SIM we want to enable 3G. For this go to-
Settings > Dual SIM settings > Mobile Data > choose the desired SIM.
Now,

Open your Phone (Dialler) app.
Enter this code: *#*#4636#*#*
An app known as "Testing" will be launched.
Touch the first option "Phone information". (Don't touch other options)
You will notice a drop-down option above "turn off Radio" button. Tap on it.
Select the third option "WCDMA Only".

You will see that network has changed to 3G mode in the notification bar. If network doesn't change, touch the "Turn off Radio" button. you will see your phone's signal are lost. Now again turn it on by tapping on the same button. Your 3G/HSPA/UMTS must have been enabled now.

Note: If you set WCDMA only mode and if your 3G network is weak, then it will not switch back to 2G network as a fallback and you will eventually lose your connection until you get back the 3G network. So you might face some interruptions while downloading/streaming etc. Instead of entering the code in the phone dialer you can use this tiny app from playstore called Testing
How to switch back to default?
Select 'WCDMA preferred' from the above dropdown list and you will go to 2G/3G mode where your phone will connect to best network mode depending on strength.


Finding an antiderivative of complex function $\sin(z^2)$

Question: I am trying to find the antiderivative of the complex function $\sin(z^2)$ as well as $\sin(z^2)/(z-i) $ and $\sin(z^2)/(z-i)^2$. The only hint don't think profoundly.
Also I have to evaluate the integrals of the above three functions respectively on the unit circle the circle centered at $i$ of radius 2 and the circle centered at $i$ of radius 4.
Comment: What have you tried so far?
Comment: Why are you trying to find antiderivatives? That won't go well. There must be another (easy) approach.
Answer: The notion of anti-derivatives in Complex Analysis is tied to the presence of some path $\gamma$ of a path integral. That is, in Calculus of Real variables, it's ok to write $\int \sin(x^2)dx$ and think about anti-derivatives as an indefinite integral.
But in Complex, we don't (usually) think about $\int \sin(z^2)dz$ without considering some path or contour associated with the latter integral. See Antiderivatives on Wikipedia or Marsden and Hoffman, page 117.
Now, let $\gamma_1$ be the unit circle, $\gamma_2$ be the circle centered at $i$ of radius 2, and $\gamma_3$ be the circle centered at $i$ of radius 4. (Do we get to assume the orientation of each of these $\gamma$s is counter-clockwise?)

For $\displaystyle \int_{\gamma_1} \sin(z^2) dz$, what can you say about the $\sin(z^2)$ function inside $\gamma_1$? Are there any singularities inside $\gamma_1$?

If we find there are a finite number of singularities, then $\sin(z^2)$ may be meromorphic (in a simply connected domain $\mathbb{C}$) - in which case we may apply the Residue Theorem to evaluate the integral. Then
However, if there are no singularities, there may be another theorem you may apply which makes this integral significantly easier. If you don't know the name of the theorem, it's named after this guy.

For $\displaystyle \int_{\gamma_2} \dfrac{\sin(z^2)}{(z-i)}$, let $f(z) = \dfrac{\sin(z^2)}{(z-i)}$ and go through the same process (ask yourself the same questions). Are there any singularities inside $\gamma_2$? If so, how would you classify them? We need to classify the singularity in order to know which formula to use to calculate the singularity's residue. We'll answer this question partially to guide you to the correct answer.

Note at $z = i$ we have a simple pole. This is the only singularity inside $\gamma_2$. Since $f(z)$ is meromorphic in $\mathbb{C}$ (a simply connected domain) and $\gamma_2$ is a closed curve, we may apply the Residue Theorem to obtain
$\displaystyle \int_{\gamma_2} \dfrac{\sin(z^2)}{(z-i)} = 2\pi i \cdot$Res($f(z), i$)),
Where by classifying $z = i$ as a simple pole, we may find the "Residue at a simple pole" formula to evaluate the residue and complete the integral calculation. See your class notes or this link for residue formulas.
For $\displaystyle \int_{\gamma_3} \frac{\sin(z^2)}{(z-i)^2}$, you will have to repeat the process: analyze the types of singularities inside $\gamma_3$, see if you can apply the Residue Theorem (usually yes), apply the Residue Theorem, then calculate the residue based off the classification of the singularity/singularities.


How to calculate mean and Variance of Gaussian-distributed random noise?

Question: I have been given a Gaussian-distributed random noise n(t) which has an average power of 5 mW.
How can I calculate the mean and variance of noise n(t)? Any suggestions? Thanks!
Comment: Please tell us in what form you were "given" the Gaussian-distributed random noise. Don't be shy; tell us _exactly_ what you were "given". Have you been told the power spectral density? Were you told that is _white_ Gaussian noise? _band-limited_ white Gaussian noise? Is it _continuous-time_ noise or _discrete-time_ noise?
Comment: @DilipSarwate Hi! In The question I have only been given that A Gaussian-distributed random noise n(t) has an average power of 5 mW.
Answer: If the values for each sample of $n(t)$ are given, then the mean and variance can be estimated using the equations for sample mean and sample variance, which is trivial so I assume the OP is only given that it is Gaussian-distributed with average power of 5 mW. From that alone, there is no way to know what the mean of the signal is since it hasn't been specified that the process is "zero-mean" or not. If the signal does have a mean value, it will contribute to the total power so this must be specified.
The variance is the portion of the power that is not included in the mean. Since units of power were provided, then the resistance would need to also be given in order to provide units for any non-zero mean (voltage or current) if there is a mean value.
Comment: How can the mean and variance be _computed_ from sample values? Did you mean _estimated_ as in _sample mean_ and _sample variance_ the way the folks over at stats.SE do it when given $N$ (independent) sample values of an alleged Gaussian random variable?
Comment: @Pressing_Keys_24_7 See my second paragraph and let me know what is still confusing you about that sentence. You have zero mean, so mean is zero. Therefore all the power is the variance.
Comment: Thanks for the answer! Consider the mean to be zero, so now how can I calculate the variance? Thanks!
Comment: Got it! Thanks a lot for the help!


Saturation Cascade MOSFETS (Need Help from EE Experts)

Question: this is a very straightforward question.
I'm running a Harmonic simulation on ADS where I need to design a cascode amplifier of two NMOS and one PMOS, that have a gain higher than Av > -100. The catch is that all my MOSFETs need to be in saturation mode.
All I want to know if I did my calculations to keep them all in saturation mode correctly. I design everything but I need help specifically with that part. Here's the design.

The equations:

Don't worry about looking at anything else, just the Saturation equations. If I do them correctly, then the rest of the circuit will work.
Answer: I believe you can use \$M1SAT > 0\$, \$M2SAT > 0\$ and \$M3SAT < 0\$ (since that is a PMOS) to check for saturation. However, I did want to point out that your \$M2OD\$ and \$M3OD\$ will not be the overdrive voltage \$V_{GS} - V_{TH}\$.


vibration under car

Question: i have a 2014 Hyundai Elantra. car was driving great at 65mph, then i had to slow down without touching my brake. as i was coming down past 60 it starting vibrating. i felt the underneath of me vibrating but not in the steering wheel. then as i went to accelerate it made a terrible hard loud type vibration and immediately was fine after that. it did this two more times, same speed within mins of each other,same driving situation. now it's vibrating all the time but not in the steering wheel. any ideas?
Comment: Welcome to Motor Vehicle Maintenance & Repair!
Answer: WARNING: Before you drive again, check that all the lug nuts are properly tightened. Loose lug nuts can cause your symptoms.
Is it mud season in your area? Check all four wheels for a buildup of mud. (Ice / snow can give the same result.) Be sure to also check the sides of the wheels that you can't see unless you get down on hands and knees and peek around the tires.
If you find mud, hose it off and that should take care of it.

vibration under car


Global warming and air temperature

Question: The layman's question. Is there a maximum temperature that can be reached by air on Earth due to global warming? For example, one that would prevent living organisms from functioning? I read somewhere that with the increase of the sun's brightness by 10%, the average temperature on our planet will be 47 C. This, however, only for about 600 million years. Would global warming enable reaching such a high average temperature?
Comment: Humans get in big trouble already at $40^\circ$C and high humidity. Global warming will increase the area where humans cannot work or live.
Answer: Is there a limit?  Yes and no.
No, there isn't really a maximum temperature anywhere near what we're used to.  It's certainly possible to reach an average temperature of 47°C.  That may well trigger a runaway greenhouse effect, when all the oceans evaporate.  Look at our neighbour Venus.  On Venus, the greenhouse effect leads to a surface temperature of 467°C.  That's very far away from where we are now on Earth, and we'll most likely not reach that any time soon, but it's probably not theoretically impossible to reach.  On Venus, the partial pressure of CO₂ is around 9 MPa.  On Earth, it's closer to 40 Pa, a factor of around 200,000 less.
There is, of course, a maximum temperature; we can't reach $\infty$°C.  Venus may be close to the upper bound.  But at that maximum temperature, life on Earth will be history.
Answer: Given what we currently understand about climate, it is not likely that Earth could be triggered into a runaway greenhouse effect, nonetheless arrive there without a push from human industrialization.
https://www.technologyreview.com/s/426608/how-likely-is-a-runaway-greenhouse-effect-on-earth/
The surface temperature of the sun is about 5778 Kelvin, which is definitely hot enough to destroy any life on earth. As stated, the temperature on Venus is only about 740 Kelvin, in which it is conceivable that extremophiles could live. So "the maximum" for life on earth is likely somewhere between these two temperatures.
Comment: extremophiles at 740 K?  Really?

Global warming and air temperature


Easiest way for two people to switch an iPhone 4 and 4s

Question: I have an iPhone 4 and my wife has a 4s.  We want to trade phones.  Once we get Verizon to reassign the phone numbers,  what's the easiest way to migrate the apps, settings and data between phones?  BTW, the 4 syncs with iTunes on windows 7 and the 4s is paired with a OSX Lion machine.
Answer:
Connect both phones to their current respective computers
Open iTunes and perform a backup on both phones
Swap the phones to the opposite computers.
Once swapped, click on the Restore button in iTunes, then click
Don't Back Up.
When iTunes finishes the restoring process, set up your 'new' phone
from a backup, making sure to click on your old phone's latest
backup (the one you just completed.)

This should restore the new phone to your old phone's last condition.
Comment: You can also do this on the same computer if you don't have two that sync each device separately. If you are worried about mixing backups, power off the phones after the last backup and hold the home button when plugging it it, it won't sync but instead enter recovery mode where you can only restore (erase) it.
Comment: If you want to add an extra layer of safety/paranoia, back up your home directory's ~/Library/Application Support/MobileSync/Backup directory(s) to an external drive after Syncing, and before swapping and restoring the two iPhones.
Comment: ryebread:  thanks for the info.  I'm planning to do this over the next few days.  I don't understand the need for step 5.  Wouldn't Restore process in step 4 be sufficient to swap the OS and data on the phones?  Why is there a need to "set up your 'new' phone from a backup"?
Comment: After you restore a phone, it is reset to factory defaults; (i.e. no user data) so iTunes will treat it like a new phone and you have to select a backup to restore it to, otherwise it will be like the day you bought it. Hope that helps!  If you have any other questions, feel free to ask!
Comment: @Sajee: You are welcome! Clicking on the "Answer" button beside this answer closes the question.  Thanks!
Answer: With iOS 5, iCloud can be a great solution.
Set up an iCloud account for each user.  Each person set up his/her own account. After, go to Settings -> iCloud -> Storage & Backup and turn on "iCloud Backup" then tell it to perform an immediate backup.
After backup is complete, go to Settings -> General -> Reset -> Erase All Contents and Settings.  Physically exchange iPhones, and when prompted set up the iPhone from the appropriate iCloud backup.
After the iCloud backup is restored, sync with the appropriate computer to pick up ripped media, iPhoto (or My Pictures) images, etc.


What does these phrase "he is on the field" and "all layers of play shed off as..." mean in this sentence?

Question: "Chanyeol is as intense when he kisses as he is on the field, all layers of play shed off as he just.. conquers."
I tried to look up the words in dictionary but still i couldnt get what it means.
Someone help me please.
Comment: Title of book? Context? Is Chanyeol a {soccer/football/hockey/polo} player? Did you look up **all** the different meanings of "field"?
Comment: Please include the research IN your question, it's not enough to say "I looked the words up". Maybe you didn't look hard enough? P.S. Someone who writes "pls" (what's wrong with writing "please"?) on an English website, shows disrespect to users who spend time posting answers.
Answer: I guess Chanyeol is either a footballer, or some other field-based sport (rugby, maybe cricket) or he's a general or soldier who fights in pitched battles (or tournaments). The phrase "on the field" usually references how someone plays a field-based sport or performs in battle. You probably got a lot of references for "in the field" when you looked it up, and it is similar, but "on the field" is more specific to sport or battle (as you can see if you look at the books contributing to the results in ngrams). Whatever the sport, he plays it "intensely".
The second phrase "all layers of play shed off" relates to the first. Kissing is no longer a game so his playfulness is cast off. The word "shed" here is the verb meaning. From TFD, first definition from American Heritage:

shed 1
a. To have (a growth or covering) be disconnected or fall off by a natural process: a tree shedding its leaves; a snake shedding its skin; a dog shedding its hair.
b. To rid oneself of (something not wanted or needed): I shed 25 pounds as a result of my new diet.
c. To take off (an article of clothing).

The layers of playfulness (when he plays the sport) are dropped when he is kissing. The word "conquers" suggests he's more likely a general in an army than a footballer.
Comment: Lovely detailed answer to an off-topic question. Wish I could upvote.
Comment: No problem @Mari-LouA. I added it because the question was less easy than I first assumed. I tried searching for "on the field" and got a bunch of "in the field" hits. I actually had to try to find a suitable "on the field" reference! And then the ngrams were more about historical warfare (or electrical engineering!) rather than football. I was relieved to see that your comment showed that you thought it meant sport, too!
Comment: Thank you so much for your answer! I finally understand the meaning of the sentence.


Is there a way to set each user with its own language?

Question: I use a fresh Mageia 6 with gnome-shell and 64bit.
I have two accounts (or users), is there a way to set each account with its own language for example my account is in English and the other account would be in French.
Answer: Yes, you can set this up from the settings. Open the menu at the top right of the screen, click on the settings icon (the tools in the lower left of the menu), click on "Region & Language", and choose your language in the top field. This setting is stored per user.


Should I drop and create indexes on my tables that SQL Server created?

Question: In an effort to get rid of some fragmentation left from rebuilding and defraging
we thought that we would drop and create indexes so I went to write a script.
It identifies a clustered index that needs work and drops indexes and primary keys
and rebuilds the indexes and primary keys for a table.
Here is the problem I ran into: SQL Server makes quite a bit of its own indexes
based on statistics with its own unique naming system.
Question: Do I want to only drop and create the indexes we made or do I want to drop all indexes and create only the ones that we made or do we want to drop all indexes including
the ones SQL Server made and create all indexes including the ones that SQL Server made?
Answer: You can always defrag your indexes, which is easier than drop and recreate. There's a decent explanation of how to do it in this article.


What kinds of flooring resist water damage?

Question: My condo has a concrete slab.  We put down engineered wood flooring.  There has been some flooding in neighboring condos, which has damaged the flooring. Does anyone have a suggestion for flooring that would resist the water damage? Would ceramic tile work ?  There are cracks in the slab that we have repaired. the building was built in 1950.
Comment: vinyl tile is an option. how much flooding/water damage are we talking?
Comment: Some photos would be helpful, in my experience all concrete cracks with time. I have tiled shopping malls in my early years that had cracks the tile held up fine for many years. Haven't been back there in 20 but it was still almost that many years, they probably have remodeled since then.
Comment: yea, pics would be nice, does it flood often ?
if concrete was the concern, yes leveler then flooring but if it floods often then other options would be best..
Answer: You may want to look into floating tile floors. These are tiles with a rubber or foam backing and snap together like puzzle pieces, instead of being secured to the subfloor with grout. You still need to grout the tiles, but these are made for DIY installation, instead of professional installers. It's more expensive to buy and have other issues, but if you have another crack in the concrete, it won't destroy the tile. Also, if you do find out about a crack you need to fix or have to clean up after a flood, these will be easier to remove and should even be able to be reinstalled.
For more info:
https://www.bobvila.com/articles/floating-tile-floor/
Answer: If you are concerned about future floods it could be an idea to look into decking floor tiles. As its generally used for outdoor purposes it should handle a flood without issue.
Another benefit would be that it will leave some air gaps letting the concrete breathe, trapped moisture after a flood can create some real issues.
This is the type of tiles i'm referring to.
Answer: If I had a floor with cracks and known water issues I would do one of the following:

Cover the floor in something like - DRIcore Subfloor Membrane (not recommendation just example).   Then add either engineered wood or carpet on top (if carpet you probably do rigid insulation panels.
Pure vinyl click lock.   Don't confuse these with run-of-the-mill vinyl flooring that comes in sheets or has a vinyl top with some other (usually padding plus mdf) type of backing.   These are pure rubber click locks.   This would be the quickest, easiest, and cheapest solution.   If they get wet you spray them off or just let them be.

I would not suggest putting down tile even though it is a pliable option.   If you do you will need a membrane on the entire floor.   This is expensive and these membranes are hard to install right in huge areas.   The other issue is membrane or not, if there is enough concrete movement your tiles will buckle/crack.


What's the shortcut to delete selected layer in GIMP?

Question: In my old image editing program, hitting the delete key would delete the currently selected layer. Apparently not so in GIMP - what's GIMP's shortcut to delete the selected layer?
Answer: You can use Ctrl+X.
This is because standard copy-paste shortcuts can be used to interact with layers. So Ctrl+C will copy, Ctrl+V will paste and Ctrl+X will cut the active layer.
The Del key deletes the content of a selection. If there is no selection, the content of the layer is the selection - so Del deletes the layer's content but preserves the layer itself.
Comment: I'd love this answer. So cool & so easy and simple. THANKS.
Comment: this is very practical. just remember to remove any selection outline before hitting ctrl+x (this is done with shift+ctrl+a   OR    Manu>Select>None)
Comment: I didn't know that one. Very nice trick.
Answer:
In the GIMP toolbox, select Edit → Preferences.
Select Interface from the menu on the left, and then click on the "Configure Keyboard Shortcuts" button.
Create a new shortcut for the "Delete Layer" function, I would expand the "Layers" section and click on "Delete Layer".
Type in desired shortcut or accelerator. If the accelerator is already assigned to another function, a pop-up box will give you the option to reassign the accelerator to the new function.
Once you have assigned all of your desired shortcuts, close the "Configure Keyboard Shortcuts" window. Click on the "Save Keyboard Shortcuts Now" button so that you can immediately begin using your shortcuts.
The option to "Save keyboard shortcuts on exit" should also be selected. Close the Preferences window when finished.

Gimp references:

GIMP Keyboard Shortcuts.
Creating Shortcuts to Menu Functions.
Comment: Sadly it does not seem to allow shortcuts with special keys like Ctrl+Del.
Comment: Is there a shortcut to Hide a layer? I mean, instead of clicking in the eye icon I'd like to use a shortcut to hide the selected layer. Then I could move to the next one easily.
Answer: fn + Backspace
For Mac running on 10.10.5:

fn is the key in the lower left corner
Backspace is the delete key in the upper right corner


How do they film scenes with storms?

Question: In some movies, such as Equalizer 2, for example, there are scenes that take place in storms or hurricanes. How do they create such scenes? It would seem to be difficult to fake whole streets being blown by 60-mile-an-hour winds.
Comment: It probably varies but there are significant rain and wind machines that can be used to create in-camera driving rain. Combined with lighting and sound, and these days a CGI sky, that can go a long way. https://jmfx.net/products
Answer: Creating this type of movie is challenging because in not making it look extremely cheesy the director is forced to use as many practical effects as possible. Of course, there is also the aspect of making the weather look good, to give the viewer this feeling of monumentality where real tornados and other extreme weather conditions are hard to capture from up close or hard to make look good on camera. For the inside of a tornado or up-close shots CGI is mostly used. For shots from the distance both real or CGI versions of the tornado are used.
There are clips about making this kind of movie.
Making of Twister from 1996

Ocean storm sequence from a TV commercial
Comment: The making of video of Twister is very long and talks about a lot of subjects unrelated to the question at hand. Perhaps you can link to a couple timecodes where they talk about weather effects specifically?

How do they film scenes with storms?


How loops appeared when skipped listening and learning state?

Question: In STP convergence process, I just know that after a link failed a blocking port become listening state for 15 seconds then learning state for 15 seconds. I've read a CCNA 200-301 Guide explained me that
Listening state: The switch removes unused MAC address in MAC address table because these unused MAC entries can cause of potential loops. I still don't know how the loops appear if the switch skipped listening and learning state. I think when the link in topology failed that can't cause of the loops anymore. Can anyone give me an information about how the loops appear?
Comment: If a port moves from blocking directly to forwarding, it is not checking for a loop, and thus a loop *could* exist.
Answer: STP blocks redundant links in a network.
Generally, an Ethernet network is required to form a tree (of arbitrary breadth and depth). Any additional link between nodes in that tree creates a bridge loop, making broadcast frames circulate infinitely: A forwards to B forwards to C forwards to A forwards to B ... (plus causing other problems).
The STP algorithm locates and blocks these looping links. It creates a mathematical spanning tree where there is only a single path between any node pair. Any extra links are blocked.
When a new link is established, it might create a loop - you don't know yet. Accordingly, it is blocked for the time it takes to make sure that it doesn't create a loop - it is either integrated into the spanning tree and enters the forwarding state, or it is redundant and is blocked permanently.
If you have a port entering the forwarding state right after the link comes up (portfast or admin-edge mode) and it does create a loop, you'll have a broadcast storm raging for the time it takes for the spanning tree to reconverge. Likely, you wouldn't want that for a redundant link created on purpose.
Comment: Thank you for the answer. Could you give me some examples of some situations when temporary loop occurs if the redundant link change its state from blocking to forwarding immediately?
Comment: When the link in the forwarding state creates a loop, the loop *always* causes a broadcast storm - see the answer above.


clipping an area out of multiple satellite images in QGIS

Question: How can I clip the exact same area out of  multiple satellite images ( multiple bands)? I am working on a remote sensing project and only need a certain island but the images show much more.
Answer: It might be faster to use GDAL instead of QGIS even for a couple of images but especially if you will need to do clipping frequently for your area. Use the -projwin option
http://www.gdal.org/gdal_translate.html
The order of coordinates [-projwin ulx uly lrx lry] may feel odd at the beginning.
<code>gdal_translate -of GTiff -co tiled=yes -projwin 10000 50000 20000 40000 satellite_in.tif clipped_out.tif
</code>
Answer: As you said clip. Menu: Raster > Extraction > Clipper. You can clip your raster from an extent or a mask layer (other vector table). You have other clipping methods too if you use the menu Processing > Commander and type clipping.
Answer: Here is another potential way. With this code you could write a batch script.
<code> gdalwarp -q -cutline D:/Temp/aoi2.shp -crop_to_cutline -of GTiff C:/temp/satellite_in.tif Z:/temp/satellite_out.tif
</code>


Export Marketing Cloud Journey Data to Salesforce Sales

Question: We have numerous Journey version since we have made changes throughout the year so having a nice single dashboard showing all the email metrics of the Journey is not possible unless I am missing something.  So what I am wondering is, can I export the SFMC data(clicks,opens,bounces,...) to the SFSC environment?  The goal would be to consolidate all the version of a specific Journey into a single reports/graphs.
Answer: You will note that when configuring an Email Activity in a Journey Builder Interaction, there's an option to Send Tracking Results to Sales Cloud (refer to screenshot below). I have yet to use this feature, but I assume this will only work if you are using a 'Salesforce Data' event or 'Salesforce Campaign Event' from the Define Entry Event modal when creating an entry event.
This feature is undocumented, but I assume that it enables you to review tracking data for each email in Salesforce, similar to the current functionality with Salesforce Email Sends.
Comment: Eliot, Thank you for your answer.  I am going to select the 'Send Tracking Results to Sales Cloud' after I determine that it will not effect the current active Journeys or I may need to create yet another version of the same Journey.  Thanks again.


Moving Google Form into Google Docs

Question: My daughter has a survey in Google Form and wants to put the form as an appendix in her Google Doc.  Is there any way to produce a "Word" version of the form--with the questions and check boxes as one sees online--and put them in Docs?
Comment: You could use a screen capture program to get an image.  Jing is a free one I have used. SnagIt is, I believe 50.00 US and will scroll down a page for a long form.  Both are by the same company and I have no affiliation outside having used them for many years.
Answer: I would recommend printing a copy of the form as a pdf so that it can be easily attached.  When you generate a printable copy of the form it makes a number of changes to the format to assist in printing.  For example, it will make a list of all options in a drop down.  This is more useful than a screen shot, which wouldn't include all of the content of the form.
First, you may need to download a print to pdf utility to allow you to save a pdf from your print dialog.  On Windows I prefer using CutePDF: http://www.cutepdf.com/
To generate the printable copy of the form make sure your form is open and click the vertical '...' button on the top right.  Then select 'Print.'  In the destination dialog change the destination to Save as PDF/Print to PDF.  It then asks you for a location to save it to and there you have it, a pdf of your form.
Answer: In Google Forms, you can click in the three dots next to send and click Print

Then we're redirected to the following screen

It's in portuguese in my case. In the highlighted dropbox I defined want the file to be saved as PDF (from the portuguese "Guardar como PDF").
Once you have the .pdf you can just copy-paste mostly everything.
Answer: The best way is by printing it as a OneNote file. In Google Forms, you can click in the three dots next to send and click Print.

Save it as a OneNote file, then you open it and you will find copyable pictures like the figures in the response section in Google Forms.

When you copy them to a Word document they look pretty cool.
Comment: sorry, my answer looks a little messed up.

Moving Google Form into Google Docs


Publishing papers as a high school student

Question: How to scientifically approach theories and research them as a high school student to get it published? (Given that the theory is not yet proven by anyone and may or may not be true).
Comment: https://academia.stackexchange.com/questions/42763/how-can-i-get-into-computer-science-research-as-a-high-school-student or https://academia.stackexchange.com/questions/159732/how-should-a-high-school-student-approach-professors-in-research-institutions-ab might be relevant.
Answer: You will need an experienced researcher to guide you.  Most high school students that I know who have published had help from their parents (usually professors), or a professor who is associated with a school.  An example is Intel's science competition.  Have a look at the students who participate every year, their support system; e.g., mentor(s).
Comment: Depending on your area, perhaps look for a mentor network within the appropriate professional society? AMA, MAA, ACM, IEEE, etc. etc.
Answer: As a high-school student, you are going to have three or four main difficulties, all of which will probably require the assistance of an experienced researcher.  The difficulties you will encounter are: (1) finding out what is already known and published about the topic (what we call a "literature review"); (2) knowing the substantive method to use to investigate the topic; (3) if the paper involves data analysis, knowing enough about statistics to do this analysis; and (4) being able to write the resulting paper in an appropriate way for submission to a journal.  All of these are hard skills, and they are usually taught over the course of a full undergraduate and then postgraduate research degree at university.  It would be hard for a high school student to have skills sufficient in these areas to produce something publishable.
Having said that, if you have a good and novel research idea, and you have a rough idea of how to do the research in a substantive sense, you might be able to find an experienced researcher who is willing to help you (perhaps in exchange for co-authorship or even primary authorship) of the resulting paper.  Most high-school students who have published papers in academic journals have had help from researchers who are family friends or parents, and if you don't have these connections it will probably be difficult to get the required help.
I recommend you start by reading some papers in academic journals in the field that contains the topic of interest to you.  Browsing some articles in those journals will give you a sense of what is required to produce a published paper.  If that doesn't put you off, write up the goal and methodology for your project and show it to some academics in the field to see if it makes sense, and to see if you can find a researcher interested in helping you.  Bear in mind that when academic researchers collaborate with students, we are usually dealing with PhD students aged between about 24-40 years old, who already have a strong undergraduate degree in their field.  Consequently, convincing a researcher to collaborate with you will require you to show an unusually high level of ability for someone your age.


Should I clean the engine area

Question: Should I clean the engine area to remove years of built up grease and dirt? What are the benefits?
Comment: Do you plan to clean it with pressurized water or manually going through all surfaces/sockets/tights/etc ? That's a big difference
Comment: @KromStern I don't know. That might be the topic of another question. Right now it seems that manual cleaning might be easier because I don't have hot water nearby.
Comment: There are also degreasing chemicals marketed for this purpose, but they're highly flammable and I'd be a bit scared to use them. I'd be interested in hearing opinions on this too.
Answer: Aside from the general desire for cleanliness, there are couple things that come to mind:

With clean engine it is easier to see if anything is out of order, such as fluid leak. This, potentially, can have dire consequences, if not caught in time as, according to U.S. NFPA report, 2/3 of vehicle fires are caused by mechanical or electrical failures.

In 1994-1998, roughly two-thirds (66%) of the highway vehicle fires were caused by some
  form of mechanical or electrical failure, such as part failures, short circuits or backfires. Part failures, leaks or breaks caused one-fifth (19%) of the passenger road vehicle fires. Short circuits or ground faults caused 18% of the fires in these vehicles, 10% were caused by backfires and 7% resulted from other electrical failures.

And while distribution of causes may differ by country (in UK, for instance, vast majority of vehicle fires are caused by arson, according to annual governmental Fire Statistics reports, compared to less than a fifth in the U.S.), significant portion of accidental fires are still caused by mechanical failures, and fluid leaks onto hot exhaust, or combined with electrical shorts and other similar causes, are a serious concern.
In the above report, annual averages had shown that even general lack of maintenance was attributing cause to slightly more fires than as result of damage in collisions or overturns.
Dirt, grime, oil, road salt, and other contaminants lead to premature deterioration of such engine components, as hoses, electrical wiring, sensitive electronics (ECU, sensors, etc.) and so forth. Some of this, again, can lead to issues presented in the first item of this list.
Comment: @R.., If one would read the report, one could infer, that the vehicle fire is a statistically significant problem, as in U.S. alone there are over 300 000 vehicle fires a year, and that vehicle fires is a significant portions of fires overall.
Comment: That's a stupid statistic. Of course some large percentage of vehicle fires (or any other vehicle problem) are caused by an underlying problem of some sort. The useful statistic is what percentage of mechanical or electrical failures leads to a vehicle fire.
Comment: Public fire departments responded to 329,500 vehicle fires in the United States during
2002. These fires caused 565 civilian deaths, 1,825 civilian injuries and $1,392,000,000
in direct property damage. Vehicle fires accounted for 20% of the
1,687,500 fires reported to U.S. fire departments that year. In that same year, vehicle
fires caused 17% of all civilian fire deaths, 10% of all civilian fire injuries and 13% of the
nation's property loss to fire.
Comment: Granted, this does not provide explicit answer, but it does give one something to compare to in a general scheme of fire-related things. It is a matter of risk management. If you want to disregard the "stupid" statistics, and take on additional risk, all the power to you. On the second thought, your disregard is costing the whole society, so no.
Comment: By the way, statistics is not stupid. Stupid are people who (mis)interpret (or disregard) it.
Comment: What I mean by "stupid statistic" is that it sounds like it's saying one thing ("this issue causes a lot of fires") when it's actually not saying that. I agree the issue is important, but using the wrong statistic to argue that is misleading.
Comment: @R.. Perhaps, I should rephrase along the lines that 20% of all fires in U.S. is vehicle fires, and out of those 2/3 is… etc.?
Comment: The interesting statistic is how much having a fluid leak increases the chance of vehicle fire. That's probably hard to measure. I agree vehicle fires are a serious matter - I've actually been driving behind a vehicle that caught fire once and had to yell at the driver to get out of the car ASAP because she didn't even realize it was on fire when it stalled.
Comment: Wow, that does make us in the UK sound like a bunch of arsonists:-/
Comment: @RoryAlsop, I think it mostly related to riots. Probably, football. :)
Answer: Having a clean engine bay is really nice when you need to work on the engine, and it helps identifying leaks. There are a few things to be careful about when cleaning though.

Pressurized water can get into electrical connections and cause shorts.
Water causes corrosion.
Cleaning old degraded plastic connectors and shields can cause them to fall apart.

If you clean it, make sure you disconnect the battery, let the engine cool, and then clean everything. Afterwards use compressed air to dry out all the electrical connections and blow the pooled water out of all the crevices (especially fuse boxes), then let it dry for a few hours (best to do on a warm day). Connect the battery and drive it for a good hour to get it hot and finish drying out.
Answer: On the downsides, when buying an used car, I'd be suspicious of vehicles with overly clean engine compartments (even though some dealers would do it as a matter of procedure to all cars they resale). This is usually an indication there is a serious leak somewhere which will almost surely be expensive to repair. This is more valid when purchasing a car from a private individual instead of going through a dealer.
So, you might not want to scrub it shiny just before reselling your car, but as a matter of maintenance, it positively won't hurt.

Should I clean the engine area


Mail.app: open messages in tabs instead of windows?

Question: Is it possible to have Mail.app open and manage messages using tabs instead of windows? Google tells me a plug-in called MailTabs was created for this back in 2011, but it's now defunct, and I can't seem to find any other options. Thanks!
Answer: MailTabs previously would only install up to Lion.
I just confirmed MailTabs can now install on Yosemite, since it seems to be detecting 10.10.1 as 10.1. Messages that are opened as separate windows will fill the window as if taking up a tab. The Shift-Command-LeftSquareBracket and Shift-Command-RightSquareBracket keys work in that you can navigate between the messages and the normal app view, but there are no actual tabs present. The messages do not stay open between closing the app and re-opening the app. The full-screen view is very broken, and it even got stuck for me, leaving me only with the option to Force-Quit.
This plugin would be extremely useful if it was revived, as it can give you the tab functionality available in Thunderbird. The MailTabs page on the site has not worked for a while and now the parent website itself for http://simplicity.fm now seems to be down as well. My hope that this plugin will be available again is slowly dwindling because of this.


Avoid exception in WebRequestObject

Question: I am reading data from a website as follows:
webRequestObj = (HttpWebRequest)WebRequest.Create("http://localhost/503errorPage.php");
theResponse = webRequestObj.GetResponse();
theResponseStream = theResponse.GetResponseStream();
theStreamReader = new StreamReader(theResponseStream);
theWholePage = theStreamReader.ReadToEnd();

If I get to a page that has a 503 error, the line:
theResponse = webRequestObj.GetResponse();

throws a WebException:
The remote server returned an error: (503) Server Unavailable.

Is there a way check if the website returns a 503 error instead of wrapping everything up in a try/catch block and waiting for the exception?  I am doing many updates per second and would like to avoid the try/catch if possible.
Answer: The cost of the try/catch will be miniscule compared to the time it takes to make the network connection. Really, if performance is what you're worried about - quit worrying :)
Now I'll readily admit that it's annoying at a more philosophical level that you can't make a speculative call - a sort of TryGetResponse - but I don't know of a way of doing that. It's possible that one of the async approaches would work, but that ends up potentially changing quite a lot of code.
Btw, make sure you dispose of the response and the stream - if you don't dispose of the response, you'll be limited in terms of how many connections you can make to the same server.

Avoid exception in WebRequestObject


Reload page or div using RJS

Question: I have a 'like'-counter in a rails project. Whenever one clicks this 'like'-link I want to add one to the like_counter in the database. The logic works well and the database is updated, but I cannot figure out how to set up the Ajax Request correctly so it refreshes the page or the div when completed.
In my view this looks as follows:
<%= link_to_remote 'like', :url => {
                           :controller => 'projects',
                           :action => 'like_it',
                           :id=> @project.id }%>

The controller:
def like_it
    @project = Project.find(params[:id])
    @project.update_like
    render :update do |page|
       page.reload
    end
end

the update_like method is in the model and just adds one to the counter and saves the project (this part works).
As for the page.reload I Firefox throws an RJS-Error: ReferenceError: Reload is not defined. And the page is not reloaded
What do I do wrong? Is there a more distinguished way to just reload the div containing the counter? Any help is much appreciated!
Answer: Try:
render :update do |page|
    page << "window.location.reload()"
end

Reload page or div using RJS


Extract only uppercase text from db field

Question: I "inherited" a db with a field in a table where there are lowercase and uppercase mixed together, eg.
gateway 71, HOWARD BLVD, Chispa, NY

They aren't easily "splittable" with code because they don't always come in this form. What I need is a way to extract only uppercase letters. Is this possible with SQLite?
Answer: This is a case where it may just be easier (and perhaps quicker) to SELECT with any additional WHERE requirements you may have and create a cursor to iterate over the results doing your uppercase checks in code.
Another option with SQLite would be to create a custom function, so you could do something like:
SELECT foo WHERE MYISALLUPPERFUNC(foo) = 1;

Answer: As NuSkooler mentions, this is probably easier and faster to do using a cursor; an especially attractive option if you will only have to do this once.
Here's a quick example (using built-in SQLite from Python REPL):
import sqlite3

with sqlite3.connect(":memory:") as conn:
    conn.execute('''create table t (c, newc);''')
    conn.commit()
    conn.execute('''insert into t (c) values (?);''', ('testing MAIN ST',))
    conn.commit()
    results = conn.execute('select c from t;').fetchall()
    for line in results:
        tokens = line[0].split()
        filtered_tokens = [i for i in tokens if i.isupper()]
        newc = ' '.join(filtered_tokens)
        conn.execute('update t set newc = ?;',(newc,))
        conn.commit()

    conn.execute('''select c,newc from t;''').fetchone()
    # (u'testing MAIN ST', u'MAIN ST')

Comment: I think he wants to extract the uppercase words and not turn them all into uppercase.


Why does one get their head tonsured and offer the hair to Lord Venkateswara in Tirupati?

Question: Many Hindus who visit Tirumala Venkateswara temple in Tirupati get their head tonsured and offer their hair to Lord Venkateswara. Why is this tradition followed? Why is it only followed in Venkateswara temple and not other temples?
Comment: It's followed in many other temples Ex: Dharmasthala
Answer: A small but popular story is there for this.
When Lord Sri Venkateshawara  (MahaVishnu/Balaji) was inside the snake-antHill on Tirumala , one sacred cow is to come and give milk to the Lord daily (Brahma took the form as sacred cow), When a cow-herd man at once saw the sacred-cow pouring milk in the snake-ant Hill, he became angry and without understanding the truth, the Cow-herd man took the axe and has hit the cow on the cow's head with the axe. The Supreme Lord Sri Venkatesha(Vishnu) who was present inside the snake-antHill received the hurt of the axe on his head from the cow-herd man instead of Cow getting hurt. When Lord received the hurt of the Axe on his head, the portion of his hair on his head disappeared due to hurt by the axe. When mother Neela Devi saw Lord being hurt on his head, she immediately removed the hair from her head and placed on the Lord's head in the portion where the lord was hurt. Immediately Lord became well and Lord's hair reappeared as beautiful as before he was hurt. Lord Venkatesha(Vishnu) knowing that hair is one of the beautiful features of women, Lord Sri Venkatesha promised that his devotees will shave Hair of their head (tonsure) and dedicate their hair to her. Neela Devi accepts the hair sacrificed by Devotees of Lord Venkatesha(Vishnu) and Lord blesses his devotees who sacrifice their hair for the sake of the Lord. This is the reason why Devotees tonsure or shave their head in Tirumala.
There are also Spiritual reasons: Tonsure or Shaving hair as offering for Lord represents a real sacrifice of material beauty and giving up false-ego in the way of shaving their hair as the sacrifice to please Supreme Lord.
Sources:

Wikipedia article on Venkateswara Temple, Tirumala .
Quora question on the same topic.
Comment: You should cite sources.
Comment: as @KeshavSrinivasan as mentioned please cite the sources and i will accept the answer
Answer: There is a verse in Dharma Sindhu and also possibly in some other Puranas:

tIrthopavAsa kartavya sirasomundanAnicha sirogatAni pApAni yAntimandanatho yatah

What it means is whenever one goes on a pilgrimage, be it to a temple, a river or any other sacred place, they should clean-shave their heads because for everyone their 'pāpa' is attached to the hair. Symbolically, by getting rid of your hair, you are getting rid of your pāpa or sins and become eligible to visit that pilgrimage site.
This is also the reason why a son should clean-shave his head, get rid of his sins, and is then qualified to perform the funeral rights or Śrāddha on the death of a parent.
All the above is explained in this YouTube video (Telugu) of the program 'Dharma Sandehalu' which aired on Bhakthi TV channel.
It's possible that over the years, people forgot the original underlying reason behind this tradition and now do it for other reasons.
Comment: Do you believe sins are stored in hairs?
Comment: No. IMO, removing one's hair is more of a symbolic gesture/reverence. As for sin itself, my current understanding is right & wrong, morality, etc. varies from community to community, country to country etc., so what you consider a sin needn't be a sin for others.


Open Visual Studio project on MAC OS X

Question: I have a c++ project in Visual Studio, and I need to run that project on MAC OS X computers. Is that possible?
Answer: MonoDevelop Can be used to open and manipulate Visual Studio project on a Mac.
It can however only open .csproj files, not the legacy .vcproj. You can convert your old project to a compatible one, using Visual Studio Conversion Wizard.
As you are working with C++, you are however free to use any IDE or editor you like. As long as loosing your project metadata files isn't a problem, you can just open the files in Xcode, TextMate, Sublime Editor or any editor of choice.
Answer: Even though it's several years after asking this question, there is a possibility at last.
You can now install Visual Studio Code on Mac and work with C++. Here's how you can do it.
Comment: the 2nd link is for windows... the question specifically asks for mac os x
Answer: There are SOME things you can do with Visual Studio Projects / Solutions on a Mac if you use Expression Studio.

Open Visual Studio project on MAC OS X


In terms of betting, how would you say "You will get 5× in return if you win"?

Question: In terms of betting, how would you say "You will get 5× in return if you win"?
Answer: You would likely "place the odds at 5 to one."
source
Comment: I'm not really a betting man, but actually I think if you bet £1 on a horse that wins, and the bookie returns you £5, that would mean the odds were **4 to 1** (your winnings are 4 x £1 *plus* your £1 stake which you also get back).
Comment: @TimLymington: Like I said, I'm not really a betting man (I've only  been in a betting shop a couple of times in my life, and *that* was only to look for someone). The thing is in most informal contexts (betting between friends) the stake *never actually changes hands*. So if you bet someone £1 at 5:1 that you can drink him under the table, say, you should only expect to receive £5 when you win. Of course, in those circumstances your opponent would be *really* woozy, so you might persuade him to give you £6 anyway! (or maybe you get £0.20 - I'm really not too clued up on betting odds! :)
Comment: @FumbleFingers: A bookie who took your £1 bet at five to one but tried to fob you off with £5 total would find himself in trouble (though automated bookmakers like fruit machines or the National Lottery seem to get away with it). I believe OP is asking about a five-to-one bet.
Comment: I think that should be 4 to 1, not 5. I.e. you will put 4 pounds into the pot for every 1 that the other person puts in, and the winner gets the pot.
Comment: The phrasing "five to one" implies that for every one you put in, you will get five back if you win (*including* your stake). This means that a bet of £1 at 5:1 returns £5. It doesn't matter if you exchanged money beforehand or not. If you put your 1 in before, you get 5 back including the 1. If you didn't put your 1 in before, you get 4 or pay 1 depending on victory. In a situation where one winner gets the pot, the odds are N:1 where N is the number of players (assuming all players ante the same amount).
Answer: To say it in betting terms, you'd say that the odds are five to one, probably. In literal terms, you would read your sentence aloud as "You will get five times in return if you win".
Answer: You will get your money back fivefold
The suffix -fold means

used with numbers to make adjectives and adverbs describing how much something increases
  a fourfold increase (an increase in an amount that makes it four times larger than before)
Answer: A four hundred percent return might work as well.
Answer: If you were looking for a slightly more rustic solution than those already presented, you could say "five will get you twenty-five," substituting any two sets of numbers that represent x and 5x.


Statistical 'process' behind quantum gates

Question: Thinking about gate creating entangled state, it looks to me that the inputs to the gate look like marginal/independent distributions, and the output looks like their joint distribution. Does this process have any statistical meaning?
Comment: what do you mean exactly with "the inputs look like the marginal/independent distributions"? How does an input/output "look like a distribution"?
Comment: Squared qubit's amplitudes sum to one (as well as any product state), entanglement looks like dependent joint distribution, and no-entanglement mean that factoring to two separate states is possible (again, the same behavior as independent random variables). So the gate creates some statistical joint distribution (separable or not) - the question is, how can this process be described from statistical point of view.
Comment: that is still unclear. When you say "entanglement looks like dependent joint distribution", I assume you mean "entangled states produce correlated (marginal) probability distributions"? That is true, but misleading: separable states can also give correlated probability distributions: consider as a trivial such example a maximally mixed state.
Answer: The question is a bit ambiguous but yes you can think of unentangled states as independent and the process of entanglement as "adding" correlations. Take the following unentangled state for instance:
$$\vert 00 \rangle + \vert 10 \rangle$$
Then the probability distribution of each qubit is independent of the other:
$$P(q_1|q_0) = P(q_1)\>\> and \>\>P(q_0|q_1) = P(q_0)$$
But by performing a $C_{not}$ with $q_0$ as the target we put the states into complete entanglement or correlation (statistically):
$$\vert 00 \rangle + \vert 11 \rangle$$
$$P(q_1|q_0) = P(q_0)\>\> and \>\>P(q_0|q_1) = P(q_1)$$


When clicking Save&New, choose record type

Question: I have a related list on my object. My Child object has two record types. The record type of the child depends on the record type of the parent, so my button does that correctly.
My problem is this: When I click "Create New Child", then I pass the record type and the correct child record type is shown. The problem is, when I click on "Save & New". That will bring the user to the record type choice page. Is it possible to pass the record type of the previously saved record along with the save&new button?
Tia.
Comment: Is "Save & New" a custom created button?
Comment: No, it's the standard button.
Answer: This time you would need to create a VisualForce page with a controller extension and override the Save & New button. There is this article here about how to implement the save & new functionality.
If you look at the url when you create a new object, in my case the account
/001/e?retURL=%2F001%2Fo&RecordType=0122000000064UU&ent=Account

You can bypass the record type selection by assigning the record type Id to the Url. You would need to create the URL, select the various record type you cannot hardcode ids and encode the url in the extension controller.
Let me know if this is what you desire and will update the answer with more information.
Answer: I assume 'your button' is a custom button. There is no way of overriding Save & New button. So you can consider a work around:
Do you want the user to select the Record Type for the child ever? If they don't have to then,

remove both the record type of the child from the profiles
Create a workflow on child object, that sets the record type as the parent's.

Does that help?
Answer: I have the exactly same problem.
From my Master details page I have a custom button that runs some javascript to redirect to create a new child record with the RecordType specified by the Master. It also auto-fills the master record Id.
  var url ='/a6c/e?RecordType=' + record_id + '&CF00NO0000001s1Cj={!Purchase_Request__c.Name}&CF00NO0000001s1Cj_lkid={!Purchase_Request__c.Id}&saveURL={!Purchase_Request__c.Link}&retURL={!Purchase_Request__c.Link}';
  window.location = url;

I've tried to use the save_new_url querystring without success.
Creating a new VisualForce page to override or remove the Save & New button is not an option. I will have over 10 different Record Types, all with their own Page Layout. Maintaining this with custom VisualForce pages is not feasible.
Hope somebody could come up with an idea on how to solve this.
Comment: Irri, you've posted this as an answer (=solution) to the above question.  If your question is the exact same there is little point in re-posting it here (or as a new question). There is no way to do this in the standard UI at this time.


Deserializing a class defined in a plugin

Question: In my process I load plugins from which I get objects I use in the rest of the process.
This class inherits from MyInterface so serializing it is not a big deal.
I just implement a virtual const unsigned char* Serialize() method in it.
What I can't figure out is how I can deserialize it, since the deserialization method is supposed to be static, I can't do the same.
Must I expose a Deserialization method from the plugin DLL or is there a better way to do it?
Comment: Show some actual code and context. This is unanswerable in it's current form.
Answer: Whether or not you need to expose the Deserialize function in your DLL's exports depends on your application's design.  If you need clients to call the Deserialize function, then it needs to be exposed.
As far as how it works, Deserialize needs to have the same basic architecture as a Factory Method.  The serialized data needs to indicate what type of object it represents, in addition to all the goodies in the object.  Otherwise, the whoever calls Deserialize needs to know what kind of object is to be deserialized, but it sounds like this is not possible or desirable in your scenario.  If you store the object type as part of the serialized data, you can then switch on it in your Deserialize method, and construct the correct type of object.
Comment: ok, but if someone else writes the plugin, I have no idea what is inside the object he sends to me.


Does Linux have timer coalescing?

Question: I've been reading about timer coalescing. Windows has had it implemented for a while, and Apple just integrated it in 10.9. I can't find much information about it for linux.
Comment: If you don't get any hits you may have more luck here: http://unix.stackexchange.com/ depending on the context. (just don't double post)
Comment: @Enigma there's no need for that, it's perfectly fine here. Your comment encourages cross-posting which is frowned upon
Comment: @Sathya Fixed. I am not in disagreement but just trying to facilitate an answer for the asker since it is specific and there happens to be overlap.
Answer: From Wikipedia:

Timer coalescing
From Wikipedia, the free encyclopedia
Timer coalescing is a computer system energy-saving technique that reduces central processing unit (CPU) power consumption by reducing the precision of software timers to allow the synchronization of process wake-ups, minimizing the number of times the CPU is forced to perform the relatively power-costly operation of entering and exiting idle states.[citation needed]
The Linux kernel added support for deferrable timers in 2.6.22,1[2] and controllable "timer slack" for threads in 2.6.28 allowing timer coalescing.[3][4]

Citation 1, in the Wikipedia header, is to:

Linux 2.6.22 Released, 8 July 2007

So timer coalescing has been around, in Linux, for 6 years.
Comment: Is that an answer though? It says it allows it, but I've never heard about it otherwise. Does it need to be activated? Does Ubuntu come with it on standard for example? I know that some things need to be turned on when building the kernel. This sounds like one of those times.

Does Linux have timer coalescing?