How to compile *.ins files in TeXstudio

Question: I am using TeXstudio and I am having difficulty in compiling elsarticle.ins and elsarticle.dtx files. Does anyone have any inputs on solving this?
Comment: TeXStudio is *not* a compiler. You have to type the command 'latex elsarticle.ins' in a command interpreter (eg CMD, Powershell..)
Comment: Why not install the package with the package manager of your distribution?
Comment: a .ins file is just a tex file so you can treat it as any other tex file either on the commandline or in an editor, but elsarticle is in texlive and miktex you should not need to install it from source.
Answer: TeXStudio has its default configuration (Options->Configure TeXStudio->Commands) to execute only .tex files.
This is done in the 4 commands (for LaTeX, PdfLaTeX, XeLaTeX, LuaLaTeX) by using the special char %, for the name of the file, and .tex.
If you change this to  ?me it will compile (m means name, e means extension).

In my case, since it is configured to -interaction=nonstopmode I must delete de .sty file, or LaTeX will ask to overwrite it and the compilation will stop.
It will also work for the .dtx file, or any other file opened in your editor.
Comment: I found this question while looking for a solution. It took months, but I hope it is still useful to someone.

How to compile *.ins files in TeXstudio


Lost my passport with F1 visa before leaving to the USA to begin my masters programme

Question: I lost my passport with my F-1 visa 3 days before leaving to the United States to begin my masters. Can I get an expedited visa appointment and get a new visa? Or can the already approved visa be replaced?
Comment: I suspect that you will have to have another interview. The regulations are such that waivers of the interview requirement are very rare as far as I know.
Comment: Where are you? Have you already replaced your passport? I do not know whether you can get an expedited appointment, but the visa can certainly be replaced -- by submitting a fresh visa application and paying the fee again, I suppose.  You'll need the same materials as your previous application plus a new passport and probably some sort of loss report for your previous passport and visa.  You will probably have to delay your departure, I'm afraid. At least the new visa should be granted relatively quickly since you've already been evaluated.
Comment: I am in India. I haven't left the country. I lost it before leaving India. Will I have to take the interview again? Or is there like a different process for this?
Answer: According to the State Department, interview wait times are currently 42 days in Mumbai and 18 days in New Delhi.  You may be able to get an expedited appointment:

Qualifications for an Expedited Interview Appointment
Consular sections overseas may be able to expedite your interview date if there is an urgent, unforeseen situation such as a funeral, medical emergency, or school start date. The process to request an expedited nonimmigrant visa interview varies by location. You should refer to the instructions on the website of the Embassy or Consulate Visa Section  where you will interview, or on their online appointment scheduling site. You will need to provide proof of the need for an earlier appointment.

The last requirement should be pretty easy to meet in your case.


Is it possiible to get a virus without running an exe file?

