Etiquette on addressing fellow-users

Question: I had started an answer with "Dear [username] " and I see that this heading was deleted by a moderator. Is this a general policy on this site ? I'm a new user and don't yet know the rules. Needless to say, I am not arguing and intend to comply but I just wanted  to ask about this point of etiquette.
Comment: I prefer to be addressed by my real name, written on a check in the amount of $5,000 or more. A note of praise accompanying the check is thoughtful, but not strictly necessary. And please, no perfume. I mean, come on!
Comment: Elencwajg: I think this is a pertinent question, and nicely presented. My understanding is that for any given Question, the ideal is that *one* Answer should (rapidly or eventually) become far more upvoted than any/all others. Support for Comments is partly to help contributers discuss and fine-hone their Answers in pursuit of that ideal, and partly to foster the general sense of community that makes the site a nice place to visit. But that sense of community is only really needed while the Answers are being formulated and assessed. In the end you just want the bare Answer.
Comment: @Robusto - are we allowed to put lipstick on the note?
Answer: The key thing to remember is that this site is not a traditional forum or a social network; it is all about questions and answers, not "addressing fellow users". When you write an answer, you don't write it just for the original poster, you write it for anyone and everyone who might have that question in the future. Personal salutations are extraneous clutter at best, and completely misleading at worst. Remember that anyone can change their user name at any time without notice, or even completely delete their account, so you will end up addressing a meaningless string of characters.
For further reading, check out e.g. this question on the meta Meta: Should 'Hi', 'thanks' and taglines and salutations be removed from posts?
Here I will quote just a paragraph or two.

If this is supposed to be a website which is servicing more than just the primary author, we need to think about how we construct messages so that they appear more clearly to those searching on google for questions that match their own. If I am looking for a solution for question X, I want to find someone who had the same problem, not their short autobiography and formalities before getting to that actual question. — TheTXI

