What is the use of using address in quote object while calculating total of cart(table: sales_flat_quote_address)

Question: Please explain why magento involve address while calculating grand total and other calculations while calling collectTotals() in saving cart.It involve table sales_flat_quote_address while interacting with sales_flat_quote
Answer: The shipping address is used to determine the cost of the shipping method, because it might be a different cost for the shipping whether you ship to USA, Germany or Denmark.
If a shipping method is already set in the session that is.
For example if you go into the checkout and select a shipping method and then go back to the cart, then your shipping costs will be shown on the cart page.
Comment: What if I need to add an attribute like tax in my case(advance partial payment) which is independent of shipping address?Do I need to add that attribute to **sales_flat_quote_address**


Full wave rectifier circuit

Question:
Hi! I want to do this circuit in my document but I'm new in this, I have no idea where to start. Specially the diode bridge, I don't know how to do it. I would be very grateful if someone could help me. Thank you!
Comment: Botth TikZ and circuitkz could do this easily.  See if all your components are available.  Putting them along diagonals is no big deal.  Actually, the trickiest parts are the u and i arrows (not standard form).
Comment: @isabella-salgado, if any of this answer suited you, please think about [accepting one answer](https://tex.stackexchange.com/help/someone-answers)
Answer: This question is a bit a kind of "do-it-for-me"; it would be much better if you tried something and then posted an example showing where you got problems.
You can do it both with the internal TikZ circuit library and with circuitikz. Both have manuals that I think are quite readable, especially the first one ;-).
Just to help you start, this is the start of the solution with a recent circuitikz. Notice that you need to learn TikZ before starting to use circuitikz because all the concepts (nodes, coordinates, paths) are from there.
\documentclass[border=10pt]{standalone}
\usepackage[siunitx, RPvoltages]{circuitikz}
\begin{document}
\begin{circuitikz}[european, circuitikz/straight=true,
    american inductors, full diodes,
    circuitikz/diodes/scale=0.5]
    \node [transformer](T){};
    \draw (T.B1) to [open, v=$u_s$] (T.B2);
    \draw (T.B1) to [ccsw] ++(2,0) coordinate(top bridge);
    % bridge
    \draw (top bridge) to [D, *-*] ++(1,-1) coordinate(right bridge)
    to [D, *-*, invert] ++(-1,-1) coordinate (bottom bridge)
    to [D, *-*, invert] ++(-1,1) coordinate (left bridge)
    to [D, *-*] (top bridge);
    \node [jump crossing](X) at (left bridge |- T.B2) {};
    \draw (T.B2) -- (X.west) (X.east) -| (bottom bridge);
    \draw (left bridge) -- (X.north) (X.south) |- ++(2,-1);
    \draw (right bridge) to[short, i=$i_p$] ++(1,0);
\end{circuitikz}
\end{document}

You can do better, with a bit of coordinate math, to avoid the ugly "kink" at the bottom of the bridge, and retouching the style of component, etc... but this is a start.
Ah, straight for the voltage is a sort-of experimental feature. No guarantees...
Anyway, remember that you can also draw the circuit with a graphic tool (and maybe for one-off it's the best path) and include it. I am one of the authors of circuitikz, but often in a rush I use the very good Xcircuit tool, also.
...and then, ok, I bite the bullet — I will use this as an example and, in future, a test code to try to work around a fix for a nasty bug with american voltages positioning on opens.
There are a lot of comments in the code; notice the way I centered the bridge on the transformer.
\documentclass[border=10pt]{standalone}
\usepackage[siunitx, RPvoltages]{circuitikz}
\usetikzlibrary{calc}
\begin{document}
\ctikzset{% styles here!
    european,
    american inductors,
    full diodes,
    bipoles/cuteswitch/thickness=0.3,
    diodes/scale=0.5,
    resistors/scale=0.7,
    capacitors/scale=0.7,
    capacitors/thickness=4,}
% note that the switch "straight" (for straight European voltages) is
% experimental
\begin{circuitikz}[circuitikz/straight=true,]
    \node [transformer](T){};
    \path (T.A1) node[ocirc]{} (T.A2) node[ocirc]{};
    \draw (T.B1) to [open, v^=$u_s$] (T.B2);
    \draw (T.B1) to [ccsw] ++(2,0) coordinate(top bridge);
    % bridge
    % find the center of the bridge; cross the top bridge with
    % the center of the trafo
    \coordinate (center bridge) at (T.center -| top bridge);
    % now the coordinates to the right, bottom and left bridge
    % this uses the calc library of tikz
    \coordinate (right bridge) at ($(center bridge)!1!-90:(top bridge)$);
    \coordinate (left bridge) at ($(center bridge)!1!90:(top bridge)$);
    \coordinate (bottom bridge) at ($(center bridge)!1!-180:(top bridge)$);
    % draw the bridge
    \draw (top bridge) to [D, *-*] (right bridge)
    to [D, *-*, invert] (bottom bridge)
    to [D, *-*, invert] (left bridge)
    to [D, *-*] (top bridge);
    % the rest of the circuit
    \node [jump crossing](X) at (left bridge |- T.B2) {};
    \draw (T.B2) -- (X.west) (X.east) -- (bottom bridge);
    % notice that if you change the "-2" here then the rest of the circuit
    % will adapt, thank to using cross-coordinates and relative movements!
    % The same will happens to the numbers in the ++(...) coordinates.
    \draw (right bridge) to[short, i=$i_p$] ++(1,0) coordinate (c2h)
    to[C=$C_2$, i>^=$i_{c2}$, *-*] ++(0,-2) coordinate(c2l);
    % join the left part of the bridge now
    \draw (left bridge) -- (X.north) (X.south) |- (c2l);
    % ok, the rest of the circuit now
    \draw (c2h) to[L, l_=$L$, i=$i_L$, v^=$U_L$, *-*] ++(3,0) coordinate(c1h)
    to[C=$C_1$, i>^=$i_{c1}$, *-*] (c2l-|c1h) coordinate(c1l) -- (c2l);
    \draw (c1h) to[short, -o] ++(1,0) coordinate(u1h)
    to[short] ++(1,0) coordinate(rh) to[R=$R$] (rh|-c1l)
    to[short, -o] (u1h|-c1l) coordinate(u1l) -- (c1l);
    \draw (u1h) to[open, v^=$u_1$] (u1l);
\end{circuitikz}
\end{document}

Full wave rectifier circuit


Tested negative for TB and then tested positive for TB?

Question: What could this mean, if a few years ago I had a TB test, tested negative, and then just a few weeks ago, tested positive for TB.  I know I am immunized against TB but I find it quite odd that I was tested positive when previously I had tested negative.
Comment: 1) False positive from your vaccination, 2) you were exposed to TB at some time between your first TB test and your more recent one.
Answer: You don't specify which test was used to screen for TB, in this answer I will assume that Mantoux test was used.

You probably were vaccinated using Calmette-Guérin vaccine.
Unfortunately this has been proven not to give an efficacious immunity against TB infection.
In this scenario there are two chances:

You actually were exposed to M.Tuberculosis.
The Mantoux test is probably a false positive due to your vaccination if you are at low risk for TB infection or to other factors.

Being at low risk means an individual was not:

In contact with another person with infectious TB
Born or has lived in a high TB prevalence country
Continually exposed to populations where TB prevalence is high

In both cases I would personally advise you to contact a doctor to get a chest x-ray and a IGRA quantiferon blood test to further investigate. This is particularly advisable in your case having two different outcomes from serial testing which honestly could increase the possibility of latent TB.
Comment: Thanks for the answer. I had a chest x-ray done but the doctors indicated it was more likely it was exposure to someone who had TB and not I who had TB>
Comment: You should seek consulence from a specialist who can prescribe a IGRA quantiferon test and if it confirms the diagnosis of latent tuberculosis you should begin treatment for the condition.


Books of collected CD liner/program notes?

Question: I love reading the liner notes and short texts that come inside classical CDs and concert programs. Can you recommend a compilation of these in book form? Either by multiple authors or one, but definitely shorter reading.
Comment: Are liner notes ever collected in a book ?  It's an interesting idea, but I've never heard of this.  A compilation of these from a particular writer or for a particular concert hall or record label could make sense, I guess.
Answer: Your best bet is to look for compilations of program notes written for performing organizations.  Such as:

Michael Steinberg  "The Symphony", "The Concerto", "Choral Masterworks"
Jonathan Kramer  "Listen to the Music"
David Ewen "The World of Twentieth-Century Music"

There are a few others worth looking for. The Steinberg and Kramer books are still in print, I think, and are available via Amazon, etc.
A. R.


C# GUI macro libraries or general approaches?

Question: In a C# WinForms application (on .NET 3.5, probably 4.0 soonish), how would you go about allowing the user to define their own macros? For instance, a user could want the key press CTRL+K to mean clicking a certain item in the menu, and entering some text in the dialog opened by the menu, before pressing "Ok" to close the dialog.
Ideally, our software could provide a macro-recording functionality, that would enable a user to just start recording, perform the desired tasks, and the stop recording to have a macro available. This a feature that they are used to from the old version of the software, that was written in FoxPro, a tool that has such capabilities built-in.
The best option for us would clearly be acquiring and utilizing a tried and tested third party library of some sorts, but ideas for rolling our own version are also appreciated.
Answer: If I were working on something like this, I would perhaps integrate a general purpose eventhandler to log events that you want to be recordable ( perhaps either as an individual handler added to available buttons or by creating a RecordedEventHandler class to extend EventHandler and then subclassing all your event handling from that - these are just top-of-the-head ideas so I haven't looked into which would be most viable ) and just use the "record macro" button as a switch for that. There are only likely to be a few different types of event that need to be recorded - button clicks, keyboard input on any text fields, keyboard shortcuts and mouse input on any mouse-input fields so it's not an enormously taxing task although of course working out how to store and bind macros and how to facilitate import and export if you were inclined to do so is time consuming but not technically challenging. I don't know of any libraries for this purpose ( although I expect some exist ) and thinking about it I'm not sure how easy it would be to integrate something like that because most peoples' needs in terms of macros are likely to be different.
If you needed to be able to log events around your application then you may find the ManagedWinApi to be helpful.
Answer: I have good experience with "command design pattern" for macro-recording functionaly. Every command fire some application-wide (static for example) event with informations abou parameters etc... The recorder listen to this event and persist the sequence of command calling.


What are some general tips to improve my MNIST classifier?

Question: I have built a CNN from scratch in python using Numpy, to tackle the MNIST hand-written digit recognition problem. It's composed out of a convolutional layer (3 3x3 filters), a maxpooling layer (2x2 pooling) and the 10-label output layer. I'm using softmax for the output activation function and cross-entropy as loss function. I've tried running it with a couple of different hyperparameters and so far the best accuracy i've gotten is 97%, when training on the whole train dataset (60000 images) for a single epoch and using SGD. The accuracy does vary a bit though, usually around 92-95% under these conditions. I've only tried one epoch when using the whole dataset because it already takes maybe 15 min for my algorithm to train using 60000 images (with cpu on my low grade school laptop). The thing is that I don't have an perception of how good/bad this is, i.e. how much time one would expect such an network to take and how accurate it would be. Is this really slow and inaccurate? I'd love some general tips on how I can improve my network, whether it's through some optimization methods or brute force (increased amount of layers/neurons). I've also tried implementing mini-batches but for some reason (maybe faulty implementation?) this only seems to decrease the accuracy.
Answer: You may find this OpenML interesting
In there several benchmarks on different datasets are shown so that you can see how different models score across the same dataset
For your task MNIST the plot shows:

that might give a good idea of how well your model is performing as compared to other implementations/models
Metric button in the upper left corner will allow you to compare in terms of classification metrics and also in terms of execution time
Answer: The fact that you are using accuracy as the metric suggests that your model is not performing well. It is an overly optimistic model.
The reason being that for multiclass classification you should never use accuracy. It will always give overly optimistic results. Go for categorical_accuracy as the metric and sparse_categorical_crossentropy as the loss.
As for increasing the performance of your model:
1.) Increase your number of epochs to atleast 50 or 100
2.) Use a different metric as suggested above
3.) Use adam or a variation of adam as the optimizer
4.) Since you do not mention hyperparameter tuning I am assuming you haven't done any. Try Keras Tuner for hyperparameter tuning.
As far as computational time is considered in CNN, 15 mins is not computationally expensive. CNN even when training on GPU takes a lot of time so 15 mins is nothing new.
Answer: 100% accuracy is a bad goal. 93-97% accuracy is considered decent for CNN approachh. Some samples in MNIST are incorrectly labeled which provides bad training gradients.


