What would happen when if fuel is added during the combustion process?

Question: What would happen when more fuel is added during a combustion process? Will the time of combustion decrease or increase or stay the same?
Answer: The short answer is "it depends."
Gasoline engines would ideally run with a stoichiometric mixture – just the right amount of fuel and air to produce complete combustion. Now in reality you don't necessarily get to do that. For example some aircraft engines are designed to run with an excess of fuel at high power in order to provide additional cooling, the "cool with fuel." Other factors such as exhaust gas temperature and emissions considerations will also impinge on the "perfect" mixture. As you add more fuel, the mixture becomes richer, within limits this will increase power and lower temperatures – at the expense of efficiency.
I think the burn time in a gasoline engine is related to the speed with which the flame front advances in the cylinder. I would guess that this is relatively constant and thus adding fuel would not produce much of a change in the burn time of a gas engine.
Diesel engines run with an excess of air, so in a diesel you can add fuel and increase power without loss in efficiency that would occur in a gasoline engine.
In a diesel there are two ways that you can add more fuel: you can use bigger injectors and pump the fuel in faster, or you can increase the injection time. If you do the former you'd expect the burn time to be about the same, if you extend the injection time then the burn time would also be extended.
Extending the injection time means that more of the more of the stroke is used for combustion and there are limits to the benefit that you can achieve here. If you advance ignition too far the combustion starts to resist the piston as it moves towards TDC, if you extend the burn for too long then you may be unable to extract all of the energy from the fuel.
Answer: Keep in mind that engines are designed to have the combustion chamber closed tight during combustion. If we relax that constraint then I'd say it depends on the timing of introduction for that additional fuel.
If combustion is already occurring then the fuel catches it and creates a second explosion that either

Assists the explosion to make it more forceful or of a longer duration.
Does nothing because the cylinder is as the bottom of the power stroke so there's nothing else to receive the new power.
Does nothing because a valve is open and the force of gas expansion leaks out leaving no pressure to be harnessed.
Does little because the fuel is partially combusted, maybe even leaving fuel for the next cycle.

Viewed in a bigger picture I'd say that it would complicate matters and break the critical timing that an engine is designed to have. If you're designing an engine you need some simple discrete model of a combustion event, not a complicated chain of combustions that conspire in some complex hard to model fashion which introduces the need for additional timings that need to be coordinated and managed. I'd be curious of the effects on the valves in having a combustion where the wrong valves are open at the wrong time, should make a condition where you have no explosive pressure and things just don't work. I'd wonder too if the fuel injectors could be at risk of catching fire too with the valves open when combustion occurs. The engine would probably just be destroyed firing at random, as if the timing belt were broke or something.
We might get some insight too by comparing to systems which have fuel on fuel on fuel combustion, like a rocket or something, which I don't know much about. All and all we have to keep in mind that combustion engines don't want combustion for combustion sake but rather seek to harness that chemical energy in gas and convert it into mechanical energy via rapidly expanding gases via the explosion from the spark.
Comment: so the question is about diesel engines.. Which way does the rate at which combustion occurs change when additional fuel is added to a cylinder? What happens to the combustion time
Comment: @Ryze2 Welcome to the site!  If the question is about diesels, you should put that in the question.  And preferably, put it in *before* you ask the question.  It can be quite frustrating for answerers to spend 20 minutes typing up an answer to then have the question changed. But, it's your first question.  Your next one will be better, right? ;)
Answer: Gas engines actually run with a variety of mixtures, stoch. is only one possible mixture.  For max power, the engine will run rich; this is partially to enhance power and partially to protect the engine from knock during high load events.  On the highway, the engine can run lean.  Some Honda's will run as lean as 17:1 or even 20:1 on the highway cruising.  There is also deceleration fuel cutoff; when you lift off the gas at a high rpm, the engine will cutoff fuel largely and the engine will go into a lean condition as well.  At idle, the computer will target stoch. and run in closed loop via the O2 sensor(s).  When you are blasting around at WOT, the engine most often runs in open loop and uses look-up tables to compute the fueling and the MAF or MAP senors to judge how rich to run.


Can a catalytic convertor be to small for an engine?

Question: My car, a 2L BMW e34, failed its MOT on the gas test for CO readings. The tester said he thought it may be the cat had failed. I put a brand new exhaust system with cat and oxy sensor on my car, new spark plugs, and air filter. Took it for the retest and it still failed on the same thing, although a bit better readings, even though the guy testing it did his best to make it pass. The cat on the new exhaust was half the size of the one that came off. Now I'm wondering if the cat could be to small for the engine? We are now at a loss for ideas how to make it pass. My mechanic says it does not make sense.
Any advice please
Comment: Are you sure its the correct part for your car? Given that it is smaller than previous item.
Comment: Non OEM cats are sometimes smaller, although I think the current answers have addressed your question but I want to add, make sure you do a long drive before going to the MOT place. My MOT place is near my house and I've had difficulty with emissions because although it looks like the engine is up to temperature, the cat might not be. Go for a hard drive and make sure you leave the engine running when you arrive at the test station.
Answer: The basic answer to your question is: Yes, a cat can be too small for the engine.
In your case, I wonder, though. Your engine is very small in the grand scheme of things. I had put a cat on my V8 Camaro which was good for an engine up to 460 cubic inches (or 7.54L). It wasn't what I would call "large". I know my car passed the emissions testing without issue when I brought it in for testing. Point being, the size of the cat does matter, but I'm wondering in your case.
There are a couple of alternatives you could look at to see if there's an issue.
I'm not sure if your BMW runs a Manifold Absolute Pressure (MAP) sensor or not (it may just use a Mass Air Flow (MAF) sensor). If this is faulty, it could be sending the wrong signals to the ECU and causing the air/fuel ratio to drift away from stoich, causing high CO readings. If your car only runs a MAF, you may try cleaning the MAF to see if it helps. It could also be the engine temperature sender or the throttle position sensor. Both of these would also cause an issue moving things away from stoich. These things would be very hard to check by the average person as to whether they are functioning correctly, so you may want to have your mechanic take a look at them. These can provide false data to the ECU without causing the ECU to kick out a trouble code (check engine light).
WRT your cat, do you know if it was broken in properly? If not, it could be it isn't working to full efficiency. I'm sort of doubting this, though, since you are still facing the same issue with the new cat as you did with the old.
All in all, I guess what I'm saying is, the size of the cat could be at fault, but I'd be looking at other areas prior to replacing it with a bigger one. Considering you are still facing the same issue with the new cat as you were with the old one, this could be the case.


Filter coefficients for colored noise Voss Algorithm