[I]f we had two parallel worlds, one with the [post] including the greetings etc, and one without, which would we choose? I'd choose the world where the [posts] just had the required information, as readably and concisely as possible. — Jon Skeet
Comment: Thank you for this very clear and thorough answer. I knew that this site is all about questions and answers, but I'm a user of another such site where personal salutations are quite common. However, as I already mentioned in my question, when I am on this site here I shall of course fully comply with its etiquette.
Answer: Usually we restrict the question area to the question itself, since the site is intentionally structured as Q&A rather than forum discussion.  So introductions, thank-yous, signatures, and the like are generally deleted.  (Of course, these aren't seen as "poor etiquette" per se, they are just not part of the format of the site, so they will be removed when not relevant to the question.)  The same goes for answers.
Comment: Thank you for your explanation, Kosmonaut. I  shall of course follow the rules and customs you have indicated.
Comment: Precisely.
Answer: Greetings are polite, and generally used on forums.
However, Stack Exchange sites are not forums, and greetings take up a line of space for no particular practical reason.
Thus, per convention, the greeting is made implicit. There is no need for it on every single post... or, indeed, on any!

Etiquette on addressing fellow-users


Any way to restore connect to windows share as a different user?

Question: When I upgraded to Ubuntu 13.04 the file manager lost the ability to connect to windows shares as a specific user(from 'connect to server') from the file manager.  I could be connected to z share as one user and x share as another, but now connect to server offers no place to add credentials as it used to. When I try without credentials, I get an error that says "UNABLE TO ACCESS LOCATION - FAILED TO MOUNT WINDOWS SHARE - PERMISSION DENIED". I find screenshots where it's supposed to prompt me for a username and password, But I never get it. Just an error. Is there something that maybe carried over from the previous version? Should I delete ~/.nautilus? or something?
Comment: I moved every .* file to a temp directory and rebooted my system and logged in. It still does not prompt me for anything when trying to access a share. Just an error. So my profile is probably not the issue.
Comment: If you are unsure of it being a profile related issue or not; the first step to take here is to create a new user and try Connect to Server. Do you still not receive the prompt under a new user?
Comment: Is it needed that you can input the username/password on a per-share level? Maybe it would be enough to connect to one (or more) servers with always the same shares and credentials?
Answer: If you open up your /etc/samba/smb.conf file you should see at the bottom the share definition. Generically it looks something like this:
[share-name]
comment =
path = /media/[some-name]
read only = No
guest ok = yes

What you want to do is add a "force user" line to that share definition so that the remote user appears to be you:
[share-name]
comment =
path = /media/[some-name]
read only = No
force user = [your-user-name]
guest ok = yes

Then restart samba:
sudo service smbd restart

Official sources: http://www.samba.org/samba/docs/man/manpages-3/smb.conf.5.html#FORCEUSER
Answer: I think that developers have decided to simplify the way "Connect to server" work.
With most servers, you should be asked to enter your credentials when you try to access a share... But with some others, you first have to explicitly specify which user you want to use. In fact, in that case, you simply have to use a syntax similar to the one you would use under Windows.
Basic syntax to use in "Connect to server" :
smb://UserNameToUseToConnect@SMBServerName/ShareName/

Example :
smb://franck@myserver/myshare/

Using this syntax, one window letting you enter your domain name and password will appear.
I hope that this will help you to solve your problem. If you still can't provide your domain name and password (no window/error message appears) or else, more information about the configuration of your server might be needed.
Answer: This probably shouldn't be an answer because it's a bit speculative, but perhaps the lack of a prompt is another feature removal in the 3.6 version of Nautilus. It might be fairly painless to try installing the 3.4 version from the SoluOS, as regards this article from WebUpd8.
Basically :
sudo add-apt-repository ppa:webupd8team/experiments
sudo apt-get update
sudo apt-get dist-upgrade
killall nautilus

Good luck!
To roll back this change :
sudo apt-get install ppa-purge
sudo ppa-purge ppa:webupd8team/experiments
killall nautilus


Why does the beryllium 2+ ion have a larger radius than a helium atom?

Question: $\ce{Be^2+}$ has an ionic radius of $\pu{45 pm}$, while $\ce{He}$ has a radius of only $\pu{31 pm}$. If they are isoelectronic (they both have two elections in the $\mathrm{1p}$ orbital), and $\ce{Be}$ has more protons to attract them, why doesn't $\ce{Be^2+}$ have a smaller radius?
Comment: He has VDW radisum of 140 pm, what particular radius of He are your referring to? There is more than one.
Comment: It's probably down to different definitions and/or measuring techniques.
Answer: You are mixing apples and oranges.
Or, to be more precise, an ionic radius for $\ce{Be^2+}$ with coordination number (C.N.) 6 and van der Waals radius of $\ce{He}$.
To make it clear I compiled data for van der Waals and covalent radii [1, p. 9-58] as well as ionic radii [1, p. 12-13]:
$$
\begin{array}{lccccc}
\hline
\text{Element} & R_\mathrm{vdW}/\pu{Å} & R_\mathrm{cov}/\pu{Å} & \text{Ion} & \text{C.N.} & R_\mathrm{i}/\pu{Å} \\
\hline
\ce{Be} & 1.52 & 0.99 & \ce{Be^2+} & 4 & 0.27 \\
  &  &  &  & 6 & 0.45 \\
\ce{He} & 1.40 & 0.37 &  &  & \\
\hline
\end{array}
$$
Apparently, there is no experimental ionic radii for helium to compare with as helium, well, represents one of the most non-reactive elements.
Also, all radii set are determined using various methods and cannot be directly compared.
From the foreword [1. p. 9-58]:

There are many scales of van der Waals radii, but they are not fully consistent with one another. The van der Waals radii determined by Bondi [...] from x-ray diffraction data, crystal densities, gas kinetic collision cross sections, critical densities, and liquid-
  state properties are the most widely used values. [...]
The covalent radii tabulated here are recommendations for single covalent bonds,
  and they are based on a comprehensive evaluation of experimental data [...].

Ionic radii are estimated first and foremost from the experimental crystal structure data, averaged and supplemented by empirical and theoretical calculations (extrapolations, e.g. using Zachariasen method).
References

Haynes, W. M.; Lide, D. R.; Bruno, T. J. CRC Handbook of Chemistry and Physics: A Ready-Reference Book of Chemical and Physical Data.; 2017; Vol. 97. ISBN 978-1-4987-5429-3.
Comment: Different types, yes. It is much like comparing the height of one man with the height of _house of_ another man, and concluding that the latter is higher. Sure, both parameters are called the same ("height"), but there is a catch.
Comment: This is a bit over my head right now, but if I am understanding your basic point correctly, the variation is due to different types of radii and some measurement inconsistencies?
Comment: @TrumpetDude Yep, this is pretty much it.


Can a man marry step sister of his wife

Question: Can a man marry step sister of his wife. i.e such sister who has the same mother but different father
Comment: That would make her a half-sister, not a stepsister.
Comment: Salam and welcome on Islam SE. Please consider taking our [tour], checking our [help],  [meta] and especially read [ask]t o learn more about this site. To your concern As @Moon made clear in his answer there's no difference between maternal or paternal siblings in Islam they are siblings. This means this woman is the sister of the wife, which is already discussed here http://islam.stackexchange.com/questions/29670/can-i-marry-my-wifes-sister-who-is-widow-now
Answer: NO
First of all you must understand is Islam doesn't differentiate between half-siblings. A sibling is a sibling.
Also there are rules about qualifying half siblings who were nursed by your mother or you parents took them in and called them their children. These rules I don't know in detail. But there is almost no differentiation between Siblings and Half Siblings and there is NO differentiation between the two when it comes to Nikkah.
Now there are these Ayats of Quran: [4:22-24] An-Nisa

And do not marry the women who were wedded to your fathers (and grand fathers), except what has already passed; that is indeed an act of shame and great wrong; and an evil way.
Forbidden for you are your mothers, and your daughters, and your sisters, and your father's sisters, and your mother's sisters, and your brothers' daughters and your sisters' daughters, and your foster-mothers (who breast-fed you), and their daughters (your foster-sisters), and your wives' mothers (mothers-in-law), and your wives' daughters who are under your protection - born of the women with whom you have cohabited; and if you have not cohabited with them, then it is no sin for you to marry their daughters; and (forbidden are) the wives of your own sons (and foster-sons and grandsons) and the keeping of two sisters together in marriage, except what has already passed; indeed Allah is Oft Forgiving, Most Merciful.
And all married women are forbidden for you except the wives of disbelievers who come into your possession as bondwomen; this is Allah's decree for you; and other than these, all women are lawful for you so that you seek them in exchange of your wealth in proper wedlock, not adultery; therefore give the women you wish to marry, their appointed bridal money; and after the appointment (of bridal money) there is no sin on you if you come to a mutual agreement; indeed Allah is All Knowing, Wise.

According to my knowledge the rules for slave girls was later amended by Hadith.. I can not refer to Hadiths about this but this is the accepted rule by scholars.
After this then there is the rule if one can marry sister of a Wife after the wife has passed away or divorced. That case is "Yes" but ask scholars.

Can a man marry step sister of his wife


What are pros / cons to add UIView to cell vs cell.contentView?

Question: I have a UITableViewCell. How should I add a subview to it? I have seen many example to add subview to the contentView, but why not directly to the cell?
Answer: You can do it, but  If you want to customize cells by adding custom view, you should add them to the contentView in order to get them animated along the table animations
Answer: When you add a custom view to contentView or assigning to contentView handles framing resizing  part ,animation part and when editing mode is ON (tableView.editing = YES;) tableview tries to operate with views of itself meaning contentView, accessoryView. So when you want to add something to the table view and let control be given to tableView go for contentView


How is jitter of an oscillator measured and quantified in practice?

Question: One of the characterisation parameters of oscillator is jitter. But I guess this requires a measurement technique with good timing accuracy.
In practice what sort of lab equipment is used? How is jitter is measured and quantified?(as a big picture)
Comment: You can use a good phase locked loop for this.
Comment: See [eye diagrams](https://en.wikipedia.org/wiki/Eye_pattern), for example.
Answer: Jitter is the time domain word for this characteristic. The frequency domain characteristic would be the Phase noise.
Check wikipedia for a quick overview: https://en.wikipedia.org/wiki/Phase_noise
Phase noise can be measured different ways:

Spectrum Analyzer. The spectrum analyzer must have a significantly better oscillator than the one you want to measure!
Special Phase noise measurement equipment. There are certain specialized ways to measure it.
Take an oscilloscope and measure the jitter in time domain (Usable only for lower frequencies that can be well measured with an oscilloscope)

Here is a presentation from keysight explaining the measurement: https://www.keysight.com/upload/cmc_upload/All/PhaseNoise_webcast19Jul12.pdf
Since you didn't specify the sort of oscillator (low frequency, high frequency etc, sine, square...) it is difficult to give an exact advise on how to measure it.

Edit: The spectrum of phase noise can be described with Leeson's formula
$$ L(f_m) = 10 \log \bigg[ \frac{1}{2} \bigg( \bigg(\frac{f_0}{2 Q_l f_m}\bigg)^2 + 1\bigg)\bigg(\frac{f_c}{f_m} + 1\bigg)\bigg(\frac{FkT}{P_s}\bigg) \bigg] $$
If you measure the phase noise spectrum you can calculated back the parameters inside the formula, like the quality factor Q of the oscillator. It can also be used to qualify the oscillator's performance.
Comment: A nice trick if you don't have a perfectly stable reference oscillator is to measure the signal against a delayed version of itself. Just use one long and one short cable, trigger on the short one and look at the flanks.
Comment: Yes. That's one way. Another way is, to lock a reference oscillator via a phase locked loop. This only really works, if you're jitter is low enough so it can lock properly. Another way is to use two refernece oscillators and correlate them. The noise is uncorrelated and will cancel out.
Answer: The magic to measuring phase noise or jitter (which can in general be seen as two sides of the same coin) is autocorrelation. You can even measure the phase noise of a DUT with a device that has internal phase noise worse than the DUT!
Consider the following: If you have a number of clocks or oscillators, that are completely isolated from each other, their output phase will also be uncorrelated. If you now use each of these in a PLL tuned to the same frequency as the DUT, the phase noise of each of these tones will still be uncorrelated.
Now you can mix the signal of the DUT down with each of your separate LOs. Your resulting output will cointain two sources of phase noise: the original DUT's phase noise, and the phase noise of the LOs of your testing equipment. Now you can use a cross-correlator operation to look at the correlation of the inputs. As the test-equipment LO phase noise is uncorrelated, it will be averaged out, and we end up only having the phase noise of the original DUT.
Dr. Shahriar Shahramian, who also hosts The Signal Path Blog explains this in more detail in one of his videos:
TSP #162 - Tutorial on Theory, Characterization & Measurement Techniques of Phase Noise
Answer: An oscillator may be analog or digital and the jitter measurements are done quite differently.
Since the analog domain has already been covered, let me share the methods I used for digital data.
Given there is almost an infinite number of digital channels that exist in the last 50 years, there exists in every well-designed channel, an error budget for each type of phase error. If we consider the synchronous channels with clock and data either as separate lines or combined into one channel by some form of baseband modulation to encode the clock, there exists many solutions to separate the clock and data from the channel.
A PLL almost always is used to generate the Tx clock and regenerate the Rx clock.  The jitter in the clock is just one part of the total error budget.  In my experience, the most useful tools I have used measured the "window margin" between clock and data errors as either a discrete value or a percentage of the total timing window, rather than simply a Time Interval jitter analyzer.  The recovered clock introduces some jitter from tracking errors due to the data jitter which must be minimized by matching the channel noise spectrum and optimizing the ratio of tracking data bit shift while minimizing clock tracking errors.
There exists a unique curve between the Bit Error Rate or its inverse the number of bits between errors and the channel jitter or phase margin remaining after clock and data recovery.
By reducing the data window and detecting the margin before errors occur, I could determine using different data patterns, a dozen different types of noise characteristics such as slicer or limiter asymmetry, synchronous random noise, synchronous impulse noise, like a defect on a magnetic disk track, InterSymbol Interference (ISI) due to group delay distortion in the transmit filter, the channel and the receive filter using different worst-case bit shift patterns like 001 or 110 or 0110 1101 1011  or 6DB and many others.
I had about a dozen types of jitter analyzers and for transparent window margin analyzers, my favourite complex tools were the Guzik and the Cambrian Phase Margin Analyzer (obsolete).  But for a simple tool, I used a little box inserted in series with the digital serial data. I used the data edges to drive a pseudo-random (PRSG) pattern to shift the data transitions in series with any data channel to MUX precise delay lines to either Early, Normal or Late or -,0,+. The tool was pre-configured to the desired margin loss like +/-10% or +/-25%, which corresponds to some jitter value and thus bit error rate (BER) value, one could instantly obtain go/no test results rather than wait for long periods of data frames between errors to verify a channel of clock, data or media noise.
This was all done circa the mid '80s and I used this up to 50Mbps. For fibre optic gigabit systems similar methods are used such as Tektronix and Agilent tools.


When using a drill whip to degas, how do I ensure I will not aerate the wine/mead?

Question: Some my wine/meads have been a bit bubbly after bottling.  I'm thinking the problem is I have not be degassing.  If I use a drill whip, how do I ensure I will not bruise or aerate the brew?
Answer: The oxidation in wine you get from vigorous degassing is minimal compared to beer, and those flavors are actually beneficial.
The cardboard or paper flavors that brewers fear from post fermentation oxidation are a result melanoidin based molecules.  Melanoidins are very low in wine.
They sell those wine whips that attach to a drill for a reason.  Whip away and get that gas out.  The out serious out gassing will also counter act some of the O2 pick up.
I make wine as well as beer, and whipping it into a frothy mess is not a problem for the wine.   In fact, you need to get the gas out to help ensure clarity steps further down the road.  We also add sulfite base stabilizers to wine which helps with oxidation.
I'd recommend strongly that you use your wine whip with you fermentor either in a larger sink or place in on a couple old towels.  The wine will foam over if you are in a 6 gallon carboy with 5 gallons of wine.
Comment: I'm not sure that it's true for wine - I made a red wine last year that oxidized going into the bottle. Got a brown tint and tasting of port/sherry. It was not ruined, but not as planned.
Answer: You should be agitating the wine or mead without sloshing it. The agitation happens under the surface, which causes the co2 to be released. There should be little or no motion on the surface, and certainly no splashing.
This next point is a bit controversial - for mead, don't worry about oxidization - the oxidization of honey is apparently actually flavorful, according to Moonlight Meadery
Comment: in my experience, that flavor is "cardboard"
Comment: I thought the same - I couldn't believe what I was hearing. However, since Michael Fairbrother is an international award winning mead maker, I'm hoping there is some credibility to what he says. I've oxidized beer and got that papery, cardboard and sherry, and got typical port flavours in wine, but not had that problem in pure-honey meads.
Comment: The issue with mead 'oxidation' (in my opinion) is that you will tend to drive off some of the aromatics, which tend to be pretty volatile. A mead that just sits with exposure to ambient air/oxygen will be somewhat less fragrant.
Answer: I've had meads that have suffered from oxidation and have turned for the worse.  I believed this to be at least partially at fault of using a drill whip to degas.  After doing more research and experimentation, I've decided that the best method to degas my wines & meads is to actually use a vacuum.  I've had successful results of using a foodsaver to degas, similar to what is seen here in this video.
My advice to anyone trying this is to take one of your bungs, and make a custom fit from the vacuum.  I used hot glue to the bung, and it creates a air tight seal.


Who's the character at the end of the last episode of Owarimonogatari season 2?

Question: At the very end, who is the girl with a black ribbon who's running down the stairs? She can be seen at the last still shot in a weird pose holding/being held by Kanbaru. It's not Ougi, as she has a tie instead of a ribbon, and can be seen to the right of them in that still shot when it pans out.
Answer: This appears to be Higasa, who is on the basketball team and in the same year as Kanbaru. In the anime productions, she first appears at the beginning of Hanamonogatari.

Hanamonogatari opens with a section where Kanbaru talks about her parents, before she wakes up on the morning of her first day of her third year of school. She runs into Ougi on the school's athletic grounds. Ougi asks Kanbaru if she has heard of Devil-sama.
We then see Kanbaru is sitting in her classroom that same morning. Higasa, being now in the same class as Kanbaru, walks into the room, and Kanbaru identifies her by name.
There is then a time-skip to the afternoon of the same day. Higasa suggests to Kanbaru that they should go home together, but Kanbaru demurs. She then asks Higasa about Devil-sama as Higasa is leaving.
Answer: Unfortunately, this is some mistake, there's the difference between the girl running down the stairs with Higasa. And I know it clearly since I'm writing this answer by seeing both scenes of "the girl" and Higasa holding Kanbaru. The girl is brown-haired and I believe it and Higasa is black-haired


AI to PDF, mask over photo doesn't show

Question: I layered a gradient over a photo and masked it to create a fade. When I save the file as a PDF and place the file in an email the image doesn't show the fade. I've saved it every way I can think of as a high quality print, press quality, et. I've played around with the compatibility, checked and unchecked the options available. No change, the fade still, well, fades. Any ideas?
Comment: Possible duplicate of [Clipping mask over photo doesn't show in PDF](https://graphicdesign.stackexchange.com/questions/122842/clipping-mask-over-photo-doesnt-show-in-pdf)
Comment: Please don't post the same question multiple times. Is's best to refer back to your *original* question and edit it if necessary. Be aware, browser and email client abilities to display a complex PDF accurately vary considerably.
Comment: Sorry, I thought this was a different problem because it was in a different file and I was using different tools. I'll try to keep this in mind next time I'm posting a question.
Answer: I also had a similar problem. I saved an AI file, which had a layering mask of a gradient over a photo, as a PDF to print. When I open the PDF with Acrobat Reader it opens okay, with the layering mask. But when I open the PDF with Chrome or Firefox, it doesn't show the gradient.
I couldn't find the problem within the PDF settings. The way I found to surpass this was to flatten the image with the clipping mask (not the best solution, but now the gradient appears the way it should no matter where I open the PDF file).

AI to PDF, mask over photo doesn't show


Ultimate reality and tilakkhana

Question: Is it correct to say that the tilakkhana (anicca, dukkha, anatta) is ultimate reality?
Comment: The Buddha didn't use lakkhana but sanna (perception) which might answer the question. How ever, useful to do [First things first](http://accesstoinsight.eu/en/lib/authors/thanissaro/firstthingsfirst)
Answer: Tilakkhana is Pali for "three lakṣaṇa". "Lakshana" means indication, symptom, attribute, feature, omen, that by which a thing is recognized.
Anicca, dukkha, anatta are the three aspects of all dharmas or all phenomena. Dharmas have many different attributes or qualities, but these three are the subset of qualities that helps us let go of our simplified assumptions about dharmas and to realize their true mode of existence aka "ultimate reality".
The way dharmas really exist does not come in three pieces. Anicca is not separate from dukkha is not separate from anatta. Instead, the ultimate reality is this fluid stuff. We, being equal parts naive and fearless, try to describe this stuff in terms of distinct dharmas, but every time we create these distinctions they are inaccurate, unreliable, and unstable - and that's what trilakshana refers to.
So it would be more accurate to say that trilakshana is a characterization of our description of reality than something that applies to reality itself.
In other words, trilakshana is Samsara we overlay on top of Nirvana - not Nirvana itself which is free of the three marks.
Comment: In the Theravada, the first two lakkhaṇa do not apply to all dhammas. Nibbāna is not anicca or dukkha.
Comment: Right, and that's what I concluded with, that they apply *not* to Nirvana. As to whether Nirvana is included in All dharmas or not, and whether it is Anatta or the more strict N/A, have been the topic of debate since Sthavira Nikaya split from Maha Sangha, so I'd rather not go into those details.
Comment: Andrei "fluid stuff" Volkov. Any reference for that part?
Comment: https://www.amazon.com/Rice-Seedling-Sutra-Teachings-Dependent/dp/161429643X  commentary by Geshe Yeshe Thabkhe.
Answer: Nibanna has not the tilakkhaṇna marks. Nibanna has only the not self part and it is as real as whatever has the 3 marks. But nibanna is not a product of mano, ie an idea, not  an object of the 5 usual senses, and not a material good, so it is a weird object which is why the buddha uses ''direct knoweldge'', instead of the ''intellectual knowledge'' that philosophers claim exists and actually is knowledge, to talk about the knowledge of nibanna.
Answer: AN 3.136 explains the tilakkhana (anicca, dukkha, anatta) are invariable natural laws; even when they are not known or perceived.

Ultimate reality and tilakkhana


IPSec software that can use multiple CPU cores

Question: Can anyone recommend a good IPSec software that can use multiple CPU cores to achieve performance ~2Gbps on Linux dual-CPU quad-core E5620 Xeon setup (total 16HT cores)?
I have tried OpenSwan and StrongSwan. The OpenSwan KLIPS stack runs only on a single CPU core. And the KLIPS+OCF crypto offload also seems to be very badly implemented because it is consuming all 16 CPU cores at 70% while delivering only ~600Mbps. And as a side product it is also reordering TCP packets.
So far with OpenVPN which uses different protocol we were able achieve ~2Gbps on the same hardware with load balancing without any problems. Only 4 out of 16 cores were utilized at 100%. Now it is time to do the same thing with Ipsec. Preferably that should be OpenSource IPsec solution.
Update:
My latest findings indicate that IPsec NETKEY stack might be able to handle two gigs of traffic without a problem (but only on Multiqueue NICs). I was not able to verify this for sure, because it seems that NAPI switches NIC drivers to polling mode under high load and at that time all performance drops from 1.7 Gbps to 500 Mbps. Also it seems that ubuntu 10.04 does not do time accounting for some kernel threads and because of that I do not see how workload is distributed accross all CPU cores.
Comment: What Linux distribution are you using?
Comment: I am using Ubuntu 10.04 Server edition.
Answer: hifn based crypto accelerator hardware has been in use in BSD for while now; quick Google shows Linux drivers as well.  The Express DX 1845 card boasts 25Gbps throughput on their brochure, but YMMV, and obviously I'd want to talk to a product/sales engineer first to see if it would work for your purposes.


How to add apps or files to the Finder toolbar in 10.9 Mavericks?

Question: In previous versions of OS X, I could drag an application or any file onto the Finder toolbar, creating a persistent shortcut that works in all Finder windows.  It's no longer working in Mavericks.
Answer: cmd + drag does the job! This got me trying for a while.
Answer: The reverse of this operation is holding command, then dragging the folder back out. The problem of having unwanted folder or files linked and residing on the toolbar confounded me for a long time. It had had the effect of making the Spotlight window INVISIBLE when in Finder.
Answer: I was looking for the same thing. The closest solution I could find was to add the app to the sidebar. Select your app and hit Cmd+Ctrl+T.
Answer: In OS X 10.9, Mavericks, you have to hold the Option and Command keys to add it.


Can I provide separate power to USB device?

Question: I have a USB device that requires more power than the RPi can provide.  I don't want to use a powered hub. Couldn't I build a simple adapter that passes only the data lines and breaks out Vcc and ground to the device (no connection to RPi) such that the device could be powered by a separate source?  Could the source be the same as the RPi's?
Thanks for your thoughtful answers.
Comment: Why don't you want to use a powered hub?
Comment: Fair question.  I have an application that must be battery powered so I have to keep the power requirements low.  I have the proof-of-concept working; now I'm working on refinements.
Comment: I see! I'd like to see someone develop a powered USB expansion board, which would be perfect for you as it could power the RPi and the devices efficiently.
Comment: What I considered doing was removing the PWB from a powered hub, mounting it in the same box as the RPi and powering both from the same battery.  But the application doesn't require 4 more USB ports, all that extra HW and battery drain or cable to connect the hub and RPi!  It's headless and the two built-in ports are sufficient.  All i need is a tad more juice to the USB device.
Comment: did you manage to get this setup working CPRitter.
I could appreaciate some details;) thanks
Answer: It should be fine. You should connect the grounds together though.
If the wires are really long, you may have problems with earth loops
Comment: Thanks for your response!  I certainly am not an expert but I was thinking that since the data lines are differential, no reference would be necessary and therefor it would not be necessary to connect the grounds.  Am I incorrect?
Comment: @CPRitter, You may get away with it if the usb device is "floating", but if there is a significant difference in the grounds you will run into problems.
Answer: I would like to take this discussion one step further.
Apparently on the revison 2.0 boards, if you have a hub that puts power on a cable going into (coming from?) the USB A connectors you can power the Pi from the hub. In other words, the signal would be coming out of the A connectors and the power would be going into the A connectors.  So in this case, the battery pack could be spliced into one of the USB cables. Or it could, for example, be incorporated into a keyboard assuming this application has a keyboard.

The resetable fuses protecting the USB outputs have been removed. This feature was implemented on some later revision 1.0 PCBs by replacing the fuses with links; revision 2.0 permanently implements this modification. It is now possible to reliably power the RPI from a USB hub that back feeds power, but it is important that the chosen hub cannot supply more than 2.5A under fault  conditions.

http://www.raspberrypi.org/archives/1929


How to extend my short stay Schengen visa?

Question: I hold a China main-land passport.
I am doing study abroad from the US to France and Spain. With all the confusion and my poor judgement, now I end up with a short stay visa in France (Schengen visa). This only covered my stay in France but not long enough for my classes in Spain.
Is it possible for me to extend my stay in Spain?
Comment: What's the total duration of stay?
Comment: What type of visa do you have? "C" or "D"
Comment: How long do you expect to stay Spain? If this is short and for vacation, then it's a duplicate of the linked Q, otherwise you might need to consider a study permit.
Answer: I believe you cannot extend short-stay visa. This is based on my own experience. My friend got rejected once because her visa was a short-stay visa and according to some regulations. It cannot be extended. You have to go out of the Schengen area and re-apply for your visa again. In this case it has to be China. They only allow long-stay visa to be extended inside the country.
Comment: I don't believe to be true. They sometimes give "Short-Stay" but type "D" visas so it changes.
Answer: If you have student visa type "D", you should go to the city offices of the city you are registering to (required if you are staying more than 7 days in one place) and go to the foreigners division. There, you can apply for temporary residency permit, which allows you to stay for the duration of the program.
On the other hand, if you have not applied for a "Student Visa / Type D", I don't think it is possible to extend the duration of your visa. You either have to apply for a new one in China/USA. Recently I have gotten a German visa for Internships/Studies program, from a Consulate in the USA. I am in an exchange program from the USA just like you and given my nationality (Turkey), I have gotten "D" type visa. I could tell you that in my experience, it took me 3 months to get the visa. You should talk to the consulate ASAP.
Schengen Visa Info:

The students who are not citizens of any European country yet still wish to come and study in Europe must apply for Schengen student visa. Together with the visa, if the duration of the studies is longer than 90 days as it happens with most of the students that wish to complete a whole academic year or even more, students must also apply for the residency permit that allows you to reside in the designated country for a period of one whole year.
Comment: You can find further info in the link provided above.
Answer: Schengen visas (visa category C) can be issued for short-term stays of up to 90 days in the Schengen region, for instance, for tourist visits or visits for business purposes or for medical treatment. The consulates of the Schengen States are responsible for granting Schengen visas.
An extension to a Schengen visa is only possible
in exceptional cases where new facts and special reasons arise after entry.
If entry into the Federal Republic of Germany or into another Schengen state is late, the Schengen visa can be extended by the non-used duration of stay.
A Schengen visa which has already expired cannot by extended.
Comment: Could you cite sources (links or possibly personal experience) to underline  what you state in your answer? That would make it a lot more useful!
Comment: Hi and welcome. Please add authoritative references to support your claims so as to improve the quality of this answer.


Why do Binary Options have a bad reputation?

Question: Actually, I have no experience with binary options trading but on the internet, I see that people talk about them in a bad way.
Why does binary options trading has a bad reputation?
Thanks
Answer: Binary options are not traded on standard options exchanges and cleared OCC.   Instead you are trading vs individual houses/web sites.   These sites have been accused on not paying, freezing funds, and generally creating barriers to allow the customer to benefit from winning trades.
Comment: actually i think i have heard of some binaries on commodities that at least at one point were traded on exchange , also i think fed funds binary options used to trade on the CME
Comment: I'm sure you could find legitimate ways to trade them.  You could call a dealer and get an OTC market.   But it just happens that the majority of the venues where retail investors trade are fraudulent.
Answer: Adding to the answer of @JoshK, many of the firms offering binary options often operate their scams by advertising their trading platforms on sites like Facebook. Their trading platform and website are designed to look very professional, making you think the company is legit. Some of the scammers go to the extent of creating YouTube accounts where they seemingly "daytrade" binary options with success on their own trading platform, and thus lure in new "uninformed" investors to their website/scam.
Be aware that the trading platform is rigged and in many cases they "let" you win a few trades, in order for you to deposit even more money into your account, and consequently trade larger positions. This will inevitably end with the investor loosing all of his money, if he keeps trading on their rigged trading platform. If you "win" a few rounds and decide to withdraw your money, they will do whatever possible to refuse the customers withdrawal request.
There are some informative sites here and here about the scams done with binary options.
Answer: I find the above answers very interesting, and they do manifestly support the premise of the question. This is not really an answer, but I do feel some right sizing may be appropriate, and I can offer some insight at least in terms of the UK.
My background is one of being an ex institutional exotics trader, am UK based, and unlike most UK traders, who are banned from trading binaries (I believe since ESMA ruled as such perhaps as of Jan 2020), am fortunate (or not, depending on perspective) to have professional status and therefore am permitted to trade them, should I wish to do so, under FCA regs.
The criticisms levelled above are both shocking, and completely alien to me. Digitals are not my instrument of choice for the most part for PA dealing, however have dabbled now and again, and have never encountered any of the issues mentioned above. Have traded them on a well established platform (which I've used for about a decade for other things) which offers them in addition to other instruments, and not from some unsolicited inbox / internet canvassing. Surprised that people do get duped by things like that!
In terms of why the regulator here does not like them, I think broadly:
A) they feel 'investors' do not understand the risks
B) particularly with short dated digitals, they feel the payoff is too prone to enabling / potentiating problematic gambling behaviour.
I've never been particularly enthralled by them, but I do like that they exist.
Digital payoffs exist in sports betting, in the distant part I helped model correlated payoffs in this arena, and so that this post has non-zero math finance content, I will say here that Bachelier and not lognormal vols were de rigeur, but this is some years back.
If this post is hated, I'll be happy to delete, just trying to offer a perspective from some experience and having seen some regulatory opinion some time ago.


Will a titan shifter stay in their titan form if they die due to the curse?

Question: What if the titan shifter is in the last moment of his curse, and then the time comes where they die (according to the Curse of Ymir)? Are they still gonna be in their titan form for eternity?
Answer: So far, no person with titan-shifter powers experienced this.
But, if I were to speculate what would happen given the facts laid out in the manga, I have a possible answer.
The following facts are what I took into account:

From here, it is said that 'if an individual with the power of the Titans dies before it can be transferred, the power will be passed on to the first Baby among the Subjects of Ymir, who is born directly after the said inheritor's death, regardless of distance or relation to the previous inheritor.'

Also, from here and from what can be observed in the manga, it is known that,

'after death, Titan corpses rapidly evaporate to skeletal remains, then to nothing at all.' From what I understand, this is also true for people with titan-shifter powers whenever they leave their Titan bodies or, for the Colossus Titan's case, when they want their body to evaporate at their own will.

For titan-shifters, they themselves are the source of their Titan powers and their ability to manifest a unique Titan body. If that source is 'gone', then the Titan body would evaporate, as seen in the manga/anime.
So to answer your question: For how long can a titan shifter be in his/her titan form after his/her death while he/she is still inside the Titan's body? The same time it takes for a Titan body to evaporate after it is killed or when a titan-shifter leaves it. After they die, their titan-shifter powers 'leaves' them and are passed on to the next inheritor who is born after the current inheritor's death. Since the 'source' of their power is gone, the Titan body would simply evaporate just like any bodies of Titans killed.


How is it possible for demand to be perfectly elastic under perfect competition?

Question:
So according to perfect competition, a single firm is a price taker, having to sell at the equilibrium price as determined by supply and demand. As you can see from the single firm graph, demand is perfectly elastic. However, from what I've read about perfectly elastic demand, that means the quantity demanded is infinite at the given price (P). But according to the industry graph, the quantity demanded at price P is Q, a finite quantity. How is it possible that the quantity demanded for a single firm at Price P is infinite, when the quantity demanded for the entire industry (which includes the single firm) at Price P is a finite quantity (Q)?
Answer:
How is it possible that the quantity demanded for a single firm at Price P is infinite, when the quantity demanded for the entire industry (which includes the single firm) at Price P is a finite quantity (Q)?

It is not completely correct to say quantity demanded for perfectly elastic demand is infinite. That is quite common misconception. Rather, demand can be any quantity between $[0,\infty)$ but that is not the same as being only $\infty$. Horizontal demand curve says that consumers would be willing to buy any $Q$. This is why the line goes to infinity but $Q$ itself will not be infinite.
In fact as your own graph show the firm will produce $Q$ such that $MR=MC$ and clearly as the graph shows the $Q$ is well below infinity.
Comment: Thank you for your answer. Only thing I have a hard time understanding is that if the single firm sells at the equilibrium price, it can't just sell ANY non-zero quantity. At most, it could only sell the equilibrium quantity as determined by the industry graph. For instance, let's say the industry equilibrium price is 5 dollars and the industry equilibrium quantity is 100 units. If an individual supplier sells units at 5 dollars, it would only be able to sell 100 units at most
Answer: The demand for the firm being perfectly elastic in perfect competition means if the firm increased the price a bit, its demand would go down to 0 as their consumers would all flee to their competition as competitors are selling the same product cheaper.
On the other hand, if they decreased the price a bit, they would steal all their competitors' demand as they are the firm producing that product the cheapest of all.
Answer: The horizontal red line in the right figure is not the graph of the demand function $Q(p)$ but the graph of the indirect demand function $p(Q)\equiv P$, which is constant at the market price $P$ and indicates that a firm can sell any quantity it wants but will always achieve just the market price. Thus, "perfectly elastic demand" really means perfectly inelastic indirect demand.
The "demand function" $Q(p)$ indicating the demand facing the firm as a function of the firm's price is not well defined as a function into the real numbers. Instead, one can work with the (set-valued) demand correspondence $Q(p)\in\left\{ \begin{array} \{\{0\} \ldots p>P \\ [0,\infty) \ldots p\le P \end{array} \right.$


Does the CollectionViewSource class include functionality of INotifyPropertyChanged interface?

Question: I've written 1 WPF app.  A pretty simple app.  It works great and is being used heavily as a LOB app today.  Now I'm going to start work on a major re-write of an old VB6 app, and will make it into a WPF app as well.  When working on the first app I learned of the INotifyPropertyChanged interface, and how vital it is to WPF/Silverlight data binding.  My concern, now, is that quite some time ago I wrote a WCF service which is meant to replace the old middle-tier component I wrote in VB6 many years ago, for the old VB6 app.  The WCF service I wrote returns ADO.NET datasets, because honestly I've been working with those for years and am comfortable with them.  However, now that I'm beginning to work on this new app, I'm very concerned about my WCF service, since ADO.NET datasets don't implement the INotifyPropertyChanged interface.
So I've started looking at other things.  Right now I'm looking at Entity Framework.  I'm using Julia Lerman's book, "Programming Entity Framework: Second Edition", and it really looks promising.  I've working through her example of a WPF app, which uses a EDM assembly she wrote in a previous chapter.  Including references to the assemblies gives me CollectionViewSource's, and at least to me, it appears as though they act much the same way that the INotifyPropertyChanged interface does.
So my question is this: does the CollectionViewSource class implement the INotifyPropertyChanged interface?  I've tried looking at the MSDN documentation, and it doesn't say so, directly, but I'm wondering if the DependencyObject class CollectionViewSource inherits from either duplicates the same functionality as the INotifyPropertyChanged interface, or does CollectionViewSource implement it?
Answer: You'll notice the MSDN doc on CollectionViewSource contains this as the class declaration:
Public Class CollectionViewSource _
    Inherits DependencyObject _
    Implements ISupportInitialize, IWeakEventListener

Neither it nor its base classes implement INotifyPropertyChanged. When you bind to the View of the CollectionViewSource, you must call its Refresh() method yourself when the underlying collection changes. If you change properties (such as sorting and grouping) of the CVS, Refresh is called automatically.
Comment: WOW, really?  That causes me concern, as I really wanted to depend upon the INotifyPropertyChanged interface, or something equivalent to it.
Answer: just to mention a little detail to Rod answer:
when adding or removing an item to collection, the items goes through any filter, grouping, sorting, etc.
But when a property of an existing item changes, then, you have to handle that by yourself to update filters, grouping, etc.
At this point, the solution of the Refresh() works BUT, can bring very bad user's experience since the whole collection get refreshed.
One solution is to simulate an remove/insert of the item. See my post fore more details.


Genetic algorithms(GAs): to be considered only as optimization algorithms? Are GAs used in machine learning any way?

Question: As a quick question, what are genetic algorithms meant to be used for? I read somewhere else that they should be used as optimization algorithms (similar to the way we use gradient descent to optimize the best parameters search with a linear regression, neural network...).
If so, why are these GAs not so much present in machine learning (or at least I did not see it too much in the literature)?
Answer: Yes, as you found they (evolutionary algorithms such as genetic algorithms) are using for optimization tasks. One reason that they are not using mostly in machine learning could be their performance to converge to the optimum point. Also, implementation of the GAs for some domains could be problematic and it could not be generalized like gradient descent, as it's involved in at least 5 phases (mutation, crossover,  ...).
Comment: While GAs are indeed mostly used for what is broadly defined here as "optimization", other EAs (like Genetic Programming) have been successfully applied to more problems that would be better described as "synthesis".
Comment: Gradient-based optimizers are only meant for continous spaces, which are differentiable. They're not even meant to work in non-convex spaces, but give results considered good-enough.
Answer: I think you downplayed too much about GA. GA is still used actually in machine learning although not as widespread. You can see some implementation by code bullet and a more academic one for example. One of the issue with GA is it is most of the time it is computationally expensive and to some degree requires luck (because you are mutating instances randomly), hence it is usually not popular when we already know a more deterministic solution to a problem. But there is a set of problems where GA could excel, one of that is when you don't have differentiable objective e.g. parameter search, or reinforcement learning.
Comment: excellent answer, I completely agree with you about thinking of it for cases where you do not have a differentiable objective function to optimize; luckily I have a team mate who is an expert in GAs, so the idea is to apply it to cases where other more common optimization algos are not applicable or when hyperparameters search could be too expensive to do with an exhaustive grid search for instance...
Answer: Tackling the second part of the question, yes GAs can be used in machine learning but are not the commonly used method.
Mainly, to optimize parameters on (parametric) models, it is common to use either a closed solution (like in least squares) or Gradient Descent (and it's variants) but the choice of Hyper-parameters are usually open to taste, GA's could be used in here, but people usually try things like Random Search, Grid Search and so on.
Comment: Grid search is a optimization algorithm (not very efficient, but it is)
Comment: thanks for your answer Pedro, although I would not mix hyperparameter tuning methods like grid search with the selected optimization algorithm itself (like gradient descent). I.e., you use gradient descent to find the best coefficients of your model for each hyperparameters setup among the several ones contained in your grid search strategy
Comment: I am not mixing, Hyperparameter tuning is an optimization procedure, usually not tunned with gradient descent but other optimization algorithms.


Increasing Flood Plain

Question: I am doing a project where we are attempting to determine how many more buildings would flood if the FEMA flood plain increased by 1',2' and 5'. I have the elev of the flood plain rasters from lidar data, but I am having trouble figuring out how much more area will be inundated by the rises I described earlier. I'm using raster calc and I have a buffer for the flood plain that also has elevation data. Any thoughts?
Flood plain in the county with elevation data (raster)
Comment: Arcmap 10.2, should have specified
Answer: You could create 1' contour lines, using your LiDAR data. Then use those contour lines to calculate your 1', 2', 5' increase. Using a basic approach in determining the increase potential and create polygons over those to display.
In addition, you could look into Esri's Floodplain delineation from lidar points, provides a general overview of options of using LiDAR within the ArcMap environment.

Being able to accurately estimate extents of different magnitude floods is a critical application in water resources. This information is needed to assess risk for insurance, emergency management, and planning. Lidar is quickly becoming the predominant source of topographic data for floodplain delineation. This is because it's both accurate and cost-effective.
Flood extents are typically estimated by comparing models of water surfaces and ground surfaces. Water surface profiles for a given flood event (for example, 50-year flood) are created by a hydraulic engineer or hydrologist using tools like HEC-GeoRAS. Each profile represents the height of water across the river at a given location. The length of each profile is long enough to capture the largest possible flood extent going out from either side of the river.

Profiles are generated at reasonable intervals along the river where the flooding is being modeled.

Run the Surface Difference geoprocessing tool using the water surface TIN and a bare earth terrain made from lidar points as inputs.

The primary output from the Surface Difference tool is a polygon feature class.

The Surface Difference tool provides an option to output a difference raster.
Comment: Thank you for your detailed response, but I don't have the water surface profiles. If could generate those from my raster elevations then I would easily be able to increase the height of my flood plain. I have stream center lines, and the raster image that I am going to add to my question, as well as lidar data for the whole county.
Comment: I would look into the first part I mention about creating 1' contour lines and using a basic approach in determining the increase potential and create polygons over those to display.
Answer: Workflow I am using:

Split flood outline by points placed at regular interval:

Interpolate bits into 3D polylines, using elevation model and compute average elevation (Z) values for them.
Identify "impact" areas using either Eucledian Allocation or Watersheds of the bits:

Transfer increased levels from the bits to relevant polygons and compute new flood extent using conversion to raster and raster calculator:

Both methods will produce similar results in well defined valleys, although my personal preference is hydrological assignment.

Increasing Flood Plain


I ask for an explanation about the なの in [祖母は耳が遠い、つまり、耳が少し不自由**なの**だ。]

Question:
Is なの considered as a whole (grammatical expression)?
Or is it な ,to make 不自由 an adj, and の seperately?
If 2) is the case, what does の mean here?
Answer: Here の is used in the same manner as you might こと, as a nominalizer(sp?)
It is common to end a sentence with ことだ or のだ basically turning the sentence structure into " it is the case(thing) that ..."
Effectively there is little difference in the meaning than if it was not there at all, but it can have connotations of politeness, so for instance in the sentence you have given, there is an implicit respect for the Grandmother.
This 文法 is used all over the place, and if you spend much time in conversation you may find yourself doing it without thinking.
Comment: What about the Na before that No?
By the way, i'm sorry, but i didn't understand what u meant by (sp?).
Comment: (Sp?= I am not sure on spelling)
Comment: ok so the な attaches to your なadj.
大きな車 ⇒  お兄ちゃんの車は大きなの。(大きいcan be both なor いadj)
早い車  ⇒  お兄ちゃんの車は早いの。
Comment: Sorry for another, but there is also a connotation of teaching or informing when なのis used, kind of like だよ.


Does asking for deviation due to weather give ATC any leeway for reducing separation between aircraft?

Question: When needing to deviate due to weather, does asking for deviation "due to weather" give ATC any leeway in terms of aircraft separation?
Comment: No, it does not change the rules for aircraft separation. That's the whole point of them asking ATC for a deviation in the first place. See this question for the details about separation: http://aviation.stackexchange.com/questions/2806/how-much-is-the-minimum-safe-distance-between-two-planes-in-flight/2809#2809
Answer: No, it does not. ATC can specify a restriction to the deviation, especially in a non-radar environment where they can't keep an eye on you.
The only thing that frees ATC of separation responsibilities between two IFR (or IFR/VFR depending on airspace) aircraft is if one them reports the other in sight, and is issued an "maintain visual separation". After that the responsibility of not hitting the other aircraft, or its wake, rests solely with the pilot in command.
Comment: Aircraft deviate for weather without radar all of the time (think oceanic flights).  What are we supposed to do, just fly through that level five thunderstorm if radar goes down?  ;-)  That being said, I agree with the rest of your answer.  Separation is still required at all times (and that includes visual separation).
Comment: @Lnafziger that is true. I was thinking about that as well. How is that handled? Using corridors of certain size? How about more congested airspace when the radar is down?
Comment: Timing, pilot position reports, etc.  We need controllers here to answer these types of questions!  :-)
Comment: @Lnafziger I'm guessing timing and position reports only really work if you have a route, so... re-routing then?
Comment: Well, I've been asked to report my bearing and distance to a VOR when I'm in a non-radar environment (which is what I meant by position reports) but typically they just say something like "10 degree right deviation approved, cleared direct  when able.", sometimes with a restriction to not deviate more than a certain number of miles of course.  They would then need to keep all of that airspace clear.