Question: I will often download .exe files and soon decide I do not wish do download them (just want to make sure I don't get a virus). Is it possible that I could get a virus from these downloads before I even run the executable?
Comment: You can get a virus just by having your PC running. So big **yes, you can get viruses without executing exe files**.
Comment: You have two questions. Your title is different from the content. Can you clarify what you want to know
Comment: @BlueWizard if you regularly apply OS updates, don't just have a bunch of open ports, and don't open unknown documents and programs, chances of getting a virus are close to zero.
Comment: @Groo Disagreed. There was once a case where a popular image drivers allowed arbitrary code execution when being presented with manipulated image files. Thus you can get infected just by looking at an image from some website. OS updates won't save you. You run tons of stuff on your computer. All of this might be buggy and all of this might be exploided. Be it your email program, your document viewer or your browser
Comment: For all the time I've had a PC, the number of zero day exploits that can infect you without you doing something silly, that I can remember, is very small. In fact, I can think of only the GDI+ overrun (probably the image exploit you mentioned) and a couple of worms in the Windows XP era (but even then could have been prevented with regular  updates). So I am just saying that the chances are very slim, not zero, but you have a greater chance of losing your unbackuped data due to disk failure. :)
Answer: It is possible for the act of merely downloading a file and doing nothing with it to be a security vulnerability, but this is true of any file type (not just exe files), and attacks of this nature are much more difficult than simply tricking random people into opening an untrusted file. This kind of attack would be exploiting some error in your browser or download manager's programming to execute arbitrary code rather than running a malicious exe file directly. This would essentially be equivalent to getting a "drive-by-download" virus from visiting a website, except it would be exploiting the download engine rather than the browser scripting or rendering engine.
Executable (exe) files are mainly dangerous because they run a program on your computer. If you run a program you are giving it permission to do anything your user account has access to do, including installing other programs, reading or destroying data, modifying system configuration, etc. If you do not run that file then it does not execute and you have not given it permission to do anything
Answer: You can get a virus from many file type including exe files.
PDF and office files are very common. Especially office files that contain macros. E.g in word it could be a .docm extension


Asked to send emergency travel money by MoneyGram, is this a scam?

Question: The employer offered to pay all the visa and travel and is now in the process of work permits. The issue is the advocate referred to has requested that I deposit money into MoneyGram into my name being sent by a relative in my name as a emergency or travel allowance which will cater for my needs in the first month before I get my salary. Is this legit?
Comment: No, it's a scam, 100% guaranteed. Run away!
Comment: Think about it: if you have enough money to cater for your living expenses in the first month of employment, why do they want you to put it into a MoneyGram account instead of just leaving it in your own bank account or taking it with you in cash? Do you have any reliable evidence other than through a 3rd party 'advocate' (whatever that is) that this 'offer' comes from a genuine employer? Your instinct is telling you this doesn't look legit, listen to that voice.
Comment: Rule #1: If you have to ask: it's a scam!
Comment: @Hilmar Rule #2.  See Rule #1
Answer: You are being scammed.  The "job" you are being "hired" for does not exist.  This is a classic form of advance fee fraud, since a legitimate employer will never ask you to pay money upfront for anything.  Asking to use MoneyGram is also a huge red flag, since anybody with the code can collect the money and there is no way to reverse the transaction.
Here's a similar case with good advice: Job interview in London requires me to wire money to the travel agent. Is this a scam?
Comment: The scammers may have nothing to do with the actual job application, except they hacked someone's personal data. Anecdote: I got in touch by email with an old high-school friend. I knew he was a keen chess player. Soon after,, I got an email purportedly from him, saying he was at a chess tournament in Eastern Europe, had lost all his travel documents and credit cards etc, and requesting me to send money so he could get back home. This obviously made no sense -why didn't he ask his family, instead of me? - and of course I ignored it.


crmURL with selectedChild parameter?

Question: I'm trying to do something like the following in my extension's template:
{capture assign=contactUrl}{crmURL p='civicrm/contact/view' q="reset=1&id=`$contactId`&selectedChild=jobs" h=0}{/capture}
View Contact's Jobs

But the selectedChild does not show up on the resulting URL. We do have a contact summary tab for Jobs in our case (part of the extension), and it does work if I hand type that parameter into the url. But not in smarty.
What is the right way to assign the correct crmURL (so the right URL works with any CMS) with the selectedChild parameter included? Or is this method no longer how we can direct to a specific tab on the contact summary page?
Answer: I think you can just use $contactUrl instead of $smarty.capture.contactUrl
Try replacing the last line with:
View Contact's Jobs

crmURL with selectedChild parameter?


What does exactly "memory is accountable" mean?

Question: I understand that "accounted memory" means memory that is ensured to be always commited, that means: every page of the VMA is either in RAM or swap, so every page must be allocated.
However, if I cat /proc/self/smaps, I can see that the [heap] has the ac flag (I have ommited the irrelevant fields from the output):
<addr> rw-p 00000000 00:00 0                          [heap]
Size:                132 kB
Rss:                   8 kB
Shared_Clean:          0 kB
Shared_Dirty:          0 kB
Private_Clean:         0 kB
Private_Dirty:         8 kB
Referenced:            8 kB
Anonymous:             8 kB
Swap:                  0 kB
THPeligible:    0
VmFlags: rd wr mr mw me ac sd

However, the VMA has a size of 132 kB, but only 8kb are resident, and so there is 124kB that are not commited yet.
What does ac means in this context? The man proc says that ac means "the area is accountable", but I don't really know what does mean.
Answer: I believe "ac" mapped VMAs are counting toward the OOM-killer weight. E.g. glibc stack guards are not marked with ac, so they don't count.


Only before VAT price is displayed

Question: My website displays price before VAT only no matter what I change in the price display settings.  The VAT is not added until the checkout.  I want to show both before and after VAT prices on the website, whats going wrong?
Answer: Go to magento -> configuration -> sales -> Tax -> there are options to display tax inculude or exclude on product page, cart page etc.

Only before VAT price is displayed


Wave function of a system of two identical fermions

Question: In N. Zettili's 'Quantum Mechanics Concepts and Applications' [chapter 8, solved problem 8.3], we have to find wave function and ground state energy of a system having two identical fermions and in the solution it is mentioned that the wave function of the system must be anti-symmetric.
But if we have a system of two identical fermions(say electrons), the net spin of the system is then either 1 or 0, hence integral. So the wave function must be symmetric!
Is this right or am I missing something because it is repeatedly written in Zettili in subsequent problems as well?
Comment: you are confusing the net spin of the two-particle system with the fermionic nature of the individual particles.
Answer: The total wave function needs to be antisymmetric under particle interchange, e.g.:
$$\Psi(x_1, x_2) = - \Psi(x_2, x_1) $$
where the total wave function is factored into space, spin, and maybe color, and so on:
$$\Psi(x_1, x_2) = \psi(x_1, x_2)\chi_{1, 2}C_{1, 2} $$
where $C=1$ for colorless electrons.
As you point out, the spin can be $S=0$ or $S=1$. Spin zero is antisymmetric:
$$ \chi_{1, 2}=\frac 1{\sqrt 2}(|\uparrow\downarrow\rangle-|\downarrow\uparrow\rangle) = -\chi_{2, 1} = -[\frac 1{\sqrt 2}(|\downarrow\uparrow\rangle-|\uparrow\downarrow\rangle)]$$
while spin one are the three symmetric combinations, such as:
$$ \chi_{1,2}=|\uparrow\uparrow\rangle=+\chi_{2,1}=+[|\uparrow\uparrow\rangle]$$
For the total wave function to be antisymmetric, the spatial part of the wave function needs to have opposite symmetry, so that if the ground state is spin zero:
$$ \psi(x_1, x_2) = \psi(x_2, x_1) $$
so that:
$$ \Psi(x_1, x_2) = \psi(x_1, x_2)\chi_{1, 2} = [+\psi(x_2, x_1)][-\chi_{2, 1}] = -\Psi(x_2, x_1)$$
Particle interchange means interchanging all coordinates: space, spin, color, flavor, and whatever else may be relevant.
Now the comment that the total spin of the system is 0 or 1 and hence is symmetric is interesting. Yes, the 2 particles form a composite boson, but there is only one boson, and hence, nothing to interchange.
The best example of this is $^4$He. It is obviously a boson, as it forms a condensate--superfluid helium, and indeed, the superfluid wave function is symmetric under interchange of any two helium atoms. Nevertheless, the 2 electrons, 2 protons, and 2 neutrons in each helium atom are antisymmetric under interchange.
Comment: So just to be sure, if there are N identical fermions in a system, the wave function will be anti-symmetric no matter what the resulting spin is. While if there is a system with electrons and some other fundamental particles, then we need to calculate total spin to find out whether it will be symmetric or not. Is that it?
Answer: The book is right; you are wrong. An antisymmetric wave function of two electrons can have spin 0 or spin 1.
The wave function has a spatial part and a spin part. The overall wave function for two fermions must be antisymmetric.
If the spatial part is symmetric and the spin part is antisymmetric, you have total spin 0.
If the spatial part is antisymmetric and the spin part is symmetric, you have total spin 1.
Comment: But that is what i want to know, if total spin is integral, the system should behave as a boson and hence should be symmetric. Why is it anti symmetric despite having integral spin?
Comment: Because of the spin-statistics theorem. (https://en.m.wikipedia.org/wiki/Spin–statistics_theorem) When the component particles are fermions, the wave function must be antisymmetric, even if the combined system has integral spin. The integral spin of the combined system (say, a hydrogen atom) becomes relevant when considering the behavior of multiple combined systems (such as a gas of hydrogen atoms).
Answer: A bound state of two fermions is a boson, whether the total spin is $0$ or $1$. The wavefunction of the constituent fermions is still antisymmetric, but the wavefunction of the bosons (regarded as elementary objects) is symmetric. By "wavefunction" here, I mean the whole thing, considering both spatial and spin degrees of freedom. This is clarified below.
Suppose we have four fermions arranged in the form of two integer-spin bound states. The "wavefunction" of that two-boson system must be symmetric with respect to exchange of the two bosons (the two bound states, each regarded as a unit), even though it is still antisymmetric with respect to the interchange of any two of the fermions. This can be seen in a formulation using creation/annihilation operators. Suppose that $a_n^\dagger$ are operators that create fermions, where $n$ labels different possible modes that a fermion can be in — different combinations of momentum and spin-orientation. To simplify the notation, I'll pretend that there is only a discrete list of possible modes. These operators satisfy the anticommutation relations
$$
  a_n^\dagger a_m^\dagger = - a_m^\dagger a_n^\dagger.
\tag{1}
$$
An operator
$$
  \sum_{n,m}f(n,m)a_n^\dagger a_m^\dagger
\tag{2}
$$
creates a pair of fermions, and we can choose the complex-valued "wavefunction" $f(n,m)$ so that this pair corresponds to a bound state. The anticommutation relation (1) implies that the wavefunction $f(n,m)$ might as well be antisymmetric; the symmetric part doesn't contribute to the sum (2) at all.
Now consider the operators
\begin{align}
  b_j^\dagger\equiv \sum_{n,m}f_j(n,m)a_n^\dagger a_m^\dagger,
\tag{3}
\end{align}
where the index $j$ can be used, say, to label bound states in different locations or with different total momenta. The anticommutation relations (1) imply that these new operators commute with each other:
$$
 b_j^\dagger b_k^\dagger =b_k^\dagger b_j^\dagger.
\tag{4}
$$
Therefore, in an operator that creates two of these objects, such as
$$
  \sum_{j,k}g(j,k)b_j^\dagger b_k^\dagger,
\tag{5}
$$
the "wavefunction" $g(j,k)$ might as well be symmetric, because the commutaiton relation (4) implies that the antisymmetric part does not contribute to the sum (5) at all.
For this reason, a bound state of two fermions is a boson.
Comment: A system of two electrons in the Helium atom, is an example of a two-fermion system. But you write the **combined** total wavefunction $\Psi(1,2)$, you still write an antisymmetric wavefunction! @ChiralAnomaly
Comment: By combined wavefunction I meant the wavefunction of two electrons taken together ($\Psi(1,2)$). For example, the wavefunction of two electrons in Helium atom taken together. By total wavefunction, I meant the space part and spin part taken together. Honestly speaking, I have the same confusion as the OP. Why is $\Psi(1,2)$ antisymmetric i.e. still given by a Slater determinant? No. I don't disagree with you. I am trying to understand (for example) why is the wavefunction of a meson symmetric but other two-electron systems is antisymmetric e.g., He atom for concreteness (See Sakurai).
Comment: @SRS The total wavefunction of any 2-fermion system should be antisymmetric with respect to the exchange of all of the two fermions' degrees of freedom, including both spatial and spin (and color, etc). This is true for the 2 electrons in orthohelium and in parahelium, and for 2-quark models of mesons. If a text says that the 2-quark wavefunction of a meson is symmetric, then presumably it's talking about exchanging only some, not all, of the degrees of freedom. Do you have a source that seems to contradict this?


How to create a GIF animation that moves smoothly?

Question: How to create an animation that moves smoothly similar to the GIF below?
Answer: The animation itself was likely created in After Effects or some other animation tool. The key to the smoothness is the GIF frame delay time.
Most computer displays run at 60fps (frames per second), so the best frame rates for smooth animation are 60fps and 30fps, or even 15fps if the motion is slow and you're trying to create the smallest file possible.
GIF animation timing is measured in hundredths of a second, and exact values corresponding to the frame rates we're after aren't possible. However, most web browsers happily animate GIFs in sync with the display, using rounded down frame delays. The values we're after are 2/100ths for 60fps (0.02s in Photoshop), 3/100ths for 30fps (0.03s in Photoshop), and 6/100ths for 15fps (0.06s in Photoshop).
Most of the smooth GIFs you've seen use a 0.02s or 0.03s frame delay, and those are the values I typically use for mine as well.
Comment: Once I apply the setting you provide, I'll show you how it looks :)

thanks very much
Comment: Thank you for the info Marc. If you were to create an animation at 60fps or at a 0.02 second frame delay in Photoshop, would you have to add more frames between point A an point B within the animation?
Comment: @spacerGIF the GIF format stores frame delays in integer hundredths of milliseconds, so a "true 60fps" frame delay of 0.016 seconds isn't possible. The format only natively supports 100fps, 50fps, 33fps, 25fps, etc. Therefore, 2/100ths is the best you can do for a 60FPS gif
Answer: I can't comment on spacer GIF's comment but as Marc Edwards says the GIF format specifies delay in 1/100s of a second as an integral value. Using  0.02s, 0.03s, or 0.06s for the delay is as close as it can be to standard frame rates of 60, 30, or 15 fps.


Distribution of Sum of Absolute Value of Random Variable

Question: I'm wondering if there's a distribution $\Gamma$ such that if we draw $x_i \dots d_n$ iid from $\Gamma$, then $\sum_{i=1}^n |x_i|$ has a nice distribution. I thought maybe the normal distribution, since then the absolute value would be half-normal, but I'm not sure what the distribution of the sum of half-normal variables are.
Comment: If you're willing to consider a distribution that's supported on the positive reals to begin with, there's a nice expression for the distribution of a sum of independent exponential random variables (http://en.wikipedia.org/wiki/Erlang_distribution)
Answer: If i.i.d. random variables $X_1, X_2, \ldots, X_n$ have Laplacian density
$$f(x) = \frac{1}{2}\exp\left(-|x|\right), -\infty < x < \infty,$$
then $|X_i|$ are i.i.d. exponential random variables with mean $1$, and
$\sum_{i=1}^n |X_i|$ is a Gamma random variable with mean $n$ and order parameter $n$.  This is effectively the same result as the one in the comment by
@PinkElephants but without the requirement of support on the positive
reals only (which makes the distinction between $X_i$ and $|X_i|$ irrelevant.)
Comment: I think the cases given thus far all satisfy the conditions for the central limit theorem.  So for large n there is a normal distribution approximation that should be pretty good and can be normalized so that a standard normal approximation can be used.


Can the encrypt-and-authenticate method result in secure authenticated encryption if the MAC scheme has unique tags(non-deterministic)?

Question: If we use non-deterministic MACs in encrypt-and-authenticate approach, is it secure?
Comment: How would a non-deterministic MAC have unique tags?
Answer: Not necessarily.  Let $M$ be a secure deterministic MAC like HMAC-SHA256.  Define the randomized MAC $M'_{k, \rho}(m) := M_k(m) \mathbin\| \rho$; that is, $M'$ just appends the randomization to the MAC.  Then encrypt-and-authenticate with $M'$ still leaks message equality, even though the MAC is technically randomized.

Can the encrypt-and-authenticate method result in secure authenticated encryption if the MAC scheme has unique tags（non-deterministic）？


Can your phone be traced without your SIM card for Android?

Question: I'm just wondering I'm not a criminal but a friend is also wondering and Idk.
Comment: A similar/identical post already exists here:

http://security.stackexchange.com/questions/30876/can-android-phone-running-without-sim-card-be-tracked-localized-by-police
Answer: Short answer: Yes, each phone has an IMEI number that is tracable.
Fun note: phone still works without SIM card incase you need to dial 911.
More info on IMEI https://en.wikipedia.org/wiki/International_Mobile_Station_Equipment_Identity
Answer: There are many ways where your phone can be tracked even with out a SIM Card.  Your phone emits other radio frequencies other then the Cellular.  For example, the Washington post has an article that detailed how retail stores may use your Wifi to track your location within the store:
https://www.washingtonpost.com/blogs/the-switch/wp/2013/10/19/how-stores-use-your-phones-wifi-to-track-your-shopping-habits/
Additionally, if you have blue tooth or even perhaps NFC these may be used to track your phone or at least provide information that would help identify the owner of the phone.  These particular attacks require a closer range than the standard Cellular connection; however allow for tracking none the less.


WPF: writing smoke tests using ViewModels

Question: I am considering to write smoke tests for our WPF application. The question that I am faced is: should we use UI automation( or some other technology that creates a UI script), or is it good enough to use ViewModels directly (after all the viewmodels were created to make unit testing easier in a first place).
Answer: There's no reason why you can't write unit tests for your ViewModels if they're properly separated from your Views.
A smoke test is a test that actually fires up your application and checks that it works and (for an application with a UI) UI automation is the way to go for that.
Answer: We used to write our integration tests (smoke tests if you like) using the ViewModels directly. It worked, but we did have to deal with some interesting threading issues: what happens, for example if your ViewModel causes a Message Box to be shown - how does your test close the Message box? We had to make sure that our application was running on one thread and our tests on another.
We've now moved over to UIAutomation and those kind of problems go away because your tests and the application are explicitly running in two separate processes. There is a bit of a learning curve involved, but UIAutomation isn't as scary as it first appears: I've written a tutorial that might help you get started - follow the link, and you'll also find a few helper methods that tame the UI Automation API somewhat.


Mercurial list files from changegroup

Question: I want a simple command to get the list of files which differ after pushing to a mercurial repository on a server,
that is the differences between the previous push and the current push.
On the server, I have a hook on the changegroup event which calls a bash script.
$HG_NODE is the revision for the first commit in the changegroup.
My attempts:
hg status --rev $HG_NODE::

Exclude changes made in the first commit
hg status --rev $HG_NODE^1::

Includes changes that affected the parent revision through others pushes.
hg log -v --rev $HG_NODE:: | grep ^files

Include committed then reverted changes, still has 'files:' and files are not one per line
hg status --rev $HG_NODE:: && hg status change --rev $HG_NODE

Does not give exactly what I want, rather the change between the parent to the first commit in the changegroup + the change between this one (instead of the two changesets merged)
hg status --rev some_tag ; hg tag --remove some_tag ; hg tag --local some_tag

(Have not tried, is it a good idea?) Uses a local tag to keep track of the head for the last push, updates it each time.
Also I want to only monitor the default branch, so I assume I will use something like --rev "revision and branch(default)" or the branch option for hg log.
As to why, I need to go through the changes to determine parameters for an automated build.
Answer: hg stat -r is to list the removed files. To get the list of files which differ, you should use hg st --rev as follows.
hg st -m --rev tip^:tip

Comment: My bad, I was actually already using --rev, I used -r in the post to shorten the code thinking it would be the same (I fixed it). I already tried with ^, but the revision parent for my case may not be the same as the previous tip

Mercurial list files from changegroup


EU Blue Card Application with BA Degree for Software Developer

Question: I hope everyone is doing well and healthy.
I have a query regarding the Blue Card Application. Recently I have received a Job offer from a German company with a salary of Euro 58K, and I have only a BA degree from Indian University along with six years of IT work experience. The company is preparing the Contract and asking me to go for the EU blue card visa appointment. I am worried about this part. Is there any possibility to get  National Visa for Blue card with my BA degree as a Software Developer. If anyone familiar with the situation or have any idea about this scenario, please share with me. I will be pleased to hear about it.
Comment: Why are you are worried about going to the EU blue card visa appointment? Would you also need an appointment for a  National Visa for Blue card ?
Answer: According to BAMF

The EU Blue Card is a residence permit which, when issued for the
  first time, is valid for a maximum of four years. It is issued subject
  to the following conditions:

a German or recognised foreign or comparable foreign higher
  educational qualification
submission of an employment contract or a
  binding job offer
as a matter of principle proof of a minimum annual
  gross salary of 53,600 Euro.

Exception: A lower salary threshold of 41,808 Euro is applied for EU
  Blue Cards issued to scientists, mathematicians and engineers, as well
  as to doctors and IT specialists.

restricted to a maximum of four years when first issued.

Exception: If the employment contract is shorter than four years, the
  residence title is issued for a period that is limited to the term of
  the employment contract, plus three months.

Holders of an EU Blue Card are to be issued with an unlimited
  settlement permit if:

they have held their employment as a highly-qualified person for more
  than 33 months,
they can demonstrate that they have made obligatory
  contributions in this period or show other proof of expenditure to
  obtain an entitlement to insurance benefits which are comparable to
  those from statutory pensions insurance, and
the other prerequisites
  generally necessary for issuing a settlement permit are met.
If the
  holder of the EU Blue Card has an adequate knowledge of German (level
  B1), the settlement permit is issued earlier, namely after 21 months.

It looks like you have
 - BA Software Engineering (recognised foreign or comparable foreign higher educational qualification)
 - A job offer,
 - A Salary of €58.000 (Above the min €53.600)
You are entitled to a Blue Card for 4 years. If you keep your employment for 3 years (33 months), pay into your employee contributions, and a B1 in German you will be able to get permanent residence.
Comment: Not sure that it is a BA in software engineering I think its an arts Degree which why the OP is worried.
Comment: Dean's answer makes sense to get a blue card with the existing offer, but I am worried about with my BA degree only. BA in India is a three years bachelor degree in arts. Additionally, I know the A2 level of German and doing Master Degree in Computer Science through Distance mode which will take one more year to award the degree. So without a technical degree may I can proceed my Visa?
Comment: You have a Bachelor Degree which is Germany is accepted as a "recognised foreign [...] higher educational qualification". This solves point 1. You have an employment contract. This solves point 2. You have a minimum annual gross salary above 53.600€ (which is the point where you start to pay maximum taxes btw.). This solves point 3. Point 4 is just an info that it is restricted to 4 years.

In other words: You fulfill all requirements. It should in no way matter that your degree is for another field.
Comment: Also the simplest thing with basically everything regarding such matters in my experience is to talk to them about it. You are definitely not the first person to be in this situation - if you are polite and ask nicely they will surely help you.


On an energy-maneuverability (E-M) diagram how does the shape of a specific excess power (Ps) curve change as thrust is increased or decreased?

Question: Most E-M diagrams for high-performance aircraft show a "dog house" plot with turn rate on the Y axis and velocity on the x axis.  They may also have additional lines for constant turn radius and load factor.  There are also Ps curves that show specific excess power at an given point in the performance envelope.  The Ps curves tend to be shaped like a "rainbow" when superimposed on this chart.  Most curves that I've found only demonstrate performance at maximum thrust (normally maximum afterburner).  However, I'm curious what the Ps curves would look like at 100%, 75%, 50% power, etc.  I theorize that the Ps curves would tend to become flatter and would shift to the left of the chart.  Ideally, I'd like to see a comparison of two charts at different (known) throttle settings (with all other parameters being equal).
Comment: Why would curves for less than mil power be interesting in any way?
Comment: The greater power need to hold the velocity in the turn, the less excess power you have.  A tighter turn will be draggier.  The curves at lower power levels will look the same as max power for progressively smaller engines, all the way down to hamster wheel.
Answer: The shape does not change much, but they shift up and down. Below you see a diagram I once made for a HALE unmanned airplane with a turbofan engine. Instead of varying thrust I calculated the instationary turn rate at different sink speeds. Sinking frees up energy similar to a thrust increase, so these curves should look the same for different thrust levels. After all, the unit for SEP is a speed, too.

Turn rate diagram for different sink speeds and flap settings. Blue lines are for cruise and red curves for the landing setting of a simple camber flap. The aerodynamic model did not include wave drag, so the results above Mach 0.7 are not correct.
As you rightly assumed, the curves shift to lower speeds for lower thrust, but only the red ones become flatter for lower sink speeds / thrust levels.


Why there is no remotes/origin/HEAD --> origin/master for a new branch which I pushed to repo

Question: I created a git branch and pushed it to origin master. Now when I do git branch --all it does not show me remotes/origin/HEAD --> origin/master.  I am able to perform all the git operations though.

Is this expected?
What is the logic behind having/not having this
entry?

Edit:

Looks like there is some confusion in what I actually did. I imported a repo from p4
Here is the sequence:
 1. git init
 2. ../git/git-p4.py clone --detect-branches //projects/<my_project_path_in_p4>
 3. git checkout -q -b master refs/remotes/p4/<my_project_path>
 4. git add --all
 5. git commit -m "Initial Commit"
 6. git remote add origin <my_git_path>
 7. git push origin master

and then when i do git branch --all i don't see that particular entry:
* master
remotes/origin/master
remotes/p4/workflow_manager/workflow_manager-15.3.0

** Second Edit:**

When I clone the same branch and do git branch --all I get remotes/origin/HEAD --> origin/master. Here is the output after cloning which is expected
* master
remotes/origin/HEAD -> origin/master
remotes/origin/master

So now I am even more confused :)
Comment: Edit your question and add the output of `git branch --all`. Also, you write: *I created a git branch and pushed it to origin master*. There seems to be some confusion, here: `git push origin master` means "Git, please push my local branch called 'master' to the remote repository that this local repo knows under the name 'origin'."
Comment: @Jubobs  added more details
Comment: I'm not sure what you're doing in line (2) with `../git/git-p4.py clone --detect-branches //projects/`. What is the git command here?
Comment: Hi @Shaun this command is for checking out p4 branches using git-p4 plugin.
Comment: @AbhijitMazumder Aha. I have no idea how git-p4 works.
Answer: Why is remotes/origin/HEAD missing?
You could have deleted it from your machine via git remote set-head -d origin. It sounds like you didn't do that.
How do I get it back?
In any case, you can get it back by running git remote set-head -a. This asks the remote to determine its HEAD and then updates your local appropriately.
Is a missing remote HEAD expected?
No, that's not expected.
Why would we have remotes/origin/HEAD?
remotes\origin\HEAD indicates the default branch on the remote. The logic is that you can then use origin as a shorthand whenever you would otherwise use origin/master. E.g. it makes git log origin/master equivalent to git log origin.
See Also
https://www.kernel.org/pub/software/scm/git/docs/git-remote.html
Answer: There are two ways to make git-p4 detect branches:

Have branch specifications defined in your P4 server that allow git-p4 to determine possible repartitions in the directory structure.
Use git config --local git-p4.branchList path/to/branchA:path/to/branchB to have the branch definitions local to your git repository.

Getting the second option right is sometimes difficult, but following your example I think that you should start by adding the following configuration:
git config --local git-p4.branchList workflow_manager/workflow_manager-15.3.0:workflow_manager/workflow_manager-15.3.0

Please note that in my personal experience I've always started by importing a P4 repository that already contained branches. That is, all the initialization work was done directly under P4. I suggest that you do the same. But take into consideration that for the branches to be correctly detected you need to import the complete history using the @all notation at the end of the P4 repository path.
An alternative would be to use a temporary git repository without branch detection for the initialization of the P4 server, then use P4 to integrate/copy/branch from the initial branch to the new one. At this point you should be able to correctly import the P4 repository to a new git repository using branch detection and the configurations I described above.


Why does NFS use UDP by default?

Question: I'm sure there's some ancient legacy reason for it, but what is it?  It seems like a service that's geared towards reliable data delivery.
Comment: appears NFS doesn't use UDP by default anymore, see some of the answers.  NFSv4 might even only use TCP?
Comment: Yes, for the NFSv4, see https://tools.ietf.org/html/rfc7530#section-3.1.

UDP is mostly going away at this point.
Answer:
NFS was originally designed to be used on a LAN where loss rates are very low.
UDP is faster, and has less overhead
NFS is stateless, so it's simple for clients to retry

Note that NFS v3+ can use TCP.
Answer: UDP is the default for NFSv2 (which nobody should really use these days) but NFSv3 use TCP by default.  TCP mounts are more reliable and you know you have a network problem much faster than with UDP.
Comment: It's true - when you're using NFS over TCP and there's a network problem you get long timeouts and stale handles. With UDP it recovers by sheer force of UDP packet blasting will.
Answer: UDP is stateless, TCP isn't, but TCP has many predefined properties that didn't suite NFS, or rather that NFS wanted to govern the specifics. In particular, when TCP is doing packet transfers, it does govern timeouts, etc.
With UDP, you lose the overheads that you don't particularly want any way. When the NFS filesystem, the thought originally was, the system does a write, and if it only half finishes, that would be bad ... so NFS (in hard mode) will continue to retry to complete the transaction forever, 1 minute, 5, 10, and hour, a day ... when the connection comes back the transaction could continue to completion...
NFS looks after the "state" instead of TCP, whose design sets up a new state on the new connection (or reconnection), that connection (and state) could die for whatever (hardware) reason and a new connection wouldn't persist that state ... Think about processing a file ... you just leave the process alone, the NFS connection drops out for a bit, but when it comes back, everything will just continue.. These days applications are smarter, routes are numerous, things are more modular, and we are a lot more impatient... if its not going to plan .. someone gets a phone call and has to log on and get it going anyway they can ... back in the day, when it could be left, it was a more seamless thing ... The way that it works is still good today, but have so many more options now, and tend to have more people fixing everything more promptly now. Also the idea of each end passing session objects back and forth and not committing in between jobs, until both sides agree that they're done -- back in the day NFS did a lot of this for you ....
The analogy is somewhat similar to how the RS232 stuff worked ... electronics would do its thing and load their buffers and will get full and have to stop (or lose infomation), they could pass that stream of info (and empty their buffers and continue) when the CTS (Clear to send pin- as in metal pin on the plug) was high or low (what ever its supposed to be).
Answer: UDP was also used because it could greatly reduce the memory usage.  In the 1980s when NFS was originally developed, you'd have a UNIX system with like 4-8MB of RAM, and (at least in academic environment) the "server" may have simply been one of these 4-8MB systems with a few extra disks hooked up to it.  RAM use on the server was a big concern, you could have lost several MBs to TCP buffers that my have been better used as disk cache. It also made it easy to handle memory pressure, an overtaxed NFS server could simply drop requests.
Answer: UDP is used when the protocol is going to be managed by the application itself.  The app may have a better idea for how to do it, or it may be faster (under the special conditions of the application).  TCP is very nice but has a lot of overhead associated with it.
Answer: Performance. UDP has a much lower overhead than TCP. On the other hand NFS has to handle reliable transport on its own then (compared to TCP) but as this is a protocol for LANs where connection problems and package drops are (or better: should be) not a problem, it's optimized for performance.
Comment: @Feuermurmel I'm not sure why this should be misleading. By the time this NFS protocol decision was made Gbit/s or higher was not a common case for network infrastructures. Furthermore the TCP stacks were not that optimized and (more or less) fault-tolerant as they are today.
I'm pretty confident that the NFS developers applied a fair share of performance testing on present network stacks/protocols before they decided to implement a handcrafted protocol.
It did not work out with even higher network speeds and other optimizations, that's probably why they changed the default in later versions.
Comment: This is just misleading. UDP being the default transport is the most important reason of why NFS over fast links (e.g. Gbit/s or 10 GBit/s Ethernet) is abysmally slow if not configured correctly.
Answer: My guess is that it's probably for legacy (historical) reasons.  Originally NFS was probably used on low latency networks where there was very little possibility of error, so the overhead of initiating the 3-way handshake to set up the TCP connection (together with the bi-directional acknowledgement of all messages) outweighed the simplicity of using a connectionless protocol like UDP.
When UDP is used as a transport protocol, presumably it would be up to the NFS client to manage retransmissions if necessary.
Answer: The stateless UDP connection minimizes network traffic, as the NFS server sends the client a cookie after the client is authorized to access the shared volume. This cookie is a random value stored on the server's side and is passed along with RPC requests from the client.

Why does NFS use UDP by default?


How can I make visual studio highlight .php files

Question: Hope the title explains it all, but all I'm trying to do is open some .php files in my web-site solution and have Visual studio treat them as if they are html files. I don't need the actual PHJP code highlighted (it's only includes). The HTML syntax should be parse-able, should it not?
Answer: Tools -> Options -> Text Editor -> File Extension
in the Extension box, put .php. For the Editor, you can select HTML Editor. Click Add, then OK
Answer: You can also install the PHP Tools for Visual Studio add-in. Tools > Extension and Updates and then search for PHP online. Your first result should be this add-in.
If not, you can get it from here:
http://visualstudiogallery.msdn.microsoft.com/6eb51f05-ef01-4513-ac83-4c5f50c95fb5
Comment: It should be noted that this is not a free product.
Answer: If you want intellisense, debug, and other advanced functionality, you could get the  php ide for VS
If all you need is syntax highlighting, check out this link. It's what I'm currently using, but doesn't have all the goodies of vs.php.
Answer: Install Phalanger.
Answer: If you're using VS2013 or older, I would recommend this extension for PHP Language support : https://visualstudiogallery.msdn.microsoft.com/2a10ba81-26c5-47d9-939b-6bcc7bbec251
For me Josh's solution didn't work and Miguel's solution needs PHP Tools which is free for 30 days but then you need to activate it.


Does a method to check the file type being uploaded belong in the controller?

Question: If I create a controller that has a method ActionResult UploadFile(HttpPostedFileBase file)  Where is the best place to add the code that will verify that this is a good and useable file?  The reason I ask, is I will have to do more checking than just the file extension.  For instance; check number of columns in spread sheet, check column names, etc..
Answer: The best way i have found to determine when i should move code from the "presentation" to the "service" layer is by asking the question... if i change client (from mvc to winforms), is this code "reusable" by both client?
In your case, for example, the code that does a deeper validation, should be in the service layer, not the controller, so it can be used the same way by multiple clients. In other words, you don't have to rewrite it again.
This method works for me and keeps my controllers skinny like an anorexic Victoria's Secret model :)
Comment: `This method works for me and keeps my controllers skinny like an anorexic Victoria's Secret model :)` This answer would benefit greatly from some pictures. But not of your code... :)
Answer:
Does a method to check the file type being uploaded belong in the controller?

No, business logic belongs in the 'Service' layer.
Rule of Thumb with MVC:

Keep your models fat and your controllers skinny.

For more background, please see this thread.
Answer: You could read out the file stream in the controller and then pass the file to some business logic later which will handle more complex analysis.


"a spouse of" vs. "the spouse of"

Question: May I ask which one is correct
"a spouse of", or
"the spouse of".
Example: Dana is a/the spouse of Peter.
Thanks.
Comment: This is also useful: http://ell.stackexchange.com/a/17433/3281.
Answer: Basically, the difference between the and a/an is one of specificity and shared knowledge.
the indicates that this is knowledge that is shared between you, the speaker, and the listener/reader. a indicates that you might not know about this instance of the thing.
Here's an example of it from a WDSU news story (my emphasis):

Police are looking for an armed man in connection with an attempted murder in New Orleans East.
The incident happened in the 6000 block of East Hermes Street about noon Wednesday.

In the above excerpt, an is used to introduce something that you don't know about, after which the is used to refer back to it (anaphoric reference).
In your example, there is a difference in meaning between the two:

Dana is the spouse of Peter
Without anything before it, we draw on shared cultural knowledge (homophora) to infer the meaning. In many Western societies where Christian religions have been dominant, it is understood that relationships are monogamous unless otherwise stated - that is, having one partner/spouse is the unmarked relationship.
Also, because of this knowledge, using the is the less marked way of phrasing that (although saying Dana is Peter's spouse is even less marked)
Dana is a spouse of Peter
Conversely, by using a, the more marked form of this clause, you are signalling that there is something unusual - ceteris paribus (all other things being equal), it would signal that Peter has more than one spouse.

Possibly related:
"the" vs. "a/an" + clauses
Comment: I found your answer really interesting but was wondering if you know why even family relationships that aren't understood to be one-to-one are also generally identified with 'the'? i.e. 'Sarah is an employee of Mark's' vs 'Sarah is the daughter of Mark'?
Comment: @jam these are probably bad examples; it is very *un*idiomatic to say "X is the Y of Z", it's much more natural to say "X is Z's Y" - that is, with your examples, "Sarah is Mark's employee", "Sarah is Mark's daughter". This makes it extremely difficult for me to decide whether "Sarah is the daughter of Mark" or "Sarah is a daughter of Mark" is more natural. I would expect "Sarah is _the_ daughter of Mark" would be used if the relationship, or number of children, was in question - "Does Mark have twin daughters?" "No, Sarah is _the_ daughter of Mark." or "Yes, Sarah is _a_ daughter of Mark."
Comment: Similarly, with employees, you could only really use "Sarah is _the_ employee of Mark" in response to a similar question, whereas "Sarah is _an_ employee of Mark's" could be used in response to a question like "Is Sarah one of Peter's employees?" "No, Sarah is an employee of Mark's". But as I said, these are all highly marked, and I would expect in unmarked, natural dialogue, that speakers would use ***'s*** to show possession and this kind of relationship.
Comment: @jimsung thanks for your answer. The example which made me ask is you sometimes get ' is the daughter of ' in print, but on reflection I guess that does fit your initial explanation - X is clearly the daughter of someone, so we can use 'the' because there is knowledge. I agree it would be weird the other way round in an unprompted statement.

"a spouse of" vs. "the spouse of"


Is there a legal standard for Heraldry & Family Coats of Arms in U.S.?

Question: How can I know that a rendering of Heraldry or a Coat of Arms from a website is legit? What is the legal standard in the U.S.?
Answer: Dick Eastman covered this in his blog a few years ago:

The United States has never accepted the concept of nobility and
  therefore has no officially-recognized heralds. Several American
  organizations claim to be able to issue coats of arms but any such
  arms issued by an American organization have to be considered as
  "unofficial." There is no official issuing body in the U.S.

See the full article, which is useful background reading, especially for anybody thinking that coats of arms belong to families (they are specific to individuals, but can be inherited, subject to permission).
Comment: [US Constitution Article 1, Section 9, Clause 8](http://en.wikisource.org/wiki/Constitution_of_the_United_States_of_America#Section_9): "No Title of Nobility shall be granted by the United States"
Answer: I'd recommend you review the information provided by the American Heraldry Society:
https://www.americanheraldry.org/education-resources/guidelines-for-heraldic-practice/


How do I skew the drop shadow of the top logo to look similar to the bottom logo?

Question: How do I skew the drop shadow of the top logo to look similar to the bottom logo
Comment: Not a job for Photoshop... better suited to Illustrator where you can draw tangents more easily.
Answer: There's no skewing here.
Draw extra filled pieces to make the letters look like they are extruded 3D shapes.
An example

Note: Although you could do this in Photoshop, it's less than ideal for work like this. Better to use a vector image editor for creating logos.
Answer: It's not a drop shadow. The letters have got brown inserts which are drawn like the letters have some thickness. Every letter has its own insert which makes it look like it's is extruded to different direction than the others.
The best result (assuming one knows what he wants) can be got by drawing the inserts manually. It's already shown by the others. It can become difficult when the general form of the shape is curved and there are many letters. Anyway, it's possible, but needs some patiency.
Illustrator's legacy 3D effect Extrude&Bevel speeds up things and helps to make it regular. The drawback is that you do not have 100% control. But the result can be good enough. An example:

In the left there's some text. Every letter has the same grey fill and no stroke.
In the middle the text got Arch Envelope Distortion to make it curved. The arch strength is 25%.
In the right the envelope distortion is expanded and the result is ungrouped to have 4 individual shapes. It's essential to have no strokes nor groups.
In the next strip the letter shapes were selected at the same time and they got the legacy 3D extrusion effect:

In the left the same effect is applied to all. In the middle the Y axis rotation angles are adjusted manually. They are +12, +6, -6 and -12 degrees.
In the right the shading is changed to "No shading". It's done separately for each letter and it could be done in the same time than the rotations were adjusted. No shading is a must for manual surface coloring.
Manual coloring is possible after expanding the 3D effect. It's done by applying Object > Expand Appearance. It leaves often clipping masks and complex groups. Release clipping masks and ungroup about 5 times to be sure every piece is free. Then you may want to build new groups of items which will get the same color. I didn't make groups because there's only few colors and individual surfaces.

On the top all shapes are at first colored to dark brown (picked from your image). Then the frontages got orange fill.
In the middle the frontages are all selected and an offset path is made. Negative offset shrinks. The offset paths got brown fill.
In the bottom every item got a stroke. The frontage side shapes got black strokes. The extruded body shapes got the same stroke color than the body itself. It's needed to keep all shape sizes compatible. Every stroke has the same line width. The stroke corners are set to be round to avoid peaky miters.
When you are ready in Illustrator, prepare an empty image in Photoshop with high enough resolution for your purposes. Copy and paste the result to it. You can do it also shape by shape and as paths.
Comment: Question is asking about Photoshop.
Comment: I did not add the Photoshop part recently. You just didn't read the full text
Comment: I red it, but wrote the easy receipe for Illustrator. The Photoshop part is inserted recently. If it must vanish, wait a day before you delete it, because the questioner may want to see the easy method. A few downvotes are no harm.


How to get ApplicationID from inside Apache Apex application?

Question: Is it possible to retrieve the Apex application ID: e.g.application_1463594017097_0024 within the Apex program? For example from the DAG object or some other object?
Answer: Use the conf object passed to StreamingApplication

String appid = dag.getValue(DAGContext.APPLICATION_ID);

In an operator, use

String appid = Context.OperatorContext.getValue(Context.DAGContext.
  APPLICATION_ID);

Note:
It can't be run within populateDAG function. APPLICATION_ID is assigned to an application once it is launched. In populateDag() phase, the logical plan is being created but the actual YARN application is not created. There isn't an APPLICATION_ID created yet which is why it is null.


Do I need a Panama transit visa with a Zimbabwean passport to the Bahamas

Question: I have a Zimbabwean passport traveling from Johannesburg to the Bahamas, do I need a visa to transit through Panama City?
Answer: Depending on layover time, no, according to TIMATIC :

Visa required.
Visa Exemptions:
Nationals of Zimbabwe with a multiple entry visa issued by Australia, Canada, Japan, Korea (Rep.), Singapore, USA or an EU Member state . The visa must have been used and be valid for a minimum of 6 months on arrival. Passengers must travel as tourists for a maximum stay of 90 days.
TWOV (Transit Without Visa):
Passengers with a confirmed onward ticket for a flight to a third country within 12 hours. They must stay in the international transit area of the airport and have documents required for the next destination.

No Visa is necessary if you book your entire trip on a single ticket, if   it isn't the case, you will need to get a visa beforehand


Adding new field need to update all the old records with default value

Question: I am adding a new custom drop down field to contact. Options are YES Or No, The default value will be Yes. however I need all the old records to have the yes value as well. I tried to do it using workflow but old records wont be updated. I may be able to do it with trigger but I have never written one and not sure what I need or how to write one
Answer: You can do this by going to the Developer Console and writing a small piece of code to get what you want. Try it first in your sandbox please!

The Developer Console runs in system content and it will execute your
  logic, so be careful if you haven't used it before.

I don't know the name of your object so you need to change the object in your code.
<code>for(List<Contact> conList :[SELECT Id, yourDropDownField__c FROM Contact])
 {
  for(Contact ob: conList)
   {
     ob.yourDropDownField__c ='Yes';
   }
      update conList;
}
</code>
This way you can create chunks of 200 records and they will get updated with the new value.
I hope it helps!
Comment: You can go up to 50.000 records on the SOQL, more than that will reach governor limits.
Comment: Hi, thank you for the respond, so the object is Contact, so the List would be List.. how does it know to do this 200 records at a time
Comment: You don't need to worry about the 200 chunks, the system will run an iteration and do the job for you. Do you have more than 10.000 contacts?
Comment: I dont think so
Comment: Ok, them the code will take care of all Contacts. All you need to do is to add the correct field to the code above and run it. Make sure you try first in your sandbox to get the results you looking for. Good luck!
Comment: that worked perfectly in my sandbox thank you very much
Comment: does it make  a difference if I have 25,101 records?


why this frequency response is added to the power of e?

Question: From where did this ${\angle}H{(\Omega)}$ came into power of $e$ ?
Answer: $H(\Omega)$ is a complex number. $Ae^{j(\Omega t + \phi)}$ is another complex number, expressed in polar format by its magnitude $A$ and phase $\Omega t + \phi$. When you multiply complex numbers in this format, you simply multiply their magnitudes and sum their phases. Thus:
$$
H(\Omega)Ae^{j(\Omega t + \phi)} = |H(\Omega)| Ae^{j(\Omega t + \phi \angle H(\Omega))}
$$
Comment: Got it here Modulus representing Magnitude.... thank you sir!!!!


Difference, in terms of completeness, between the Dirac well and barrier

Question: I was in my undergraduate QM lecture and we just finished with the Dirac barrier. My question is as follows: We know that the Dirac well's complete set of solutions requires one bound state and an infinite set of scattering states (plane waves). The solutions to the Dirac barrier are a only a set of scattering states (plane waves again). How can both sets of solutions be complete? I asked this question in lecture and was told that no one-to-one correspondence exists between the two sets of plane waves, so the comparison is improper, but I've been unable to find anything else on the subject.
Comment: Can you expand on your reasoning as to why you think they shouldn't be complete?
Answer: I'm not quite sure what OP asks, but the potential profile $V$ clearly matters. E.g. if $\lim_{|x|\to \infty}V(x)=\infty$, such as, the harmonic oscillator, or the infinite well, then there are no scattering states at all!


Plugging Surge Protectors into UPS

Question:
Possible Duplicate:
UPS and power strip interactions?

I have heard that plugging a server into a surge protector (cheapo power strip) is not good.
Is this accurate?
For instance:
Server  --> Fellows Power Strip --> UPS
-Josh
Comment: Sorry, for some reason did not see the other ?
Answer: I wouldn't say it was a bad idea, just a bit pointless as UPS's generally provide far smoother power than any power company. That said if you have a device on the spur that's creating it's own interference - that could bother other devices on the same spur - then you could put that single device behind a line conditioner - not for it's benefit but for the benefit of everything else.
Answer: Definitely not a good thing.  The UPS, by design, has surge suppression built in.
If you need more ports than the UPS provides, invest in a good PDU.
Answer: Well more to the point, in many areas (at least in the US) this is probably against the electrical code. You can't daisy-chain power distribution devices (power strips), and for all intents and purposes a UPS, with 6+ outlets on the back, is a power distribution device.
Servers generally draw quite a bit of power. Most UPSes that I've seen have more than enough outlets. If you need more than the UPS has, I'd say it's a good bet you're overloading the UPS.
Your best bet, if you have rack-mount equipment, would be to get a hardwire kit for the UPS, and hard-wire in rack PDUs or vertical rack power strips.
Can I ask why you'd want to plug a power strip into a UPS that already has 6-8 outlets?
Comment: The large UPSs we have only have a single 240v  and two 120v outlets on the back. You're expected to bring your own distribution scheme.
Answer: Your Equipment Protection Policy may be void if you do so.  The surge supressor does things to the power supply that can cause problems for the UPS and attached equipment.  If you need new plugs use a distribution strip that doesn't do surge suppression.
See http://nam-en.apc.com/app/answers/detail/a_id/1372/kw/warranty for some details.

Plugging Surge Protectors into UPS


VLOOKUP or MATCH with IF GREATER THAN

Question: Is it possible to automatically pull a list of students with 2 or more absences onto another tab in Google Sheets? In the following link, the first tab has a list of students and how many absences they have. I'm wondering if the second tab can be set up to automatically keep a running list of students with two or more days missed. Thank you in advance for your help. I'm trying to learn, and I think the use of formulas and what they can to is really cool, but it just breaks my brain. :-( https://docs.google.com/spreadsheets/d/1wYmOYOZAKsmXCi1z1OUSPk0HBNspJTxSEAgpgAwAENQ/edit?usp=sharing
Comment: Welcome to [Web Applications Stack Exchange](https://webapps.stackexchange.com/tour), and thanks for sharing a sample spreadsheet.
Answer: Use query(), like this:
=query(Sheet1!A3:B, "where B >= 2", 1)
To display more columns, and use another column as criteria, use this:
=query(Sheet1!A3:D, "where D >= 2", 1)
See the new Solution sheet in your sample spreadsheet.
Comment: Thank you for taking the time to answer. It's not 100% what I'm looking for, but I probably wasn't clear enough. However, your answer will definitely help me in the future, so I appreciate it!
Answer: What you are looking for is a simple query. I have added a duplicate tab on your sheet called "Kevin Help".
Here is a single formula that pulls both rows (in cell F4):
=query(Sheet1!A4:D19, "select A, D where D >=2")
If the rows move and you are interested in doing this with VLOOKUP, here is the formula in cell A4 that pulls names that have a a total absences of 2 or greater for just the names:
=query(Sheet1!A4:D19, "select A where D >=2")
And here is the formula in cell B4 that fills in the number of absences that the corresponding student in row A has using VLOOKUP with an arrayed range:
=IFERROR(arrayformula(VLOOKUP(A4:A, {Sheet1!A4:A,Sheet1!D4:D},2, FALSE)),"")
Comment: Thank you so much!!! It's amazing that people like you are out there helping others. The VLOOKUP option seems to be working, overall. I only have two questions: What If I wanted to grab only 2-4 absences, for example? Like >=4 but <5? And how to I keep the query formula from returning #N/A if completed with empty output? I mean to not pick up the data at all if it doesn't agree with the formula? Here is a copy of the actual document I'm working on, without any real names or student numbers: https://docs.google.com/spreadsheets/d/1ToeDdavA-red9tH40jqFmcv8soQ-pgwICcZPZOUUHNY/edit?usp=sharing
Comment: @SarahSavoy No problem! I don't want to edit your actual sheet without your permission first. But if you say so, I'd be more than happy to help. If you want to constrict the query selection, you could change the second from `"select A where D >=2"` to `"select A where D>=2 and D<=4"`.
Comment: @SarahSavoy To prevent a query or vlookup array from returning #N/A, wrap the original formula in an iferror. It would go from `=query(Sheet1!A4:D19, "select A where D >=2")` to `=iferror(query(Sheet1!A4:D19, "select A where D >=2"), "")`. Those last two quotation marks will contain what you want the formula to show if there is an error or no data. In this case I left it blank, but depending on context, I will sometimes put "No Data" or "0". That is your choice.

VLOOKUP or MATCH with IF GREATER THAN


How to amplify both phone audio channels in this case (infrared remote)

Question: I'm a photographer and have limited knowledge about electronics.
recently I saw this circuit:

which is explained here
I tried to Build it, it works fine on my laptop jack, but does not work on my android smartphone jack. I guess it's because of low output signal voltage (less than 0.6V) as explained in this case.
since I only have lm386 IC in my stuff an it's important to keep circuit size as small as possible, I am wondering if there is a way to use just one lm386 IC to amplify both channels without any change in output infrared signals?
please guide me how to design my circuit.(with one or two ICs)
Thanks
Answer: All you need to do is have a simple "bias" on the base of the transistors in your circuit. This would basically "pull them up" to have a higher average value; say 0.5 volts, and a capacitor to couple with the bias. So when the alternating waveform from one of your jacks goes say between +/-0.6v, the transistor would see +1.1 to -0.1v. The circuit would look like this:

simulate this circuit – Schematic created using CircuitLab
Comment: Thank you Jodes, your second edition is more understandable
Comment: Dear Jodes,
When I connect the circuit to my phone's jack, it shows some malfunctions in touchscreen (random taps without my Interference)
do you know what should I do?
I used two 1N4007 diodes for each channels and its ok to connect them to circuit but when connect the ground wire, malfunction starts!
any suggestions?
Comment: Hmm... that's a bit worrying. I'm not entirely sure how you're saying you've connected your diodes, perhaps you could draw a circuit diagram? It definitely shouldn't have an effect like that on the screen. Could you give a complete circuit diagram of everything that connects via the jack, including diodes, and anything else? I'm worried you are shorting the jack, or worse. It's worth re-checking your wiring as well.
Comment: I replaced my AC-DC adapter with a battery and everything works great!(no need to rectifier) thank you
Answer: Try this...

simulate this circuit – Schematic created using CircuitLab
Note that GND is not the bottom of the circuit, but instead connects between R3 and Q3.
Comment: I should note that the resistor values chosen for R1 and R2 are optimal for a 9V battery, but if you're using a 3V they'll be pretty sub-optimal. For 3V, change R1 to 47Ω and change R2 to 1kΩ.


Collapse operators in multi-level atomic systems?

Question: I'm trying to understand the case of multiple ground states and excited states. Due to selection rules, usually we say there should be 3 collapse operators, namely C_+1, C_-1, C_pi, corresponding to sigma+, sigma- and pi spontaneous photon emissions. But if there are multiple ground states in one single kind of transition, say C_-1, the state after the collapse would be a superposition of all possible ground states. I'm not very clear on how to explain the physics idea? I saw in some examples (laser cooling simulation of 87Rb) people used 6 collapse operators. There were two sets of collapse operators for collapsing into F=1 and F=2 respectively. I find this more confusing and am not sure if it is right. Thank you for your answer!
Comment: Please can you give a little more context? What do you mean by "collapse operators", specifically?
Comment: @MarkMitchison It happens when you try to simulate the atomic internal states evolution using master equation or quantum Monte Carlo method. In the latter case they are also called quantum jump operators.
Answer: If you are modeling something like spontaneous emission from an excited state into multiple ground states, you should keep in mind that the photon emitted from the atom typically carries information about which state the atom decayed to. You described a situation in which the polarization alone of the emitted photon does not distinguish between the atom having decayed into multiple different states. However, in this case, the frequency of the photon generally will carry this information.
For example, since you brought up Rubidium: consider a Rubidium atom in the excited state $|5P_{3/2}, F=2, mF=1\rangle$. It can decay via a $\sigma^+$ transition to $|5S_{1/2}, F=2, mF=0\rangle$, or to $|5S_{1/2}, F=1, mF=0\rangle$ (the only difference being the $F$ number). However, the two decay channels are separated in frequency by $6.8$ GHz, so the emitted photon will indicate to the environment which state your atom ended up in and destroy the superposition.
Always look for what information the photon has about the atom, either in its frequency, polarization, timing, or anything else. When the photon is lost to the environment this information about your atom will be revealed. So yes, you should model the decay from an excited state to each distinguishable ground state with a separate collapse operator.
Comment: Thank you. What I'm not clear is how much the measurement of the emitted photon gives. If the states are Zeeman shifted, which is often the case, we should also distinguish photons by their frequency. Then we'll have a bunch of collapse operators decaying to different Zeeman sublevels.
Comment: And is this information limited by our imagined detector quality, e.g. the frequency resolution..
Comment: That's a great question. You are correct that for a small frequency separation, the emitted photon would not fully distinguish between the two states. This is characterized by the frequency separation relative to the bandwidth of the photon; in the case of spontaneous emission, the bandwidth of the photon is the linewidth of the transition (6 MHz for the D2 line of Rubidium).
Comment: Hi @HarryLevine, do you know of a textbook or lecture notes where this is addressed? In particular I assume as a magnetic field is turned on there's some transition of distinguishability between Zeeman levels, which would be interesting to see written down.
Comment: @WillC Here's a reference for the idea that the polarization of the emitted photon becomes entangled with the final state of the atom: https://www.nature.com/articles/nature09256. I think this would be the primary effect for decay to different Zeeman states which would be polarization-selective transitions. But there might be examples where one could tune the distinguishability with a magnetic field, as you suggest… interesting to think about, I'm not sure!


What is benefit of service logic testing and client logic testing in WCF web services testing?

Question: I Develop WCF web services for  enterprise project.I use NUnit testing in service logic business layer for test in server side and in client side I use WCFTestClient for invoke web services  method.
I have to do automated test for my project,But I really don't know which approach is better?
Answer: I suggest you both. Service Logic testing is important from the perspective of the service as is, it must works just as expected and that's what you test.
Now, Client testing is also important from the perspective (as it names implies) of service clients. I mean, client testing helps you in the design of clear and usable service APIs. When you test what your service users will be doing you get another perspective of the situation.


Configuring an instrumentation Amplifier

Question: What is the purpose of the resistors(470 and 100k) at the input pins 3 and 2 of the instrumentation amplifier and what difference does it make if i do away with them?
Comment: i think it's to have a connection to the high-impedance inputs in case the connector is disconnected from the source.  so the op-amp inputs don't float.  maybe the 470 ohms is to isolate the source a little from the electronics of the instrumentation amp.
Comment: @WhatRoughBeast Its an ecg signal. It's(instrumentation amplifier) suppose to amplify the ecg by a gain of 5 +(85k/R1)
Comment: No faint idea. What is the source of your schematic, and what was it trying to do?
Answer: The series 470R offers additional limited ESD current limit protection of device to internal shunt diodes from cable to body capacitance  discharges.  It reduces the rise time of avalanche ESD effects so the protection diode can respond faster than the sub-nanosecond events.
The 100K shunt values provide a CM shunt impedance of 100K to shunt galvanic electrode CM offsets but mainly a reference ground for shielding CM noise as well.
Electrode coupling resistance are expected to be 1~10k.


MyEther Wallet storing ICO tokens

Question: Should I move ERC Tokens off of MyEther Wallet or can I store them there?
Answer: your ERC Tokens are stored in the smartcontract which generate them, there are like Ethers. however you sould keep your private key safe. With Myetherwallet you could backup your private key in order to user with another wallet.
Answer: With a MEW you have full control over your private key. You can think of your private key as a mathemagical stamp that can be used to sign virtual "checks" written on the ERC20 contract's token.
ERC20 tokens are only stored in the contract that created them. The contract can generate virtual "checkbooks" for that token. The checks in the checkbook are not worth anything without a signature your private key can sign those checks.
Remember the ethereum network is only updated with signed transactions only private keys can sign transactions.
Also remember anyone who has your private key (or the list of 12-24 word seed) can sign transactions
Your private key has all the control. Your public key is basically like legal letter head, anyone can see it, but its also has no power without a signature.
My Ether Wallet does not have access to your account, it's just an interface for the network.

MyEther Wallet storing ICO tokens


"penny LANE" vs "PENNY street"

Question: Why do English speakers say "penny LANE" (emphasis on LANE) but would say "PENNY street" (emphasis on PENNY)?
Comment: Because of the Beatles... ;-)
Comment: Two questions: 1) do you mean for "Penny" to stand for all possible lane/street names 2) by "English" do you mean "English language" or "English nationality"?
Comment: Note that the difference (if any) in emphasis carries no meaning.  Native English speakers will tend to emphasize one word more than another for a variety of reasons, mainly having to do with the mechanics of producing the associated sounds.
Comment: To me, it just seems like a lexical difference between the words "lane" and "street." (By which I mean, I don't know why.) It would be interesting to look at how other similar words pattern. I can't think of any other word that takes the stress pattern of "street." There's a list here: https://en.wikipedia.org/wiki/Street_suffix but I'm only familiar with a few of these.
Comment: @sumelic: In some parts of the U.S. (e.g. New Jersey), *road* does not get stressed. In other parts (e.g. Massachusetts), it does.
Comment: @PeterShor: that's a good find, but there's no explanation of *why* this pattern exists over there, just some discussion of the distribution and the existence of other patterns, mainly supported by anecdotes.
Comment: Note that "lane" ends with your mouth fairly wide open, while "street" ends with it nearly closed.  This alone will make "lane" sound a bit louder.
Answer: In general two-word names of places, squares, people and roads of various descriptions take stress on both words. In the following list, the stresses are marked with a preceding apostrophe:

'Kings 'Road
'Kings 'Avenue
'Kings 'Crescent
'Kings 'Cross
'Kings Em'bankment
'Kings 'Drive
'Kings 'Lane.

The exception to this rule is roads or addresses with the moniker "street":

'Kings Street

One can only speculate on the reason for this. However, stress in general serves to mark out important informative information in English. As a last word drive, crescent, avenue or even road might provide vital information to distinguish the names of such roads from many others. On the other hand the word street is so ubiquitous that it does not provide enough differentiating information from the plethora of other "streets" in existence.
Comment: Did you mean to have the apostrophe in the possessive position in "King's Crescent"? I can't imagine we actually emphasize the ***s***.
Comment: @Araucaria- I am up-voting your answer (over my own) for its clarity and logic, but I still believe The Beatles have forever determined the pronunciation of "Penny LANE," at least for the duration of my life. While we may disagree on this point, please know that I very much respect **all** of your opinions, comments and answers.
Comment: @MarkHubbard Are you sure that you say "penny LANE", rather than "PENny LANE"?
Comment: @MarkHubbard Thank you. I hope that's a bit tongue in cheek though - I  don't think I respect all my comments or answers ;) Also thanks for giving me an excuse to listen to Penny Lane again. Haven't listened to that for yonks!
Answer: This is purely speculation, but I suggest that the difference (if it in fact exists - and with the question having firmly planted the Beatles in my consciousness I can't be sure) is due to the rarity of "lane" vs "street". I suspect most speakers would stress "lane" to make sure that the hearer understands that it is not, in fact, "Penny street".
Comment: Precisely the first thing I thought of. It also applies to *avenue* (as in Shaftesbury Avenue), *square* (Trafalgar Square), and *gardens* (Kensington Gardens).
Answer: First this is in no way official.
To me it's not a emphasis on lane as much as it is a lack of emphasis on street.
I think it comes from two distinct points.
First consider the question "What street do you live on?"
If you lived on 1st Street you would say either "1st Street" or just "1st". If is very common to say just "1st" and omit the street in this case.
If you lived on 1st Ave. You would say "1st Ave." In this case you can not omit the Ave.
Second, is the popularity or Streets v.s Ave. roads, and lanes. Typically there is a real difference between streets and roads, lanes, and others. Ave.s have a "technically" different meaning too. So (at least around here) there are far more streets then there are alternatives.
If I were to come out of no where and say I live on TreeBend, your would probably assume TreeBend Street, or Maybe Treebend Rd. So I have to train my self to say TreeBend Lane, or my Pizza might not get here in a timely manor.
To make matters worse, when  you tell another person something they often hear what they want to hear. I usually have to repeat "Lane" 3-4 times and have them read it back to me, or, once again, my pizza will arrive cold.
This is specially true in towns where names overlap, and the only difference is between two streets 20 miles apart is Lane vs. Street.

"penny LANE" vs "PENNY street"


Apt-cacher and Apt-proxy

Question: Does anyone know the differences between apt-proxy and apt-cacher or know of a better package proxy cacher for Ubuntu?  I used apt-proxy, but it hangs in weird places and gives me weird errors sometimes.  It is written in python, Apt-cacher is Perl but seems to be more stable, but slower on updates.  Anyone with other experience?
Comment: My experience mirrors your own.  apt-proxy is somewhat buggy and hangs.  Apt-cacher seems to be slower.  I am almost the point that I was thinking it would be easier to just mirror the entire x86 portion of the repository.
Answer: Use approx. I had continuous issues with apt-proxy, switching to approx solved all my problems.
Answer: If you read both of these you should be able to figure out the difference.
apt-proxy
apt-cacher
The apt-proxy is used to get packages from a remote machine. The apt-cacher is used to create a local proxy for packages.
Comment: If you read those, you will see both programs fulfill almost the exact same function.  The possibility I see is that apt-cacher does not cache the update files (the files fetched during an update), whereas apt-proxy does.
Comment: They do appear to serve the same function but are meant for different applications.
Comment: What are the different applications?  From what I have read they appear to fulfill exactly the same function, apt-cacher seems to be a apt-proxy replacement
Answer: I have used mod-proxy in apache to provide this service in the past.  With proxy-cache, it seemed to work better than either of these solutions.
Squid with a cache may also do. There are the squid-deb-proxy package for caching, with squid-deb-proxy-client for cac autodiscovery of the cache.
Comment: Setting up a apache to proxy seemed to complicated, but makes sense that it worked the best since it has built in modules.  I see some pages with instructions, I may try that

Apt-cacher and Apt-proxy


EC2 Windows password recover

Question: I can't get the password from the AWS console tools. I can reach the box via rdesktop.Can I reset the password remotely? If so, how to go about doing this? the machine is Windows server 2008 R2 Datacenter.
Comment: why don't you just terminate instance and launch new one?
Comment: Why can't you get the password from the AWS Console? Do you not have the key? Does the key you have not work or does it say there's no password generated for this instance?
Comment: It says password is not ready... after 10 hours. The key is ok because I have since logged into linux boxes using it.
Comment: I have tried this several times. I need this specific instance.
Answer: I ran across this scenario and found a solution using the unique setup of EC2 on another site: http://www.smattie.com/2012/01/23/video-remotely-reset-windows-password-via-ec2-config-service/
The video is long, so to summarize the steps:

Create a new scratch EC2 instance running 2003 server, and log into it.
Shut down your lost instance (the one you can't log into) from the AWS console.
On the EC2 console, go to Elastic Block Store/Volumes and find your C: disk volume, and Detach it.
On that same volume, attach it to your scratch EC2 instance. You can see it appear in Disk Manager and you'll get a new D: drive letter.
Go to D:\Program Files\Amazon\Ec2ConfigService\Settings\ and edit config.xml with notepad
The first setting in the file is for the Ec2SetPassword plugin; change the State field from Disabled to Enabled. Save & close.
On the AWS console, Detach the volume from the scratch instance (don't worry, it safely detaches from Windows)
Attach the volume to your original lost instance, as /dev/sda1
Start the instance. After a few minutes, run the Get Windows Password function which will have the newly generated password.
Comment: Also, _do_ remember to use "/dev/sda1"...just "sda1" doesn't do the trick (even if that's what you see in the console UI)
Comment: This solution worked for me, but with Windows 2k8/2k12, you may need some additional steps to make the reattached drive boot. Information can be found [on the aws forums](https://forums.aws.amazon.com/thread.jspa?messageID=421859񦿣) or [at this blog post](http://www.smattie.com/2011/12/21/windows-72008r2-does-not-load-after-adding-the-drive-to-another-machine-that-also-uses-new-bcd-store/).
Comment: I'm running into a signature collision issue after I attach the volume. Any workarounds for that?
Answer: When the password says not ready for an extended period of time. It usually means that this server was launched from an AMI. The keys don't work for AMI's The keys don's work for AMI's that have modified the EC2Config service. When you save a windows AMI you need to make sure you have the administrator password written down or better yet memoried. Standard practice with amazon is to change the password the first time you log in.
If you need some type of data on the instance you can shut it down. Detach the harddrive and attach it to another instance to recover any data. But my suggestion is to use a new instance. There's nothing you can do at this point unless you have the original instance running that was used to create the AMI. The password for that machine would be the same as the machine that will not generate the password for you.

EC2 Windows password recover


Is it normal to have two (or more) apps with the same codebase and database in Google Play?

Question: I installed two Google Play applications and saw, that they are actually the same app (completely same functionality and database) with only different splash screens. Isn't it against the rules?
Answer: It's not normal but there's nothing to forbid a developer releasing multiple variants of the same product with different branding. Some companies even develop white box apps, which their customers add their branding to and publish, the same way that one off-brand gadget or home appliance is sold by different companies under different names.
It's only forbidden if one developer violates copyright by publishing another developer's app without their consent; for example, if I decompile the APK of Angry Birds, replace the name and splash screens with "Bangin' Avians", and publish it on Google Play, then I'm violating Rovio's copyright on their product.
Answer: If they're from the same developer or the software is open-source or maybe they're using a wrapper SDK, it's okay.
But there're also softwares that are truely stealing other people's code as I have encountered such cases.
Answer: That would depend largely on the app's license. Many open source licenses allow for such "forking".


History of yasnippet fields

Question: Is it possible to have a history for the value of a yasnippet field? When I expand a second time a snippet like \begin{${1:environment}} I would like to get as suggestion the value I've used for $1 in the last expansion.
Answer: I've found a solution with a pseudo-field in which I save the previous value and jump to the next. It feels ugly and I hope someone can give a better answer.
# -*- mode: snippet -*-
# name: Environment
# key: env
# --
\begin{${1:`(or (and (boundp 'last-snippet-environment) last-snippet-environment) "environment")`}}
  $0${2:$$((lambda ()
    (set (make-local-variable 'last-snippet-environment) (yas-field-value 1))
    (yas-next-field)
    ""
  ))}
\end{$1}

History of yasnippet fields


How do I Force Google Maps Links to Open the Google Maps App on iOS6?

Question: In the past (iOS5 and earlier) clicking on a link for directions within a website opened the separate maps app and provided directions. How do I force links in websites, that would normally open a google maps link in a "desktop" web browser, to open the new external google maps app? I do not find the current google maps website adequate (can't figure out how it would provide dynamic (voice) directions) and the new apple maps app is not opened by those links.
Comment: Each time you arrive on the Google Maps site it asks if you want to open the Google Map App.
Answer: As Matthieu Riegler said, when you go to the Google maps site you will be prompted to launch the app. Unfortunately, there is no way to do this automatically.
Answer: I believe at this point, Google Maps correctly implements deep links. So if you open a maps.google.com link, like this one it'll open directly in Google Maps, if you have it installed. It even works with Google Maps shortlinks, (the ones starting with https://goo.gl/ like this. This all works in both Chrome and Safari.