AudioTrack lag: obtainBuffer timed out

Question: I'm playing WAVs on my Android phone by loading the file and feeding the bytes into AudioTrack.write() via the FileInputStream > BufferedInputStream > DataInputStream method.  The audio plays fine and when it is, I can easily adjust sample rate, volume, etc on the fly with nice performance.  However, it's taking about two full seconds for a track to start playing. I know AudioTrack has an inescapable delay, but this is ridiculous. Every time I play a track, I get this:
03-13 14:55:57.100: WARN/AudioTrack(3454): obtainBuffer timed out (is the CPU pegged?) 0x2e9348 user=00000960,     server=00000000
03-13 14:55:57.340: WARN/AudioFlinger(72): write blocked for 233 msecs, 9 delayed writes, thread 0xba28

I've noticed that the delayed write count increases by one every time I play a track -- even across multiple sessions -- from the time the phone has been turned on. The block time is always 230 - 240ms, which makes sense considering a minimum buffer size of 9600 on this device (9600 / 44100). I've seen this message in countless searches on the Internet, but it usually seems to be related to not playing audio at all or skipping audio. In my case, it's just a delayed start.
I'm running all my code in a high priority thread. Here's a truncated-yet-functional version of what I'm doing. This is the thread callback in my playback class. Again, this works (only playing 16-bit, 44.1kHz, stereo files right now), it just takes forever to start and has that obtainBuffer/delayed write message every time.
public void run() {

    // Load file
    FileInputStream mFileInputStream;
    try {
        // mFile is instance of custom file class -- this is correct,
        // so don't sweat this line
        mFileInputStream = new FileInputStream(mFile.path());
    } catch (FileNotFoundException e) {
        // log
    }

    BufferedInputStream mBufferedInputStream = new BufferedInputStream(mFileInputStream, mBufferLength);
    DataInputStream mDataInputStream = new DataInputStream(mBufferedInputStream);

    // Skip header
    try {
        if (mDataInputStream.available() > 44) {
            mDataInputStream.skipBytes(44);
        }
    } catch (IOException e) {
        // log
    }

    // Initialize device
    mAudioTrack = new AudioTrack(
        AudioManager.STREAM_MUSIC,
        ConfigManager.SAMPLE_RATE,
        AudioFormat.CHANNEL_CONFIGURATION_STEREO,
        AudioFormat.ENCODING_PCM_16BIT,
        ConfigManager.AUDIO_BUFFER_LENGTH,
        AudioTrack.MODE_STREAM
    );
    mAudioTrack.play();

    // Initialize buffer
    byte[] mByteArray = new byte[mBufferLength];
    int mBytesToWrite = 0;
    int mBytesWritten = 0;

    // Loop to keep thread running
    while (mRun) {

        // This flag is turned on when the user presses "play"
        while (mPlaying) {

            try {
                // Check if data is available
                if (mDataInputStream.available() > 0) {

                    // Read data from file and write to audio device
                    mBytesToWrite = mDataInputStream.read(mByteArray, 0, mBufferLength);
                    mBytesWritten += mAudioTrack.write(mByteArray, 0, mBytesToWrite);

                }
            }
            catch (IOException e){
                // log
            }
        }
    }
}

If I can get past the artificially long lag, I can easily deal with the inherit latency by starting my write at a later, predictable position (ie, skip past the minimum buffer length when I start playing a file).
Comment: I have a similar problem at the moment. Did you find any solution?
Answer: I ran into a similar problem, although I was using a RandomAccessFile, instead of a BufferedInputStream, to read the PCM data. The issue was that the file I/O was too slow. I suspect you will have this problem even with a buffered stream, because the I/O is still taking place on the same thread as audio processing.
The solution is to have two threads: A thread that reads buffers from a file and queues them into memory, and another thread that reads from this queue and writes to the audio hardware. I used a ConcurrentLinkedQueue to accomplish this.
I used the same technique for recording, using AudioRecord, but in the reverse direction. The key is to place the file I/O on a separate thread.
Comment: Thanks!  This project has been on hiatus waiting for a solution.  I'll try this out.
Answer: A bit late to the party answering this, but in case it helps anyone in the future - I ran into this exact problem with code pretty similar to the code in the question, where the AudioTrack is created and set to play, but not written to immediately.
I found that creating the AudioTrack immediately before you start writing to it made the delay go away.  For some reason AudioTrack doesn't seem to like sitting around with an empty buffer.
In terms of the code above, you'd want to do something like
mAudioTrack=null;
while (mRun)
{

    // This flag is turned on when the user presses "play"
    while (mPlaying)
    {

        try
        {
            if (mAudioTrack==null) {
                mAudioTrack = new AudioTrack(AudioManager.STREAM_MUSIC, ConfigManager.SAMPLE_RATE,AudioFormat.CHANNEL_CONFIGURATION_STEREO, AudioFormat.ENCODING_PCM_16BIT,ConfigManager.AUDIO_BUFFER_LENGTH,AudioTrack.MODE_STREAM);
                mAudioTrack.play();
            }
            // Rest of the playback code here
        }
    }
    mAudioTrack=null;
}

AudioTrack lag: obtainBuffer timed out


choosing 3D library / platform for mobile and Desktop application

Question: I want to build an application for mobile (ios,android) and Desktop (Windows) or Web.
The application will look like this: a 3D object which the user can play with the camera perspective around it and some menus.
What I need is to manipulate a 3D Object like torus or tube. by manipulate I mean: change materials and edit the object like a polygon. of course I also need menus and communication to a server.
*Optional: I am not sure if I need to load 3D model from a file.
What I don't understand is should I look for all in one solution or combine a cross platform framework with other libraries? Are Game engine suitable for this task?
My options so far:

Use Three.js with PhoneGap and write in java script
Use OGRE and write in C++ with some cross-platform framework that allow me to write in C++.

I never developed for mobile and I wonder about those cross-platform frameworks: does the application's size is big? does the application runs well? which obstacles should i have comparing writing separate applications for each platform?
Thank you for your help
Answer: Might want to look at libgdx .


Why is metallic hydrogen degenerate matter?

Question: Why is metallic hydrogen considered a form of degenerate matter, akin to neutronium and electron-degenerate matter? I can understand that for the other two, degeneracy pressure is the only force countering inward gravity for very massive stars, but how does this concept also apply to super pressurised hydrogen? Furthermore, why would being supported by degeneracy pressure make the hydrogen metallic in nature?
Comment: I do not know enough about the theory of metallic hydrogen to answer the question how close it gets to being degenerate or if there is a perfectly degenerate state similar to superconductivity in it for some parameter of pressure range. My gut feeling tells me, that degeneracy will lead to a free electron gas, which is usually the criterion for calling something a metal, so the two properties are necessarily (?) somewhat related. Once you have a free electron gas, the optical properties etc. are similar to ordinary metals, so it would make degenerate hydrogen "shiny" in some frequency range.
Comment: Has someone been reading Robitaille's work? If you are, please [see this thread](http://physics.stackexchange.com/questions/110330); if not, ignore me!
Answer: If you crush hydrogen to very high densities, the Pauli exclusion principle will prevent electrons in the material from occupying the same quantum states. The electrons will obey Fermi-Dirac statistics and they will fully occupy states up to the Fermi energy - which increases as the density gets higher.
Presumably in metallic hydrogen what happens is that the Fermi energies increase significantly above any binding energy with the protons and thus the electrons essentially become a degenerate free electron gas. The conductivity of such a gas would be very high since degenerate electrons have very long mean free paths.
On the other hand if the temperature of the protons is reasonably low then it might be possible to confine them in a lattice governed by Coulomb forces.
The combination of these two things could be considered "metallic" behaviour. A liquid metallic hydrogen would be one in which the ratio of Coulomb to thermal energy in the protons was not high enough for them to "crystallise".
Papers I have seen talk about a possible transition taking place at hundreds of GPa at 300K. If this were a perfect gas of hydrogen atoms, the electron number density would be $\sim 10^{31}$ m$^{-3}$, with a Fermi kinetic energy of $3\times 10^{-17}$ J (187 eV). The degeneracy parameter, $E_F/kT \sim 7000$, would represent a very degenerate gas.
So the answer to your question is that it is electron degeneracy that can give hydrogen "metallic" properties, but to make the electrons degenerate you need get them to very high number densities and to do this you need to squash the gas.


Is it normal that the ad-hoc url doesn't work in the simulator?

Question: I'd like to test my app's ad-hoc deployment link, but navigating to the URL in the simulator's browser only returns  'Safari cannot open the page because the address is invalid'. The URL I use looks like itms-services://?action=download-manifest&url=[URL TO MYAPP.PLIST] Where going to the apended URL downloads the plist file.
I used XCode 5.1 to archive the build and export it for enterprise distribution with the correct certificates and such. Is the error still somewhere in my build or is this type of install capability turned off for the simulators?
Answer: Yes, the itms:// type links don't work in the simulator.