What has Israel gained with the official diplomatic relations with UAE in the strategic defense area?

Question: I know that politically and diplomatically Israel gained a lot with the UAE's new move toward normalizing the relations.
What has Israel gained in the strategic defense area?
Answer: The simplest answer may be that this is just formalising what was previously done behind closed doors.  The head of Israel's foreign intelligence service visited the UAE days after they announced the treaty.
The UAE may not seem like much of a valuable ally, especially when there are Arab states with larger armies much closer to Israel.  But this underestimates Emirati power.  The UAE has become a police state, creating an extensive internal security apparatus.  This comes at the same time as an expansion of foreign intelligence gathering capability.  For years the UAE has paid former CIA officers to train their own brand new intelligence agencies.  They have been building the intelligence infrastructure to create an spy network which spreads across the Middle East.
Israeli access to Emirati intelligence should be an obvious and impressive strategic perk, and it works both ways.  This is encouraged partly by a joint fear of Iranian influence, which has expanded in no small part thanks to the ineptness of American activities in the Middle East.
Previously, Iranian influence was contained by a hostile Baathist regime in Iraq.  This is no longer true: democratic and majority Shia Iraq, in league with Baathist Syria, allows the transport of previously unimaginable quantities of weapons directly from Iran to Israel's borders.  This new "Shia land bridge" poses an immediate threat to both Sunni monarchies in the Gulf with Shia minorities, and Israel, as Iran is a major sponsor for various militants in Israel's back yard, most obviously Hamas and Hezbollah.
Answer: As mentioned by "inappropriateCode" Israel-UAE relations have been going on under the table for quite some time. But what happened now?
All of the US Allies in the Middle East consider the Iranian Nuclear program to be the #1 threat to regional stability. And Israel, The UAE and Bahrain equally perceived the Iran Nuclear Deal, signed under President Obama, as severely problematic.
Israel, The UAE, Bahrain, President Trump and his team were very concerned that the Trump Administration might be coming to an end and a new Democrat President might abandon Trump's policies regarding Iran for the sake of upkeeping President Obama's legacy.
All parties (i.e. the US allies in the Middle East) understood that they would be able to exercise much more diplomatic pressure on any future US administration if they stand together, openly.
For that purpose, they had to formalize and publicize their ties before the elections in the USA.