Question: If I use a generic filter for generating colored noise like pink,brown,white then how do I modify this statement and how do I know what are the coefficients to be used in AR model for different noise.Signal is white gaussian noise and y gives different noise based on the value of a.
Comment: This is not a well-phrased question. If you have MATLAB programming questions, ask them on [Stack Overflow](http://stackoverflow.com). If you have questions on the spectral shape of different types of noise and how to generate them, then I would reword your question to be more specific in that direction.
Comment: I have not asked about programming.I have specifically asked about the coefficients of the numerator and denominator required to design the filters.In some answers in Mathworks http://www.mathworks.com/matlabcentral/newsreader/view_thread/292182 they mention the value of a=-0.9,i wanted to know on what basis they do that and hence what shall be the values for other colored noises.
Comment: Even just the conceptual answer for some types of colored noise can be more complex than you might expect (see e.g. http://dsp.stackexchange.com/questions/322/pink-1-f-pseudo-random-noise-generation).
Comment: There must be some values available for a,b for colored noises like the one shown in the link : http://www.mathworks.com/matlabcentral/newsreader/view_thread/292182 without going into the mathematical concept else how did the responder suggest that value?
Answer: Here, $a$ is a filter coefficient for a simple single-pole recursive low-pass filter. If you look at the documentation for MATLAB's filter() function, you'll see this corresponds to the difference equation $y(n) = x(n) - a y(n-1)$`. Let's analyze the filter in the $z$-domain to get its frequency response (just remembering that $z^{-1}$ corresponds to a single sample delay:
$$y(n) + a y(n-1) = x(n)$$
$$Y(z)*(1 + a z^{-1}) = X(z)$$
$$\frac{Y(z)}{X(z)} = \frac{1}{1 + a z^{-1}} = H(z)$$
That's the $z$-domain transfer function. We can substitute $z = e^{j\omega}$ where $\omega$ is the normalized frequency, where 0 is DC and $\pi$ corresponds to the Nyquist frequency of whatever sampling rate you're at. Now you should realize that if you use the same digital coefficients at different sampling rates, you will get filtered noise that varies depending on the sampling rate. If your sampling rate is $F_s$, then $\omega$ corresponds to the frequency $\dfrac{\omega F_s}{2 \pi}$. Let's find the frequency response:
$$G^2(\omega) = |H(e^{j\omega})|^2 = \left| \frac{1}{1 + a e^{-j\omega}} \right|^2$$
$$G^2(\omega) = \frac{1}{|1 + a(\cos(-\omega) + j \sin(-\omega))|^2}$$
$$G^2(\omega) = \frac{1}{|(1 + a \cos(\omega)) - j \sin(\omega))|^2}$$
$$G^2(\omega) = \frac{1}{(1 + a \cos(\omega))^2 + \sin^2(\omega)}$$
$$G^2(\omega) = \frac{1}{1 + 2 a \cos(\omega) + a^2 \cos^2(\omega) + \sin^2(\omega)}$$
$$G^2(\omega) = \frac{1}{1 + 2 a \cos(\omega) + a^2 \cos^2(\omega) + (1 - \cos^2(\omega))}$$
$$G^2(\omega) = \frac{1}{2 + 2 a \cos(\omega) + (a^2 - 1) \cos^2(\omega)}$$
$$G(\omega) = \frac{1}{\sqrt{2 + 2 a \cos(\omega) + (a^2 - 1) \cos^2(\omega)}}$$
Let's plot the frequency response with $a = -0.9$: WolframAlpha plot. We can also take 20 Log10() to get the frequency response in decibels: WolframAlpha plot .
Now we can find out some things about this filter. For example, its gain at DC is greater than unity! $G(0) = \dfrac{1}{\sqrt{1 + 2a + a^2}}$. When $a = -0.9$, the filter increases the DC gain by a factor of 10, or 20 dB. Often filters are characterized in terms of their -3 dB point, which is where their magnitude decreases by $\sqrt{2}$ from their peak. Let's solve for this point:
$$\frac{1} { \sqrt{2} \sqrt{1 + 2a + a^2} } = \frac{1}{\sqrt{2 + 2 a \cos(\omega) + (a^2 - 1) \cos^2(\omega)}}$$
$$\sqrt{2} \sqrt{1 + 2a + a^2} = \sqrt(2 + 2 a \cos(\omega) + (a^2 - 1) \cos^2(\omega))$$
$$2 + 4a + 2 a^2 = 2 + 2 a \cos(\omega) + (a^2 - 1) \cos^2(\omega)$$
Now treat this as a quadratic in $\cos(\omega)$, let's substitute $x = \cos(\omega)$ and use the quadratic formula:
$$(a^2 - 1) x + 2ax + (-4a - 2 a^2) = 0$$
$$x = \frac{-2a \pm \sqrt( 4a^2 - 4(a^2-1)(-4a - 2 a^2)) }{2 (a^2 - 1)}$$
Now, we want the solution corresponding to positive frequencies, and it turns out that choosing the result with the minus sign gives us that. So, we can take the inverse cosine, and get our -3 dB frequency:
$$\omega = \arccos\left( \frac{-2a - \sqrt{4a^2 - 4(a^2-1)(-4a - 2 a^2)}}{2 (a^2 - 1)} \right)$$
Let's plug it in for $a = -0.9$ and verify:
$w = 0.0958385$
$H(z) = 7.07107 = \dfrac{10}{\sqrt{2}}$
It might be useful to go the other way, to design a filter by choosing a value of a to have some desired -3 dB point:
$$2 + 4a + 2 a^2 = 2 + 2 a \cos(\omega) + (a^2 - 1) \cos^2(\omega)$$
$$2 + 4a + 2 a^2 = 2 + 2 a \cos(\omega) + a^2 cos^2(\omega) - \cos^2(\omega)$$
$$(2 - \cos^2(\omega)) a^2 + (4 - 2 \cos(\omega)) a + \cos^2(w) = 0$$
$$\frac{ -(4 - 2 \cos(\omega)) +/- \sqrt{ (4 - 2 \cos^2(\omega))^2 - 4(2 - \cos^2(\omega))(\cos^2(\omega)) } }{2 (2 - \cos^2(\omega))}$$
And again we can verify by plugging in $\omega = 0.0958385$, and we'll see that we get $a = -0.9$.
So, for example, you could use these formulas to pick values of $a$ at different sampling rates, so that you have the same frequency -3 dB point. You can use the formula for gain at DC, for example, to normalize the filter so its gain at DC is unity. You can take the formula for gain, convert it to decibels, and see that it approaches roughly a -6 dB/oct slope, which is why it's being used to shape noise like this.
Comment: WOW !!This mathematical analysis would take atleast couple of days for me to digest!Thank you for the concept,I really appreciate.So,if you would be kind enough to also tell what should be the values of a (if you remember,since it will help me to double check after the calculations) for different noises like Sine Weiner,red,violet,pink etc.
Comment: Also,there are these terms "bounded","unbounded" noise/signals. Under what category does White Gaussian noise, Gaussian Colored noise and non Gaussian colored noise fall into?
Comment: That sort of filter won't generate *exactly* those types of noise. You'll have to come up with some way to approximate it by choosing `a`. I think a good first step would be to normalize the filter's gain to unity at DC, and then to pick some point from the desire noise profile's frequency response, i.e. the 3 dB point, and try to match that. Honestly I don't really know anything about approximating different kinds of noise; sorry I don't have more information to offer.
Comment: Hi,I could not follow the last point which u have made >>It might be useful to go the other way, to design a filter by choosing a value of a to have some desired -3 dB point.Which formula to use for this?
Comment: How is it possible to know which noise has what frequency like in the answer mentioned -3dB.
Comment: @Phonon equations are worked nicely, but at equation 6 why alpha is dropped from sine component.  Please clarify if I am missing something. Thanks


Keeping installed programs when installing new OS

Question: I currently have a separate partition for / and /home. However, in the past I've had a separate /usr for all my installed programs. Whenever I change between similar OSs (eg Mint and Ubuntu) I simply reinstall and format my / only, keeping files and programs. I am looking for a way to migrate all my programs to /usr without having to redownload packages.
Answer: If you kept the same copies of the files in /usr, that would be unlikely to work correctly, and to some extent it would defeat the purpose of installing a new OS. For Linux, a "new OS" essentially means a new version of the files in /usr, so you would be missing out on any improvements or vendor customizations that were made to those programs, and you would have no guarantee that they would be compatible with the configuration files stored in /etc, log files in /var, etc.
However, something similar can be done which is safer and more useful: you can save off the list of all currently installed packages and then restore that list after you install the OS:
Restoring all data and dependencies from dpkg --set-selections '*'


Procedural generation of physics-enabled structures (in a 2D world)

Question: Is it possible to procedurally generate stable structures out of rigidbody objects at a reasonable runtime speed? Imagine Angry Birds's levels kind of structures but generated procedurally.
Comment: Then, perhaps in a cellular automata fashion, you could build castle-like structures by using rectangular collision shapes (such an algorithm is hard to detail here, hence just a comment on one possibility). You can add a new rectangular collision shape if and only if the simulation does not wake-up the already stable objects (compute impulses/forces and see that they're below the wake-up threshold). The main issue is that your castle will look very unnatural. This is why levels are usually designed by hand (but you could start with a decent arrangement and iterate that and get better results)
Comment: 2D or 3D? (the solvers for 2D are simpler)
Comment: 2D and it will remain so.
Comment: Random hint: I have more than a feeling that a "randomly generated angry birds" would be incredibly boring and frustrating. But maybe this is not what you're after.
Answer: I think the crucial part of this question is how you can procedurally generate stable structures (as generating an unstable pile of blocks in real time should be no problem)
My approach would be to prebuild sub structures that are guaranteed to be stable. Have each substructure store two sets of spans"
* one for the bottom where it requires contact below it.
* one for the top where it has stable sections that can support sub structures above it.
I'd start with subsections that have perfectly level spans and get that working first, then you could add information to each subsection for the amount of slope it can tolerate below it. (this might be pretty tricky as the center of mass changes the way the structure below will deal with the lateral force of friction)
It's worth noting that this method doesn't support some types of stable block piles. All of the sub structures need to be stable on their own. (i.e. you couldn't have a structure that requires a heavy structure above it to hold down some off balance lever)
After that is working you could probably layer on some more sophisticated stability analysis to handle the more exotic substructure types.
Matching up the contact patches exactly will be a key part of making these structures stand up - tiny gaps or interpenetration will cause real problems. It will also help to make sure that the rigid bodies are created already "asleep".
Answer: Of course it can be, but it won't be easy.  Look at Spore by EA, they did it in 3D, and their level of freedom in designing your creatures there is amazing, and your creations there are complex simulated living organisms.  What you want is something much simpler.  What you will need is a validation system to follow a set of rules.  You can't just go off randomly throwing objects on top of each other.  Otherwise most of your procedurally generated structures will tumble down once they the physics engine kicks in.  Good luck.


Op-Amp with Voltage Controlled Gain and Unity DC Gain

Question: I have a car seat motor that I am driving via PWM and am aiming to measure its position by counting the minor variations in voltage across a current sensing resistor attached to the low side of a FET as the motor rotates. At higher duties the Vpp is significantly less (30mV) than those at 25% duty (4.7V). I currently tap the signal for measuring by a microcontroller ADC at two different gain stages to handle this, but desire to make this all happen in one stage with a variable gain circuit so only 1 ADC is needed.
Before I go into what I've attempted I want to state my primary question. How do I dynamically adjust the gain of my waveform to output a signal at a constant Vpp when my input Vpp ranges from 30mV to 4.7V?
I use a TI LMV344 op amp with rails on 0V and 5V. The motors are 12V.
Currently the circuit flow is:

Sensing Resistor Output
Diode voltage clamp to remove DC bias
High gain, non-inverting LPF op amp. Filters out 20kHz PWM signal
Diode clamp to reduce bias. I now know that I can put a capacitor between the resistor an ground on the gain portion of the above LPF
Sallen-Key LPF to further reduce 20kHz PWM signal. Low gain. This is where I tap for low duty signals as any more gain causes the lowest of duties to cause the current signal to saturate the op amp.
Diode clamp to reduce DC bias.
Another Sallen-Key LPF identical to the above filter, no tap. I really wanted to filter out that noise.
High gain, non-inverting LPF op-amp. Higher duty signals are tapped here.

The problem that I have run into is that at the highest duty, the Vpp output is low enough that its sometimes hard to make out pulses. At the cross-over duty, around 60%, the Vpp on the high duty side is saturating and the Vpp on the low duty side is too small.
My current attempt to solve this issue is to use the PWM signal used to drive the motor as a means of adjusting gain on a separate gain only amp. The gain is set to put the high duty signal at the desired Vpp. As the duty increases and inverted copy of the duty is filtered into an analog signal (represented by V3) and fed through a voltage follower connected to the inverting pin on the amp with the gain stage. But when I do this, the DC outputted in step 5 causes the signal to saturate at the op amp's upper rail when low duties are used. If I put a diode clamp between the signal from step 5 and the gain only amp, I can control the gain as I had hoped. When I put a capacitor between the gain resistor attached to ground and ground to reduce DC gain to unity and eliminate the need for the diode clamp, the gain is no longer controlled and the DC gain isn't unity. The diode clamp needs to be replaced since the various Vpp values need different offsets so they won't saturate.
Here's that last paragraph as a schematic. The op-amps are LMV344 op-amps, not LMV324 as the illustration suggests. The input signal has a Vpp from 30mV to 4.7V depending on the motor duty.

simulate this circuit – Schematic created using CircuitLab
And here are two examples of the input signal. THe first is the current draw waveform at 100% duty and the second is the current draw at 25%  duty.
How can I get a variable gain circuit, amplify signals with Vpp between 30mV and 4.7V to around 4.7V, while avoiding saturation due to input DC levels? Thank you in advance. This has consumed me for the past month.
Comment: (1) Have you got any scope shots? (2) What in the motor causes these pulses? It seems a difficult choice of position tracking.
Comment: Scope shots have been added.

I believe that the pulses are from the commutator rotating and switching between brushes. Yes, this is a difficult way of tracking, but I have to stay with how this system's motors are currently tracked. I wish it used hall effect sensors.
Comment: Those two scope shots imply to me that a simple fast comparator would work so, show a scope shot of where you believe the problem waveform occurs.
Answer: One issue is that the filters to get rid of the PWM may be attenuating the signal you want to measure, so I would suggest a notch filter to get rid of much of the PWM signal.
The Fliege notch filter is a versatile and somewhat forgiving filter, and I have run one up for the 20kHz:

It has this simulated response:

The notch depth is -55dB here, although I would expect -40dB as a more realistic response with real devices and layout. The bandwidth between the -3dB points is about 2kHz.
As this filter is unity gain at DC, it would be simple to introduce a DC offset to run on single supply.
Note that R7 is only present to enable the simulation to converge, and the notch depth is proportional to the ratio \$ \frac {C_0} {R_0} \$
You could then use a high pass filter to attenuate any harmonics of the PWM drive signal which may simplify the rest of the signal chain.
Comment: The signal that I care about is between 300 Hz and 500 Hz. The filter portion of the circuit has an +8db gain at 300 Hz, +6dB gain at 500Hz, and -50dB gain at 20kHz. It drops below unity gain around 815Hz. I don't believe that my filters are attenuating the part of the signal I need. Thanks.


Unremovable invisible snapshot

Question: We are running ESX 3.5.0 and are using VCB for making backups. Yesterday VCB failed to remove its snapshot. That has happened a couple of times before, and I removed it manually as usual. But this time the VCB snapshot got replaced by a "Consolidate helper" snapshot instead.
We have had a snapshot that was hard to delete before, so I knew that if I created another snapshot and then selected "Delete all" in Snapshot Manager, it should delete all snapshots. So at the end of the day I shutdown the server, created another snapshot and then deleted all snapshots. All snapshots disappeared from Snapshot Manager, and I went home.
Today the server had been "paused" by VMware, since all disk space on the LUN had been filled by snapshot delta/redo/vmdk files. I had to move another servers disk from the LUN to make it resume again. So the snapshot was not removed after all. There are now several delta/redo/vmdk files on the LUN, but no snapshot i the Snapshot Manager in the GUI.
How do I remove this snapshot?
Comment: Arnim van Lieshout at the VMware Communities suggested using VMware Converter to clone the vm to a new machine. During the conversion all snapshots get consolidated. I followed his advice and it solved the problem.
Answer: Arnim van Lieshout at the VMware Communities suggested using VMware Converter to clone the vm to a new machine. During the conversion all snapshots get consolidated. I followed his advice and it solved the problem.

Unremovable invisible snapshot


Why is up spin in the px orbital and down spin in the py orbital considered an excited state?

Question: Why is this form of p orbital occupation an excited state? I understand that there should be one up spin and one down spin in one orbital box by Pauli's exclusion rule. But in the p orbitals, it doesn't matter, whether we put up spins first or down spins first according to Hund's rule. I thought unless up and down spin are in same box, they don't affect each other. But as what I thought is wrong, I would like to know the exact reason for this. Why is it considered to be an excited state?
Comment: [Hund's first rule](http://en.wikipedia.org/wiki/Hund%27s_rules#Rule_1) states that the lowest energy atomic state is the one that maximizes the sum of the S values for all of the electrons in the open subshell. So, a state with unaligned spins in the p orbitals will be higher in energy than the one with aligned spins and thus it will not be the ground but an excited state.
Comment: see http://chemistry.stackexchange.com/questions/15215/how-can-two-electrons-lie-together-in-an-orbital/15223#15223
Answer: Hund's rule of maximum multiplicity states that for a given electron configuration, the term with the lowest energy has a maximum multiplicity $2S+1$. $S$ is the total spin angular momentum of all electrons in the partially-filled subshell.
For the application of the rule, we consider the 2 electrons in the $p$ subshell and add up their spin quantum numbers to obtain $S$ and the multiplicity. For the ground state configuration, with both electrons "spin-up", we get
$$S=+\frac{1}{2}+(+\frac{1}{2})=1$$
$$2S+1=3$$
For your proposed configuration with one $p$ electron "spin-up" and the other one "spin down":
$$S=+\frac{1}{2}+(-\frac{1}{2})=0$$
$$2S+1=1$$
Since the multiplicity value is smaller, this configuration is not the one which is lowest in energy, and therefore cannot be regarded as the ground state.
Answer: This is a weird effect resulted from Pauli principle.
Naive oversimplificated version: since no two electrons with same spin may occupy the same place, if two electrons have opposite spin, a part of their time they spend very close to each other, and this results in increased electrostatic repulsion term in energy of the state, while in case two electrons have the same spin, they are always away of each other, so the global energy is lower.
For this effect to manifest, a a significant overlapping of orbitals occupied by electrons in consideration must occur. This usually is observed on atomic or molecular level, and sometimes on larger scale


How to simulate the contact between two distant parts in Ansys workbench?

Question: I made a test in Ansys but the result doesn't seem to be the final steady state. The two bodies didn't touch each other. How can I get the right result?
Comment: Is the fixed support (cylindrical roller) in the center supposed to remain in the centre during simulation/operation? I'll have a play later in ANSYS as this question interests me too.
Comment: Is there a reason you can't bring the ring into contact with the roller at the start of the analysis? If the ring is unconstrained apart from the roller, there's no need for that big gap as the initial condition. The act of rigid motion won't cause any additional stress and it just adds more work for ANSYS to do.
Comment: @pauloz1890 Yes, it is. This is a very simple static structural case. The roller doesn't move and the ring bears a downward force.
Comment: I am no Ansys expert, but I suspect that the problem is one of numerical accuracy.  FEM solvers are generally not used to solve large static displacement problems like this, so the numerical engines under the hood are tuned for a very different problem than you are trying to solve.  I suspect that if you take away force B, you will still get a reasonable drift between the parts, but it will be in a completely random direction.
Comment: @ChrisMueller ANSYS can definitely be used for large displacement problems if one takes the time to set it up as a non-linear analysis. For instance the displacement of a fishing rod wouldn't be well suited to a linear static analysis because it deflects so much. But ANSYS can still handle it via a non-linear analysis. I'm not sure this is the problem though as the contact could definitely be modeled in a better way.
Comment: @TrevorArchibald Because I really don't know how to move bodies around.  Sometimes I use 'translate' to move bodies, but the direction and distance are always mistery if their shapes are not so simple. Is there any better way to assemble parts like in CAD softwares?
Comment: @landings You can just import the geometry file from which ever CAD program you use. In the Design Modeler go to File then click "Import External Geometry File". STP or STEP files work well.
Answer: Okay so I ended up having a play in ANSYS Mechanical Workbench. I did a mock up of your problem. Here's how I've been able to successfully model it. Note that a lot of my decisions are based on the Contact Best Practices Guide from ANSYS.
Here's some very important points given your problem but also for contact modelling in general and a frictionless contact type:

As stated by Trevor there's no need for such a large gap initially - you don't need ANSYS to simulate that sort of behaviour because it should be obvious. So move the roller closer to the ring. I ended up moving the roller within 1mm of the ring. Just doing this on its own, however, isn't enough to get it to converge.
Mesh $\rightarrow$ Advanced $\rightarrow$ Shape Checking $\rightarrow$ Aggressive Mechanical (This is generally a good idea for any contact modelling).
After selecting the contact type as frictionless look under Advanced $\rightarrow$ Formulation $\rightarrow$ Normal Lagrange. It has highest accuracy of all the methods, can handle large sliding and interference fit. If you use Augmented Lagrange with frictionless it's likely to diverge when the contact is over a small surface area like your problem. On the other hand if you were considering a bonded or no-separation contact type then Augmented Lagrange formulation seems to converge well.
Frictionless Contact $\rightarrow$ Advanced $\rightarrow$ Interface Treatment $\rightarrow$ Adjust to Touch (should be obvious why I chose this).
Frictionless Contact $\rightarrow$ Advanced $\rightarrow$ Pinball Region $\rightarrow$ Radius. Set the radius to be at least as large as the gap between the surfaces.

Below was the deflection result (left) and Von-Mises Stress result (right). As you can see the stress distribution is not great - around the contact area in the ring there are probably large stress concentrations. You might need a better mesh around the contact area as I spent hardly any time meshing. The main reason for this exercise was to prove that even though there is a gap between the contact surfaces there's appropriate controls in place to model it:

If you're expecting large deflections then you can turn ON "Large Deflection" in Analysis Settings $\rightarrow$ Solver Controls $\rightarrow$ Large Deflection. That might help it converge.
If you're wondering whether you could do this without moving the roller closer to the ring then you could probably play around with the Pinball Radius as well as another option called "Predict For Impact" in the Time Step Controls. I've never used this personally and I'm not sure what effect that would have.
If you have the time, read the best practices for contact modelling.
Comment: This is very helpful. I am not an experienced user, so thank you sooo much for your timely help.
Answer: Unless you're trying to use ANSYS to validate common-sense/newtonian physics then start the analysis with them already touching.

How to simulate the contact between two distant parts in Ansys workbench？


Is the spigot algorithm for $\pi$ useful for computing all the digits of $\pi$?

Question: I'm asking the question here because it's not a purely mathematical question and the answer also depends on how computers work. I think that according to the Wikipedia article Bailey–Borwein–Plouffe formula, there is a spigot algorithm for quickly computing in terms of any natural number $n$ expressed in binary the $n^{th}$ binary digit of $\pi$ after the decimal place in polynomial time. Combining information from the Wikipedia articles Computational complexity of mathematical operations and Fürer's algorithm, I figured out that there exists an algorithm that computes every digit of $\pi$ in order within the time $O(n (log(n))^2 2^{(2 log * n)})$ where $log*n$ is the super root of $n$ to the base 10. I also think that according to this answer, there is an algorithm that for any natural number $n$ computes with the binary notation of $n$ as input, the $n^{th}$ binary digit of $\pi$ after the decimal place in time $O(n^3(log(n))^3)$ of the number of binary digits of $n$.
I believe both of those algorithms have a decimal analogue. If so, it seems that using the Spigot algorithm for each decimal digit of $\pi$ one at a time is slower than doing other algorithm for computing all of the digits. You might be wondering how it's possible to compute it faster than can be done by using any Spigot algorithm on each digit one at a time. Because the faster method of computation keeps some of the statements it previously computed and uses it to shorten the length of time it takes to compute the next digit to less time than it would have taken using the spigot algorithm. My question is not "Is the asymptotically fastest way to compute all the decimal digits of $\pi$ in order faster than the method of computing all its decimal digits by using the asymptotically fastest spigot algorithm for $\pi$ for each digit one at a time in order?" The reason is because I haven't thought of a proof that an asymptotically fastest algorithm for either task even exists. Here are my 2 questions:

Is there an algorithm for computing all the decimal digits of $\pi$ that's asymptotically faster than every method by finding a spigot algorithm for a single decimal digit of $\pi$ and using it on every digit one at a time in order?
If not, then is the fastest way to grow a copy of all the decimal digits of $\pi$ up to a certain point bigger and bigger on Earth to use such a spigot algorithm.

In the real world, computers are a certain size so the spigot algorithm might save memory so it might be faster to do it using the spigot algorithm for that reason. On the other hand, the faster method might only require an amount of memory that varies as the log of the number of digits that have so far been computed.
The real meaning of question 2 is quite complex and depends on what people consider feasible to build so I can't figure out a way to explain really clearly what I mean by it, but I believe that even after showing that the answer to question 1 is no, it's still not easy to figure out whether the answer to question 2 is yes or no.
Comment: Take a closer look at your last link. It refers to generating *decimal* digits.
Comment: @YuvalFilmus If give permission for anyone to edit this question into a different but similar question by rewriting it entirely if they think they can make it into a better clearer question that way. This question might turn out to be understandable by some high memory experts with certain knowledge but it might be completely impossible to write a similar question to this one in such a way that way more people can read it and understand it.
Answer: There is no known method to calculate individual decimal digits of pi quickly. And fast methods for calculating the first n digits of pi in base b are considerably faster than using a method to calculate the k-th digit n times.


Rotation matrix

Question: HI I am wondering if there is a unique matrix that maps $(x_1,y_1,z_1)$ into $(x_2,y_2,z_2)$. These two vectors have equal magnitude and are defined in orthogonal 3-D basis. If there is a unique solution how can I find it by considering rotation about all three orthogonal basis?
Answer: No.
For example, let $p_1 = (x_1,y_1,z_1)^T$, and $d_1 = (x_2,y_2,z_2)^T$. Choose $p_2,p_3 \in \mathbb{R}^3$ so that $p_1, p_2, p_3$ are orthogonal. Let $d_2, d_3$ be arbitrary. Then define the matrix
$$A = \frac{1}{\|p_1\|^2} d_1 p_1^T + d_2 p_2^T + d_3 p_3^T $$
It is easy to check that $A p_1 = d_1$. Since $d_2, d_3$ are arbitrary, it is clear that the transformation that maps $p_1$ into $d_1$ is not unique.
In fact, all transformations $A$ that satisfy $A p_1 = d_1$ can be expressed in this form with appropriate choice of $d_2,d_3$. If the $p_k$ and $d_k$ are chosen to be orthonormal, then the resulting $A$ will be a rotation (possibly improper).
Answer: There are many such matrices. If you find a single matrix $M$ which maps $v_1=(x_1,y_1,z_1)$ to $v_2=(x_2,y_2,z_2)$, then we could multiply such an  $M$ by a rotation matrix whose axis goes along $v_2$.
To get a matrix $M$ we can use $M=1/(v_1 * v_1)v_2^t v_1$. Here by $v_1*v_1$ I mean dot product of $v_1$ with itself, and by $v_2^t$ I mean transpose of $v_2$, which would make it into a column vector. That way $v_2^t v_1$ comes out to be a matrix. You have to use $v_1^t$ when computing the result of multiplying $M$ by $v_1$.
Answer: coffeemath explained why you cannot find an unique such matrix.
On another hand, since you are interested in rotations about the axes, there exists a pair of rotations $R_1, R_2$ about two of the axes of your choices, so that $v_2=R_2 R_1 v_1$. Moreover, if you fix the axes, and the order, I think there are exactly two such rotations.
To understand why, just think in spherical coordinates, where the angles are expressed with respect to the two axes you chose...
Then the first vector is $(R, \phi_1, \theta_1)$ and the second vector is
$(R, \phi_2, \theta_2)$, so a rotation if angle $\phi_1-\phi_2$ and one of angle $\theta_1-\theta_2$ should do it.
The second possibility comes from the fact that you can also do a rotation of more than $180^\circ$ with respect to the second angle....
Comment: Suppose your choice is to rotate around x axis, then around y axis. And suppose v_1 is close to the unit vector for the x axis, while v_2 is close to the unit vector for the y axis. Then after a rotation around the x axis, we arrive at a vector w which is still near the unit vector of the x axis. When such a vector is rotated around the y axis it cannot end up near the goal vector v_2. The rotation about the y axis will preserve whatever angle w now makes with the y axis.
Comment: I think the spherical coordinate approach makes it clear one can use first a rotation about the z axis, and then one more rotation. However, once the rotation about the z axis has been done, in such a way as to change the longitude of v_1 to that of v_2 (arriving at say w) there is another rotation to go. In order to now rotate w into v_2 typically the origin, w, and v_2 make a plane, and the second rotation must be around the perpendicular to that plane, which is not typically one of the three axes (x or y or z).
Answer: In the following, c stands for cosine and s for sine (of any angle $\theta$)
$$\pmatrix{c & s\\ -s &c} \pmatrix{x_1 \\ y_1}$$
So in particular, we have that $s^2 + c^2 = 1$.
The matrix multiply represents the rotation about the z-axis. The magnitude of the vector is preserved as such:
$$\left|\pmatrix{x_1 \\ y_1}\right|^2 = x_1^2 + y_1^2 \quad \text{this is the original magnitude}$$
$$\left|\pmatrix{cx_1 +sy_1\\ -sx_1 + cy_1}\right|^2 = (cx_1 +sy_1)^2 + (-sx_1 + cy_1)^2$$
$$=(c^2x_1^2+s^2y_1^2+2csx_1y_1) +(s^2x_1^2+c^2y_1^2-2csx_1y_1)$$
$$=c^2(x_1^2+y_1^2)+s^2(x_1^2+y_1^2)$$
$$=(c^2+s^2)(x_1^2+y_1^2)$$
$$=x_1^2+y_1^2 \quad \text{and the magnitude is unchanged}$$
You can apply this form of matrix a few times, starting with your first point in 3-D, and reach the desired value in one coordinate at a time. So for example, to rotate about the y axis:
$$\pmatrix{c & 0& s\\0&1&0\\-s&0&c}\pmatrix{x \\ y \\ z}$$
You would only need to do this twice, as the final value would by necessity match as desired, since the magnitudes are the same for the two points.
To find c and s, use $$c=\frac{x_1}{\sqrt{x_1^2+y_1^2}} \quad\text{and}\quad s=\frac{y_1}{\sqrt{x_1^2+y_1^2}}$$
HINT: any two values instead of $x_1$ and $y_1$ in that formula gives a valid c and s for a rotation matrix.
Answer: No, but if you provide two direction wedges, where the two wedges have identical angular width, you can find the unique 3x3 matrix rotator that transforms the input wedge into the output wedge.
What is a direction wedge?  It is an ordered pair of direction vectors, d1 d2.  Each is a 3D direction vector (a unit vector used to represent pointing direction in 3D space).  A 3D direction vector is equivalent to a point on the unit sphere
[ x, y, z].  There is a 1:1 mapping of directions in 3-space to points on the unit sphere, thus to its numerical representation as a unique point on that sphere.  This is highly advantageous for algorithmic development, as the exception cases (singularity, ambiguity, discontinuity) are avoided, while achieving symmetry among the x-y-z features.  There is only one point in 3D lacking a direction (the origin).
Back to wedges.  What is an example of a wedge?  It's just an ordered pair of two distinct directions.  You could be standing on the shoreline in San Francisco, and measure the directions to the two suspension peaks of the Golden Gate Bridge.  To make a wedge, you just need to be clear about their order...[ dir_south_peak, dir_north_peak ].  Those two directions form a 3D pie wedge going out from where you are standing.  The only restriction on d1 and d2 is they may not be coincident or opposite directions.  Another way to say this is, the angle subtended between the two directions is bracketed:  0 < angle < 180.
OK, now here's an interesting problem you can solve with this wedge.  Suppose you have a camera-equipped drone or chopper at your same location.  You want to determine the 3D orientation of this flying platform, and gyros are way too expensive.  How can you build a camera-based software gyro?
Let's say the drone's camera is wide-angle or even a full hemispherical camera, so that it can "see" the two peaks of the Golden Gate Bridge.  This camera system has its own local platform axis system x-y-z which differs from the ground X-Y-Z axes by some unknown, arbitrary 3D rotation.  The ground X-Y-Z axes are reference axes X=[1 0 0], Y=[0 1 0], Z=[0 0 1].  You want to determine the value of the platform's x-y-z axes expressed as 3 orthogonal direction vectors in the reference coordinate system.  That is a great way to represent the 3D orientation of the drone - they'll only be one unique numerical representation for one spatial orientation!  Something you're not going to achieve with Euler angle triplet [ roll angle, pitch angle, yaw angle].
OK, so platform's x-y-z axes orientation is the unknown which we want to solve.
We have the bridge peak wedge measurements [d1, d2] in reference coordinates. The
2nd wedge we need is obtained by having the drone camera measure the directions to the same two peaks.  The angular width of the wedge will be the same.  But the two directions will be different.  They will both be "off" from the corresponding reference directions by the orientation of the drone camera.  Let's call these two directional measurements [d1, d2]cam.
So now we have 2 wedges:
   [d1, d2 ]  (bridge peak directions measured in reference coordinates)
   [d1, d2]cam (bridge peak directions measure by camera having unknown orientation x-y-z)
How do we solve for x-y-z?
This is called the Rotational Inference Algorithm. I need graphics to explain it, so it doesn't appear here. It is published here:
http://spie.org/Publications/Proceedings/Paper/10.1117/12.611602
The short and skinny is that the orientation of the platform, R = [x-y-z] can be computed as:
R1 = rotator [ d1  --  (d1 x d2)norm ]  (-- the y axis is determined by the x and z axes)
R2 = rotator [ d1cam  --  (d1cam x d2cam)norm ]
R = R1 • inverse(R2)
Long answer, but everyone should be aware that you can build a 3D gyro out of a wide-field camera and a software number-crunching algorithm.  All you need are two stable, known directional beacons that the camera can latch onto and process.

Rotation matrix


How to transfer photos to a phone without a computer?

Question: I'm a beginner photographer and I'm facing a problem. I'm going to be traveling for 5 days and of course, I'll be taking my DSLR with me but I can't take a computer with me. Is there a way to transfer photos to my phone without a computer? I've heard of card readers but I don't really know how they work. I'm open to buying one but I don't know if it will be of any help.
Comment: What is the reason for wanting them on your phone?  Storage or the ability to share them. ?
Comment: Possible duplicate of [How can I backup my photos while travelling?](https://photo.stackexchange.com/questions/533/how-can-i-backup-my-photos-while-travelling)
Comment: Does your phone have a (probably micro-) SD card slot? If so, you can just put your card in it, like you would on a PC.
Comment: SD card slots on some phones are mighty inconvenient to use - eg the card slot on the S9 shares an orifice with the SIM card slot, disrupting phone operation when handled....
Answer: On android make sure your phone supports USB otg. Just do a search for usb otg in your app store. You can download an app and it should be able to tell you. Then buy an otg card reader. You'll probably need to find a file manager app that can access it. It's pretty safe to say that the most popular ones probably already have that functionality. No idea on ios, but probably a similar process.
You could also just buy an otg usb cable with a female input and use a regular card reader.
Comment: You often don't need an OTG specific app, any filemanager app should do the job.
Comment: You can get any card reader and then an OTG cable for a couple of bucks.
Comment: I used this method for a photo trip to Cuba for a week. It worked well, backed up photos to an Android tablet nightly. It also gave me the advantage of then backing up from the tablet to a USB stick, so I had 2 copies of everything besides my CF cards.
Answer: If you are using an iPhone there are adapters that are SD to lightning converters that can act like a back up to your phone as well as transfer your photos to your phone.
Another solution is to buy an SSD drives that are specifically made to back up SD cards and camera files. They have a small display and are made fairly rugged. Not inexpensive as they are made for photographers in the field. You can probably find this at a place like B&H.
The WIFi SD cards also work in many cameras and allow you to wirelessly broadcast your photos to a phone, iPad, and computer.
Answer: I have an iPhone and an EyeFi card in my Canon 70D.
I didn't like the built-in Wifi capabilities in the camera, but Canon has some nice software to remote control the camera.
The Eyefi app on the iPhone allows for the photos to be transferred immediately through Wifi (ad-hoc if needed) and land with a selectable resolution in the iPhone, but not in the camera roll.
The Apple Lightning SD-card reader allows me to read the card directly into the camera roll (which again means Photo-stream) and is reasonably fast. Duplicates may be skipped. The adapter fits nicely in my pocket, and is reasonably priced for Apple products.  I keep my pictures on the card until I can read them into a computer.  The phone is really great for a quick edit and an ad-hoc backup solution, and this is the solution I like best.
Answer: You have three options.  Physical card readers for your phone, wireless adapters/settings for your camera, or a wireless card for your camera.
Physical Card Readers

Basically you just plug these in to your phone, and you can go into any file manager and copy the pictures over.
Any iPhone at least down to iPhone 5 should work with this method.
If you use an Android device (Samsung, LG, Pixel, etc), you'll need to make sure that your device supports USB OTG for this to work.  Most recent phones support this. For example,

Samsung phones down to the S II (I know, ancient.)

Most Motorola 3rd Gen phones and up

If you don't know, download a checker app.  Those can tell you easily for free.

Pros:

Fast
Cheap
Easy on your battery

Cons:

You have to take your memory card out of your camera
Possible to lose or break them
Doesn't work on every phone

Wireless Adapters or Settings

For these, the complexity and availability varies per brand and model.  On older cameras, this isn't an option, but for Nikon D3200+, 5200+, 7100+, and 650+ models, you should be able to either use built-in WiFi, or an adapter.  I haven't figured out the different Canon lineups yet, as I use Nikon, so maybe someone could edit with information on which models that works for.  Regardless, you can just Google your camera model and WiFi, and you should get some information on that.
You'll have to use Google to find the right adapter for your camera, as there are quite a few.
Pros:

Wireless
You can often also do other cool stuff with the adapter, like wireless live view, and controlling the settings.
If your camera already has WiFi built in, there will be no extra parts to buy and/or lose.

Cons:

Hard on battery life
Often complicated and/or flaky
If your WiFi is not built in, it's another little piece to lose and break
Wireless methods are slower than physical transferring

Wireless Card

These are probably the simplest, most expensive option.  It's pretty much plug 'n play -- put the SD card in your camera, and download an app on your phone.  The rest is automatic.  EyeFi is the most popular brand, and they have everything down.  Other (off) brands exist, but if you're going this route for simplicity, use EyeFi.
Pros:

Simple
Wireless
Hard to lose (it's in your SD slot)

Cons:

Expensive (three times the price of a regular card)
Battery (?) -- I don't know how much this is a problem with these, as I've never used them in person.
Has to be instead of the SD cards you've already invested in
Wireless methods are slower than physical transferring

I guess there's one other option, which is what I've always used.  Your cell phone is a terrible place for your pictures long-term, so these options might be nice if you need to share the photos pronto.  However, if you don't need to do that, just get a couple extra SD cards!  For a week trip, you could get a couple good 32GB cards for $30, and you should be solid (unless you take a CRAZY number of pictures).  That's what I'd personally recommend.
Hope this helps!
Answer: Western Digital makes a great portable hard drive that has a SD Card Reader where you can drop your files without a computer.
https://www.wd.com/products/portable-storage/my-passport-wireless-pro.html
It also has wireless capabilities that is talked more about on their website like creating WiFi hot spots, wireless access, Adobe Creative Cloud connection, and last 10 hours of non-stop use without a charge.  It is a great companion while on the go.
Answer: You don't mention your camera platform, but there are options.
I'll address Nikon mostly, but there are options.
The One example is something like the Nikon WU-1b which lets you connect via Wi-Fi and sync the photos.
Other more modern Nikon, and Canon cameras have built in WiFi Support. Nikon calls it SnapBridge in its current implementation.
The last choice is an EyeFi, FlashAir or similar WiFi SD card. These cards go right in an SD slot and form a wireless connection you can pull images down to any WiFi device.
Comment: Wireless methods are slow for large numbers of images particularly if they are saved in raw format, and drain batteries very quickly. This might not be ideal for someone on a trip, who may not have ready access to the power grid.
Comment: @MichaelClark absolutely true, fair point. Just Bluetooth on my d850 is amazing how much it drains the battery just being idle.
Answer: For some brands and camera models there are apps available.
E.G. Olympus provides WiFi for its most recent models and some convenient app to download individual files. And you could log in to your camera using the browser on your pc or smartphone to download via WiFi. Other brands provide similar solutions for recent bodies.
A Wifi enabled SD card (or camera body) could even provide more options.
I've been using SD card readers on an iPad. Slow but works. Should work on an iPhone too, I think.
On Android your phone may act as the computer that is attached to the phone and my be able to access the images. There are SD card readers too.
For CF cards I would not be too positive to find a compatible card reader. Can be done with USB adapters but I observed difficultes myself because the CF card demanded too much energy.
However, you'll certainly get better answers when you are more specific about the camera and phone that you are using.


When are the 2017 elections?

Question: When are the 2017 elections? Is there a way to tell when the next one is? I checked the previous elections, but it didn't tell me when the next one is. Also how long are they?
Answer: Moderator elections are not scheduled events. Instead, they are brought up as the need arises, namely when more moderators are considered "needed." As you can see from the elections list, there was no scheduled election for 2015, because no new moderators were needed.
To be more exact, moderator elections typically happen when the community moderators contact Stack Exchange and ask for an election. Similarly, an election may also be triggered if Stack Exchange notices that the current mods are being overwhelmed by the duties of the site (flag queues, closevote backlogs, etc.).  Stack Exchange also contacts a site's mod team at the anniversary mark from the last election to ask the question, but this still does not guarantee an election will take place. (Source).
Unless SE or our local mods really need new moderators now, the next one is likely to happen in June 2017, but this doesn't mean it will happen then.
Moderator elections tend to take 15 days, and are split up into three "phases": Nomination, the Primary, and the Election. Instead of boring you with the details, I'll just gloss through them real fast:

During the Nomination phase, which lasts 7 days, any user with a minimum sufficient reputation (variable) can nominate themselves to the ballot.
The top 30 users by reputation move on to the Primary phase, where anyone with at least 150 rep can vote for them. Note that if 10 or fewer candidates nominated themselves, this phase will be skipped.
The top 10 users (by votes in the Primary phase) will be moved on to the Election phase. The winners will be chosen using the Meek STV method.
Comment: @UbuntuUser new mods do not replace the old ones - so the two new mods elected would be added to the team, not taking over from predecessors
Comment: I'm not privy to that information, but you can get a basic idea of the given load at any time by going to https://askubuntu.com/review . From what I've heard though, the site has been unable to flag-free for fifteen minutes for a *long* time.
Comment: @UbuntuUser Not all of the work. SE is [community moderated](https://meta.stackexchange.com/questions/160960/what-is-community-moderation-and-what-can-i-do-to-help) which does a lot of the work, but the two mods involved do have the load of dealing with the flag.
Comment: Keep in mind, though, that the flags queue isn't the *only* thing that a moderator has to deal with, we also have to deal with cases of abuse, sometimes a dispute between users, etc.  Also consider that some of us are active at different times, which means sometimes the flags don't get instantly-handled.  (That said, we do try and keep the flags queue cleaned up :P)
Comment: @Zanna unless moderators step down, in which case 'then' they would 'take over' in terms of 'replacing'; that said, I don't think there's anyone stepping down any time soon.
Comment: If there are two mods, do they do all the work?
Comment: I see, but still how many flags are there daily? Wouldn't that still be a lot?
Comment: I nominate Serg, Kaz Wolfe, Zacharee1 and Zanna.
Comment: @ThomasWard why would anyone step away from so much fun and fulfillment? No doubt there are some strenuous days but for the most part....
Comment: @WinEunuuchs2Unix various reasons, none of which I'm privy to :P

When are the 2017 elections?


Does using ssl matter if I am connected using a VPN?

Question: Say I have an internal server that I am using for source control.  If I only access that server through a VPN connection, do I still need to have SSL setup on the source control server to ensure that no one can eavesdrop on my communication with it?
Comment: I think you mean HTTPS? There are VPN technologies using SSL.
Comment: You are correct.  Sorry, I don't know a lot about this subject.
Answer: VPN is a Virtual Private Network: it isolates a group of machines from the rest of the world, so that these machines can talk to each other undisturbed by outsiders. If the isolation is reasonably thorough (it uses encryption, and it uses it properly), then communications between any two machines in the VPN will be protected from eavesdropping and alteration from machines which are not in the VPN.
But the VPN will not do anything against attackers who are already inside the VPN. Your desktop system is in the VPN; so is the server you are talking to. But there may be other machines as well. In fact, it is typical, in enterprise contexts, that all remote employees join the VPN, which will therefore contain many people as well as a bunch of corporate servers, and other systems of questionable security (e.g. printers).
Another point is that the VPN is between machines. In the "mainframe model", a given machine may run process from distinct users, with distinct rights. With SSL, the security is from one specific process on the client machine, to one specific process on the server. Even if the VPN uses authentication, it would be inconvenient for the client to get some accurate information on the identity of the server, and vice versa, because the VPN authentication is not made available to the individual process on the involved machines.
Therefore, in the presence of a VPN, SSL is redundant only if all the following characteristics are met:

the VPN provides confidentiality and integrity as well as SSL would (i.e. with correctly used cryptography);
all machines which may connect to the VPN are trusted;
authentication can be delegated to the VPN layer.

If unsure, use SSL and consider the network as hostile. This is the safe way.
Answer: This depends on a) if the VPN in use provides encryption and b) if the VPN end point is the server.  If you are VPNing to an office network for example, then your traffic would still be unencrypted from the VPN exit node (provided that the VPN provides encryption) until it gets to the server.  Using SSL will ensure that your traffic is encrypted all the way to the server (unless you are using SSL to a firewall).
Answer: VPN doesn't necessarily imply that the traffic going across the tunnel is encrypted so first I would ask what type of VPN you are using to ensure it is encrypted.
Assuming you are using a VPN that is encrypting the traffic, the communication would still be moving in clear text between the host where the VPN terminates and the source control server I tend toward a "assume your internal network is compromised" stance and thus would suggest using SSL even on a "private" or "internal" network.
Comment: Hrrm, I'm not really sure how to check the type of VPN I am using.  I am connecting from an OS X machine if that makes any difference.
Comment: do you know what you are connecting to on the other end?
Comment: It's a windows server.
Comment: If it was configured correctly, then it most likely is encrypting traffic between your machine and the VPN endpoint.  Though as I said, it is probably still a good idea to use HTTPS to access your source control server.
Answer: If the VPN server is the same machine as the source control server, and you are using a decent VPN technology such as IPSec, then no, there is no benefit in adding SSL in terms of people eavesdropping - you already have end to end encryption with message authentication. The only worry here is anyone else on the VPN can view and edit the traffic in plaintext.
If however, the VPN and end-point are not the same machine, then yes, you need to add SSL. This is because any VPN encryption terminates at the VPN server, and the VPN server then acts as a dynamic NAT gateway, essentially dialing out to the endpoint server on your behalf. From then on, the connection is in plaintext unless some other encryption layer is present, such as SSL.
Essentially, always add SSL, even when you don't think you need it. It might upset your firewall operators though...they like to be able to inspect traffic.
Answer: Yes, you need to use SSL to encrypt sensitive information. VPN establishes you encrypted tunnel between your end point on internet and end point of VPN server of that organisation. However, once you have joined VPN any non-https links you browse are transmitting clear-text data. This is vulnerable to internal attackers, and moreover, anyone in the position where he/she can intercept traffic (sitting in same network segment or man-in-the-middle scenario) can easily retrieve data by capturing network traffic between the client (your system) and the server. However, probability is less but yes possible from an internal attacker's perspective.
Excuse my english but I hope you got my point which is there is a difference between using VPN (encrypted traffic between your ISP and your organisation) and SSL (encrypted traffic between the client and the web server).


How can I use both Intel onboard and Nvidia graphics at the same time?

Question: How can I use both Intel onboard graphic chip and nVidia card at the same time?
I googled a little and lots of people said I need SLI or crossfire support for both of my cards, but I managed to do so in Win 7 so I guess it could be done in Ubuntu.
Here's some information of my computer, any help?
<code>  *-display
       description: VGA compatible controller
       product: G94 [GeForce 9600 GT]
       vendor: nVidia Corporation
       physical id: 0
       bus info: pci@0000:01:00.0
       version: a1
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress vga_controller bus_master cap_list rom
       configuration: driver=nvidia latency=0
       resources: irq:16 memory:fa000000-faffffff memory:c0000000-cfffffff     memory:f8000000-f9ffffff ioport:af00(size=128) memory:fb000000-fb07ffff
  *-display
       description: Display controller
       product: 82G33/G31 Express Integrated Graphics Controller
       vendor: Intel Corporation
       physical id: 2
       bus info: pci@0000:00:02.0
       version: 10
       width: 32 bits
       clock: 33MHz
       capabilities: msi pm bus_master cap_list
       configuration: driver=i915 latency=0
       resources: irq:43 memory:fdf00000-fdf7ffff ioport:ff00(size=8) memory:d0000000-dfffffff memory:fdc00000-fdcfffff
</code>
Comment: ...you can't =)
Answer: With the current graphics platform, this does not seem to be possible. You can only use one card


Trying to find a particular synth/keyboard from this song

Question: I am trying to find the exact keyboard/synth that has been used to make the single key sound/chord(I would also love to what key/chord it is) at 0:02 and onwards whenever the bass guitar stops playing.
Answer: I'll stick my neck out & say it's a Fender Rhodes - though half the time I'm wrong & it's a Wurlitzer ;-)
Both were 'real' instruments, electric pianos which generated sound by using a piano keyboard & mechanical levers & hammers similar to a real piano, but instead of strings, had metal bars or tines which were struck by the hammers.
The sound was then picked up by an electro-magnetic pickup similar to that on an electric guitar.
Characteristically, the Rhodes is brighter & more bell-like, the Wurly is a simpler sound with less overtones - but people got quite creative with modifications to them over the years, harder or softer hammers, effects pedals, different amps, so on occasion it's difficult to tell which is which.
Original instruments fetch good prices these days, but synthesised & sampled versions are widely available as software plugins, & are often far more sonically flexible that the original instruments.
My personal favourite is Applied Acoustics Lounge Lizard which uses both these pianos as base models, but with the flexibility to exchange components from each, giving more sound choices than you could ever get from any original piano.
Toontrack are also usually very good, though I don't own this particular one, their EZkeys Classic Electrics would be worth a listen
A couple of famous examples…
Fender Rhodes -
The Doors, Riders on the Storm -

Bee Gees, How Deep is your Love -

Wurlitzer -
Supertramp, Dreamer

Queen, You're my best Friend -
Comment: Thank you for confirming this for me. I do have Lounge LIzard, but I don't know what preset gives it that mellow sound that I hear on Herbie Hancock and other Jazz/Funk acts. I did manage to find the preset that gives it the organ sound from the Doors though. I guess this is a topic meant for another question. But nevertheless, excellent answer
Comment: I also would like to know if that was a key or a chord that caused that 'super full' and mellow sound


Why is this statement able to be resolved as true with "if"?

Question:
Why is (a) true if (if) is put in there?
Answer: Recall that a false statement implies everything. Remember that a statement of the form $$\text{If }P\text{ then }Q$$ is false only in the case when $P$ is true but $Q$ is false.
If $P$ is false then the implication is immediately true, and if $Q$ is true then the implication is immediately true. In the case of (a), both things occur.

See also:

The meaning of implication in logic
In classical logic, why is $(p\Rightarrow q)$ True if $p$ is False and $q$ is True?
Comment: Hence you can define disjunction as "if not p, then q".
Answer: Note that if we let $$P = 2 + 2 = 5,\; \text{ and}\;\;Q = \text{ triangles have three sides}$$
Then $\;$"$\text{If} \;P \;\text{ then}\;\; Q$"$\;$ is true whenever $\;P\;$ is false, or whenever $Q$ is true (in this case, it happens that both $P$ is false and $Q$ is true).
Equivalently $\;$"$\text{NOT}\; P \; \text{ OR}\;\; Q$"$\;$ is true whenever $\;P\;$ is false, or whenever $\;Q\;$ is true. (In this case, it happens that to be that $P$ is false and $Q$ is true.)
So there is a strong connection between the connectives "OR" = "$\lor$"  and "IF (- THEN)"= "$\rightarrow$"; specifically:
$$\lnot P \lor Q \;\iff\; P \rightarrow Q$$
$\quad\quad\quad\quad\quad\quad\quad\quad\quad\quad\quad\quad\quad\quad\ $
Answer: In everyday usage, "if $A$ then $B$" suggests a causal or temporal relationship, e.g. $A$ causes $B$. If, over time, $A$ is always false, it would make no sense to say that $A$ causes $B$. There are no causal or temporal relationships in propositional logic, however. In propositional logic $A\rightarrow B$ is simply defined to be $\neg (A\wedge \neg B)$. If $A$ is false, then $\neg (A\wedge \neg B)$ must be true.
Answer: The logical statement if P then Q is only false is P if true and Q is false.
In this problem P is the statement 2+2=5, while Q is the statement "triangles have three sides". Clearly P is false but Q is true, yet the outcome of the logical statement if P then Q remains true by the line above.
see the section on logical implication


I'm Making Chicken stock. How can I keep the chicken meat/bones from rising above the water line?

Question: I'm using chicken wings to make a stock, but they want to float up to the top above the water line.  Any kitchen hacks to keep them submerged??
Comment: The plate works, but it is not really necessary.  Assuming you stir your stock very occasionally over its long simmer, everything will get fully extracted--especially since the content tends to shrink over the duration.
Comment: Place a plate on it.
Comment: @Optionparty, that works thanks!  If you post that in an answer then I can give you credit.
Comment: Besides, the chicken will sink on its own after a while.
Comment: I'll try that now.
Answer: I never worry about this. As your stock simmers, the joints, muscle and connective tissue break down and eventually they'll sink in. Sometimes adding a bit of vinegar to your stock first helps with this. Until then, just stir the stock and move the bones around occasionally.
Answer: If you have a steamer basket, or a colander that fits in your pot, you can place that upside-down on top and place a weight on it to hold everything down.
Answer: Also make sure that you are keeping the temperature at a very gentle simmer. If you cook at too high of a temperature (at a rolling boil, for example) that will push the meat and bones upwards.
Comment: Hello John, I am sorry I have to delete a second answer of yours even though I see that you are genuinely trying to make good contributions :( But we are not a discussion forum, and we take the questions very literally; answers should address the exact problem in the question and not other problems which might arise in the same context. Your answer is not related to the problem itself, and I guess this is why it got downvoted, even though it is generally good advice when making stock. When you get a bit of reputation, you will be able to leave comments, which are not so strictly moderated.
Comment: thank you for clarifying. I wasn't aware that you are talking about a connection between simmering and rising. The downvote is not mine, so I can't remove it, but I undeleted.
Answer: I use a drop lid, in a lot of Japanese cooking, the use of a wooden lid which is a smaller diameter than the cooking pot is used to keep foods submerged.  But a plate works just a well, it's just hard to fish out of the hot liquid sometimes.


Beef rib roast - how much do the bones weigh?

Question: I'm trying to compare prices for bone-in vs boneless beef rib roasts (aka standing rib roast aka prime rib aka ribeye roast). What is the weight of the bones as a percent of the total pre-cooked weight? Without this number it's impossible to compare prices. (Please no debate about which is better - save that for another thread.)
Comment: I've removing some comments which said essentially there's no answer because the numbers vary. This is a perfectly valid question, and if the answer is that there is a significant range, please write an answer saying so - preferably including some idea about what that range is.
Comment: Of course it won't be an exact number, but a range or even a single data point would be helpful. 10%? 25%? I ended up buying a boneless roast that was $9/lb instead of a bone-in roast at $8.50/lb. That's only about 5% premium for not having bones so it seems like a better deal. Next time I buy bone-in I will cut it off and weigh it to answer my question.
Answer: The key factor is going to be the breed of cattle. Angus, a very high quality beef, also has heavy bone structure and a less favorable bone-to-meat ratio, where as limousine has a lighter bone structure with more meat-to-bone. Other breeds will vary as well, with hereford being (IMHO) the 'happy medium'. But, of course, each individual steer is going fall with a range of possible values rather than a constant factor.
Such value propositions really come down to individual taste and priorities. I suggest to that the comparison is really not just a xLb of bone-in vs. yLb of bone-out. The quality of getting bone-in (again, IMHO)is far superior. The attached rack provides for a degree of insulation and allows for a slower roast protecting the whole rack from over-cooking (a sin to be sure).
If you are stuck on just 'doing the math' if you are looking at a whole (7 bone) prime rib, the rack, the bones, along with the meat & fat attached to the bone that would remain if the rack were to be removed, will account for about 15% of the overall weight (give-or-take all of the variables mentioned - and more). For something 'more or less' than the whole prime (ribs 6-12) as you can see the bones will vary in size depending on whether you are at the short end or the large end of the rack.

This article, from Weber, offers a good deal of analysis of the rib roast in general and may provide some good additional information for you.

Bone-In vs. Boneless
Beef rib roasts are sold two ways—bone-in or boneless. There are
  several advantages to cooking a bone-in beef rib roast:

Fat and connective tissue that surround the bones add moisture and
  flavor to the meat as it breaks down during cooking.
Rich flavor from bone marrow may migrate into the meat during cooking.
Bones slow the cooking of meat and limit the evaporation of moisture.
Bones are easily removed after cooking and make a tasty treat for the chef!

Buy a bone-in beef rib roast whenever you can.
Comment: Good point about different breeds having different ratios of fat, muscle and bone. Another wrinkle to throw into the problem.
Answer: Cooked Beef rib bones weigh 1/2-oz per inch.thats the average weight  of the meatless bones only w/ no meat on them. A-6 - inch bone is-3-oz . A-12-inch bone is -6-oz- etc etc.
Comment: Can you extend this answer so that it actually answers *What is the weight of the bones as a percent of the total pre-cooked weight?* (and without duplicating other answers)?


Windows Media Player 12 stops importing metadata from large music collections

Question: I'm experiencing a strange issue with Windows Media Player 12 on Windows 7. I'm quite sure it has a link with the following two posts:

Duckworth's post
Loza's post

Description of the problem
Let's first describe the environment. I have a large music collection (18000+ files), all encoded in WMA. All these files are embedding well-formated metadata (I really did tag each of them). The files may be accessed using a network share, hosted on a Windows machine. This network share has been added as a location of the music library.
When I launch Windows Media Player 12 (WMP) for the first time after a fresh install of Windows 7, it begins to scan the music library normally. Songs' metadata are properly extracted, and the music files are well-sorted. However, after roughly 15-20 minutes, WMP seems to be unable to extract metadata anymore. The background scan does not stop, but all the newly detected music files are sorted as "Unknown artist", "Unknown album" etc. I can let WMP scan the whole library: at the end of the process, more than 60 percent of my collection is missorted.
Since this issue occurred at every new installation of Windows, I had time to develop defense strategies. While WMP scans the whole library, I keep an eye on the "Unknown artist" category (which in fact shouldn't exist at all). When I see it grows, I would close WMP and relaunch it a couple of seconds later. There, WMP resumes scanning the library normally. I usually have to perform 3 or 4 relaunches for each complete library scan.
Solutions which didn't help
Here is a list of hints and solutions which didn't help to solve the issue.

File corruption issue  One may obviously think my music files are somewhat corrupted. And yet they're not: when missorted files are accessed using Windows Explorer, tags are shown properly. Another piece of proof is that previously missorted files are now perfectly sorted, as their importation rank shifted with new folder additions: in the past, files from artists whose names begin with "C" were all missorted; then the folder dedicated to artists whose names begin with "A" grew; this made me close WMP before it reaches the "C" letter, and I when I relaunched it the "C" artists were perfectly sorted.
Network issue  I'm almost totally sure this is not a network issue. The network works smooth; no slow-downs, no interrupts. When WMP begins to bug, the music share is still available; and if that was a network issue, I think we couldn't explain why a simple relaunch of WMP fixes the problem.
Windows Media Player Database Corruption  Clueless. The problems appears on fresh installs of Windows; I can't believe the database went corrupted each time. Deleting database files and purging the cache does not help at all.
Windows Media Player Installation Error  The same as above. It always happens on fresh installs; I don't think WMP has installation errors as an habit. Furthermore, re-registration of wmp.dll does not help either.
64 bits issue  The bug appears both on x86 & x64 versions of Windows and WMP.

What next?
I'm beginning to think this is a real bug. I was not able to find a way to fill and send a bug report to Microsoft. Do you have other ideas what this issue may come from? If not, are there people which are experiencing the same phenomenon?
A similar discussion was opened on Microsoft Answers. No solutions so far.
Answer: I have found the same issue with my computer. The only thing I could figure is that there is not enough RAM to handle a growing database of that size. I could be wrong though.
My solution: If you have a large enough hard drive, is to have a tmp folder with all mp3 files in it, and not have it recognized in the library of WMP, Have an empty Music folder tied to WMP library. Drag and drop all the "A"s in the empty Music folder, and wait until WMP finds them all. (Update Complete) Then do the "B"s...,and so on.... It takes forever, but that is what I had to do. Hope this helps.. If there is a quicker way, I don't want to know it now.


Applying for French Schengen visa with hotel booking confirmation e-mail

Question: I am applying for a France short stay visa in July. All my documents are ready but I am a little confused about my hotel booking. I confirmed my hotel booking via a phone call directly to hotel and they send me an ordinary email with a confirmation code, check-in and check-out date and my name. Is this OK? Because my visa advisor told me that you should book through booking.com, that is more reliable and easy to confirm for the visa officer. In my case the visa officer will not be able to check my booking online if he needs to check it; only via call or email. Please, can anyone guide me on this issue?
Comment: What you have, a direct reservation with the hotel, should be just as reliable, and may be even more so. It's in France, and French officials can easily check, should that be necessary.
Answer: A direct reservation with the hotel should be just as reliable, and may be even more so. You are not required to use any specific online tool to reserve accommodations. As what you have is in France, and French officials can easily check, that should satisfy what is necessary.


Using sharepoint 2010 on another server in VS?

Question: How can I use sharepoint 2010 that is on another server in VS?
When I try to create a new project for creating visual web part, A message "Sharepoint not installed on this client" is showed.
Answer: You can develop VS projects ONLY on the same server where SharePoint is installed.
By the way, if you're using SharePoint 2013, you can develop APPS on a remote Server but that's another story.
Answer: Same question here with some suggestions for a workaround. A workaround is not recommended, though.
By the way, I had the same problem, and installed SharePoint Foundation 2010. It does not have all the options like a "regular" SharePoint, but it is free, runs fast and matches the requirements to run a decent test. The installation is described here. Just make sure you follow every step from the article. There is also a great tutorial covered with screenshots here. It`s in German, but I think you can manage to get the essence out of it.


Should i install an antivirus on my windows 2008 server?

Question: Just bought a new windows 2008 server and i set there some of our websites, the windows firewall is running, should i install an antivirus? and which one you recommend?
Answer: The decision as to whether or not you need antivirus should be based on what the server is doing. If you're serving websites and there is any way users can get data onto the server - file uploads, forum attachments, email, then you should be scanning these for viruses.
Will you be browsing the internet on your server? Will it be hosting email? If so then you need to consider AV.
There are also some exceptions, are you running SQL? Then you need to exclude some areas of that. Will you be running Exchange? You'll need a proper Exchange add-in for your AV to scan that.
What you also perhaps need to consider is what you will lose by running AV. If speed is an issue and AV is slowing your server down then sure you should consider whether you can do away with it, but if it will run in the background not causing an issue and may just save you one day, maybe it's worth it anyway? The cost of today's AV solutions is pretty minimal, especially if it's just for one server.
My personal preference is for something lightweight, so things like Macafee and Norton are out. I have used NOD32 in the past and it has performed well as has AVG's server editions.
Comment: fine, and you recommend one?
Comment: I've run AVG's without problems.
Answer: Yes preferably, and when it comes to brand - the best bet is something you're already comfortable with or use on your clients.
Get the server version (if there is a special server version, sometimes it's just a matter of using the client edition as long as it's just an application server with no special needs (like e-mail, database aso).
If you don't run an entire management suit, set it up to deal with threats in a cautions manner, reporting problems first so you can check it out and decide before it wipes your client's web site data files due to "suspected malware" detected or something ;)
Comment: Personally I recommend NOD32 due to its speed, easy management solution and sane price model - but that's just a personal preference.


Why does Agatha buy the book titled The Number 23 for her husband?

Question: Agatha buys the book (titled The Number 23 written by Topsy Kretts) for her husband Walter as a birthday present. Why does she choose this book? Is it a coincidence? Doesn't she know about the past of her husband?
Comment: I'd like to pile on this question with another, don't they recall the two of them met right after his getting out of the asylum? Or do they really get together at this time?
Answer: She merely bought the book for him as she felt he would be very interested in it, having just skimmed through it herself.  She did not (nor did Walter, at this point) know anything about his past or that he actually wrote the book.
It is essentially a  plot device coincidence.
Comment: But Agatha did know his past. It doesn't make sense why she would buy him this book and not know it was him


How do I get more space and get my memory card to start working?

Question: I have a Galaxy S2 and it keeps saying "low on space" (phone storage is getting low) in my notifications. I bought a memory card and it still says low disk space so I can't download any apps. Also my Play Store app won't open. Can anyone help me out?
Comment: The "low on space" message always refers to the device's internal memory. I've just added the `insufficient-memory` tag to your question; please see [its tag-wiki](http://android.stackexchange.com/tags/insufficient-memory/info) for first-aid and helpful links. Don't forget to come back and either [edit] your question to specify where you got stuck, or answer it when you were able to solve your issue. Good luck!
Answer: I have the same problem with Samsung Galaxy Ace 2. To make your default storage the sd card you need to modify vold.fstab. But to modify this file you need to root your phone.
I think there is no other way to do this.
Hope I have helped =).


Error using tikz externalize with TeXnicCenter

Question: When I compile my document i get the following error
<code>! Package tikz Error: Sorry, the system call 'pdflatex -shell-escape -halt-on-error -interaction=batchmode -jobname "tikz/myfile-figure1" \def\tikzexternalrealjob{myfile}\input{myfile}"' did NOT
 result in a usable output file 'tikz/myfile-figure1' (expected one of .pdf:.jpg:.jpeg:.png:). Please verify that you have enabled system calls. For pdflatex, this is 'pdflatex -shell-escape'. Sometimes it is also named 'writ
e 18' or something like that. Or maybe the command simply failed? Error messages can be found in 'tikz/OReilly_Gerard_Th
esis-figure1.log'. If you continue now, I'll try to typeset the picture.

See the tikz package documentation for explanation.
Type  H <return>  for immediate help.
</code>
I am using TexnicCenter to compile the document and have the following in the path to the compiler:
<code>C:\Program Files (x86)\MiKTeX\miktex\bin\pdflatex.exe -shell-escape
</code>
and this in the:
<code>-synctex=-1 -max-print-line=120 -interaction=nonstopmode "%wm"
</code>
The PDF file is still produced no problem but I know this error should not be occurring.
My LaTeX skills are ok at best so hopefully I am making a glaring mistake here.
Thanks.
Answer: I think I have solved the problem. I had two versions of MiKTeX installed on the same machine.
Crisis averted.


Positive PnL with long volatility strategy

Question: Suppose I was interested in longing volatility. Suppose I bought a long straddle today which expires in 3 months. Suppose that volatility was very high in those 3 months, however, the stock expires at the money on expiration day. The straddle expires worthless but my PnL was still positive. How did I make money?
Comment: That question is not entirely clear IMO: if you can trade anything along with your open straddle position (e.g. dynamic delta hedge but also any other trading strategy whatsoever) then there is infinite many ways to generate P&L knowing vols are going to be high in the future (e.g. buy variance swaps,, buy options cheap/sell high). Although I agree of course that the expected answer is certainly the dynamic delta hedging one (accumulation of realised vs hedging vol discrepancies through the option Gamma).
Answer: I think you would know better than me. But assuming this is some sort of riddle, I would say you made money by dynamically hedging the straddle. When the stock goes into the money your straddle delta goes positive and you sell stock to hedge. When the opposite happens you buy. You are buying low and selling high.
If on the other hand you just sat on the straddle you of course lost money overall (which doesn't necessarily mean it was a bad trade from an expected value perspective.  Still this example shows if you want more volatility = more money guaranteed you need to dynamically hedge.)
Answer: Another way to look at the riddle. You think volatility will be high during the next three months, so you buy a 6 months straddle. Three months from now, having been proven right, you sell your straddle (which has 3 months to go) at a high price, due to the high implied vol.
Comment: Indeed. However we explicitly state that I hold the 3 month straddle till maturity. I think the dynamic hedging is the only sensible answer


How do I set eyedropper settings using Photoshop ExtendScript (Javascript)?

Question: Is there a way to set Photoshop's eyedropper settings (sample size, sample, show sample ring) in a script? Or, failing that, use the script to find out what the current settings are? Thanks.
Answer: Based on some googling, it sure doesn't seem like it's directly possible.  However, you can use scripting listener/action manager to change the tool preset.
So... maybe you could make a tool preset for each sample size you need and change the tool preset instead.
This method does have a few major drawbacks:

One downside is that it saves all tool settings for the eyedropper, so if you need different sample layer settings too, you'd need to create even more presets...
Not to mention the tool preset file .tpl would need to travel with the script, or you'd get issues down the line.
A little bit of a drawback is that unless your tool preset list is showing presets for all tools, which it likely isn't or you can't assume it is, you can select a preset only if the correct tool is first selected.

Here's code that selects the eyedropper tool and activates a preset that I named 3 by 3 Average (All Layers).
selectTool("eyedropperTool");
selectToolPreset("3 by 3 Average (All Layers)");

function cTID(s) { return app.charIDToTypeID(s); };
function sTID(s) { return app.stringIDToTypeID(s); };

function selectTool( toolName ) {

  var desc78 = new ActionDescriptor();
    var ref38 = new ActionReference();
    ref38.putClass( sTID( toolName ) );
  desc78.putReference( cTID('null'), ref38 );
  desc78.putBoolean( sTID('dontRecord'), true );
  desc78.putBoolean( sTID('forceNotify'), true );
  executeAction( cTID('slct'), desc78, DialogModes.NO );

};

function selectToolPreset( toolPresetName ) {

  var desc75 = new ActionDescriptor();
    var ref36 = new ActionReference();
    ref36.putName( sTID('toolPreset'), toolPresetName );
  desc75.putReference( cTID('null'), ref36 );
  executeAction( cTID('slct'), desc75, DialogModes.NO );

};

I used the Xtools script: LastLogEntry.jsx to get the last Scripting Listener entry and clean it up a little.
Answer: To get a current setting of an eyedropper (switch to eyedropper first using Joonas' selectTool()):
//returns 0 for Point Sample, 1 for 3x3, etc
function getCurrentEyedropperSetting() {
    var ref = new ActionReference();
    ref.putProperty(stringIDToTypeID("property"), stringIDToTypeID("tool"));
    ref.putEnumerated(stringIDToTypeID("application"), stringIDToTypeID("ordinal"), stringIDToTypeID("targetEnum"));
    return executeActionGet(ref).getObjectValue(stringIDToTypeID("currentToolOptions")).getInteger(stringIDToTypeID("eyeDropperSample"));
};


How to adjust time for pineapple casserole and pork roast

Question: I am cooking a pork roast for3 hrs at 325. I am also cooking scalloped pineapple at 350 for 1 hr.  I need to know how long I should cook the pineapple at 325
Answer: Don't bother to adjust for the pineapple. You are overcooking it anyway, so it doesn't matter for how long you overcook it. It will still be good.
The time needed will be determined by the pork, and this depends on the cut you are using. If you are using roast meat, then the time you need has nothing to do with how long the whole roast takes - it depends mostly on the geometry of the cut. You should just stick a thermometer into a piece of pork in the middle and cook to about 60 degrees celsius. (It actually takes a bit more of that, but the meat continues to cook for several minutes out of the oven). If you don't have a thermometer, there is no way to predict the time, it can vary from half an hour to several hours depending on the shape and material of your dish and the amount you are baking. Just take out a piece, cut it open, and return it if it is not ready. If you overbake it, it will be unpleasantly tough.
If you are using stew meat, it is easier. Leave it in for 3 to 6 hours, the longer the better.


How does YouTube detect the country of its users?

Question: Does YouTube detect the country of its users (video viewers and people who have liked a video) by their IP address or by details they have given (country information they have given when signing up to Gmail or a YouTube channel)?
Answer: Country is determined by the location of the network connection used to connect to YouTube, most likely by IP.
My Google account is registered and set to the UK, but I'm often in the Netherlands. When I'm in Holland I get a little "NL" next to the YouTube logo, and when I VPN into my office in London it changes to a "GB".
Answer: YouTube, as well as other sites (Google, facebook,...), use the network, to which you are connected to, to determine your physical location in order to deliver local news, advertisement, appropriate suggestions, and even the page in the local language.
In order to avoid this when I travel I use a DNS IP address which is near my home. You can also VPN into the desired location, if any. Or you can modify the website address to reflect the correct country (i.e. www.google.ro).


How to get the list of strings within IDA's string window in my script?

Question: I'm trying to write some scripts that do some string searching through the disassembly in IDA. Currently, I loop through all the disassembly, MinEA() to MaxEA() and use idc.FindText() to see if a potential string is in the disassembly. Although this works, its very time consuming. I was wondering if there was a way I could just use an API method to get all the strings in IDAs string window. For example, I was able to get all the imports used in the import window by using idaapi.get_import_module_qty() and idaapi.enum_import_names(i, import_call_back). That's very fast and I can easily just check if something has been imported. Is there something similar that will allow me to get all the strings from the strings window? If not, is there a less time-consuming method of string searching that is possible? Thanks for any input.
Answer: It looks like that the following is what you are looking for or at least similar:
import idautils
sc = idautils.Strings()

for s in sc:
    print "%x: len=%d type=%d -> '%s'" % (s.ea, s.length, s.type, str(s))

Tested and works in IDA 6.8, 64 bit.
The details about the class Strings in idautils module are here: https://www.hex-rays.com/products/ida/support/idapython_docs/idautils.Strings-class.html
Comment: Apparently, `s.type` has changed to `s.strtype` in IDA 7.
Answer: another variation to get all the strings
import idaapi as ia
sc = ia.string_info_t()
for i in range(0,ia.get_strlist_qty()):
    ia.get_strlist_item(i,sc)
    print ia.get_ascii_contents(sc.ea,sc.length,sc.type)

Comment: That's much better because calling `idautils.Strings()` regenerates the list of strings while this method just re-use the current list of strings.
Comment: On IDA 7.7 with Python 3, swap the `i` and `sc` arguments to `get_strlist_item` and use `get_strlit_contents` instead of `get_ascii_contents` (note: returns bytes).
Answer: I found a crude yet completely different solution without having to mess with Python 2.7 .  All with IDA GUI and with the help of side Regex

Open desired file in IDA, let it load
View -> Open subviews -> Strings
Ctrl+A -> Right-Click -> Copy
Paste data to some regex-supporting text editor (I use Notepad++)
Go to find&replace with regex (On Notepad++: Replace, search mode "Regular expression" with ". matches newline" UNticked):

First, trim all " " before carriage return,
___Find: \x20\x20+\r
Replace: \r

Then (as of Jan 2021) - in Notepad++ there is a bug, that makes it regex ^ match literal \r. To work around it, you can do this: add a newline on the top (if you have the useless human readable headers on top, replace then with the newline). Count how many characters there are before the strings text begins (I had 27), and then perform,
___Find: \n.{27}?
Replace:

Warning: if you have a different count of characters before the strings text begins, replace the number with yours!

Finally, remove the first newline and your data is ready for work