How to calculate object position (lat, long) given exif GPS location of camera phone?

Question: Probably this question was asked, but I couldn't find solution to my problem. I have an image with exif GPS location (which is position of the camera) as well as elevation above sea level. How can I calculate (estimate) positions/coordinates of objects present in an image? Is it possible to measure distance from camera to objects photographed with only one point of reference? What parameters beyond exif data are needed to perform such calculation?
Answer: N.B. All the below calculations are approximate because the distance is line, but it is actually arc and so on.
First you need the distance between the camera and object d and also the angle between the line (camera to object) and equator alpha.
Then you calculate the length of two arcs (lat, long):
lat1=sin(alpha)*d
long1=cos(alpha)*d

Then you calculate two angles which need to be added to camera coordinates:
lat_ang=lat1*180/6371/π
long_ang=long1*180/6371/π

This calculation is in degrees and 6371 meters is a radius of Earth (approximated as a sphere), π=3.14159265 (https://en.wikipedia.org/wiki/Pi)
and then add those angles to current GPS coordinates:
obj_lat=GPS_lat+lat_ang
obj_long=GPS_long+long_ang

But I will recommend you another way to simply get the coordinates: go to Google maps, enter coordinates (from photo), find the object you want to get location, right click and you will get the coordinates of this object.
Comment: And there are [free maps](https://openstreetmap.org) on the Web if Google's terms are unpalatable.  Though note that many objects one might photograph (e.g. ships) aren't plotted, because they move too quickly to be represented well on a map.  (Actually, that might be a bad example, given MarineTraffic history, but it applies to e.g. wildlife, too).
Comment: @TobySpeight, right, openstreetmaps display coordinates with right click->show address. And IMHO it is not need to see the object on the sat photo, just to use average position (from photographer memory)


Distillation thermometer position

Question: I am aware that in theory the position of the thermometer needs to be right at the transition point of the vapor into the condenser. In practice,I don´t reach the exact boiling temp. at this height but rather 2-3 °C less. When I put it down further it goes up to the correct one.
In some distillation setups ther is quite a huge distance between liquid and condenser (20 cm) and the vapor condenses already on the thermometer.
What does speak against a lower position? It is still going to read the temperature of the currently boiling fraction? But we were all taught that one must not do this.
Answer: The temperature drop is obviously due high heat loses on the way up. It is usually minimized by proper thermal isolation of the upward path. The favorite way in student labs is wrapping the glass by $\ce{Al}$ foil (IR reflection), cotton wool or PU foam as thermal isolation and another foil to wrap it, all tied by a thin rope or adhesive tape.
But, you are not really interested in the temperature near boiling liquid. You are interested in temperature of vapor before leaving to the condenser.
If e.g. water in the vessel is already boiling, but the thermometer shows just $\pu{90 ^\circ C}$, it means vapor is condensing on its well cooled way to the thermometer. At this point, the ascending path is acting like a trivial distillation column and you are measuring the temperature at the "column head", which has not been reached by the vapor fully yet, and part of the gas is still air (or more volatile liquid).

The liquid has temperature of its boiling point.
The gas at a given point has initially temperature gained by convection of moist air. At places with the local temperature below the local dew point, vapor condensation occurs and the local composition of the gas reflects the local liquid saturated vapor pressure at given temperature.
At surface colder than the boiling point, there is ongoing vapor condensation and surface warming until local vapor partial pressure meets the vapor pressure at surface temperature. Air or more volatile liquid vapor is present to top the total pressure to be equal to external pressure.
If there is too little of more volatile liquid, boiling does not keep pace with the heating and the temperature of liquid starts to raise to keep the needed partial pressure of vapor. Temperature of liquid will progressively raise, as it boiling point progressively raise, while temperature in the head stagnates, until liquid reaches the new boiling point. Soon after, the head temperature steeply raise toward the new boiling point.
Whatever you know about the column distillation, is applicable on the simple distillation as well, considering it is a very, very poor distillation column.
Comment: So without insulation the correct temperature is at a lower point. My question now is how does the liquid differ from the vapor and why. Shouldn´t it be 100 °C in both? and if there was a higher boiling second phase, the temp. still would only reach 100 °C until the water is gone?

Distillation thermometer position


Diophantine Equation Without Using Fermat's Last Theorem

Question: I'm having trouble with a problem. The problem asks me to solve the equation $(x+1)^4-(x-1)^4=y^3$ in integers. I found out that the only integer solution is $(0,0)$. I found this answer by setting $x$ as $a^3$ and $x^2+1$ as $b^3$. After doing that, I got the equation $a^6+1^n=b^3$, which assures me that there is no other solution than $(0,0)$ by Fermat's Last Theorem. However, I just realized that I am not supposed to use Fermat's Last Theorem. So far, I have simplified the equation to $8x^3+8x=y^3$. Please help me prove that the only integer solution is $(0,0)$ without using Fermat's Last Theorem.
Answer: Consider $y^3=8x(x^2+1)$. Then $y$ must be even (say $y=2z)$. Then we get $z^3=x(x^2+1)$. Then we have
$$z^3-x^3=x.$$
OR
$$(z-x)(z^2+zx+x^2)=x$$
But the factor $|x^2+zx+z^2| \geq |x|$. So for this to be true $x=0=z$.
Comment: Why is |x2+zx+z2|≥|x|?
Comment: @AjitKadaveru note that $z$ and $x$ are of same sign. This means $x^2+xz+z^2 \geq 0$. Moreover $x \in \mathbb{Z}$ thus $x^2 \geq x$.
Answer: Assume the contrary. Let $(x,y) \ne (0,0)$ be a non-zero solution to the equation
$$y^3 = 8x(x^2+1)\tag{*1}$$
Since RHS is even, so does LHS and $y$. Let $y = 2Y$, we have
$$Y^3 = x(x^2+1)$$
Since $\gcd(x,x^2+1) = \gcd(x,1) = 1$, both $x$ and $x^2 + 1$ are cubes.
Let $X, Z > 0$ be their cubic roots, we have
$$x = X^3,\; x^2 + 1 = Z^3 \quad\text{ and }\quad Y = XZ$$
This implies
$$Z^3 = (X^2)^3 + 1
\implies
Z^3 > (X^2)^3
\implies Z > X^2 \implies Z \ge X^2+1.$$
and hence
$$1 = Z^2 - X^6 \ge (X^2+1)^3 - X^6 = 3X^4 + 3X^2 + 1\implies X = 0$$
This in turn implies $(x,y) = (0,0)$, contradict with our assumption.
As a result, the equation $(*1)$ has only $(0,0)$ as its solution.


Why are seeds of summer chrysanthemum different between suppliers?

Question: I bought some seed of Chrysanthemum carinatum from two different producers, as seen on photos. How come they are different? The left hand side is 1gr, the right hand one 0.5gr. The price was about the same. Which one is better?
Comment: The ones on the left in the top picture look like Chrysanthemum carinatum seeds, not sure about the other ones, but just try rubbing one or two of the seeds on the left to see if there's a different appearance to any seed inside in comparison.
Comment: I didn't think, when I grew these years ago, that the seeds were striped - not sure what they are, but perhaps they're a different variety of C. carinatum
Comment: It is not so easy to crush left-hand side seeds into smaller units, but the result of rubbing and crushing is not like seeds on the right-hand side - there are no "stripes", and the shape doesn't look exactly the same. @Bamboo
Answer: I bought a packet of "painted daisy" seeds that did not give the botanical name. The image on the packet, and the common name, most closely matched Tanacetum coccineum, formerly known as Chrysanthemum coccineum, and it has white, pink, or red rays and yellow center disks, Painted Daisy (Tanacetum coccineum). Another name for it is "Pyrethrum". The seeds I have look similar to the ones on the right of your first image, though they do not have the prominent striping.

Chrysanthemum carinatum, now known as Ismelia carinata, also came up for me when looking for "painted daisy" and those seeds match the flat round seeds on the left of your first image. The Ismelia carinata flowers look similar in form to Tanacetum coccineum, but the petals have a ring of color around the center, in addition to having yellow or orange rays unlike Tanacetum coccineum. The centers are dark brown to red Painted Daisy (Ismelia carinata).
Given all the name changes of these two plants, and their similarity, I'm going to guess that your mystery seeds might be Tanacetum coccineum.
Comment: Good detailed answer, good illustration, and good close illustration; italicisation of text can be conveniently done by typing one underscore immediately before, & one underscore immediately after the text, or, by typing one asterisk immediately before, & one asterisk immediately after the text; We encourage you to take the [Tour], and browse through the [Help], to learn more about how the site works! Thank you! Welcome to the site!


How would a large a mass be stable at the Earth Sun L4 or L5 point?

Question: I've heard about the Trojan asteroids and there is the famous idea of putting a space colony at one of these points, but the explanations I see for how something is stable at those points it they are 'insignificant mass.'  What does that mean?  Insignificant to Earth could be pretty big, insignificant to the sun could be downright huge.  What are we talking about here, the mass of a large asteroid?  The moon?  The Earth?  Surely it couldn't be bigger than one of the two bodies in the system?
Answer: The L4 and L5 points rotate around the barycenter of the Earth-Sun system. A "negligable" mass would be one that doesn't materially affect the location of this barycenter. Obviously, with the Earth being much lighter than the Sun, the L4 point is almost equidistant to the Sun and the Earth, and thus will influence the Earth far more. That means the mass should be negligable to the Earth's mass, not the Suns.
You'd obviously be able to balance the mass in L4 and L5. That's a first-order approach, though, as both masses will actually be in an orbit around L4 and L5 and (due to other planets) are quite unlikely to have the same exact orbits.
See also http://wmap.gsfc.nasa.gov/media/ContentMedia/lagrange.pdf
[edit]
I found this discussion which has a closed-form solution on possible masses for a stable three-body configuration rotating around their common barycenter : (m1+m2+m3)2 -27*(m1*m3+m3*m2+m1*m2) >= 0 (quoted from Volume 5 of of "What's Happening in the Mathematical Sciences" by Barry Cipra, apparently.)
[edit2]
The sun weighs 3.3E5 times more than the earth. That means we can reduce the formula to
(3.3E5 mearth+mL4)2 >= 0. In practical terms, since the sun is far, far heavier than the other bodies, every term but the mass of the sun squared is negligable. That in turn means that even a second earth would be stable in Earth-Sun's L4.
Comment: @Georg: see the first link. It quantisizes the stability of Earth-Sun's L3: ~150 years.
Comment: +1 for the formula you found from Barry Cipra's article. However, I'm not at all sure your intuition that you can add stability by balancing the masses at L4 and L5 is correct. Orbital dynamics is truly non-intuitive—although as long as they're both small with respect to the Earth and the sun I expect it should be stable.
Comment: I was going to write this answer, but I got a queasy feeling that since the Lagrange points are at equilateral triangles, as you vary the mass, you might have stability for any introduced masses, even enormous masses, just with Jupiter and the sun now orbiting the new massive object. Is this false?
Comment: For the Lagrange Point L3 a so called "Anti Earth" is discussed sometimes by ScFi-conspirationists.
Comment: Ok.  So it's not so 'generic' as SF stories would lead you to believe.  Putting a huge mass in L4 might be possible, but it would move that point closer to the Earth (if I'm picturing that right) so that the 'earth' pull would be stronger.  That makes sense, but is there a limit to the size of the third body?  Is there a fraction of the smaller body that above which you just can't get the three forces - sun, earth, circular momentum - to balance?
Comment: @Scott: Well, two of the three terms in that formula are known. You wouldn't care about tidal forces, either (i.e. the object internally would not need to be extremely rigid). The L4 point is the third point of an equilateral triangle. Therefore, the tidal forces between the 3 bodies depend purely on mass, and again the sun dominates the tidal forces. On earth, the tidal force of the Sun is half that of the moon: easily measurable, but it mostly affects oceans - those are obviously not rigid.
Comment: Ok.  Very interesting.  I know Jupiter had a huge amount of mass there.  Thanks so much for taking the time to answer.


how does google maps render the map etc, is it flash a java applet?

Question: how does google maps render the map etc, is it flash a java appelet?
Comment: possible duplicate of [How does Google Maps work?](http://stackoverflow.com/questions/204644/how-does-google-maps-work)
Answer: A bit more detail, google maps uses a big div element to contain several img elements.  each of those img elements is 256 pixels square, and is positioned on a regular grid.  from there, the google maps javascript program calculates which grid images should be loaded into each img tag and uses regular dom manipulation to position each img in the right place.  Only the tiles of the map that would be visible inside the div are loaded.  when you scroll off the side, the javascript library unloads the image, and loads new ones as needed.  Other elements, like the zoom controls, markers, and lines, are stacked or drawn on top of that as needed.
Answer: It's all HTML and Javascript, plus a lot of video trucks, satellites (and airplanes?), and google magic.. More information:

How does Google Maps work?
Answer: No, it is all based on JavaScript and AJAX.
To oversimply... A small script tag is embedded in the HTML which points to a big .js file over at Google. This contains a whole lot of JavaScript that builds the "map box", downloads the map images, and does things when you move your mouse around and click on stuff.
Answer: http://code.google.com/apis/maps/
Answer: Google Maps is done via fancy JavaScript if I'm not mistaken.  If you don't already have it, install Firebug in Firefox and "Inspect" the map at Google Maps, and you'll see that it's a bunch of images together, with JavaScript to provide the functionality.
Answer: It is neither flash nor a java applet.  It is simply HTML, CSS and images with a great deal of javascript to drive the interactive elements.
Please see the Google Maps API for instructions and examples on how to create and integrate the google maps widget.


Land Rover in Mongolia with no hired driver

Question: I am planning to visit Mongolia next year, mainly for wildlife and I wonder if it is possible to rent a Land Rover and drive it on our own, without hiring a driver.  Is this possible?
Comment: Hi @Flimzy, my doubt is if it's one of this countries you are prompted to hire a driver (even if it was only in some areas)or at least most of the people recommend so. From what I read is not the first case but I have seen some pages in the sense of recommending hiring a driver. Which I would like to avoid but not at any cost
Comment: Fine in what way? What are you asking?  If you will be permitted to rent it?
Comment: Specifically a Land Rover? Or any kind of off-road vehicle would do just as well?
Answer: I don't think there is any legal issue with having no driver/guide as I know it is a popular place for Motorcyclists thanks to The Long Way Round. The Mongol Rally also travels there from London and it doesn't require any driver or guides for that section.
Here is a Link to the Lonely Planet Guide on traveling in Mongolia
http://www.lonelyplanet.com/mongolia/transport/getting-around
Here is also a link to the Mongol Rally page. You could try sending them an email to clarify the legality of traveling without a guide.
http://www.theadventurists.com/the-adventures/mongol-rally


TLS 1.3 record version for application data

Question: For TLS 1.3, the client hello record version is 0x0303 (TLS 1.2). If the server negotiates to TLS 1.3 (because 1.3 version is in the supported_version), do the application data records use 0x0304 as the version?
Answer:
... do the application data records use 0x0304 as the version?

No. The standard (RFC 8446) is very clear what the version of the record layer should be, and this includes application records:

<code>  struct {
      ContentType type;
      ProtocolVersion legacy_record_version;
      uint16 length;
      opaque fragment[TLSPlaintext.length];
  } TLSPlaintext
</code>
legacy_record_version:  MUST be set to 0x0303 for all records
generated by a TLS 1.3 implementation other than an initial
ClientHello (i.e., one not generated after a HelloRetryRequest),
where it MAY also be 0x0301 for compatibility purposes.
Comment: It seems like 0x0304 is only used in the server hello in the supported_versions field.
Comment: @user2233706: not quite; supported_versions is present (and required for 1.3) in ClientHello _and_ ServerHello (including its HelloRetryRequest variant). But it is not in any subsequent message. The version field at the _beginning_ of ClientHello and ServerHello/HRR _messages_ (not records) is also 0x0303 (without the option for 0x0301 sometimes); see 4.1.2,4.1.3,4.1.4.


Rogue "enterprise_refresh_index" causing excessive Merchandising failures

Question: Thanks in advance for reading, and for any help you can hopefully offer.
My company uses Magento for our marketplace, and while we've always had occasional issues with AOE Scheduler unable to kick off an enterprise_refresh_index, lately it's been happening far more often, and at a rate that's actually hampering our Merchandising team's ability to operate, due to the rogue enterprise_refresh_index seeming to hold table locks that are causing INSERT/DELETE/UPDATE timeouts on VERY simple Merchandising operations.
It's crippling their ability to merchandise & update products & categories throughout the day, so it's crucial we track down what's causing this rogue enterprise_refresh_index that's not being handled by AOE Scheduler.
Useful info about our setup:

Magento ver. 22.214.171.124
MySQL 5.6.34

Extensions of note:

AOE Scheduler (1.5.0)
LogicBroker (1.0.8)
Amasty (Mass Product Actions 1.5.8, Extended Product Grid with Editor 4.12.4, Shipping Table Rates 2.2.3, Image-Based Dynamic Configurable Products 3.11.7)
Klevu (Replaces Mage search entirely, 1.2.5)

enterprise_refresh_index cron setup

index management configured in backend

enterprise_refresh_index erorr details from our investigations:

An enterprise_refresh_index is being kicked off by something we can't trace
We notice the issue via the usual error AOE Scheduler throws when it's having indexing issues:

Cron error while executing enterprise_refresh_index:
exception 'Enterprise_Index_Exception' with message 'Can't lock indexer process.' in /APP/magento/app/code/core/Enterprise/Index/Model/Observer.php:140
  Stack trace:
[internal function]: Enterprise_Index_Model_Observer->refreshIndex(Object(Aoe_Scheduler_Model_Schedule))

This isn't an AOE Scheduler-triggered run, as it's throwing ERRORs in the Job List trying to execute.

AOE Scheduler errors out until the running re-index finishes
This rogue index usually takes 5 to 20 minutes to complete
We've had it go for as long as 4 hours recently, with little pauses in-between of errors

We can see the active re-index going on when viewing Client Connections to the Marketplace DB; the queries to run a enterprise_refresh_index are chugging away, without any insight into what triggered this run.
Here's a look at our MySQL connections when it is happening. Note that there's not subsequent sleeping magentouser threads that could be blocking the index or anything. Just the rogue re-index running wild.

This rogue indexer often blocks our merchandising team's updates to products & categories

They get lock timeouts updating products at an extreme rate during this window, and the updates are usually small / should be easy to execute, aside from the indexer causing issues
The merchandising lock timeout errors don't seem to happen when the rogue index isn't running; We've gone through every failed save in the admin access log, EVERY one of them, and all of them correlated to a time when AOE Scheduler was throwing ERRORs when trying to run the enterprise_refresh_index. Even the most basic of product / category updates can be blocked by this re-index.
Locks happen for our merch team most frequently when trying to DELETE/INSERT into catalog_product_entity_int / catalog_category_entity / catalog_category_product
The locks even happen to simple row-level operations, which seems to imply the indexer is taking table locks (but we can't locate or pinpoint the lock / where the lock is held & managed from?):

error: SQLSTATE[HY000]: General error: 1205 Lock wait timeout exceeded; try restarting transaction, query was: DELETE FROM catalog_product_entity_int WHERE (attribute_id = '306') AND (entity_id = '205532') AND (store_id <> 0)
error: SQLSTATE[HY000]: General error: 1205 Lock wait timeout exceeded; try restarting transaction, query was: UPDATE catalog_category_entity SET entity_type_id = ?, attribute_set_id = ?, parent_id = ?, created_at = '2017-12-26 20:47:53', updated_at = '2018-01-26 21:49:18', path = ?, position = ?, level = ?, children_count = ? WHERE (entity_id=642)

Running DB statistics queries during these rogue indexers do NOT show any db or table locks in use, or active locked mysql indexes on these tables.

We're at the point where we assume one of two things, after exhausting all debugging options we can think of:

A 3rd party module we don't expect to be doing so is kicking off an enterprise_refresh_index or triggering an observer with some updates it performs
Related to theory 1: Magento has a default observer, that despite manual reindexing & AOE Scheduler handling enterprise_refresh_index,  is naturally kicked off by some setup of our cron jobs or some action taken by a 3rd party module triggering an observer.

We're hoping it's not this, as that's far harder to track down in theory…

Worthwhile bonus data:

The memory usage of the failed / errored enterprise_refresh_index jobs in AOE Scheduler's list is always 11.06 MB.
Every failed Merchandising "Save" correlates to these enterprise_refresh_index errors, but they are able to occasionally sneak product updates in while these errors occur

We're hoping for any avenues or ideas from people who may have had similar experiences, and not managed to document the solution online, or maybe trigger a solution from shop(s) experiencing similar issue(s).
We know this issue has been discussed a lot, but no one has ever had this set of scenarios where an unknown enterprise_refresh_index is holding tables hostage for so long that simple merchandising updates are failing. Our merch team has been super patient, but the more we grow as a company, the more our catalog grows, the bigger the problem becomes... Any help is appreciated.
Let me know if providing more info will help you with your theories / ideas. Thanks all.
Edit: Still looking for any help. Cheers!
-Art
Answer: The issue came from Rapidflow. Our index settings for import for RapidFlow jobs was set to AUTOMATIC (Immediately after import). Setting it to MANUAL let AOEScheduler pick up the changes via the scheduled enterprise_refresh_index, and stopped locking AOEScheduler out of the indexer. All set.


How to get a positive mental attitude towards testing?

Question: I want to write tests for my app, though each time I look at rspec.info, I really don't see a definite path to take towards "doing things right" and testing first.  I watched the peepcode videos on rspec more than once, yet it doesn't take.  I want to take more pride in my work, and I think that testing will help.  How can I break through this mental block?
Comment: community wiki?  seems unanswerable.
Answer: Find tools that will reward you for testing.  For example, make it very easy to run all the tests and get a message like
<code>73 tests passed.
</code>
Try random testing because you can test against a lot of values quickly and easily.
See if your language provides a test-coverage analysis tool that gives you percentage of statement coverage or percentage of block coverage.  It is very rewarding to drive code coverage from 60% up to 90%---and if you are lucky, you will find bugs.
My key advice is to quantify your progress in testing so that you can see the numbers going up.  That will make it a lot more motivating.  (Gee, I wonder what other numbers that go up can be found on this site...)
Answer: I was hating it until I started creating a few testing macros. Like logging in or getting to the homepage. I found it fun to start poking at what my testing framework could really do.
It also helped to have someone else get me started by writing a few. Right away I found obvious improvements which made me want to get in there and start improving things.
Answer: "Test things you don't want to break."
It might be helpful to prioritise at first. I know that typing out the full three layers of model, view, and controller specs on top of the cucumber acceptance tests can be a chore. So one idea is to just test the most critical things in your app, and add tests as you run into bugs you don't want to see again.
"Always start with a failing test."
Cucumber features plain text "stories" that are pretty awesome for getting some really concrete tests up & running. Maybe that would be one place where you could get started. Cucumber doesn't really work with an AJAX-based app though, for that you'd have to take Selenium or Watir instead. You can start with a failing story before writing a single line of code, and quickly proceed from there to make that story pass.
"Don't test, specify."
Instead of thinking of tests, try to make a mental switch: you're not testing but SPECIFYING how your application will behave. This is design work, not nearly as boring as testing. :)
Answer: Think of it like this: if you don't test, your code is broken.
Answer: You need to see the value that testing will bring in refactoring and extending your code. Once you have a set of tests that define the behavior of your classes, you can then feel free to start making changes to improve the code.  Your tests will provide the confidence that what you're doing isn't breaking the system.  When you go to add new functionality to your code, running your existing tests will give you confidence that the new code you've added doesn't break anything else.
The key is to take that long term view.  Testing is an investment.  It takes a little bit away from the code you could be writing but eventually it will start paying off with interest.  The capital that you have stored up will make it much easier to move ahead more quickly when adding new features.
Answer: Assuming you already have a list of bugs to fix, I always like to go back through and where ever possible create an automated test that demonstrates the bug.  Then fix the bug and watch the test pass.  Since you have to test the bug anyway, and the bug should already give you enough information to recreate it, you can see an immediate return on your tests.
Eventually, you'll start to get a feel for putting the tests together and how to write them, and you won't need the "blueprint" of an existing bug.
Answer: As has been mentioned previously, the easiest way to break into testing is with regression testing.
I'd also avoid doing controller specs - they are a PITA.  Do heavy model testing, because that's where the logic should be in the first place.
Try spec'ing / testing a plain ruby project before you go off into a rails project.
Answer: I wrote a motivation post about just this case couple of days ago. Here is the summary:

Start writing tests whenever you have
  an opportunity to do it (ie. whenever
  you write some code). Choose any tool
  that makes sense to you and write any
  test that you feel could cover at
  least some tiny behavior of your
  application (don't care about the
  coverage or any other scary terms from
  the day one). Don't be afraid about
  primitive tests and trivial assertions
  - you'll get more confidence as your test coverage will grow and you'll
  become more and more happier as you'll
  notice that you don't need to hit F5
  that often anymore. Think about
  testing in other positive terms - the
  better you are at it, the less time
  you need to spend with activities you
  don't like (watching the spinning
  refresh icon in the browser,
  debugging) and more with things you
  love.

And here is the whole thing, if you are interested.
Answer: Well I'll tell you how!
FIRST DO THE FOLLOWING 10 TIMES MANUALLY ON DIFFERENT APPLICATIONS ,BEFORE YOU TRY TO AUTOMATE
the negative scenarios, where the result would come out negative.
it could be wrong data entered and gives you right outputs.
for example a login screen:
There could be many scenarios when correct User wrong PW,Wrong User correct PW.... the most important thing is  YOU DONT GIVE UP UNLESS BREAK IT  .this is your mantra.
HMMM NOW YOU ARE THINKING LIKE A TESTER NOW TURN TO UR SYSTEM,
JUS WRITE THE NEGATIVES TESTS  AND THEIR RESULTS
AND THEM THE  POSITVE TESTS
DESIGN IT.
NOW DEVELOP THE FRAMEWORK


Estimating circular pipe flow velocity through a known elevation profile and known length with a known initial pressure and flow velocity

Question: I have a known elevation profile spanning the length of my pipe (~600 meters). An elevation value is given for every five meters of pipe. At the beginning of the pipe, I have a known velocity (1.1 m/s) and a known water pressure (0.1 bar) at the inlet of the pipe. The roughness and dimensions of the pipe are known. Is there any way to predict the velocity of water at each of the elevation data points through the length of the pipe?
Comment: surely the mass flow rate is constant? or do you have leaks?
Comment: @SolarMike is right, a pipe has to have the same velocity all the way through it unless the density of the fluid is changing.
Comment: Liquid water is approximately a incompressible fluid, meaning its volume changes very little regardless of what pressure is placed on it.  It is however susceptible to temperature and phase change (if you are sucking water it might apply; call it steam if it gasifies).  Regardless, info you do not mention is required- if incompressible, flow velocity in m/s is a function of your known velocity and pipe area.  If compressible you need to figure out density changes which will be driven by a variety of factors like temperature and pressure.
Comment: The flow velocity could be accelerated due to gravity and if the fluid does not always cover whole pipe cross section, the velocity actually might be variable along the length. It would basically be (partially) open channel flow.
Answer: Velocity is not necessarily constant thru-out pipe length. Density in terms of mass/pipe len can vary. Assume a baffle in the pipe.


Anyone know of a log viewer web application for java?

Question: Im looking for a web based log viewer that can be deployed to a tomcat webserver. Does anyone know of any good web based log viewers
Answer: Take a look at Splunk which satisfies your web-based log viewer criteria.
However, It is not a web app which can be deployed on Tomcat or any web server, but it runs as it's own web server at localhost:8000
Answer: Like Splunk, as mentioned in another answer but free.. Graylog2
Seems to do most of the same kinds of thing, only without an epic pricetag.


Make always reverts to old version

Question: I'm building Android on an Ubuntu 16.04. To get the build working on 16.04 make 3.81 is required. I installed the older version through dpkg
<code>sudo dpkg -i ~/Downloads/make_3.81-8.2ubuntu3_amd64.deb
</code>
But now and then make is reverted back to version 4.1 just from alone. There's  no special event like reboot for this to happen. When i just run dpkg again everything is ok. Its really annoying sometimes I'm looking in my code for errors, without noting its just the wrong make version again.
Anyone have an idea how to fix that ?
Answer: Perhaps your Ubuntu installation is set up to automatically apply the latest updates when available? If so, a new package version of make in the ubuntu repo might trigger an upgrade.
So, what you need to do is to lock the 'make' package to a specific version. This page describes how to do that:
https://askubuntu.com/questions/18654/how-to-prevent-updating-of-a-specific-package
I think the right tag for this question would be 'dpkg' or 'apt-get'.

Make always reverts to old version


Why is an electronic shutter not common in most SLR even though is so practical?

Question: Many point and shoot cameras have an electronic shutter. I only know of one good reason to have the electronic shutter: No flash synch speeds limitations; And that reason by itself i would think suffices to include it in any decent modern SLR.
Comment: Plus it is very fast and silent.
Comment: The larger the sensor, the bigger the disadvantage in terms of readout speed from the sensor and the more it negatively impacts image quality..
Comment: In other words, electronic shutters are inherently slow ?
Comment: No, large CMOS sensors output more data than small ones which takes longer to read out. The hardware needed on the sensor to allow each pixel to store the luminance value it just detected means more real estate on the chip for circuitry and less for the actual pixel well, thus decreasing image quality because of decreased sensitivity to light.
Comment: This has all been thoroughly covered here before. See also http://photo.stackexchange.com/a/14320/15871
Comment: FWIW - some Sony SLT cameras can use either both 1st and 2nd curtain mechanical shutter OR an electronic 1st curtain (where the sensor is progressively enlivened as required and the usual mechanical 2nd curtain to terminate the exposure. | Older Minolta lenses may suffer from imprecise exposure times (usually too short) when using an electronic front curtain shutter. Sony A-mount lenses do not have this problem. | The rear-curtain-only mechanical shutter is substantially quieter in operation than when both mechanical curtains are used.
Answer: First and foremost, without a mechanical shutter of some kind, there is no way to actually stop light from reaching the sensor after the exposure time has passed. With a purely electronic shutter, you continue to expose as you read out the image. Readout is fairly fast, but outside of specific cameras that use a high speed global shutter, often not fast enough to avoid exposure quirks and other artifacts.
With cameras that use a rolling electronic shutter, whenever there is motion that moves at a higher frequency than the shutter itself, you can get stuttering or jittery motion for the object(s) that are moving across the frame. The same wobbling that occurs with rolling shutters during video can result in torn or warped frames, especially if the photographer stops "holding still" while the exposure is still being read (and yes, this can still occur in the fraction of a second it takes to read out the whole sensor.)
The only way to GUARANTEE that your exposure time is 100% accurate, and avoid any unsightly artifacts caused by continued exposure during readout, is to use a mechanical shutter. Focal plane shutters are the most common, but leaf shutters in the lens would serve the same purpose with an electronic shutter. Anything that entirely blocks out light is necessary to ensure exposure functions properly. Modern global shutters with a very high speed readout are capable of replicating mechanical focal plane shutter behavior, however global shutters are not very common on still photography cameras yet. They are mostly used for video cameras, and the good video sensors with high speed global shutter tend to be very expensive.
There may come a time in the not too distant future where a good high speed global shutter that can read out the entire sensor in a small enough fraction of a second that they could effectively replace mechanical focal plane shutters. Until that time, mechanical shutters solve some critical problems, and are essential.
Comment: Only nitpicking because you used the words "guarantee" and "100% accurate" but a mechanical shutter causes exactly the same artifacts as a rolling electronic second curtain (e.g. when the camera moves as the shutter is closing) it's just it moves about 4x faster, meaning the artifacts are 4 times smaller.


tp_smapi on the Lenevo Thinkpad T440p (or just battery thresholding)

Question: I'm trying to get the tp_smapi module working on my Thinkpad T440p for battery thresholding with tlp. However, when I run sudo tlp-stat -b it returns tp-smapi   = inactive (kernel module 'tp_smapi' load error). I've tried forcing the thinkpad_ec and tp_smapi kernel modules to load in /etc/modprobe.d like recommended on the thinkwiki. I've also read that there are alternatives to tp_smapi and that is not compatible with 4th generation Intel processors. I'm about to purchase a new 9-cell battery and would like get battery thresholding working for more longevity. Does anyone know how to obtain working battery thresholding on the Thinkpad T440p?
Answer: I suggest you just implement TLP's installation instructions completely and install acpi-call:
sudo apt-get install acpi-call-dkms

You may also refer to the FAQ for ThinkPad battery troubleshooting.
Answer: If you are still facing the problem, http://linrunner.de/en/tlp/docs/tlp-faq.html maybe of help.
Essentially, the point is your model may not be supported fully. But, you may go ahead and purchase that 9 cell battery and use it without apprehensions of a reduced life, because tlp takes care of whatever is amiss.


Are there Investable Real Estate Indices which track Geographical Locations?

Question: At one time there were the Shiller Case indices.  I don't know if they are around anymore
Comment: Ralph, there *are* real-estate indices which track geographical locations. In fact, they are the *same* ones you inquired about, Shiller-Case indices. Although you've already selected an answer for the question, I'll enter another one, in case you, or someone else, are still interested.
Answer: 1. Are there real-estate indices which track geographical location?
Yes. S&P/ Case-Shiller real-estate indices are available, as a single national index as well as multiple regional geographic indices. These indices are updated on the last Tuesday of every month. According to the Case-Shiller Index Methodology documentation:

Their purpose is to measure the average change in home prices in 20 major metropolitan areas... and three price tiers– low, middle and high.

The regional indices use 3-month moving averages, published with a two-month lag. This helps offset delays due to "clumping" in the flow of sales price data from county deed recorders. It also assures sufficient sample sizes.
Regional Case-Shiller real-estate indices

* Source: Case-Shiller Real-estate Index FAQ.
The S&P Case-Shiller webpage has links to historical studies and commentary by Yale University Professor Shiller. Housing Views posts news and analysis for the regional indices.
2. Can I invest in real-estate indices?
Yes. The CME Group in Chicago runs a real-estate futures market.

Regional S&P/ Case-Schiller index futures and options are
  the first [security type] for managing U.S. housing risk. They
  provide protection, or profit, in up or down markets. They extend to the
  housing industry the same tools, for risk management and investment,
  available for agriculture and finance.

But would you want to invest? Probably not. This market has minimal activity. For the three markets, San Diego, Boston and Los Angeles on 28 November 2011, there was zero trading volume (prices unchanged), no trades settled, no open interest, see  far right, partially cut off in image below.

* Source: Futures and options activity[PDF] for all 20 regional indices.
I don't know the reason for this situation. A few guesses:

Some new futures products just don't take off.
Current economic uncertainty and elevated risk is discouraging traders from entering a new market, one with no prior history.
In time, the real-estate futures market will get active. CME introduced the indices, with encouragement from Professor Shiller, several years ago. CME seems committed to wait this out.

Additional reference: CME spec's for index futures and options contracts.
Comment: Okay @ChrisW.Rea I addressed both parts of the question, including the "investable" section. Thank you for catching that!
Comment: There's one more part to the question: Are there investment vehicles available (ETFs or mutual funds) corresponding to the indexes? Re: "Investable" in the question title.
Comment: I wouldn't delete it- the information above is valuable. I suggest just revising your answer to mention that you didn't locate anything for the "investable" part of the question.
Answer: Not to my knowledge. Often the specific location is diversified out of the fund because each major building company or real estate company attempts to diversify  risk by spreading it over multiple geographical locations.
Also, buyers of these smaller portfolios will again diversify by creating a larger fund to sell to the general public.
That being said, you can sometimes drill down to the specific assets held by a real estate fund. That takes a lot of work:

identify the contents of the fund,
review the transfer paperwork to find the companies they they purchased the assets from
review that specific company (or companies) to find their geographical location  and if they have sold some of their assets recently.

You can also look for the issuer of the bond that the construction or real estate company issued to find out if it is region specific.
Hope that helps.


What constellation does sun occupy by location and date?

Question: How can i find the location of the sun and which constellation it would occupy based on the location and date of year.
for example: an observer is in Des Moines, Iowa on April 10th, which constellation does the sun appear to occupy?
Answer: You can see for yourself for any date and location using the free Stellarium program (http://stellarium.org/).
The constellation that the Sun is in as seen from Earth does not depend noticeably on the precise location of the observer on Earth.  It depends mostly on the time of year.  Here are the approximate days of the year at which the Sun enters a new constellation:

Aries: April 18
Taurus: May 14
Gemini: June 21
Cancer: July 20
Leo: August 10
Virgo: September 16
Libra: October 31
Scorpius: November 23
Ophiuchus: November 29
Sagittarius: December 17
Capricornus: January 19
Aquarius: February 16
Pisces: March 12

The "approximate" part is that the Sun may be up to one day earlier or later than the quoted dates, just like the start of the seasons may be one day earlier or later than the average.  (Actually, it is the calendar that is early or late with respect to the phenomenon.)  Also, because of the precession of the equinoxes, these dates shift by about 1 day every 70 years.
See http://aa.quae.nl/en/antwoorden/sterrenbeelden.html#6.
Answer: There are a few ways to do this, but I would recommend a decent star chart or software that allows you to set a specific date/time and location. There are a couple of really good software programs that offer WAY more than a Zodiacal reference, and that are free.
Comment: can you provide the name of any of the software?
Comment: I use Stellarium. It's free, easy to use and very robust. It will take you a bit to poke through it all.  http://www.stellarium.org/


Digital Logic Question involving Muxs

Question: I'm having trouble understanding the solution to this digital circuit problem involving muxes. Could anybody explain how they got to this answer.
Answer: This problem is an exercise in converting logic gates to multiplexers, which are essentially used as look-up tables.
Let's first redraw the leftmost of the four identical parts of the circuit, which are the basic building blocks:

simulate this circuit – Schematic created using CircuitLab
Now we have to convert this logic circuit into an equivalent circuit with the least amount of 2-to-1 multiplexers possible. Multiplexers can be used as look-up tables and can implement every existing logic gate, provided they have enough input pins.

Can we do it with one? Obviously not, we don't have enough inputs.
Can we do it with two? Yes! Because now we can replace both gates (NOT, AND and XOR) with a MUX each that has the same truth table.

An equivalent MUX circuit for the NOT, AND gate would be:

simulate this circuit
An equivalent MUX circuit for the XOR gate would be:

simulate this circuit
The exercise text states that the inputs are also available in complement (inverted) form. So I used one of these complement signals as a_inv.
If we now assemble the subcircuits we get the equivalent of the original circuit:

simulate this circuit
If you compare the truth table of the original circuit with this multiplexer equivalent you will see that they are equal.
In text form, my circuit equals the first exercise solution: mux(a, a', mux(c, '0', b))
You should now be able to derive from that the second solution and also the solution for output x in the original exercise diagram.
Comment: Fantastic answer sir, thank you for taking the time to respond.

Digital Logic Question involving Muxs


Select points within a relative number range

Question: I need to select points that have attributes that are within a relative number range of each other. For instance; given the following numbers: 95,705,139,65,537,266,525 and 188; I need to find all of those numbers that are within a range of 50, 100 and 150 of each other.
I then need to find those that are within a distance of each other.
I am using QGIS. Any ideas gratfully accepted. Thanks.
Comment: is this a one time analysis or do you need code to run repeatedly?
Comment: Hi Willy; once I figure out the syntax; I'll be scripting it in Python.
Answer: Since you have tagged the question "sql" I guess that sql is an option to solve this.
If I understand your question right, you want to find the 50 range case, 100 range case 150 range case in different queries?
There are other options for that but to look at the simplest first we do those assumptions:
In your table you have a geometry column for your points, we call it the_geom , an id column to identify the resulting records, we call id gid and a value column with the values you presented above, we call it the_value.
THen to make the 50 range query, with a fixed maximum distance of 100 (units of the projection you use) you can write  query like this:
SELECT a.gid, b.gid
FROM the_table a INNER JOIN the_table b ON
ABS(a.the_value-b.the_value)<50 AND ST_DWithin(a.the_geom, b.the_geom, 100);

I wouldn't write any client code to get this. If it isn't huge tables it should be no problem to just create a view and use that in QGIS:
CREATE VIEW range50 AS
SELECT a.gid, b.gid, a.the_geom, b.the_geom
FROM the_table a INNER JOIN the_table b ON
ABS(a.the_value-b.the_value)<50 AND ST_DWithin(a.the_geom, b.the_geom, 100);

Another approach here could be to create a table that can keep ranges and distances. Then you can easily put range classes in your resulting view, and you can put different distances for different ranges for instance. This table is also the right place to put information about how to style the result in QGIS like size of markers.
First create the table:
CREATE TABLE ranges
(range int,
distance int,
marker_size int);

INSERT INTO ranges(range, distance,marker_size)
VALUES(50,100,4),
(100, 125,8),
(150, 200,14);

Then you can create the view like this (here we make a two-point multipoint as result):
CREATE VIEW dynamic_ranges AS
SELECT a.gid, b.gid, r.marker_size,
ST_Collect(a.the_geom, b.the_geom) as the_geom
FROM
the_table a,
the_table b,
ranges r
WHERE ABS(a.the_value-b.the_value) <=r.range
AND ST_DWithin(a.the_geom, b.the_geom,r.distance);

To get this running smooth you should put a gist-index on the point (the_geom)  column and a btree index on the_value column.
HTH
Nicklas
Answer: I might add to Nicklas' well detailed answer:
If you're looking to find points with the same table that are either a given distance from each other or have an attribute within a given value, then you can use the form:
SELECT a1.gid, a2.gid
FROM the_table a1 INNER JOIN the_table a2 ON
ABS(a1.the_value-a2.the_value)<50 AND ST_DWithin(a1.the_geom, a2.the_geom, 100);

Just work with the table twice using different aliases.
Comment: I think that is identical to the first query in my answer :-), with the difference that you call your tables a1, a2 and I called mine a, b. As you say, self joins is the way to go.
Comment: Sorry, you're quite right, of course. I saw your 'a' and 'b' aliases and didn't notice that they referred to the same single table. I apologize for butting in...


ArcGIS Workflow Manager - How to setup a query to display current step?

Question: I'd like to setup a query that shows the current step as one of the fields in the results window.  For example, we have a query that shows all jobs in the system.  The challenge for me is since "step" is not one of the fields in the main jobs table, it has to be retrieved thru an intermediary table(s).  I'm not sure how to create a query that would include this field in the display. Using v10.2.  Another way to ask my question is how do I display a field that is not in the main jobs table, in the results view.
Answer: I have managed to figure this out using some existing queries as a guide.  This is tough to answer given the proprietary nature of queries but basically you have to include, in your query, the tables and fields that you want to display. The "Where" statement is where I was having issues and you have to setup links between the primary table and the secondary table you want to display. Something like TableA.Field1=TableB.Field1 AND TableB.Field2=TableC.Field2.
Comment: Please add additional details so that future readers will be able to benefit from the question too.
Comment: Thanks @Steve.  I have included your comments in the answer.


Electrical dimmer switches for 4 switch locations?

Question: I have a bank of 6 - LED 18watt (dimmable) bulbs and this bank has 4 switch locations.  Is it possible to dim this bank?  I don't see any 5 way dimmer switches offered.
Thanks.
Answer: There's more than one option!
As ThreePhaseEel points out, Multi-location dimming is one option.
However, depending on usage, specifically the case where the lights will mostly always dimmed at the same level or just having the dimming capability at one location with the existing switch still in operation at the other 3 locations. That is, you'll replace one of the existing 3-way locations, leaving remaining switches untouched.
If this is the case look for just ONE 3-way PRESET dimmer.
One example: Lutron LED compatible PRESET dimmer: http://a.co/aIBfTR0
(Ariadni, Toggler, Diva are all examples of preset in Lutron's product line) (Disclaimer, I don't work for Lutron. I do spec a lot of Lutron product for customers in my day job, as such I know the product lines--my only bonus for selling Lutron is the Lutron rep does take me to lunch 4 times a year.)
If dimmed the same all the time, this solution will be far less pricey than Multi-location, not to mention easier installation.
The only con is that one of the existing 3way locations (not a 4-way) must be picked for the replacement dimmer. If you open up the existing and find the switch has 4 screw terminals, just stop and put it back together and move on to another location.  If the switch you take apart has 3 terminals then the PRESET dimmer can be installed in that location.
Here is a wiring diagram for a 4 location switching. In the diagram, the center two switches are the 4-way switches, the outer two switches are 3-way switches.

Answer: There are no 5-way dimmers because there are no 5-way switches
If you want to switch a light from 4 locations, you don't use a 5-way switch -- you need two 3-ways and two 4-ways instead.  Likewise, a multi-location dimming setup (that's the term you need) will be installed with a single master dimmer and matching remotes at all the other locations.
Comment: Thank you for the quick reply!  I did see the multi-location dimming setup and will go that way.  Thanks again!
Answer: There are options for supporting multiple switch locations for a set of lights where you can have dimming capability at each switch location. One option is to use a technology such as the Lutron Caseta smart switch with dimming capability. You install this switch in the location of one of the 3-way switches. Then the travellers are all tied together at the other switch locations so that the lights operate from the Caseta switch. At the remaining switch locations you install the Lutron Pico remote control RF device in a wall mount plate over the switch box. Multiple remotes can be used for 3, 4 or more control locations, each with switching and dimming capabilities. The remotes connect to the master switch via an RF wireless communication similar to the way a remote control garage door opener works.
(Note I have no interest in Lutron Caseta devices other than being a happy user).


Minimizing home heating costs with high ceilings

Question: I live in an old rental house with 12 foot ceilings and zero ceiling fans. I am trying to conserve as much energy as possible as heating costs are expensive. I have placed plastic on all of my windows and close doors, etc. but I am wanting to do more. My question is this, if I hang items from my ceiling, will that help keep my energy costs down? I am not sure what I would hang but almost like panels of some kind. The intent behind hanging panels from the ceiling is to help keep the heat from rising to ceiling level. My landlord is not likely to install ceiling fans. Would it make a difference even if I don't do a whole complete "drop-down" ceiling? Like, if I hang 2 or 3 panels, will that help in the slightest?
Answer: There are two general approaches to reducing heating costs:

Reduce the amount of space/floor area/volume that needs heating.
Improve the insulating value of the enclosure (eg. plastic on windows)

Suspended Panels
It sounds like your primary concern here is the 12" high ceilings, and you are wondering if you can effectively reduce the volume of the room by suspending panels as a way to divide the room.
I'm mostly just guessing here, but I don't think suspending panels would help much at all. A successful outcome would result in the high-ceiling area having a lower temperature (closer to the outdoor temperature) and that seems incredibly unlikely because heat likes to rise. Gaps will facilitate convection, and the panels themselves would conduct heat readily unless they were already efficient insulators (at which point, why suspend them instead of using them as insulation).
Alternatives
It is worth noting that raised flooring (such as Korean Ondol) is a recurring architectural element that helps maintain comfortable warmth inside a home, but that's probably too severe a retrofit to consider for your space.
Closing doors between rooms is a more common and effective way of reducing the heating area. If you have some rooms that don't need heat, isolating that room by closing the door, closing heat vents, turning off baseboard heaters etc. can make a big difference.
Answer: Single panels will not do very much at all, they just reduce air circulation and slightly increase the thermal mass of the room.
Two effective strategies I've used are: buy cheap cloth (ideally not flammable, just for safety) and hang that right across the room. You want to make it as close to a complete ceiling as possible. If you can, two layers will work better. Wall hangings might also help if you have cold walls (I did this in one awful rented flat), ideally hung a couple of centimetres out from the wall (it's the air that insulates). Adding proper curtains and pelmets often helps as well.
I've also build draped/four poster beds, once with thermal drapes and polystyrene on the roof. Those are very effective because the contained volume is tiny. But obviously only useful while you're actually in bed.
It's also possible to pitch a dome tent inside the room, and that will help. Those are cheap, but also very flammable. That means no candles, but also taking care not to get any other accidental flames near them. It's worth thinking about whether you're impeding your fire exits when doing this sort of thing.


From Checkbox Into Index Array, Then From Index Array Into Complex?? Array

Question: I am a newbie with coding and I have problem in figuring out my current problem.
Let me explain my situation first.
In my website, users agree to register with their Facebook account. With that, I am able to retrieve all the permitted data, save it in my database and display it in my website's user profile page. Here, the user default profile information is based on users' Facebook. In that page, user able to edit any of their Facebook information and save it (save into my database but will not change the their information in Facebook's site). My point here is, I have created the retrieve codes for displaying the saved data from the database and I do not wish to change that.
Right now, lets get into it. I have my textarea and I want user able to list out their listings in that textarea. With each line marked as list. I created an for it, so I use explode. So automatically it is set as index array right? Now, I tried to assign/associate each value with one static key so that it will ease my next step (Retrieving them. Why? I have created the default calling for them in the display page).
So here is my textarea:-
<textarea name="languages" placeholder="Your Language of Expertise... 1 Language per Line">
</textarea>

After user submitted, their input, it will go to my function page:-
$languages = explode("\n", $_POST['languages']);

and the array ofcourse will look like this for example:-
Array (
[0] => Mandarin Chinese
[1] => English
[2] => French
[3] => Hokkien
[4] => Arab
)

I tried to make the array looks like this:-
Array (
[0] => Array ( [name] => Mandarin Chinese )
[1] => Array ( [name] => English )
[2] => Array ( [name] => French )
[3] => Array ( [name] => Hokkien )
[4] => Array ( [name] => Arab )
)

So with that, I can preserve my display callings function which is like this for example:-
$user_lang = Array (
[0] => Array ( [name] => Mandarin Chinese )
[1] => Array ( [name] => English )
)

foreach ($user_lang as $lang){
    echo $lang['name'];
}

I have tried many method such as using methods such with array_walk, array_merge, array_combine, array_flip, array_fill_keys, array_keys and combination of those. I don't know, maybe for all of those, I used it wrongly. I hope you guys can help me out here. And forgive me for my lack of brain.
Comment: `$languages = array_map(function($x) { return array('name' => $x); }, explode("\n", $_POST['languages']));`
Comment: This has nothing to do with what the tag `facebook` stands for. Please read tag descriptions carefully, and tag appropriately. Tag removed.
Comment: @CBroe Sorry, I thought I've mentioned Facebook, I should include the 'facebook' tag...
Answer: You can iterate over the languages and transform each of them into associative arrays like this:
foreach ($languages as &$language) {
    $language = [
        'name' => $language
    ];
}

The ampersand before $language passes the variable by reference. This means that when you change $language inside the foreach, the original array value is changed instead of just your newly created $language variable.
Comment: After running the foreach you will se that the content of the original `$languages` variable has been updated, and the array now looks like you wanted.
Comment: The "magic" here is the &-sign. Read more about [passing variables by reference](http://php.net/manual/en/language.references.pass.php) here :)
Comment: Martisen But how am I able to save the foreach data into single array variable?
Comment: wow... I wonder how the hell php works like that... It is like css... Do you have any links for me to read how it works like that? Able to update by line stuff like that..... Anyway, thank you for that. It works beautifully.... Have my points!
Comment: Alright... thanks for that... I'll try to understand it (eventhough, right now I don't)....


Why is Byrne vs. Fischer (1956) regarded as the "Game of the Century"?

Question: (This is the game in question.) Is it because it was played by a 13-year-old Bobby Fischer?  Would it have been different if it were played by a much older player?  Who labeled it the "game of the century" and did this game between Tal and Smyslov (1959) miss being the "game of the century" by 3 years?
Comment: I just want to add that the match between Fischer and Spassky in 1972 is dubbed the "match of the century".
Answer: The "Game of the Century" was a term coined by Hans Kmoch in Chess Review. In short it was a bit of sensationalism. While Fischer did show a talent for combinations and an impressive sacrifice, the real importance of the game was the story of a leading chess master vs a phenomenal prodigy about to begin his historic rise.
Still, it's helpful to note what David Levy said: "In my opinion, however, the game, attractive though it is, can in no way be held in such high exaltation. It was merely the fact that the combination was created by a thirteen-old boy that brought the game so much publicity. Had it been played in the Barnet League between two sixty-year-old men it is doubtful whether it would have been considered worthy of publication".
As for the game between Tal and Smyslov, the similarities in age are easy to spot, but the chess playing doesn't really compare.
The full game and commentary can be found over at Wikipedia.
Comment: Except a sixty year old man in the Barnet league probably could not have found and executed the combination.  Hyperbole aside, it was a great sacrifice and a 13 year old upended a fine player.
Comment: It's perhaps worth noting that Fischer didn't even think the game worthy of inclusion in "My 60 Sixty Memorable Games".
Answer: I just wanted to add, Jerry aka ChessNetwork, a USCF Master, did an analysis of this game.  It is worth watching.
When this game was played, it was the best game of chess ever by a 13 year old.  The combination of defeating a master in a beautiful way, being the one using the black pieces, and being only 13 years old is what gave this game so much attention.
Comment: Donald Byrne was an IM.  His brother, Robert, was the GM.  /nitpick


In a song, if somebody wanted to say to their deceased mom, "We loved you so much." what form of love would you use?

Question: Would I use "Aishita" or something else? The child is a 16 year old.
Comment: Presumably you mean "deceased" and not "diseased"?
Comment: Yeah, whoops, corrected it.
Comment: Why でした? An ordinary 16-year-old boy would not usually use that to his mom unless he's being formal. Without knowing the overall atmosphere of the remaining part of the song, this question is very hard to answer.
Comment: Sorry, I'm new to Japanese, and I assumed でした referred to past tense?

The overall atmosphere is very dark. And it's about the loneliness the boy and his brother faced following her death.
Comment: でした is a past tense form, but it's the past tense of です, which is used to express politeness to the listener, and wouldn't typically be used between family members. The past tense that would be in the appropriate register would be だった.
Comment: @AlexCunningham I mean, "daisuki" is not wrong at all, but "deshita" is a (past) *polite* copula. A son might use "deshita" when writing a letter to his mother in a formal and
solemn tone, and that's what I meant by "atmosphere". So is the tone of this song like "Hey mom thanks so much" or "Dear our mother, we appreciate your kindness"? This affects how much 愛 would be acceptable.
Comment: It's, "Precious mother, sweet mother, we loved you so much."
Answer: Unlike 恋 (koi) which refers to romantic love, technically speaking, you can use 愛 (ai) to refer to familial love. But it's basically a fairly big word, and I believe most 16-year-old boys would feel embarrassed to use it. 大好き (daisuki) should be much safer most of the time. 愛 might be safely used if the writer is mature and the song contains stiff words or words related Christianity/philosophy, but your song does not seem to be like this.


Azure ADConnect - authentication error re: Office 365, Azure

Question: We have an issue with ADFS and Azure ADConnect authentication on our network.  We can sign in and use Office365 systems no problem at all, and ADFS redirect works perfectly when using our Office365 online portal.
When we try to login to an MSDN subscription (in this example through VisualStudio connecting to external Azure web apps etc.) or connect to Azure using Powershell with Login-AzureRmAccount, we get 'an error occurred' and eventID 364 logged in the ADFS server event viewer logs, 'Encountered an error during federation passive request'
<code>Encountered error during federation passive request.

Additional Data

Protocol Name:  wsfed

Relying Party:  urn:federation:MicrosoftOnline

Exception details:  Microsoft.IdentityServer.Service.Policy.PolicyServer.Engine.InvalidAuthenticationTypePolicyException: MSIS7102: Requested Authentication Method is not supported on the STS. at Microsoft.IdentityServer.Web.Authentication.GlobalAuthenticationPolicyEvaluator.EvaluatePolicy(IList`1 mappedRequestedAuthMethods, AccessLocation location, ProtocolContext context, HashSet`1 authMethodsInToken, Boolean& validAuthMethodsInToken)    at Microsoft.IdentityServer.Web.Authentication.AuthenticationPolicyEvaluator.RetrieveFirstStageAuthenticationDomain(Boolean& validAuthMethodsInToken)    at Microsoft.IdentityServer.Web.Authentication.AuthenticationPolicyEvaluator.EvaluatePolicy(Boolean& isLastStage, AuthenticationStage& currentStage, Boolean& strongAuthRequried)    at Microsoft.IdentityServer.Web.PassiveProtocolListener.GetAuthMethodsFromAuthPolicyRules(PassiveProtocolHandler protocolHandler, ProtocolContext protocolContext)    at Microsoft.IdentityServer.Web.PassiveProtocolListener.GetAuthenticationMethods(PassiveProtocolHandler protocolHandler, ProtocolContext protocolContext)    at Microsoft.IdentityServer.Web.PassiveProtocolListener.OnGetContext(WrappedHttpListenerContext context)
</code>
We have a single ADFS 3.0 server utilising Azure ADConnect to sync our on-premise AD to Office365.  The correct Office365 identity server entry is present in our ADFS configuration.
For some reason we can't authenticate MSDN accounts and logging into Azure through powershell seems to fail the same way.  S smaller window with a Microsoft account login appears, then we should redirect to our ADFS authentication page but fails.  We can login to the web based Azure portal no problems with domain credentials.
I've seen a couple of similar threads, one mentioned to run through the ADFS configuration wizard again, although if there's any more troubleshooting steps to look into that would be really helpful.
Answer: This was resolved by enabling Forms Based authentication on our Intranet Global Authentication policy on our ADFS server, following the below instructions.
https://blogs.msdn.microsoft.com/josrod/2014/10/15/enabled-forms-based-authentication-in-adfs-3-0/


zsh completion for umount: limit completion to one argument

Question: when I use zsh completion for the umount command:
umount /mnt/t<TAB>

it completes the mounted filesystem /mnt/tmp.
But when I accidentally press tab too many times, it tries to be too helpful, and suggests other mountpoints, which leads to nonsense completions such as:
umount /mnt/tmp /

how can I limit umount completion to one mountpoint only, so that further tabs will not add any further arguments?
I think I have located the relevant section in /usr/share/zsh/functions/Completion/Unix/_mount:
  # Completion for umount.
      local excl='-V --version -h --help'
      args=(
    '(- *)'{-h,--help}'[show help]'
    '(- *)'{-V,--version}'[show version]'
    "($excl -v --verbose)"{-v,--verbose}'[verbose mode]'
    "($excl -n --no-mtab)"{-n,--no-mtab}"[don't write /etc/mtab]"
    "($excl)-r[remount read-only on failure]"
    "($excl)-d[for loopback mount, free loop device]"
    "($excl)-i[don't call /sbin/umount.<fs> helper]"
    "($excl *)-a[unmount all file systems from /etc/mtab]"
    "($excl)-t[specify file system type]:file system type:_file_systems"
    "($excl *)-O[with -a, restrict filesystems by options]:file system option:->fsopt"
    "($excl)-f[force unmount]"
    "($excl)-l[lazy unmount]"
    '*:dev or dir:->udevordir'
      )

  _arguments -C -s "$args[@]" && ret=0

what do I need to modify?
Answer: _arguments is a complicated beast… The part that handles non-option arguments is
    '*:dev or dir:->udevordir'

This is an instance of *:message:action in the manual, with * meaning that it applies to all non-option arguments. Replace * by 1, which applies only to the first non-option argument (an instance of n:message:action).
    '1:dev or dir:->udevordir'

I guess zsh's completion is more liberal because umount accepts multiple filesystems on some platforms.
To also stop completing options after the filesystem, pass -A "-*" to _arguments, i.e. change its invocation to
  _arguments -C -A "-*" -s "$args[@]" && ret=0

Comment: thank you. But it still wants to suggest options, when I press `TAB` after the mountpoint: `umount /mnt/tmp `, will complete to `umount /mnt/tmp -`, and list all -options. Is it possible to stop completing -options, after mountpoint has been specified ?
Comment: @MartinVegter edited


Visual Studio Emulator for Android: Catastrophic failure when trying to launch

Question: I recently installed the stand-alone Visual Studio Emulator for Android to use with Android Studio. However, when I try to launch an emulator, I get a dialog asking if I want to configure the emulator to connect to a network. If I select "No", the emulator launches and seems to work nicely but won't connect to the internet. If I select "Yes", I get the following error:
<code>The emulator is unable to create the external network switches:

Something happened while creating a switch:
Failed while creating virtual Ethernet switch.

Ethernet port '{5A2CBD16-0961-475A-84AB-83B62B5376B4}'
bind failed: Catastrophic failure (0x8000FFFF).
</code>
I only have a single network interface which is a wireless one.
I've tried removing all the virtual switches from Hyper-V manager, but that didn't work. I also tried to create a new internal switch manually, but that doesn't affect the problem either.
What could cause this problem? How could I get the emulator to launch with an internet connection?
Answer: It looks like you are unable to create the external switch. Try manually creating an external switch in Hyper-V Manager, and if you can, then delete all of your virtual switches in Hyper-V Manager, delete all VS Emulator VMs in Hyper-V Manager, and try starting the emulator again.
Answer: I had the same issue, in my case I had sharing enabled on my wireless connection. Go into Network Connections, right click your wireless connection, go into the Properties, and under the Sharing tab make sure all the check boxes are unchecked.


How to create poetic readings for names?

Question: Can I create poetic readings for invented Japanese names? Based on [小鳥遊]{たかなし}, I would like to create the name [冷]{つめたい} with this special reading, referencing the adjective 冷たい. If I am doing something considered incorrect, I kindly ask you to teach me how to create these poetic readings more accurately. Thank you in advance for your response.
Comment: And there's nothing poetic about つめたい.
Comment: It's difficult to explain why to someone who didn't grow up speaking Japanese but つめたい sounds very weird as a name. It's not even about how to read the kanji. If 冷 had to be read in some form of the adjective, it would be its old form つめたし. In fact, 温 can be read あつし as a name. つめたし sounds like it's meant as a parody of it.
Comment: That's like reading 誠 as まこと, which is rather conventional as a name. Being unconventional is fine but some words simply don't sound like names.
Comment: I understand, but could I create unconventional readings for names? For example, could I create a name that means 'gentle' and the reading could be something like 'truth' to symbolize two meanings, 'gentle' and 'genuine'?
Comment: In fact, I misinterpreted myself. In reality, this reading was the name of a character I had when I was a child, and I thank you for clarifying the readings for me. You have helped me a lot.
Answer: Technically and legally speaking, assigning an arbitrary unusual reading to a kanji name is possible. You can sometimes find such unique names in manga/anime, and a few Japanese parents choose such names for their real children. You can see examples in this question: Was the Japanese reading "raito" for moon, ever been used before Death Note came to existence?
However, they can do this because they have grown up with Japanese for decades and understand the subtleties of the language. While both おおいし and おいしい are romanized as Oishi, Japanese people can intuitively tell which one is a natural name and which one is out of the question. Unfortunately, there is no quick guide to coin a natural-sounding Japanese name, and it may still be impossible to acquire this sense even after studying Japanese seriously for hundreds of hours.
Frankly, つめたい is out of the question as a name. Before even considering whether it has poetic quality, it doesn't look like a name to begin with. 小鳥遊 is a surname that was invented by someone long ago, and Japanese people have already accepted it as it is, but modern Japanese speakers would hardly do the same thing when naming their baby.