Can I use ST-Link programmer for non-ST chips?

Question: Can I program all kinds of SWD-programmable chips (ARM-MCUs) with ST-Link?
Comment: I use ST link to program lpc1549, it works.
Comment: Perhaps in some cases if you use something like openocd rather than the ST software.  If you run into difficulty there are open source CMSIS-DAP implementations you could flash onto it, which are more universal by placing the host software in finer control of the details.
Comment: "The ST-LINK/V2 is an in-circuit debugger and programmer for the STM8 and STM32 microcontroller families."
I don't think you can immediately, but it should be achievable in theory. Someone managed to connect it to a LPC MCU here : https://www.lpcware.com/content/forum/using-stlink-or-ti-icdi-debugprogram-lpc1700-mcu-0
Comment: This isn't what you asked, but there are also debuggers that cover multiple targets such as the PE micro debuggers.
Comment: yes the st-link can be used on various cortex-m based chips from other brands.
Answer: You could also flash the st-link and convert it to a Black Magic Probe.  The same image will also convert a Blue Pill into a BMP.
I've done both.  The Blue Pill has the advantage that the usb-rs232 bridge the BMP exports is easily available.
The BMP supports a range of chips to include but not limited to:
ST Microelectronics STM32F0, STM32F1, STM32F3, STM32F2, STM32F4, STM32F7, STM32L0, STM32L1, STM32L4
Atmel SAM3N, SAM3X, SAM3S, SAM3U, SAM4S, SAM4L, SAM D20, D21
Nordic nRF51, nRF52 (These are why I use the BMP)
The BMP is open source, can be used for commercial programming and the hardware can be cheap(The "real" BMP costs around $60, a blue pill 5 pack from amazon was less than $20 shipped).
Answer: To add to the existing answer; some chips are known not to work properly with ST-LINK and OpenOCD.
In particular, if your target is from the Atmel SAMD21 family of MCUs, you are likely to run into weird issues, where the processor is detected, but any attempts to erase flash sectors fail with an error.
The reason is rather involved, to quote:

AFAIK the problem is in half word (16-bit) write to NVMCTRL->CTRLA
  register. STLink does not implement half word memory access and
  OpenOCD emulates is as two byte operations. Unfortunately CTRLA
  register comprises from key  and command an have to be written
  atomically. If STLink writes two bytes, NVM  controller sets PROGE bit
  in STATUS: "An invalid command and/or a bad keyword was/were written
  in the NVM  Command register"

The workaround involves recompiling OpenOCD with code patches. Not fun.
However, if you don't mind flashing your ST-Link (through another ST-Link), you can convert it to a CMSIS-DAP adapter, which works just fine with the SAMD and should also work with STM32 and other Cortex-M chips.
Answer: Yes I believe this is possible, although I haven't tried it.
You would likely be in breach of the ST Licence agreement, if you tried programming devices other than those from ST
As an example Segger (One of the market leaders in debuggers and programmers) supports converting your ST-Link to J-link (essentially overwriting the ST-Link chip with the Segger code). This is also reversible, so if you want to restore your ST-link device back to its original form you can.
There are several version of ST-Link, however.
Take a look at the following links which provide further info and a guide on how to do this.
https://www.segger.com/jlink-st-link.html
https://www.segger.com/jlink-ob.html
Comment: I have been using the stlink header on nucleo and discovery boards on most of the the major cortex-m brands...and the ones I couldnt get it to work on were issues getting openocd configured not the stlink.
Comment: Flashing an ST-Link to a J-Link will only work(and be legal) on either a Nucleo or Discovery board and only for use with the targeted MCU. Read the Seggar license terms, they are quite restrictive. As far as I know, the Seggar flasher will not even work on a stand alone ST-Link.
Answer: Yes, its possible.
i am using stlink v2 (original, as well as Chinese usb stick type clones) with Coocox IDE. Coocox has also standalone programmer app - CoFlash, Which could be used to program a lot of chips. I have experience with only two series: LPC176x and LPC175x, over SWD interface. And i haven't any issues with those chips. I also haven't made any specific changes or updates for the programmers (except that original st link required the high voltage level at TVCC (PIN1), otherwise, it didnt allow to program chip, so i connected directly pin 19 (3.3vcc) to pin 1 on stlink v2).
Answer: An STLink V2/V2.1 or V3 with recent firmware can also be used with the PC-Hosted Blackmagic pc-stlinkv2 platform. Compile with "make PROBE_HOST=pc-stlinkv2", start the debug server with "blackmagic_stlinkv2" and connect to :2000 in gdb or directly load binaries with "blackmagic_stlinkv2 ". This works with all targets that BMP knows. However V3 activly denies working on non-ST targets, while V2 does not care.


Accessing virtual machines through a web browser

Question: Are there Virtual Machine Servers that you can install Virtual Machines on and then the clients can just fire up the OS (Windows, Mac, Linux) through the web browser?
That would be very efficient.
Comment: I would clarify this question to something like "accessing virtual machines through a web browser"
Answer: I don't think there are many out-of-the-box products that will do what you want. The closest would be something from VMware. If you wanted to spend some time though, you could use a combination of Xen + libvirt + Virtual Machine Manager to achieve something close, but it's still limited to the desktop I believe.
It's also worth mentioning the potential security risk by having your hypervisor exposed through a web browser. If you have many machines running on your server, one exploit through the browser will expose all your VMs at once to an attacker. Your hypervisor/virtual machine server should be preciously protected because of this.
Answer: VMware's ESX pretty much does this by default although this feature has now been removed from ESXi and will not be available in future releases after V4.1 once the ESXi variant becomes the only one that VMware will update in future. Web based access to a remote guest console is trivially easy to provide for ESX but as others have said there are some serious security issues with this that limit its practical use.
Answer: VirtualBox can be scripted, so it would be possible to include a web front-end command interface.
Microsoft's Virtual Server 2005 was ran exclusively from a web front-end, bit it has largely been supplanted by Hyper-V.
Hyper-V is scriptable via Powershell, I believe, so a web front-end would be possible but I think it would require making calls in a web-friendly language to then make Powershell calls.
VMware does have APIs for VBScript and Perl, and possibly Powershell.  I'm not sure, but they may only apply to ESX.
-Waldo
Answer: RHEV can do that using pre-made templates
Answer: phpvirtualbox is providing this kind of interface: http://code.google.com/p/phpvirtualbox/


Will Google Play Game Services allow turn-based gameplay?

Question: Will the Google Play Game Services multiplayer allow (turn-by-turn) gameplay like DrawSomething?
Comment: This question appears to be off-topic because it is speculation about a future that now has arrived (and in which the answer is clearly "yes").
Comment: I think it allows anything since the game interfaces with the computer rather then google.
Answer: You are not talking about asynchronous gameplay (which is explained here).
You are talking about turn-based gameplay. But I think you can relinquish the idea of using Google Game Services, because of the missing realtime gameplay (= you don't need to establish a connection between the clients).
I would recommend using a database, which contains everything relating to the game like the gamestate, the players, who did the last turn and things like this.
Answer: If you can do synchronous gameplay (i.e. playing together in realtime) you can always do asynchronous gameplay as well. The only deciding factor is whether you're able to establish the required connection at any time.
Comment: I fear it may not be that easy since it looks like as if player interaction is necessary (accepting invites, actively creating new games and searching for other players). The API really does seem to be designed in a way that only allows direct peer to peer socket connections over the duration of a real time game session. Maybe the API can be bent in a way to maintain a session that outlives the duration of a so-called "Room". Would be nice to see some actual code samples for that.
Comment: Ah yeah, so you mean more similar to "play by (e)mail"? That case you'd probably have to use your own custom server and service or networking stuff.
Comment: Well, really depends on what you consider "turn by turn". If the other player isn't necessarily online at that moment you'll probably need some kind of server anyway. Don't think Google would allow you to save your game state somehow to some kind of cloud.
Comment: I was thinking about turn-based in a sense of "Ruzzle". You can take your time for making your move. But I see your point and I also understand why Google implemented it that way. It saves resources. Your original answer made me think it could be possible to use the current API in an "asynchronous turn-by-turn" way. I'll experiment with it in the near future and report back.


What's the formula to calculate the monthly or lump-sum investment amount for a desired future value?

Question: Give the following values:

Inflation Rate 2%
Expected Return Rate 5%
Future Value 1,000,000 monetary units
Years to Target - 10

What is the formula to calculate the amount of?

Lumpsum investment
Monthly investment
Comment: Are you expecting the FV to adjust based on the inflation rate, e.g. after 1 year, it should be 1.05M? Else the number given has no place in our calculations.
Comment: I adjusted the inflation rate to 2% to clarify the question a bit. Such that the money saved will decrease in value (as result of inflation) year after year.
Answer: It's not entirely clear what you're asking... If you're talking about an Excel Formula for getting both of those, then:

=PV( Rate, NPER, PMT, Future Value)
=PMT( Rate, NPER, Present Value, Future Value)

For the lump sum investment, you would put the final value you need in as "present value", and the Payment would = 0.
For the Monthly Investment (with no up-front lump sum), you would put the monthly investment as the payment, and 0 for the Present Value. The Future Value is still the same.

If you're interested in doing the math, the formula for a Future Value of a Lump Sum is:
FV = (Present Value) * (1 + r)^n

The formula to calculate the monthly payments to achieve a Future Value is commonly called a "Sinking Fund Payment":
PMT = ( FV * r) / [(1+r)^n] - 1]

r = interest rate for the period, n = the number of periods. Make sure that the interest rate matches the investment's compounding frequency.
If you are calculating the value of an upfront investment and additional monthly investments, you have to do the calculations as two separate problems.
You can do the algebra to reverse the lump sum formula around for Present Value fairly easily, or you can find the answer on Wikipedia.
Present Value   &   Future Value
Comment: +1 for the sinking fund formula, however I would add that this is a handy but approximate standard formula.  For example, the same formula is used in the Goliath example [here](http://termsexplained.com/135732/sinking-fund), but if the resulting periodic contribution is compounded up for 15 years the future value is $512.5m, a 2.5% overshoot.
Answer: This is the 2nd edit to the Original post, as I write without thinking the formula for annuity payments had the wrong interest factor and growth factor as I divided the rate by 12 for monthly compounded rate (this is a common error in logic) the actual factors use annualized rates for interest and growth. This has now been fixed in the two different formulas I have in this post
This is an edit of the Original post that includes indepth explanation and accompanies code for two user defined Excel PV and PMT function that permit gradient in calculating annuity payment and the lump sum
Lump Sum
PV = FV (1+g)^9 (1+i)^-10

g = 2% per annum i = 5% per annum
The formula listed above is correct but since your future value of 1,000,000 includes the growth thus we would use the following form of the formula to find the initial investment
PV = FV (1+g)^-9 (1+i)^-10

Here we are discounting 1,000,000 at an interest rate for 10 periods then a further discount at growth rate of 9 periods
Monthly payment
The formulas PV, FV, and PMT earlier had it wrong, it has been corrected now
PV = PMT [ 1 - (1+aey(r, c))^-(n) (1+aey(g, c))^(n) ] / (aey(r, c)-aey(g, c))

PMT = PV (aey(r, c)-aey(g, c)) / [ 1 - (1+aey(r, c))^-(n) (1+aey(g, c))^(n) ]

g = 2%/12 per month i = 5%/12 per month
The above formula helps find the payment that grows by a rate and earns interest when initial investment is known. When you have only final or maturity value of the investment then the following formula is used.
The formulas posted earlier had errors that have now been fixed
FV = PMT [ (1+aey(r, c))^(n) -  (1+aey(g, c))^(n) ] / (aey(r, c)-aey(g, c))

PMT = FV (aey(r, c)-aey(g, c)) / [ (1+aey(r, c))^(n) -  (1+aey(g, c))^(n) ]

The annual effective yield for interest and growth is calculated as follows
aey(r,c) = [(1+r/c)^c] - 1
aey(g,c) = [(1+g/c)^c] - 1

The formulas for PV, FV and PMT that are listed above will only find the correct results when period is in units of 1 and compounding is in units of 1. or if these units are the same
But when period gets defined as a fraction of a year such 1/12 for month and compounding frequency is selected such as 1/4 for quarterly then these formulas will not work
The VBA code uses a different formula which happens to be the sum of sequences of geometric series to find the correct answer. This is quite complex work as when you have periods with a fractional part such as 25.75 then to find the present value for 0.75 requires difficult calculations. It gets even more complex with arithmetic gradient whose closed form formula is listed below but its open form formula requires alot of work
PV = { PMT [ 1 - (1+aey(r,c))^(-n) ] / aey(r,c) } + Gradient/aey(r,c) { [ 1 - (1+aey(r,c))^(-n) ] / aey(r,c) - n (1+aey(r,c))^(-n)}

Excel does not offer options for inflation adjusted values, there are however 3rd party Excel add-in such as tadXL that permit Arithmetic and Geometric gradients in the time value of money calculations
But since Excel TVM functions have no way of adjusting for inflation, I will here offer you a slim down version of tadPV and tadPMT function that allow for a geometric gradient. The actual TVM functions in tadXL allow for not only a geometric gradient but also an arithmetic gradient (linear growth). And then those functions are much more complicated as they allow for growth period that does not co-incide with the payment period. And further they allow for a gradient thay may not begin immediately. Even without these options the following code offers much more as compared to Excel PV and PMT functions.
These functions allow you to define the period (length of the period) such as year=1, quarter=1/4, month=1/12, fortnight=1/26, week=1/52, day=1/365, binenial=2, triennial=3, and so on
These functions allow you to enter the compounding frequency of iterest such as yearly=1, quarterly=1/4, monthly=1/12, fortnightly=1/26, weekly=1/52, daily=1/365, infinite=0, biennial=2, triennial=3, and so on
You may also specify the discounting convention of your choice such as full-year=1, mid-year=1/2, 3rd Qtr=3/4, Biennial=2 and so on
Here are the results from your data
Lump Sum
=tadPV(5%, 2%, 10, 0, -1000000)
$513,695.15

Monthly Payment
=tadPMT(5%, 2%, 10*12, 0, -1000000, 1, 1/12, 1/12)
$4,795.73

Here is the code.
' Author: Abraham A.
' Publisher: http://thinkanddone.com

Public Function tadEFFECT(ByVal rate As Double, ByVal compounding As Double) As Double
If compounding = 0 Then
    tadEFFECT = Exp(rate) - 1
Else
    tadEFFECT = (1 + rate * compounding) ^ (1 / compounding) - 1
End If
End Function

Public Function tadFVIF(ByVal rate As Double, ByVal n As Double, ByVal compounding As Double) As Double
    tadFVIF = (1 + tadEFFECT(rate, compounding)) ^ (n)
End Function

Public Function tadPVIF(ByVal rate As Double, ByVal n As Double, ByVal compounding As Double) As Double
    tadPVIF = (1 + tadEFFECT(rate, compounding)) ^ (-n)
End Function

Public Function tadPVIF2(ByVal r As Double, ByVal n As Double, ByVal c As Double, ByVal p As Double, ByVal d As Double) As Double
Dim t As Double

t = 0#

t = (n - 1) * p + d * p
If (r = 0#) Then
    tadPVIF2 = 1#
Else
    tadPVIF2 = tadPVIF(r, t, c)
End If
End Function

Public Function pvifga(ByVal r As Double, ByVal g As Double, ByVal n As Double, ByVal type1 As Integer, ByVal c As Double, ByVal p As Double, ByVal d As Double) As Double

Dim pvifa, t, gt, remaining, aif, af1n, af1d, af2n, af2d, af1, af2, af, N0, N1 As Double
Dim i As Long

    pvifa = 0#
    t = 0#
    gt = 0#
    remaining = 0#
    aif = 0#
    af1n = 0#
    af1d = 0#
    af2n = 0#
    af2d = 0#
    af1 = 0#
    af2 = 0#
    af = 0#
    N0 = 0#
    N1 = 0#

remaining = n - Int(n)

For i = 0 To Int(n) - 1

    If (type1 = 0) Then
        t = i * p + d * p
    Else

        If (i = 0) Then
            t = 0
        Else
            t = (i - 1) * p + d * p
        End If
    End If

    If (i = 0) Then
        gt = 0
    Else
        gt = (i - 1) * p + d * p
    End If

    pvifa = pvifa + tadFVIF(g, gt, c) * tadPVIF(r, t, c)
Next i
N1 = (n - 1) * p + p * d
N0 = (Int(n) - 1) * p + p * d
If (remaining <> 0#) Then
    If (r = g) Then
        af1n = n * (1# + tadEFFECT(r, c) * type1) ^ (p * d)
        af1d = (1# + tadEFFECT(g, c)) ^ (p * d)
        af2n = Int(n) * (1# + tadEFFECT(r, c) * type1) ^ (p * d)
        af2d = (1# + tadEFFECT(g, c)) ^ (p * d)
        af1 = af1n / af1d
        af2 = af2n / af2d
        af = af1 - af2
    Else
        aif = (1# + tadEFFECT(r, c) * type1) ^ (p * d)
        af1n = tadFVIF(g, N0, c) * tadPVIF(r, N0, c)
        af1d = (tadEFFECT(r, c) - tadEFFECT(g, c))
        af2n = tadFVIF(g, N1, c) * tadPVIF(r, N1, c)
        af2d = (tadEFFECT(r, c) - tadEFFECT(g, c))
        af1 = (aif * af1n) / af1d
        af2 = (aif * af2n) / af2d
        af = af1 - af2
    End If
    pvifa = pvifa + af
End If
pvifga = pvifa

End Function

Public Function tadPV(ByVal rate As Double, ByVal gradient As Double, ByVal nper As Double, ByVal pmt As Double, ByVal fv As Double, Optional ByRef type1 As Integer = 0, Optional ByRef compounding As Double = 1, Optional ByRef period As Double = 1, Optional ByRef distribution As Double = 1) As Double
    tadPV = -fv * tadPVIF2(rate, nper, compounding, period, distribution) * tadPVIF2(gradient, nper-1, compounding, period, distribution) - pmt * pvifga(rate, gradient, nper, type1, compounding, period, distribution)
End Function

Public Function tadPMT(ByVal rate As Double, ByVal gradient As Double, ByVal nper As Double, ByVal pv As Double, ByVal fv As Double, Optional ByRef type1 As Integer = 0, Optional ByRef compounding As Double = 1, Optional ByRef period As Double = 1, Optional ByRef distribution As Double = 1) As Double
    tadPMT  = ( -pv - fv * tadPVIF2(rate, nper, compounding, period, distribution)  * tadPVIF2(gradient, nper-1, compounding, period, distribution) ) / pvifga(rate, gradient, nper, type1, compounding, period, distribution)
End Function

Answer: Using APR as defined here, and neglecting inflation for the demo calculations.
Note
To account for inflation inflate the target final value (f) accordingly.  I.e. aim for final value

Periodic investments (m) would continue to be made at the face value, unaffected by inflation.
The demo calculations
The periodic investment case assumes periodic investments up to the time that the target final value is achieved.
Answer: And to figure out the Payment for a given FV, you cannot 'reverse' the formula given (FV for a stream of payments), but have to do some guessing and iterate to refine your guesses. Binary iteration is easiest (but takes more iterations than more sophisticated iteration methods). I seem to remember that Excel does offer a 'solve by iteration' tool.
Binary Iteration: If you know that Payment is between X and Y, then try with the midpoint of this range and see which half of this range the Payment value lies within. Then try again with the midpoint of your new range. And again, and again.
FV in your case would be adjusted for inflation as 1M*(1.05)^n.
Note that there is no 'indexing' of payments to inflation in this formula.
I assume you are not just interested in the answer for the case where Interest = Inflation? Because then it would just be Payment = FV/n.
Comment: Regarding "have to do some guessing"...not entirely true I've updated the answer I gave to include the formula.
Comment: Solving for Rate requires 'guessing' but not FV or PMT. Agreed THEAO


Does Wizards of the Coast still package World Championship Decks?

Question: The most recent decks that I can find are from 2005. Are the top 4 championship decks from each year still being packaged for retail? If so, where's a good place to buy them?
Answer: Unfortunately they were discontinued (at around the time you state) for not being widely popular.  The cards could obviously not be played in tournaments and weren't even very good for casual play because of the nonstandard card backs.
A shame because I quite liked the feeling of playing a finely-tuned Pro deck too... but Wizards are just too cagey about printing anything resembling proxies of top-tier tournament cards.
Comment: They were not that popular then, but now they are at least somewhat sought after by cube enthusiasts that appreciate official proxies.


GRUB menu not loading after restart

Question: I accidentally restored BIOS on my dell Inspiron 5559 which was dual booting earlier with Windows 10 and Ubuntu-16.04. After restoring BIOS, GRUB got deleted which I repaired using 'boot-repair' .  I restarted the system and GRUB successfully loaded.  I wanted to make sure that windows was okay or not so I booted in the windows. Problem arose when I restarted from windows. GRUB was nowhere to be seen after restarting from windows. Please help!
Answer:
Get a usb with a live OS installation.
Boot into Rescue mode
Run these following commands to install grub onto your hardrive.
update-grub
grub-install /dev/sdX

After these steps you should be able to boot into grub.

GRUB menu not loading after restart


No electric current going into Water Heater

Question: We bought a brand new water heater back in November. Came home last night to no hot water.  Check circuit breaker and it wasn't tripped.  Turned it off an on anyway.  Nothing.  Hit reset button on thermostat, nothing.  Check for electric current per manufacturers instructions and there was nothing.   Put in a new circuit breaker.  Still nothing.   What else could it be?
Comment: Did you test (multimeter, voltage tester) at the water heater if there was power or not?
Comment: Yes we used the Multimeter to check for power at the water heater...that is what I meant by "check for electric current".
Comment: Did you actually check the main two black and white wires that come from the panel or did you simply test for power at an element?
Comment: I assume you mean the wire in the junction box on top of the water heater?  If so, yes.
Comment: It is possible that the new breaker could be bad. That has happened to me before. Also check for a break in the wiring by disconnecting both wires from the breaker and wire nut them together. Then go to the water heater junction box and disconnect the two wires from the heater and check for continuity through both of the wires.
Comment: Ok, I'll try that when I get home tonight.  Thanks!
Answer: Since this is brand new, and assuming you hit the red reset button on the UPPER thermostat, then it's most likely a loose wire somewhere. It might have been touching a terminal and worked for a while, but under load that loose connection over heated and burned away. One bad connection and the entire circuit is broken, so unless you know how to test for that, you can easily get a false negative reading. Here is what your entire circuit looks like.
Comment: Do you mean a loose wire in the Junction Box?  I can double check that when I get home tonight.
Comment: Anywhere in the circuit. Although Ground is not usable as part of a circuit, is it usable for testing purposes. So instead of testing line-to-line looking for 240V, test line-to-ground looking for 120V. If any wire that is supposed to be hot does not show as 120V to ground, that is the dead part of the circuit. Wherever you find that, work backward toward the breaker until you find the bad connection.
Comment: Seems quite unlikely, but it is a small possibility that both heating elements have went bad (open circuit). How many ohms do you measure across the water heater elements (nothing else in the circuit)?
Answer: If no power at the junction box and you installed a new breaker did you verify there is power on the breaker? Most water heaters are double pole you should see 240v at the 2 wires coming out of the breaker. If there is no power there it can be a bad buss. I have seen this with 2 brands FPE stab lock panels made by federal Pacific and zinsco panels. If there is not 240 at the breaker check the main breaker, if you lost a leg I would expect you to notice other circuits not working but worth a check.
Comment: There is definitely power coming from the breaker, as the water softner unit is in the same utility closet and that is working.  It is on a two-pole 30/30 circuit breaker.
Comment: Ok with power from the breaker and none at the water heater there may be a splice someplace. Are you sure the water softener is on the same circuit? I have installed a few but they were all 120v and I thought 15 amp branch circuits but my memory could be failing there. If they are on the same circuit you will need to find where the splice is a wire nut could have come loose or a broken wire would be what I would look for.


How can I wire an exhaust fan to turn on from multiple locations?

Question: I just bought a Panasonic FV-20NLF1 inline bath exhaust fan that I planned to used to exhaust 2 different bathrooms.  I want each bathroom light switch to control the fan, so when the lighting turns on in either bathroom, the fan will go on. If both light switches are off, the fan will go off.  If one light is on the fan will stay on.  Could someone share how I could accomplish this, ideally in a diagram?
Comment: As Tester101 says, if you use a separate switch for the fan (one in each bathroom) this would be quite simple. With this option, you could also use a [countdown timer](http://www.amazon.com/Leviton-LTB60-1LZ-Incandescent-Resistive-Inductive-10-20-30-60/dp/B00313JXB0/), which is a great way to control bathroom fans. They come with different time ranges: max 15 minutes is great for powder rooms (smells..) while 30 or 60 is good for humidity from showers. This keeps the fan running for a bit after the light shuts off, though you do have to remember to actually turn it on.
Comment: Do I understand that each bath will have an independent light but a common fan all on the same switch?
Comment: Is the fan large enough to adequately exhaust both rooms at the same time? Do the fan and lights have to be on the same switch, or can there be independent switches for lights and fan?
Comment: The easiest option is to install two fans, one for each room. If you need a single duct, you may be able to hook that up with dampers to prevent the exhaust from going back into the house.
Answer: I don't think it's possible to individually control two different lights while controlling a common fan using conventional house wiring devices. Powering the fan will backfeed power to the other light that was supposed to stay off. But I look forward to being proven wrong.
It can be done if both lights and the fan all go on at the same time. This is just a standard 3-way switch circuit. Alternately, wire two standard switches in parallel so one bath user would not accidentally turn off the light for the other. This can be confusing as one switch may not always turn off the lights.
To have only one light go on with a particular switch, you need a pair of single throw-double pole switches where one pole of each switch goes to it's associated light and the other pole of each switch both go to the fan. While such a switch is common in electronics, I don't know if such a device is available for house wiring.
Alternately, a double pole relay could be used to switch the fan. Either pole powers the fan, but the separate coils keep each circuit isolated from the other. Sorry I'm not illustrating this, I need to take some time to learn how to add drawings here, I know it's fairly easy. In the mean time, if anyone gets what I'm saying, feel free to add some illustrations.
Comment: I don't see why a DPST switch would be against code. The concern I'd have would be the power source. If the bathrooms are on a different breaker, you cause a potentially dangerous situation: turning off the breaker for bathroom 1 would mean that if someone turned on the switch in bathroom 2, it would energizing one pole of the switch in bathroom 1. If they're on the same breaker, or OP could run a common source for the fan to both switches, this situation wouldn't be a problem. At the VERY least (and this may be a code issue) swap in a double-pole breaker to power both bathrooms.
Comment: +1 for the single throw-double pole switch idea. That's typically used for 220v switches where you have two hots, but electrically it would work for a single hot to two activities. That said, I don't know if it's up to code, and I'm sure the next electrician would be thoroughly confused.
Comment: Also, this calls for labels: putting something like "to fan and bathroom 2 switch" on the wire would be immensely helpful to any electrician in the future.
Comment: You don't want two out of phase circuits supplying each bathroom. If both switches are on, you'll get a 220v short! In phase is better, but you have potentially cross connected circuits, a big non-no. This concept only really works at all if it all involves the same circuit. Only the relay idea would work if multiple circuits are involved.
Answer: You have one option that you could consider. Leave the existing single pole switches to control the lights in each of the two areas but remove fan wiring from these two switches. Then add a 3-way wiring setup and two switches, one at each location, to control the fan interdependent of the lights. This of course would wire the fans up using conventional 3-way switches and the two wiring travellers running between the switch locations.
This approach as a distinct advantage of allowing the use of low cost readily available components with which to implement the solution. Standard 3-way switches, electrical boxes and multi-conductor wiring is available at most hardware stores and home centers. If installed correctly it will meet your local electrical code and regulations.
Comment: This answer was migrated from an identical question.
Answer: A second option that you have is to add a pair of relays driven one each from the two lighting circuits. The relays would have coils sensitive to the AC line voltage applicable to your area. Each coil would be wired in parallel (across) the light fixtures. The output contacts of the two relays would be wired in parallel to the ventilation fan so that either light on would relay over to the fan so it would be on.
One difficulty with this approach is procuring the suitable components and then installing and packaging the solution in a safe and legal manner following all applicable electrical codes and regulations.
If you were to want to attempt to go with this relay approach I would suggest that you deploy some industrial style solid state relays that are designed to accept a wide range AC input and capable of driving the vent fan. One possible component that could be used, as pictured below, can be mounted inside the bottom of a larger metal electrical box, two side by side, and then wired appropriately. This style of component has isolated mounting holes to facilitate mounting to the electrical box and convenient screw terminals for wiring up to the lighting and fan circuits.

Here is the distributor that could supply the above pictured component.
Comment: This answer was migrated from an identical question.
Answer: I had this problem a while back - simple, use a two gang 2-way switch and wire the fan up as if it was a 2-way lighting circuit, one switch controls the fan, the other controls the light - no backfeed, fans operate when needed (client will have no automatic control however, unless you install a flush PIR in between switch and fan) Dont forget your 3-pole isolator switch however!
Answer: There are two approaches to this problem:

use dual pole switches to control the fan and each light simultaneously -- this is the best approach if the lights and fan all are on the same circuit from the panel
use a dual relay to control the fan circuit from the light circuits -- this is the best approach if the fan and lights are on separate circuits, or if the lights in each bathroom are on different circuits from each other.