What is batching in homomorphic encryption?

Question: I have been reading journals about FHE schemes and I keep encountering the term "batching". What does it mean to batch in homomorphic encryption in a simple way?
Comment: What sources did you read and what is confusing you? like this one `encrypting and
homomorphically processing a vector of plaintext bits as a single ciphertext.` from abstract of [this](https://eprint.iacr.org/2013/036.pdf) 363 times cited article!
Answer: In simple terms, batching means "encrypt many messages into a single ciphertext so that one homomorphic operation acts on many messages simultaneously".
This is typically done by representing the message space in a "tuple" format (via an isomorphism).
For instance, by the Chinese remainder theorem (CRT), we know that any tuple
$(m_1, m_2, m_3) \in \mathbb Z_2 \times \mathbb Z_3 \times \mathbb Z_5$
can be written as a single integer $m \in \mathbb Z_{30}$.
Thus, if you have a homomorphic scheme whose message space is $\mathbb Z_{30}$,
we can encrypt tuples
$(m_1, m_2, m_3)$
and each homomorphic operation will actually operate on three values.
In this scenario, you would start from $(m_{1,i}, m_{2,i}, m_{3,i})$,
then obtain $m_i$ via CRT, then encrypt $m_i$ into $c_i$.
Now, if you multiply two ciphertexts $c_1$ and $c_2$ homomorphically,
you obtain an encryption of
$m_1 \cdot m_2 \bmod 30$,
but this is actually equivalent to
$$(m_{1,1}\cdot m_{1,2}\bmod 2,
 \,m_{2,1}\cdot m_{2,2}\bmod 3,
 \,m_{3,1}\cdot m_{3,2}\bmod 5).$$
So, one homomorphic multiplication is multiplying three messages in parallel. Of course, instead of 3, you want a tuple with many entries.
Things work essentially in the same way for polynomials, i.e., you represent a tuple of polynomials of low degree as a single polynomial of high degree, then you encrypt it...
Answer: Purpose of batching
Batching is a way to improve the performance of homomorphic encryption, essentially making it faster. But it does (as far as I know) not in any way improve the security aspect of homomorphic encryption.
Homomorphic encryption is still a performance-heavy procedure (see this previous question "Why are homomorphic algorithms slow?" for further information).
As explained in the abstract of the paper "On-the-fly Homomorphic Batching/Unbatching":

We introduce a homomorphic batching technique that can
be used to pack multiple ciphertext messages into one ciphertext for parallel processing. One is able to use the method to batch or unbatch messages homomorphically to further improve the flexibility of encrypted domain evaluations. In particular, we show various approaches to implement Number Theoretic Transform (NTT) homomorphically in FFT
speed. [...] The advantage of this method is we are able to batch independent homomorphic NTT evaluations and achieve better amortized time.

Security of batching
The previously mentioned paper apparently may even decrease the level of security, while still guaranteeing some level of security. Section 6 - Implementation Results:

The security level of the experiments varies on the settings,
but each setting has at least 100-bit security.

I also found this paper "Batch Fully Homomorphic Encryption over the
Integers", where at least semantic security is apparently provided.


Differential equation of the free falling object with air resistance

Question: I'm puzzled by the result I get when I try to solve the differential equation for an object that is falling subject to air resistance. Suppose the $y$-axis is directed upwards, then $\vec{F_a}=bv \hat{y}$ and $\vec{P}=-mg\hat{y}$, where $b,v, g$ are positive. This leads me to the following equation: $$\\m\frac{dv}{dt}=bv-mg,$$ which eventually leads to $$v(t)=\frac{mg}{b}(1-e^{bt/m})$$ which is obviously an absurd result since we expect $$\lim_{t\rightarrow \infty}v(t)=mg/b.$$ What am I missing? Are the forces involved described correctly in my frame of reference?
Comment: You have missed a minus sign: Your velocity is the downward velocity ($\vec v =-v \hat y$), so there is an extra minus sign on the lhs of your differnetial equation. Then, you get $v(t)=\frac{mg}{b}(1-e^{-bt/m})$ as expected.
Comment: Uh, now I understand, thanks. One more thing: in cases where I don't know the orientation of the velocity, what should I do? Should I try both $m\frac{dv}{dt}$ and $-m\frac{dv}{dt}$ and see which one leads to a physically acceptable result?
Comment: @GabrielePrivitera the drag force is always opposite in direction to the relative velocity of the object with respect to the air.  You could use sgn(v) as appropriate.
Comment: Yes but in my last comment I wasn't talking about this specific problem, I wanted to know how to behave in general
Comment: Comment about terminology: A fall with air resistance is by definition not a free fall.
Answer: You have missed a minus sign: Your velocity is the downward velocity ($\vec v =−v\hat y$), so there is an extra minus sign on the lhs of your differnetial equation. Then, you get $v(t)=mgb(1−e−bt/m)$ as expected.
In general, you can write $\vec v= v_x \hat x +v_y \hat y$) and solve the equation of motion ($m\dot{\vec v}=\vec F$) with the appropriate boundary conditions. In your case, you assume $v_x(t=0)=0$, and so $v_x$ stays zero; for $v_y$ the main point is that you have to keep track of the relative signs between the $\dot v_y$ term and the drag force term $b v_y$.
Answer:
Suppose the y-axis is directed upwards, then $F_a→=bv\hat{y}$ and $P=−mg\hat{y}$, where b,v,g are positive. This leads me to the following equation:

The bold part is where the entire problem lies. You decided to make the positive direction of y upwards, right? But you are describing a falling motion, this means that velocity will be negative, right? But you said that b is positive, but if b is positive, then $F_a→=bv\hat{y}$ will be negative and because $v$ is negative and is being multiplied by a positive number $b$. So, the drag force will be negative, pointing in the same direction of the weight, which is incorrect.
Your equations:
$$m\frac{dv}{dt} = bv - mg$$
$$v(t) = \frac{mg}{b}(1-e^{\frac{bt}{m}})$$
Are absolutely correct, but you are using b as a positive number, so the limit doesn't converge to the terminal velocity. But assume that $b$ is negative and voila, the $e^{\frac{bt}{m}}$ converges to 0 as $t$ goes to infinity. And the terminal velocity goes to $v_{ter} = \frac{mg}{b}$. And, since $b$ is negative, again, this velocity is negative, pointing downwards as defined by your axis orientation.
So, you were correct in your equation solving, your assessment of the $b$ constant was incorrect, in your system of coordinates $b$ is negative.


Does adviser choice matter?

Question: I'm at the War Table and I want to perform a certain mission, but there are a number of advisers to send. Does it matter which one I choose? Will I get different rewards if I send Leliana instead of Cullen, does Josephine have a higher rate of success on certain missions?
Comment: One of the tutorial prompts indicated that using different advisers will have different results, but I have not verified the results for myself.
Answer: Yes, advisor choice absolutely matters. In general, the descriptions provided will give you an idea what each advisor will be doing in a given operation, as well as a mention of the rewards, if those differ.
Answer: There are some operations that can lead to long chains of additional operations if you use some advisors, but will just cut off if you use others.
For example, the Sutherland operation chain can be cut off if you use the wrong advisor.

 If you use the correct advisors, you can get a very long chain of operations (and quests) that develop a team of adventurers for the Inquisition.  Sutherland is located in the inn in Skyhold, and if you send him on operations, he ends up recruiting and gearing up a team.  He can also get his team captured during an operation, leading to a quest where you need to go rescue him.  If you use the wrong advisor, he just gets sent to the kitchen and the whole chain ends there.

Does adviser choice matter?


Patenting medicinal plants in Australia

Question: Interest in associated costs and what potentially pharmaceutical companies may pay for such patents? Also do patents generate money without selling them?
Comment: There is two questions in this so it might be better to split them. The second question is good by itself, but might not be found based on the title.
Answer: I'm not an expert in medicinal plants, so I'll address your second question about how patents generate money. First, for companies that actually make and sell things, patents are valuable in that they protect the company from competition. If you can prevent competitors, presumably you can sell more product, possibly at a higher price. Patent holders can also generate money by licensing patents. In this case, the patent holder maintains ownership but allows another company to sell product that otherwise would infringe on the patent in return for compensation. The patent owner may decide to sell the patent in return for direct or deferred compensation.
A controversial use of patents to generate money is what is often referred to patent trolling. This is where the patent is used to threaten a company with an infringement suit. The cost of pursuing a law suit is high so the company may be inclined to pay a license even if the merits of the suit favor them.
Comment: Actually patent trolling is when you don't produce anything but patents and therefore threaten others while at the same time not infringing any patents with which they could sue you back because you don't produce anything. All the trolls do is file patents and more patents and then use the broad ones to threaten anyone who might do anything that comes close to those patents
Comment: @DonQuiKong I don't think what I wrote contradicts what you are saying. One could argue that some large companies (which I'm not going to name) threaten other companies with patents they are either not using or which really aren't being infringed upon. The idea, is that with the cost of a court case is so high (and the possibility of losing even when you shouldn't) there is an inducement to settle.
Comment: Yes, I just narrowed your claim ;) with many big companies you can use your own patents as a defense, not so against trolls
Answer: Patenting plants in Australia
Unlike most countries, there is no general prohibition in Australia of patenting plants1. Rather, all Australian standard patents (that is, ignoring innovation patents) must fulfil the usual criteria for patentability, regardless of their subject matter. Notably, the claimed invention must be novel and involve an inventive step2.
If you have discovered a naturally-occurring medicinal plant, this is not novel per se. That is, the plant has existed well before your discovery.
However, you may have discovered a use of the plant for the treatment of a disease, or a method of preparing the plant into a medicament, or something of that nature. As long as this part is novel and involves an inventive step, you could well receive a patent for your discovery (but still not the plant itself).
Alternatively, if you have bred a plant such that it is a new variety, you may be able to receive a patent for the plant itself. Alternatively, if your variety is distinct, uniform, and stable, you would be entitled to apply for plant breeder's rights3.
Costs
Like with any patent application, this differs significantly based on the nature of your invention, who your attorney is, and how prosecution goes. So it could be anything from AUD 2000–20000.
What would a pharmaceutical company pay for a medicinal plant patent?
This is impossible to answer in general terms. 0 would be pretty typical, I suspect. But could be millions (or billions?) for the right one.
Do patents generate money without selling them?
No: a patent does not inherently produce any income. Indeed, they cost money to maintain.
The only ways to make money from a patent are:

Exploit your monopoly by selling the patented products safe from competition.
License your patent to others to exploit.
Sue other parties for infringement of your patent (or agree not to sue in return for a payout).
Sell the patent (or ownership in an entity that controls the patent).

1. Grain Pool of Western Australia v Commonwealth [2000] HCA 14 [48].
2. Patents Act 1990 s 18(1).
3. Plant Breeder's Rights Act 1994 s 43(1).

Patenting medicinal plants in Australia


Is petroleum a valid explanation of why the U.S. military fought the first Iraq war?

Question: Why couldn't the U.S. have bought petroleum from Iraq after they took control over Kuwait's oil supply?
Comment: Let's say you have a favorite taco truck. You buy tacos from that truck often on your lunch break, at least once or twice a week. You're friendly with the taco merchant, they recognize you, you exchange pleasantries. One week, employees of a nearby Taco Bell violently expel the taco merchant from their truck, leaving them bloody on the pavement, and these employees carry on selling tacos from the truck. Why can't you keep buying tacos from the truck?
Comment: Last sentence puts oil as the only alternative motivation to the WMD pretext. You don't consider in your question that there may be many other reasons for the war. Strategical control over the wider region? Big money for the defence sector? The intention to destabilise countries not directly control? We don't know what was their plan, but assuming either or is too simplistic.
Comment: The title mentions the first Iraq War, but the body of your question mentions the second Iraq War. Can you specify which one you're asking about? If it's the second one, then [there's already a question that answers that](https://politics.stackexchange.com/q/1571/20220).
Comment: @F1Krazy Primarily the first Iraq war
Comment: @FluidCode Maybe using "or" was admittedly poor word choice. Do you have another theory though?
Comment: @PineappleThursday No I don't have a theory, I can't access any more information than any other simple citizen and I understand that most theories and conspiracy theories out there are all false and well designed to add confusion to confusion.
Comment: I removed the reference to the 2nd Iraq War, as it seems like it's not really relevant to the question or answers. If you do want to ask about the second Iraq war, maybe create a new question so as not to invalidate these answers
Comment: I thought the first war was fought because Iraq invaded Kuwait.
Answer: Why couldn't the U.S. have bought petroleum from Iraq after they took control over Kuwait's oil supply?
Part of the reason for the quick international action on Kuwait during Gulf War 1 was that the West was worried that Iraq could then menace the Saudi oil fields as well, which would have given them a huge leverage over the global oil markets (by controlling their own, Kuwait's and Saudi Arabia's).  And would also have made staging the Kuwait liberation force much harder.
(Aug. 8, 1990, 7 days after invasion):  BUSH SENDS U.S. FORCE TO SAUDI ARABIA AS KINGDOM AGREES TO CONFRONT IRAQ

The American troops and planes being sent to Saudi Arabia tonight are intended to be part of a broad international force designed to deter an Iraqi attack on Saudi oilfields and to intimidate President Saddam Hussein of Iraq.
The first United States contingent is not large enough to take on the million-member Iraqi Army. More than 100,000 Iraqi troops are in Kuwait. But Pentagon officials said the force could be considerably augmented if the need should arise.
The move ordered by President Bush is plainly intended to demonstrate that any Iraqi attack on Saudi Arabia would mean a direct confrontation with the United States, a confrontation that would bring the full weight of American military force against Iraq from bases around the world and aircraft carriers deployed in the region.

So, no, "business as usual" wouldn't be very applicable here.  And there is also a big difference between buying oil from an "unfriendly" government that took over its own country (Iran, Venezuela) and rewarding one that stole that oil from another (Iraq).
Comment: Unfortunately I don't have any source, just my memory, but I well remember that after invading Kuwait Saddam asked to open peace talks implying that he was ready to withdraw in exchange for something. But the then president, Bush senior flatly denied any possibility to talk.
Answer: I don't think capturing the oil was a motivation for the US at all, but the oil markets played a big part in many of the events surrounding the war.

After the invasion of Kuwait by Iraq took place in Jul 1990, oil prices spiked, reaching a peak in Sep 1990. Historical price chart - note, it is adjusted for inflation. Nominal prices were in the $10/barrel range prior to the Kuwait invasion.

The pre-invasion oil price was not considered remarkable, but after the invasion people in the US became concerned (vague personal recollection, was a child). News programs would make references to the 1970s oil crisis.

Whether by coincidence or not, the US economy went into a recession at exactly the same time, beginning August 1990. It would eventually cost GHW Bush his re-election -- Clinton's unofficial re-election slogan was "It's the economy, stupid" two years later. This put pressure on the White House to "do something".

Yet another oil angle was OPEC and how the US-OPEC relationship fit into the cold war. The power of OPEC had waned in the 1980s. The same oil chart above shows a big fall in the oil price in 1986, which put pressure on the USSR. However, in 1990 it was not yet suspected that the cold war would end the following summer. The connection to Iraq and Kuwait was the possibility of consolidating the power of OPEC, i.e. by controlling Iraq and Kuwait, and the mere possibility of intimidating Saudi Arabia. This may have been one of the factors in the price spike, although fears of the shooting in the oilfields were probably also in play. I found it interesting that the price chart actually comes down during Desert Shield and the peak already clearly passed when Desert Storm begins.

Last but not least, the US had a high priority relationship with Saudi Arabia, as the most important individual oil producer. While Kuwait may or may not have been expendable, as the OP question suggested in early edits, I suspect threatening the desert kingdom was a serious transgression, despite by the loose standards of behavior that were applied to countries then receiving US support. (Recall Iraq was supported by Reagan-Bush during the Iraq-Iran war in the 1980s)
Answer: I suspect that oil was pretext more than context in the first Gulf War. Had Iraq successfully annexed Kuwait, it would have had minimal impact on global oil markets, and the regional power balance would have shifted only slightly. Kuwait has always been a fairly minor player, and Hussein's regime was a major one; the other oil producing states would have complained, but it likely wouldn't have gone past sanctions and diplomatic snubs.
As I see it, the real motivating factor behind the first Gulf War was more geopolitical. The Soviet Union had collapsed two years prior, and the HW Bush administration was facing an existential question of how to justify the exorbitant US military industrial investments without another super-power as an opponent. One idea was to turn the US military into a kind of global police force that could unilaterally intervene in regional conflicts. The Gulf War and the invasion of Panama were (arguably) test cases for the policy. There's some evidence, in fact, that the Bush I administration indicated that the US had no interest in Iraq/Kuwaiti disagreements — ostensibly prompting Hussein to undertake the invasion — before turning around and beginning the war.
Comment: Please cite sources on your first assertion, that it was to justify the military industrial complex and not for oil. Re. the ambassador, it would help if you remembered, or at least mentioned, the context:  Iraq had been accusing Kuwait of side-tapping wells into Iraqi *oil* fields.  The ambassador was widely assumed later to have indicated a lack of US interest in arbitrating *that* dispute, not giving the green light for an *invasion*.   No one, in the West - the Kurds & Iranians would have differed -  really expected Saddam to be that loony at the time.
Answer: In addition to what Italian Philosophers 4 Monica said, there is also the matter of the Petrodollar.  With control of Kuwait's oil fields, and especially if they can threaten Saudi oil production, Iraq could start selling oil for currencies other than USD.  The American economy is heavily-reliant on USD being the reserve currency of the world; demand for USD staying high allows the issuance of Federal bonds at much lower interest rates than other countries with other currencies can.  Further, a strong dollar keeps imports cheap, and a massive percentage of consumer goods are imported.  If any country is allowed to sell oil for anything besides USD, the bottom falls out of the US economy.  Inflation will go through the roof as all those dollars that used to be needed to buy oil are suddenly not so necessary.
Basically, its not just the oil itself at stake, but also the entire US monetary system.  Even if Iraq was not planning to do this, the risk that they could was just too great.
Comment: That didn't happen until [the current century](https://www.theguardian.com/business/2003/feb/16/iraq.theeuro). The 1991 war predated the main plausible alternative currency, as far as I know. Prior to the Kuwait invasion, Iraq was a US ally, most notably in the Iraq-Iran war, and there wasn't any long standing antagonism that was widely publicized.
Comment: @PeteW Oil had been pegged to USD since 1975.  Iraq would not need to sell oil for another currency, they could trade it directly for gold if they wanted.
Comment: Perhaps, but I don't believe avoiding dollar markets was on Iraq's agenda at all in 1989-1990, when the tensions with Kuwait were building up.


Why are hard drives not limited to sizes of a power of 2?

Question: For example, hard drives can be 320GB (between 2^8=256 and 2^9=512) in size, whereas memory appears to be limited to sizes of power of 2.
Comment: Memories are not limited to powers of 2. It's just the address space is limited to powers of 2, as it is composed of N bits, giving 2^N possible addresses which don't really have to be there.
Answer: The answer to this is hinted at in a similar question on Superuser.
In short:

Memory DIMMs connect directly to the CPU.
There are usually multiple memory modules (but there can be only one).
Multiple modules combine to make one linear address space, e.g. 0-8GB.
Memory is accessed directly by the processor, which has special hardware to speed up access.

Therefore it is advantageous to tie memory access to dedicated hardware that can quickly switch between multiple modules. By using powers of two it's possible to build dedicated circuitry in the easiest manner.
In contrast:

Hard drives do not connect directly to the CPU.
Hard drive volumes are not typically addressed directly. There is a file system and maybe other logical abstractions like LVM, RAID, etc.
Even in configurations where multiple drives are used (e.g. striped RAID) you never read "off" the end of one disk and into another. Multiple drives do not combine into a linear address space.

Therefore it makes little sense to tie hard drive sizes to a power of two. Access to the raw hardware is already slowed slightly by lots of other factors, creating fancy hardware optimised to a power of two is not going to help.
Answer: Hard drives consists of plates, each with circular tracks, each filled with sectors. Number of tracks is limited by radius of the drive, number of plates is limited by heigh of the drive and number of sectors on track is limited by how many you can reliable write and read on such size. (more or less, now it is much more complicated, but who cares).
Any of the above is not related to the power of two, so the result of multiplying is usually also not a power of two.
As for memories, they are also not limited to power of two, but they anyway usually are produced such, that the capacity is the power. It is related to the fact, that you have to address the memory by memory lanes (wires), which can be just on or off, so the limits for memory was set on the number of wires before, and with newer protocols it is still related to the length of possible address, which is power of two, as it is binary number. The memory itself just cannot exceed the limit, but can be smaler. The main restriction here is, how many silicon you are willing to use and how good technology you have. As internaly it would do a lot selecting based on the power of two too, it makes sence to use some "rounded" number - some power of two - to use all the gates optimally and not have problems with alignment and with detecting, if address is or is not in reachable range - if the address is not longer then your internal bus (which is power of two), then it fits, if is longer, it is out - totally simple logic and many times also make impossible by construction to address more, than exists inside.
As silicone is cheap (relatively) and the complexity does grows with wider busses mainly, it is better to use the power of two as your memory size, than any other number. So nearly any manufacturer does that.
Also for programs/OS/whatever is more easier to use memory going from zero without spaces to some multiple of power of two (actually to small multiple kilobytes, megabytes, gigabytes etc).
Answer: Disk drives have serial data on moving media, and there is no requirement in serial data access that the start and stop of the data be reached by
dead-reckoning.  So, you don't need to know the address beforehand, just
know how to recognize it when you pass it (after you pick the right
track on the disk, anyhow).  Directions to find data on a hard disk
are something like 'look on platter four, the 220th track from the
center, and find the sector labeled '0x333'.
Other than knowing one disk from another, some limited number of bits to select the platter and track (those are 'cylinder' addresses), and another limited number of bits to find the sector, your addressing is free-form.  Nothing
is lost if a sector or block tests bad, one can just move the
sector labels around to a good spot on the disk.
For random-access (RAM), however, it is a programming and hardware imperative
that some address-format be immediately presented by the CPU and
recognized by the RAM memory bank, and cell within that bank, and it
has to be done in HARDWARE for speed.   So, 64-bit CPUs think some sizeable
chunk of address space is their contiguous working storage.   It all
has to be there, reporting back data (or accepting written data) with
minimal delay.  The poor memory controller has to know how to make a solid
wall of data out of the 'bricks' of contiguous storage of its DIMMs.
It does this, because the DIMMs all come in standardized sizes.
The power-of-2 limitation on memory module sizes means that the memory
controller's hardware can easily remap addressing of a mixture of modules into a
contiguous physical-address region in the 64-bit memory address space.


Word to Describe One Who Speaks Politely but with Conviction

Question: Imagine you are at a debate on a controversial topic. One of the speakers presents her case straightforwardly and with conviction; there is no doubting her stance on the issue. At the same time, you are struck by how politely and tactfully she addresses this divisive topic. Is there a single word that might describe such a combination of traits?
Comment: I think **Aplomb** might be the closest to what you are asking for. _'She debated the controversial issue with great aplomb.'_
Comment: These are two different qualities. It's kind of like asking for a single word for someone who is courageous and humble. Why must it be one word?
Comment: @JoeDark Yes, 'aplomb' indicates that she did it with self confident assurance. It doesn't actually mean 'with conviction', nor does it directly imply 'tactfulness', but I am sure that to do both of those at the same time, one would need to demonstrate 'aplomb'.
Comment: @medica I think this combination of qualities is rare, but not mutually exclusive. Perhaps I could dial "conviction" back to "certainty" and "tactfully" back to "respectfully".
Answer: This is what psychologists call assertiveness. Here's how wiki starts its entry:

Assertiveness is the quality of being self-assured and confident
  without being aggressive. In the field of psychology and
  psychotherapy, it is a learnable skill and mode of communication.

However, not all general-purpose dictionaries are up to date and seem to define assertiveness in an opposite way. Here's what The Free Dictionary says:

Inclined to bold or confident assertion; aggressively self-assured.

Merriam-Webster is sort of treading a middle course:

[D]isposed to or characterized by bold or confident statements and
  behavior


Is there a way to mirror two severs on Ubuntu?

Question: I was wondering if it's possible to mirror two servers, like you could upload files to one server and they'd push to the other server, etc. I'm more curious to file mirroring, it doesn't have to mirror package management and setup (But that'd be cool too!)
Comment: File Mirroring: Gluster or DRDB; Website mirroring: Varnish or HAProxy; DB Mirroring: MySQL Circular Replication, or Postgres Replication.; - Most server packages have a cluster operation mode, or there's reverse-proxies that allow you to do that.
Answer: It depends very much on the job at hand.
Why do you need file mirroring. Do you want to update something like a website or content repository where it's usually okay to update periodically. Or do you need real time synchronization of data?
For periodic asynchronous mirroring of files it is usually sufficient to have a Staging Area that you upload all your data to. And from where you distribute it to the Servers.
In your case - with two servers - you could create some staging fileshare on srv1 to where you transfer the data (via FTP, NFS, DAV, SFTP, etc.) and then have a cronjob rsync the files to the "live" directories of srv1 and srv2.
The easiest way to use rsync in that case is to generate a ssh keypair that you will use for data transfers and which is authorized on all servers in your cluster.
Example:
srv1:/data/staging/  <= is where you upload your data
srv1:/data/production/ <= is where your servers get their production data from
srv2:/data/production/

srv1$ cat /etc/cron.d/syncdata.cron
=====
*/5 * * * * syncuser rsync -a --delete /data/staging/ /data/production/
*/5 * * * * syncuser rsync -az --delete -e ssh /data/staging/ srv2:/data/production/
=====

This should give you a basic idea. Of course you would want to wrap the rsync calls in some scripts and implement a proper locking so that it doesnt run twice in case the sync takes more than 5min, etc. Also, it goes without saying that a staging area is not mandatory. You might as well sync srv1:production to srv2:production directly. Just than srv2 might show data that is up to 5min older than that of srv1. Which might be a problem, depending on how you balance between the two.
Another way to asynchronously distribute files is to package them as rpm or in your case deb files. Put these in a central repository and have them install/update via something like cfengine, monkey or some diy message bus based solution. This has the nice side effect of versioning of deployed data but is only suitable for smaller amounts of data that you produce and deploy yourself (like versions of your own software). You wouldn't wanna distribute TBs of data with this and also it's not suited to mirror content that changes with a high frequency, like every other minute or so.
If you need to replicate data in near realtime but not necessarily synchronous instead of calling a cron every so often you can use some inotify based method like the already mentioned incron to call your sync scripts. Another posibility is to use Gamin (which also uses inotify if present in the Kernel) and write your own little sync daemon. Last but not least, if all the files are uploaded to one server via e.g. SFTP you might check if your SFTP Server allows you to define hooks which are called after certain events, like file upload. That way you could tell your Server to trigger your sync script whenever new data is uploaded.
If you need real time synchronous mirroring of data a cluster filesystem might be in order. DRDB has already been named. It is very nice for replication on the block level and often used for high available MySQL setups. You might also wanna take a look at GFS2, OCFS2, Lustre and GlusterFS. Though Lustre and GlusterFS are not really suited for a two Server setup.
Comment: DRBD looks nice. Is it bad to use this with one server being live? Like how would it affect the live server?
Comment: Depends - what is the live Server doing? Is it a webserver, database server, fileserver, etc.?
DRBD does synchronous replication, with all the implications that come with it. Depending on if you plan to go Single-primary or Dual-primary certain I/O caching (and filesystem) restrictions will apply which in turn affect your applications. For details I suggest reading the DRBD User's Guide http://www.drbd.org/users-guide-emb/ which is very well written and explains all the implications in great detail.
Answer: Basically you have 3 possibilities:

Let your application push the files to both servers.
Asynchronous replication, e. g. rsync every 15 minutes (or less) with a cron job
Synchronous replication on file system (e. g. GlusterFS) or block device level (e. g. DRBD). If you use replication on block device level, you need a file system which supports distributed locking (e. g. OCFS2 or GFS2) if you want to have r/w access to the files from both servers at the same time.
Answer: cron + rsync = mirrored directories/files
Answer: Depending on your specific use case - You could use something similar to DRBD http://www.drbd.org/
Answer: If you are trying to build a backup solution here (which I have personally done in pretty much the same setup) be carful. There are many diferent thigns that you need to backup against, one of (arguably the) biggest being accedental deletion -- any live replication system will just replicate the deletion, and provice no safety. For this daily replication works, but is a pretty weak answer. Try RSnapshot.
Unison may well work for you, but I have no personal experiance.
Running Rsync in both directions with the aproprate flags can work, but it has the rather tricky issue of how to handle deleted files, without special handeling, it simply restores the files, which is fine if you never delete anything like me, but a bit poor otherwise. It also does odd things if a file is moved.
Whatever you are doing, if any situation can arrise where files can be simultaiusly be edited at both ends, you have a problem. unison is the only solution i know of that can handel this even close to satisfactorally.
Comment: Note that the loops mentioned below will not be a problem with Rsync, as it maintains the modify dates of the files it transfers if set correctly.
Answer: If it is one-way (I mean, always from one server to one other server, but not viceversa) you could use incron. It is like cron but based on filesystem events.
Everytime a file gets created or changed, it will trigger a scp or rsync to the other server.
Bi-directional has the problem of loops :).
Answer: it depends on your needs..... i have a very "cheap and easy" setup for clustered webservers.
i simply have one "fileserver" (NFS) where all the webservers mount the following dirs:
/etc/apache/sites-enabled
/etc/apache2/sites-avaliable
/var/www

dead simple and working
Answer: clonezilla can also looked at which uses rsync
Comment: Not sure clonezilla's applicable here... though, it is a nice utility.


Exhaust fan and light on same switch

Question: I want to add an exhaust fan to my bathroom. Do I run power from the light switch to power the fan or do I run power from the light box. Thanks as of now there is a single pole do i use a double pole switch?![enter image d)
Comment: Can you post photos of the insides of the existing boxes please?
Comment: My wording is wrong I basically want to add the exhaust fan and have the light and the fan on the same switch so they come on at the same time
Comment: The existing wiring may decide what you do depending on your ability's and if you can pull new wiring. The easiest method would be to add the fan to the light. But as others have said then the fan only works when the light is on. To provide how to do it we would need to know where the feed for the light is. Is it in the light or at the switch.  If there is only 1 cable with 2 wires and possibly a ground at the switch location the feed is at the light, multiple cables at the switch the feed probably at the switch. Adding a second switch will require adding a new cable unless there is a spare.
Comment: I dont mind the fan working with the light as this is a bonus bathroom with not much use.
Comment: It depends on how the wiring is arranged now.  "From the light" is safer.
Comment: Is the existing light a ceiling fixture, or a wall-mounted vanity light or sconce?
Comment: I got it fixed thanks I just ran wire to the fixture
Answer: Answer from the UK but the principles should apply wherever.
You usually want switched live, permanent live and neutral (+ earth) going to the fan via a three-pole isolating switch. The permanent live is optional but lets you use a fan with a timer or humidistat that runs even when the light is off. The switch allows you to work safely on the fan without turning off power to the entire house and lets you turn it off temporarily if the fan ever breaks while still being able to use the light. The isolator would typically be located high up on a wall or in the ceiling, out of reach of bumps and splashes, and less intrusive visually.
Comment: Usually one turns off power at the breaker, not the switch, before working on wiring at a fixture. It's _way_ too easy for you (or someone else) to bump the switch or turn it on out of habit to rely on just the wall switch to prevent electrocution.
Comment: Fair enough. However, I see no indication that the OP is in the UK. (Well, I didn't click through to read his profile...)
Comment: @FreeMan in the UK the isolator switch for the fan is typically located in the ceiling or high up on a wall somewhere between the light switch and the fan. Some of them can even be locked for extra safety. The situation you describe won't happen.

Exhaust fan and light on same switch


OpenVAS certificate

Question: I have an error when trying to rebuild my openvas database that appears to be caused by a certificate problem. I'm out of the usual debugging I'd so and I'm at a loss as to what is going on.
Here's the command I wanted to run.
server# openvasmd --rebuild --progress
Rebuilding NVT cache... failed.

Checking openvasmd.log I find the following, indicating I need to update my certificates.
lib  ... openvas_server_verify: the certificate is not trusted
lib  .... openvas_server_verify: the certificate hasn't got a known issuer

On double checking the commands I rebuild the server and user certificates with the following:
openvas-mkcert -q -f
openvas-mkcert-client -n -i

The server cert files it creates all show today's date and time. The four files that it creates all show today's date and time.
/var/lib/openvas/CA/cacert.pem
/var/lib/openvas/private/CA/cakey.pem
/var/lib/openvas/CA/servercert.pem
/var/lib/openvas/private/CA/serverkey.pem
I restarted the manager daemon using strace to be sure that these certificates are right.
server# strace -f -e open openvasmd 2>&1 | grep pem
open("/var/lib/openvas/private/CA/serverkey.pem", O_RDONLY) = 4
open("/var/lib/openvas/CA/servercert.pem", O_RDONLY) = 4
open("/var/lib/openvas/CA/cacert.pem", O_RDONLY) = 4

I then checked that the server certificate is indeed valid:
server# openssl verify -CAfile /var/lib/openvas/CA/cacert.pem /var/lib/openvas/CA/servercert.pem
/var/lib/openvas/CA/servercert.pem: OK

By all rights this should be working. What is going on?
Answer: Execute this:
openssl verify -CAfile /var/lib/openvas/CA/cacert.pem /var/lib/openvas/CA/servercert.pem

openssl verify -CAfile /var/lib/openvas/CA/cacert.pem /var/lib/openvas/CA/cacert.pem

openssl verify -CAfile /var/lib/openvas/CA/cacert.pem /var/lib/openvas/CA/clientcert.pem

And the solution is:
openvasmd --modify-scanner $(openvasmd --get-scanners) --scanner-ca-pub /var/lib/openvas/CA/cacert.pem --scanner-key-pub /var/lib/openvas/CA/clientcert.pem --scanner-key-priv /var/lib/openvas/private/CA/clientkey.pem

Comment: Thanks, this solution worked for me. The EPEL RPM package paths are a bit different though. Certs are stored in /etc/pki/openvas/CA, keys in /etc/pki/openvas/private/CA. So the command that I used was:

`openvasmd --modify-scanner $(openvasmd --get-scanners) --scanner-ca-pub /etc/pki/openvas/CA/cacert.pem --scanner-key-pub /etc/pki/openvas/CA/clientcert.pem --scanner-key-priv /etc/pki/openvas/private/CA/clientkey.pem`

OpenVAS certificate


What are some good resources for building a voxel engine?

Question: What are some good resources (tutorials, code, papers, etc.) for learning about voxel rendering?
Answer: I recently did some experimentation with voxels for rendering terrain, with support for overhangs. I pretty much used these articles to build my prototype:

This GPU gems 3 chapter on generating procedural terrain on the GPU. Even though my solution was CPU based (I work with shader model 3, so I couldn't reuse any of their shaders). There's a lot of good information buried in here!
The Wikipedia entry on the marching cubes algorithm. Great set of references, such as to this site that has a good pictorial overview on how things work.
For any procedural work, you're going to need a good noise library like Lib noise. There are also C# equivalents for Lib Noise.

Something to look out for, I could never get normal generation to work correctly once I had generated a mesh from my voxels. If anyone can give any pointers for this, I'd be grateful.
Answer: Here is a 10 year old tutorial that goes pretty deep into Voxel rendering as a technology. It's still a good read.
Comment: This article doesn't exists anymore.
Answer: This paper by Jon Olick is pretty interesting:
http://s08.idav.ucdavis.edu/olick-current-and-next-generation-parallelism-in-games.pdf
And those two forum threads about it:
http://ompf.org/forum/viewtopic.php?f=3&t=904
and:
https://mollyrocket.com/forums/viewtopic.php?t=551
It gives you a nice overview about how things could be done in a modern voxel engine.
Comment: 2nd link appears to be what is now a browser addon (possibly malicious) and the 3rd link is dead. Just wanted to warn people before they bother clicking :)
Answer: I work on an open-source voxel library called PolyVox which has some good documentation for the technology. Also linked at the bottom of our documentation page is a chapter of 'Game Engine Gems Volume 1' on volumetric representations in games via Google Books.
Answer: Check this Stackoverflow post for links to Voxel libraries.
I'm also developing a renderer based on voxel raycasting.
I developed an out-of-core voxelizer and SVO builder and published paper and code here.


Save/load position of image

Question: I have a little problem with saving a position for my image. I have action in my app which animate image to the certain position. I want to save this position for the image and shut down app and then when I open app I want found the image into the position when I save it. How can I do this?
Answer: Save it in a file, the first number is the x-coordinate, an the second the y-coordinate ;)
The first line for x and the second for y.
You will have just to parse either String to int.
EDIT
<code>    // Saving....
    DataOutputStream dos;

    try {
        dos = new DataOutputStream(
                new BufferedOutputStream(
                        new FileOutputStream(
                                new File("myFile.txt"))));
        dos.writeInt(678); // x-coordinate
        dos.writeInt(239); // y-coordinate
        dos.close();

    } catch (FileNotFoundException e) {
        e.printStackTrace();
    } catch (IOException e) {
        e.printStackTrace();
    }
    // Loading....

    int x, y;
    DataInputStream dis;

    try {
        dis = new DataInputStream(
                new BufferedInputStream(
                        new FileInputStream(
                                new File("myFile.txt"))));

        x = dis.readInt();
        y = dis.readInt();
        dis.close();

    } catch (FileNotFoundException e) {
        e.printStackTrace();
    } catch (IOException e) {
        e.printStackTrace();
    }
</code>
Comment: Can you specify it please?

Save/load position of image


Which physically acceptable quantum interpretations do not require the existence of any observer at all?

Question: Some interpretations of quantum mechanics — like the Copenhagen interpretation in particular — require the existence of an observer. The role of the observer is a bit mysterious. After all, observers are not needed in classical mechanics. Which physically acceptable interpretations of quantum mechanics do not require the existence of any observer at all? By that, I mean they would continue to make sense even in the absence of any observer. The many worlds interpretations appears to require an observer to subjectively determine which branch is selected.
Comment: That is in itself an interpretato, @lubos, the observer dependence in many worlds is no worse philosophically than in classical mechanics.
Comment: This video has a recipe for anyone who doesn't find QM (and QED) sufficiently psychologically easy and philosophically pleasing: http://www.youtube.com/watch?v=iMDTcMD6pOw
Comment: I challenge you to *really* convince yourself that you can describe any theory of Nature without including the role of an "observer". This is not a quantum thing.
Comment: Dear Kenneth, classical mechanics may be thought of as a description of a "real world" that exists independently of observers, but quantum mechanics cannot. That's why it's quantum mechanics. If it were describing an objective world, it would be classical physics. So every correct "interpretation" of quantum mechanics agrees with the fact that it is a tool to give probabilistic answers to well-defined questions chosen by observers, according to some logical scheme. It is not a description of a objective world that exists independently of observers.
Comment: Well, MWI is an ill-defined framework and no one agrees what it is exactly supposed to mean. But if you have a version of MWI which makes physics as observer-independent as classical physics, then you should call it a classical theory, and it can't be a valid description of the world around us which is not classical. It is not equivalent to any classical theory. Every picture that tries to "reinterpret" quantum mechanics as an objective, observer-independent description of some objective reality is classical and wrong whether or not it is "philosophically pleasing" to anyone.
Comment: It would be interesting to know what Feynman would pick out as the most interesting developments in Physics since Luboš' choice of video was recorded. Perhaps sadly, except that it's in the nature of things and perhaps we should just accept it, we have to pick out what is interesting for ourselves.
Comment: @Luboš Motl However, does this mean that the "observer" has to be treated ontologically as a separate thing from the rest of the universe? But how can you do that if you accept say "materialism" that all observers are just made up of quantum particles like everything else? Does this mean materialism is wrong, there is actually a fundamental difference between "humans" and other things in the "universe"? That we need to introduce religious, spiritual, mystical etc. type non-materialistic concepts that set humans apart from the universe in their nature? Or can you have QM + materialistic monism?
Comment: Mike, who is observer and who isn't - where is the dividing line - is a subjective thing. The word "ontological" may mean various things but if it involve "objective" i.e. a unique dividing line for everybody, it's simply wrong. "Materialism" can mean many things but if it postulates that the laws of physics may be applied without a subjective division of the world to the observer and the rest, then this materialism is indeed wrong. If you  want to call quantum mechanics religious, be my guest. Nature is religious in this sense. Nature is whatever She is. You can't "order" Her to be something.
Answer: For the Penrose interpretation, quoting Wikipedia:

Penrose's idea is a type of objective collapse theory. For these theories, the wavefunction is a physical wave, which experiences wave function collapse as a physical process, with observers not having any special role.

You can check more about objective collapse theories here, and more about the referred Penrose interpretation here.
Also, the Wikipedia article on the double-slit experiment slightly mentions about the novel experiments that goes on the corners of the measument problem and the wave-particle duality. For this you should look for "Unsharp particle-wave duality in a photon split-beam experiment", "Simultaneous wave and particle knowledge in a neutron interferometer", "Afshar experiment" and other related experiments and its critiques.
Also, quoting Heisenberg on "Physics and Philosophy":

It applies to the physical, not the psychical act of observation, and we may say that the transition from the 'possible' to the 'actual' takes place as soon as the interaction of the object with the measuring device, and thereby with the rest of the world, has come into play; it is not connected with the act of registration of the result by the mind of the observer. The discontinuous change in the probability function, however, takes place with the act of registration, because it is the discontinuous change of our knowledge in the instant of registration that has its image in the discontinuous change of the probability function.

Which may give you another view for the term observer.
Also, Feynman says on his Feynman Lectures on Physics:

You do add the amplitudes for the different indistinguishable alternatives inside the experiment, before the complete process is finished. At the end of the process you may say that you "don't want to look at the photon". That's your business, but you still do not add the amplitudes. Nature does not know what you are looking at, and she behaves the way she is going to behave whether you bother to take down the data or not.

and later on:

If you could, in principle, distinguish the alternative final states (even though you do not bother to do so), the total, final probability is obtained by calculating the probability for each state (not the amplitude) and then adding them together. If you cannot distinguish the final states even in principle, then the probability amplitudes must be summed before taking the absolute square to find the actual probability.

When he says, "Nature does not know what you are looking at, and she behaves the way she is going to behave whether you bother to take down the data or not", I think he's ruling out the common sense for observers.
Comment: I tried to find Feynman quotes where he says "Nature knows" on my Lectures copy, but could not, [thanks @terry-bollinger](http://physics.stackexchange.com/a/22490/7819)
Comment: It is not interpretation, it is a theory (and rather fringe one). -1 for proposing a theory as an interpretation.
Comment: @Anixx well, it has been some years for this -1 but, I don't get which one you're exactly referring to, if it's Penrose's, so should that wikipedia section be removed altogether? (since it's named "Penrose interpretation")
Comment: it is named incorrectly. It is not an interpretation.
Comment: Penrose's idea is logically a complete rejection of QM, of course not in how well it works, but rather as QM then becomes - similar to Newton vs Einstein's gravity - a 'mere' approximation to another theory.
Answer: Well if such interpretation existed it would be useless because it would be unable to make  predictions for observations by any existing observer.
That said, you correctly noted the many-worlds interpretation. While it needs observers to explain observations, it still has a concept of so-called "universal wave function", a wave function of the entire Universe, that does not correspond to any observer and which undergoes unitary evolution from the very beginning of Universe. The problem with it is that nobody ever can measure it :-) It is just postulated that Universal Wave Function exists, but it is unobservable and at best corresponds to an infinitely distant (in both space and time) "observer".
Moreover. In this work it was shown that universally valid theory is impossible. That is however good a theory is invented the observer could not use it to predict the future of a system that contains himself. This result means that however well a theory predicts future of any observed external objects, the observer himself is excluded from normal application of the theory's laws. As the whole universe inevitably includes the observer himself, this means that no theory can be used predict the future of the universe as a whole because inevitably there is a point in the universe where the theory's laws are broken.
Answer: There is always an observer in the sense that someone has to decide what experimental apparatus to construct, what data to collect, what statistics or other multivariate functions of the data to construct from that data, and what theoretical model to compare the data to. That was and is equally true of classical Physics as it is of quantum theory.
There are as many Copenhagen interpretations as there are people who've written about what it is. A recent paper by James R. Henderson, "Classes of Copenhagen interpretations: Mechanisms of collapse as typologically determinative", Studies in History and Philosophy of Modern Physics 41(2010)1–8, doi:10.1016/j.shpsb.2009.08.001 (sorry, I couldn't find a non-paywall version to link to), discusses three people's approaches,

"Visions of the theory from von Neumann, Heisenberg, and Wheeler offer
  different mechanisms to break the continuous, deterministic,
  superposition-laden quantum chain and yield discrete, probabilistic,
  classical results in response to von Neumann's catastrophe of infinite regress."

On the second page, Henderson suggests that, for a measurement to happen,

"Heisenberg and Wheeler merely need macroscopic objects, a measuring
  device and a record of a measurement, respectively, and von Neumann
  invokes the human mind to accomplish the task."

One can take issue with any such classification of the evolving history of the Copenhagen interpretation over the last 80 years, but in relation to your Question I suggest that there is enough to justify a claim that some varieties of the Copenhagen interpretation do not require an observer.
On another front, one of the claimed advantages of the de Broglie-Bohm interpretation is that it is observer-independent in the same sense as classical dynamics (which for some people is desirable enough that they are willing to accept other aspects of that interpretation).
Answer: Surprisingly, in some of his writings Feynman seemed to lean towards an observer-free interpretation of quantum theory in which objects as small as atoms or particles replace observers by acting as event recorders (memories). Two relevant Feynman quotes are below; Chico in his answer noted several other relevant and related Feynman quotes.
Vol. III, Sec. 3-3 Scattering from a crystal, p.3-9, first full paragraph, talking about whether a neutron will interact with a crystal as a wave or as a particle:

"You may argue, 'I don't care which atom is up.' Perhaps you don't,
  but nature knows; and the probability is, in fact, what we gave above --
  there is no interference."

Vol. III, Sec. 3-4, Identical particles, audio version only:

"... if there is a physical situation in which it is impossible to
  tell which way it happened, it always interferes; it never fails."

In the first quote, Feynman pretty much says that what counts is whether the event got recorded by an atom, regardless of whether an observer looks at it or not. That's remarkable if you think about it, since it does not even acknowledge the view that a conscious observer must always participate.[1]
Instead, Feynman employed the idea that an atom that is capable of being struck by a neutron is all the "observer" needed to make an individual neutron bifurcate between the two possible paths of remaining quantum (where it leaves no specific information trace is left in the crystal, and the neutron continues as a wave) or becoming classical (where it leaves a small but clear mark on a single atom within the crystal, and ceases to behave like a wave.)
In the second quote, Feynman uses this same concept of information signatures to define the difference between quantum (interfering) and classical situations. Only those situations that fail to leave such an information trace remain quantum. (In current terminology, this would be called the decoherence problem.)
While I really like Feynman's approach to such thought experiments, I must also point out that to the best of my knowledge he never made any attempt to expand such ideas into an explicitly quantified approach. Furthermore, since Feynman clearly did feel that there was such a thing as a universal wave function, and that the concept of wave collapse was "magic" (in a QED footnote I think), it's possible that he was simply making a subtle distinction between "simple" and easily reversible forms of wave functions (the neutron diffracting) and "complicated" wave functions that were far less likely to be reversible (the neutron colliding with one atom). John Bell had a marvelous essay on just that point,[2] in which he showed how very careful one must be when assuming that a "clearly classical" event had no wave representation.
For my part, I like the pragmatic simplicity of Feynman's "did it leave a trace?" rule very much, even if it lacks the formal depth and elaboration of other more abstract frameworks. Quantum events by this rule simply become the ones that don't leave information traces... period. In fact, if you are familiar with Feynman's QED framework and think about it a bit, you will see that Feynman's marvelously accurate and predictive integrals of all possible histories are just the flip side of the same idea.
That is, those many possible histories become significant precisely because no classical event has occurred yet that would contradict them. The absence of classical information traces allows such whispers of worlds that could be to take on a certain degree of measurable reality, if only as vanishingly tiny parts of a wave that is the sum of all such not-yet-forbidden worlds.

[1] Feynman was very much aware of the conscious-observer viewpoint, since his PhD adviser John Archibald Wheeler was one of its main advocates.
[2] John Bell, Speakable and Unspeakable in Quantum Mechanics.
Comment: Feynman's description is not different from anyone else's in this respect--- it is just clarifying things for people who think that "measurement" and "entanglement with a complex decohered environment" are somehow different. The issue of interpretation is not that decoherence and measurement are distinguishable, but that the result of decoherence is to produce classical probabilities for observations where classical probabilities don't appear in the fundamental theory.
Answer: Adding to the answer by paper_chico,
There are various views including quantum bayesianism, penrose interpretation(objective collapse theory), information-based quantum mechanics, many-world interpretation or relational quantum mechanics according to my knowledge. Personally I like Penrose interpretation, which is based on objective collapse theory and removes the supremacy of observer.
Penrose interpretation: This interpretation assumes that a particle can stay at multiple places at the same time, but since every particle bends space-time around it, it requires some energy to sustain its 'gravitational field' ( space-time curvature,precisely). So, depending upon the energy levels the object can stay at various places.While understanding this, one must rip off the concept of 'wavefunction collapse' from his head. This also explains why macroscopic objects can't exist at multiple places, just by saying that the energy difference is so large, that the objects can't stay there for measurable time. Quoting Wiki:
In Einstein's theory, any object that has mass causes a warp in the structure of space and time around it. This warping produces the effect we experience as gravity. Penrose points out that tiny objects, such as dust specks, atoms and electrons, produce space-time warps as well. Ignoring these warps is where most physicists go awry. If a dust speck is in two locations at the same time, each one should create its own distortions in space-time, yielding two superposed gravitational fields. According to Penrose's theory, it takes energy to sustain these dual fields. The stability of a system depends on the amount of energy involved: the higher the energy required to sustain a system, the less stable it is. Over time, an unstable system tends to settle back to its simplest, lowest-energy state: in this case, one object in one location producing one gravitational field. If Penrose is right, gravity yanks objects back into a single location, without any need to invoke observers or parallel universes.
Loosely put, it explains the wavefunction collapse in the following way:
Wavefunctions do collapse, not because of some observer observing it(Copenhagen interpretation), but they will collapse just after the curvature in space-time attains a particular threshold level. If the energy of the particle does not allow the it to stay in different states, it'll collapse to one state.
I'm not an expert in this field, however, I've shared what I know about it. If anyone has better views on this topic, or a deeper insight, please discuss.
Comment: There is no Penrose interpretation. It is a fringe theory, not consistent with the current formulation of quantum mechanics. -1
Comment: Quantum mechanics is not only about location, it is also about orientation, spin, current direction. There is no indication that mixed states produce more gravity (or any other charge) than pure states.
Comment: @Anixx thanks for pointing that out, I tried to answer as far as I could. Can you please explain what do you mean by 'fringe theory'? This seems new to me.
Answer: Quantum Mechanics is almost certainly as flawed as every other physical theory that has come and gone. That statement gets on the nerves of a lot of physicists - many of whom think that 'This Time its Different'.
Take Newton's gravity for example. Newton knew that the whole instantaneous transmission of gravitational force did not make sense, yet the theory was wildly accurate and is still used today for 99% of things like space flight. Yet the theory is fundamentally flawed from a conceptual viewpoint.
With QM - where is the problem? It is likely in the transition from the microscopic realm to the macroscopic realm, where the 'large hand wave' called waveform collapse comes into the theory. So getting to the question: Here are some possibilities:
http://neshealthblog.wordpress.com/2011/11/01/quantum-upgrade-removes-need-for-spooky-observer/
Re: This time its different:
http://press.princeton.edu/titles/8973.html
Comment: -1: This is a ridiculous misunderstanding of how precious the knowledge gained by science is. Newton's theory of instantaneous transmission makes sense, it just is incorrect. There are reasons to doubt QM, but at some point, we will have a complete theory, and we might already be at that point--- this discovery process can't go on forever with regards to the physical sciences--- the down-below fundamental stuff is not infinitely complex, so you run out of questions.
Comment: The history of science is pretty clear. Where did I say that gravity or QM are not precious? Newton did not like his instant transmission, knew it was a problem, in the same way that people who study QM know it has some problems, measurement being the biggest one.


Cannot connect to Raspberry Pi using en0 IP address

Question: I have two separate RPis I have only ever used headlessly using my Mac (OSX). When I set up my first RPi I used an online tutorial wherein I went into System Preferences->Network and changed 'Configure IPv4' to 'Using DHCP with manual address' (as opposed to DHCP) and then inputted a static IP (i.e. 192.168.x.x). I was able to SSH into my RPi without difficulty using
ssh email@example.com

and set up my Raspbian GUI.
Later, I then plugged in my second RPi. I had not changed any of the settings mentioned above, figuring the IP address would be the same but when I tried to SSH into the RPi using the same 192.168.x.x as the IP, it would not accept the default password. I then manually changed the IP address to 192.168.y.y (same subnet) but still had the same problem. I changed the IPv4 setting back to DHCP, got a new IP (192.168.z.z) and tried again with the same outcome.
At this point I couldn't SSH into either of my RPis anymore. Googling told me that I was likely not inputting the correct IP address for the device. However, I used
ifconfig

and got the en0 IP from there and then tried to SSH using that. Again, no dice. In all instances the problem is that I am asked for the password and the default password is not accepted. I KNOW this is the correct password - I never changed it.
I was able to solve this problem with my first RPi by re-downloading Raspbian and adding a line of code to one of the default files specifying a static IP (e.g. 192.168.a.a) before writing it to the SD card and then setting the IPv4 on my Mac to 192.168.a.b. However I'm so annoyed that I don't know what's going on here. I can't access the second RPi at all. Can anyone help me understand why I cannot talk to it? All of the IPs I've used (static and non) have been on the same subnet. The problem seems to be that SSHing is possible (I am asked for the password) but I just cannot access the device. I'm using the same cable to connect to both RPis (the one I set up with the static IP that now works and the second one I have not set and does not work) so I know both are connected to the laptop via the en0 connection. I don't have direct access to the router or peripherals at the moment which is why I'm doing things this way.
Answer: as you mentioned a Mac, maybe you used an SSH-key for login (usually root-login is only allowed with ssh-key, this can be extended to any user), and updated the Mac - I know with one of the last updates the start of ssh-agent/system-keyring was broken (check the reason in /var/log/auth.log after pulling out the SD card)


Ohio school tax

Question: My mother recently got a letter from the state of Ohio saying she didn't pay a school tax that was active for her 2010 return. She filed through H&R Block so went there thinking they should be responsible for the mistake which is going to end up costing her over $700. They say that they are not responsible and she will have to pay it. Does anybody have any advice for this? She really can't afford $700 for a mistake that the people preparing her taxes made.
Answer: Is the $700 the tax, or the penalties? Did the H&R employee sign the return as a paid preparer?
If the $700 are penalties and the return was properly signed, she can sue them to compensate her for the penalty.
If the $700 is the tax itself, she'll have to pay it, tax liability is still hers.
Comment: I've never used H&R storefront, don't they *have to* show the return as paid preparer?
Comment: @JoeTaxpayer of course they **have to**. The question is whether they did.
Comment: I meant to suggest that if they did not, and OP has a paid receipt that in fact H&R did the return, isn't H&R in more trouble? The school tax is common in Ohio, this is a very careless oversight. But they had better have signed the return.
Comment: The fee is a little over $500 the rest is the tax.
Answer: From the H&R Block site:

The H&R Block Guarantee: The H&R Block Guarantee is included with every tax return we prepare. If H&R Block makes an error on your return, we'll pay resulting penalties and interest. If you are audited, we'll explain your IRS tax audit notice and the documentation you should provide to the auditor.
Maximum Refund Guarantee: Get the maximum refund you're entitled to, or your tax preparation is free.
Satisfaction Guarantee: We're so certain that you'll have a positive experience that you don't pay until you're satisfied.

It would appear they will need to pay whatever portion is a penalty and interest. As littleadv wrote, they won't repay the tax itself.
May I ask? - Who did her return last year? This (school) tax isn't new.

Ohio school tax


Will humans ever have 6 fingers on one hand?

Question: The polydactyly gene is dominant over the common gene for finger number. Will humans ever have six fingers?
Comment: I feel like this question would be more appropriate on the biology stack exchange, or do they not take what if questions?  How is this world building?
Comment: Is it really dominant? From the pictures at linked web page, it does not seem to be any beneficial, and extra useless digit is removed. If it were dominant and beneficial I would expect it to be more widespread, but it is rare.
Comment: @PeterMasiar The Wikipedia page says "autosomal dominant transmission is suspected" for at least one type. So yes, it's dominant. Being beneficial is dependent on the environment, not the dominance of the gene.
Comment: @Samuel - autosomal dominant means only that you have to get the gene from one parent. It does not mean that if you have a parent that has it, you will automatically get it. It's also a mutation, not an adaptation. And, given that we had several million years in which it could occur and be passed on and still only occurs rarely, I would say that no, it won't.
Comment: @JohnP Yes, obviously. Its inheritance is 50% if one parent has it and 75% if both have it. It is still around though, despite millions of years. If it ever becomes an advantage, then it will be defined as an adaptation and could become much more common.
Comment: @Samuel - To an extent, yes. 75% you will get it, 50% chance it will be the "normal" mutation (whatever it is), and 25% chance you will have a more extreme version. If parents are Gg, then kids are possibly gg (no), Gg ("normal" level of mutation) or GG, higher level of mutation.
Answer:
Will humans ever have six fingers?

I'm assuming you mean all/most humans here.
Unlikely.  Being dominant means it will show up when present.  It also makes it easier to spot.  If 6 fingered people became 'desirable' and reproduced more then it's possible.  But more likely it has the opposite affect and it reduces their opportunities because it is a 'strange' physical 'defect' that often will make them less desirable (less successful in producing heirs to carry the gene).
My understanding is that in general humans are slowly losing the pinky finger and in a few hundred generations we will have 3 fingers and a thumb.
Comment: You should give credit to Darwin :)
Comment: @Vincent I thought that was a given!  :)
Comment: Your understanding is slightly off. Pinkies won't disappear because of the opposable thumb, pinky finger is what gives you the majority of strength in your grip. Pinky is the worst finger to lose if you have a choice (First finger, non writing hand is the most desirable. Don't ask). We are, however, most likely going to lose our pinky toes, as balance passes more through the middle of the foot than the edges.
Comment: @JohnP I thought the third finger of the non-dominant hand is best to lose. It's already partially slaved to the middle finger. What's your source?
Comment: @Samuel - Anatomy classes way back when. Fingers work best when together, losing that finger leaves a gap, and also weakens the connected muscle/tendon complex. Also corroborated by broscience on the web.
Comment: @JohnP The weird thing about [this article](http://www.businessinsider.com/if-kidnappers-chop-off-one-of-your-fingers-heres-which-finger-you-should-sacrifice-2013-9) is that it corroborates your claim but the quote from the doctor lists all but the third finger as useful. I think the author got it wrong.
Comment: Cartoonists will be happy then to have their models match reality.


How to show that $GL_n/U$ is birationally isomorphic to $B^-$?

Question: It is said that $GL_n/U$ is birationally isomorphic to $B^-$. Here $U$ acts by right multiplication on $GL_n$. I think that $GL_n/U$ consisting of cosets. Two matrices in the same coset if any two minors of these two matrices which have the same row indices and column indices and contains the first column are the same. But I don't know how to prove that $GL_n/U$ is birationally isomorphic to $B^-$. Thank you very much.
Answer: For $GL_n$ you have the Gauss decomposition $G' = L \cdot D \cdot U$, where $L$ are the lower triangular matrices with $1$ on the diagonal, $D$ the diagonal matrices and $U$ the upper triangular matrices with $1$ on the diagonal. $G'$ is the open subset of $GL_n$ consisting of all matrices with nonzero leading principal minors $M_1$, $\ldots $ , $M_n \ne 0$. You can explicitely calculate the decomposition
$$g = l \cdot d \cdot u$$
using quotients of minors of $g$.
The components $l$ and $u$ will be expressed in terms of minors  invariant under right $U$ multiplication. For instance, the diagonal elements are
$$d_p = M_p/M_{p-1}$$
and the off diagonal elements are again quotients of minors
\begin{equation}
n_{qp}= \frac {M_{(1,\ldots, p-1, q) ( 1,\ldots,p-1, p)}(g) }   { M_p(g)}
\end{equation}
Answer: They key to this observation is the Bruhat decomposition $G=\bigcup_{w\in W} BwB$, where $W$ is the Weyl Group of $G=\operatorname{GL}_n$ with respect to a maximal torus $T$ of $B$. For $w_0\in W$ the longest Weyl element, $Bw_0B$ is an affine open subset of $G$ which is isomorphic to $B^-\times U$. A good reference for this is the book Linear algebraic groups by Jim Humphreys.


Group G hasn't all conditions of Lie group

Question: Is there a group $G$ with the property that $G$ is a smooth manifold, the multiplication map of $G$ is smooth, but the inversion map of $G$ is not smooth?
Comment: For a compact manifold $M$, the group $Diff_{C^k}(M)$ (for $k\ge1$) of all $C^k$-diffeomorphisms of $M$ is a smooth manifold. Right translations are smooth, but left translations are only continuous. Inversion is only continuous.

The same holds for the group $Diff_{H^s}(M)$ (for $s\ge \frac{\dim(M)}2 +1$), the Sobolev completion of order $s$ of the group of all diffeomorphisms.
Comment: I believe I've heard there are infinite-dimensional groups for which each left multiplication $g\cdot$ is smooth, but the right multiplications $\cdot g$ aren't all smooth.
Answer: Robert L. Bryant "An Introduction to Lie Groups and Symplectic Geometry" requires in the definition of a Lie group only that the multiplication map be smooth, and then proves that the inversion map must be smooth also.  (Proposition 1, page 14.)
Comment: One could add that the main ingredient in the proof is the Implicit Function Theorem. It's kind of frustrating that this property of Lie groups motivates some people to give the wrong definition of a Lie group. Of course in the end it's all the same, but the concept is wrong (and breaks down for group objects in other categories, for example $\mathsf{Top}$).
Comment: Thanks Steve,most of books are gabby,it's sufficient to show that the map G to G*G s,t a to (a,-2a) is smooth.
Comment: But surely (using your additive notation) proving $a\mapsto -2a$ smooth is just as hard as proving $a\mapsto -a$ smooth.
Comment: Kind of obvious and pedantic, but it's possibly worth noting that Bryant's proof only works in finite dimensional Lie groups (to be in keeping with Allen Knutson's comment under the question)
Answer: Every Čech-complete paratopological group is a topological group. That means that for Čech-complete groups you do not have to require the continuity of the inverse, continuity of multiplication suffices. Every manifold is Čech-complete. Using the affirmative answer to Hilbert's fifth problem we get that every paratopological group on a manifold is actually a Lie group uniquely determined by the topological group structure.
In the spirit of Martin let me give a correct (I hope I have not forgotten anything) definition which is even wronger than the definition without the inverse:

A topological space $G$ with a function $\cdot\colon G^2\to G$ is called an $n$-dimensional Lie group if and only if

$G$ is second-countable
There exists an injective, open continuous map $\iota\colon \mathbb{R}^n\to G$
For every $g\in G$ the map $x\mapsto g\cdot x$ is continuous and surjective
There exists $e\in G$ such that $x\mapsto x\cdot e$ is the identity
For every $g\in G$ the map $x\mapsto x\cdot g$ is continuous
$\cdot$ is associative


Is there any algorithm for 3SAT problem that is fast and relatively easy to implement?

Question: Here is the description for 3SAT satisfiability problem. I already know about the DPLL algorithm, but it's implementation is pretty complex. I would like some algorithm that is relatively simpler but improves the performance by some extent. I would prefer something that is not Tree/Graph based instead bit-mask or multi-bit assignment based approach.
Comment: Why not use a SAT solver where all the hard work has already been done for you? There are also libraries for popular languages that provide solver routines.
Comment: Exhaustive search is straightforward to implement.
Comment: DPLL isn't all that complex. I can't think of an algorithm that would provide a meaningful speedup over exhaustive search that'd be simpler than DPLL.
Answer: If you're determined not to use the standard deterministic algorithm, the usual alternative is what's known as local search or stochastic search.  The basic idea is that you start with a random bit pattern as a variable assignment, observe what's wrong with it in terms of unsatisfied clauses and try to improve it by flipping one or more variable assignments.  Observe how this new assignment fails, try to improve it, and repeat.
Local search typically outperforms deterministic search for satisfiable random SAT instances, but performs poorly on more structured instances.  It also offers no way to prove unsatisfiability unless some proof system is layered atop it.
There are various local search algorithms on offer, from Uwe Schöning's scheme to PPSZ and its variants.  None of them outperform DPLL-based solvers on all instances.
Answer: I've implemented my own CDCL solver (which is the main modern variant of DPLL), and I found that the hardest part by far was understanding and implementing the 1-UIP heuristic, which in my opinion is well-motivated but not very well-explained in the literature.
If you want to see how fast and simple SAT solvers can be, check out Tinisat. It's only around 500 lines of C++, 20% of which is parsing DIMACS files.


How massive can a terrestrial planet be and still be habitable? Will its space civilization have problems due to its escape velocity?

Question: The star is Sun-sized and my planet will be more massive than Earth.
How massive can my planet be and still be habitable. This is without its internal heat being a problem leading to its becoming a dead inhabitable world. Also, will its space civilization have problems taking off and landing on the planet because of its escape velocity?
Comment: Tech level is extremely important for this question. Also we prefer only one question per post. If you have multiple questions related to a particular please feel free to ask several separate questions each in their own post!
Comment: Welcome to worldbuilding.SE!  When you have a moment, please take our [tour] and visit our [help] to learn more about us.  This is a great question.  From a technical standpoint, it asks how much bang the tech you selct can handle (let's say present-day tech, just how much thrust can we get out of a rocket?).  From a biological standpoint, it's how much muscle can you pack on before bone structure degrades.  Are we talking about carbon lifeforms?
Comment: On  a small planet like Earth, we seem to find it quite difficult and expensive to overcome our puny escape velocity. It's hard to define "having problems getting up and down" without wandering deep into Opinions. Perhaps there is a better or more useful metric?
Comment: See [Could an advanced species having evolved on a large planet with a deep gravity well be helped out of it from above ?](https://worldbuilding.stackexchange.com/questions/21582/could-an-advanced-species-having-evolved-on-a-large-planet-with-a-deep-gravity/38155)
Answer: Without antigravity generators (aka handwavium tech), a super-earth can't be colonized, unless we were cyborgs. Our structure can withstand so much stress for so much time, before a series of problems set it -bones, muscles, bloodflow, they'd be strained 24/7 to work overtime. Even with aG generators, we'd need to decompress when leaving the higher gravity environments, or the bends caused by the higher atmospheric pressure would kill us.


Earth Movers Distance and Maximum Mean Discrepency

Question: By Kantorovich-Rubinstein duality the Earth Movers Distance (EMD)/Wasserstein Metric is equivalent to Maximum Mean Discrepancy (MMD) correct?  See here for a more thorough explanation.  Why then does the original Kernel MMD paper compare their method to EMD (see the first paragraph in section 7.2) and corresponding lectures by people like Alex Smola seem to imply that they are different metrics.  I feel like I'm going crazy because I always assumed that everyone knew that MMD and EMD were the same via the Wasserstein GAN paper (granted Gretton et. al. published way before WGAN was introduced, but I can't find anyone referencing the equality even with a google search now), but now reading these papers I feel like up is down and down is up.
Comment: So I mean equivalent in the topological sense, although I also mean theoretically as I understand MMD with a RKHS will not give the same answer as the Wasserstein distance with at Lipschitz 1 neural network.  I was under the impression that the Wasserstein GAN proof showed that, theoretically (if you could compare every possible Lipschitz <= 1 function), this was equivalent to the EMD.  Is my understanding off?  If you have a good explanation of these you can make it an answer and I will mark your answer as answered.
Comment: You mean "equivalent" in the sense that these metrics are integral probability metrics? Then they are equivalent. But Gretton et.al. discuss MMD for Reproducing Kernel Hilbert Spaces (RKHS). In case of EMD the unit ball is made of Lipschitz functions with $L\leq 1$. This is not a RKHS, So it makes sense to compare.

Or do you mean "equivalent metrics" in the topological sense? This would not follow from duality and I don't think it is true in general.
Answer: No, they are not the same.
First, let's start with a more general framework to motivate the use of EMD or MMD. Suppose we want to fit a family $(\mu_{\theta})_{\theta}$ of parametric distributions to an empirical one $\nu$, which means we want to solve the following minimisation problem:
$$\min_{\theta} \mathcal L(\mu_{\theta}, \nu)$$
where $\mathcal L$ measures the difference between two distributions. For example, if $\mathcal L$ is the Kullback-Leibler divergence, this is asymtotically equivalent to the usual maximum likelihood framework. Or when $\mathcal L$ is a $\phi$-divergence (I omit the detail of the function $\phi$), then we recover the infamous original GAN.
Now, WGAN is nothing but picking $\mathcal L$ to be Wasserstein distance, or more precisely, $1$-Wasserstein distance, aka EMD (there are also $p$-Wasserstein distances, for $p \geq 1$, but they are all equivalent metrics, under some mild conditions). The maximisation in the minimax problem is just the dual form of EMD.
(Bonus: if you pick $\mathcal L$ to be MMD, then you will find something called "Generative moment matching networks" but do NOT confuse with MMD-GAN, they are close but the latter is a generalisation of the former).
Next, let see how MMD and EMD are different.

They both belong to the family called Integral Probability Metrics, which means something of the form
\begin{align*}
  d_{\mathcal F} (\mu, \nu) = \sup_{f \in \mathcal F} \Big( \int f d\mu - \int f d\nu \Big)
\end{align*}
For example, if $\mathcal F$ is a kernel function from the unit ball of the kernel-reproducing hilbert-space, then we recover MMD. Or if $\mathcal F$ is the set of $1$-Lipschitz functions, then we recover EMD in dual form. What special about this family is that under some mild conditions, it characterizes the convergence in law: $\mu_n \overset{\mathcal D}{\longrightarrow} \mu \Leftrightarrow d_{\mathcal F} (\mu_n, \mu) \to 0$. So MMD and EMD are equivalent in this sense. This is NOT true for Kullback-Leibler or total variation.

Another way to see their difference (which I find more clear) is via the entropic regularisation defined as
\begin{align*}
  L_{c, \epsilon}(\mu, \nu):= \min_{P \in \Pi(\mu, \nu)}\langle C, P \rangle + \epsilon H(P)
\end{align*}
For now, let's omit everything in the definition. What we care is when $\epsilon = 0$, we recover the definition of EMD (or more correctly optimal transport distance). When $\epsilon \to \infty$, we recover MMD.
Comment: @AlbertJamesTeddy: you can have a look at the book "Computational optimal transport" for all details.
Comment: @SiXUlm can you please provide a reference to read more on the case when $\epsilon \to \infty$?
Comment: Thanks for the answer, could you explain what are C and P and PI(mu, nu) in the last equation ?
Comment: @NovinShahroudi: you may have a look at the section on Sinkhorn divergence here: https://mathematical-tours.github.io/book-sources/optimal-transport/CourseOT.pdf


Is there a longer version of Lenin's quote "кто кого опередит?"

Question: I want to get a tattoo with Lenin's quote "кто кого опередит?"  I was originally just going to do the first two words, but the Cyrillic lettering is so beautiful in the last word.  I've only seen the last word in a few of the references that I checked.  I want to know if it is more specific/elaborate or a full sentence with the third word included because my Russian language is very limited but I have a deep fascination with Russian history.  Any help would be appreciated!
Comment: This is an extremely questionable choice of text for a tattoo. A Russian person (even a Communist) will never guess that this is a quote from Lenin.
Comment: @shabunc I don't see that a question is about English - It's "Is there longer citatition that includes Кто кого опередит"?
Comment: @artemix, you are right- I've got it all wrong and apologize for this.
Answer: Wiki: Who, whom? Кто кого?
is a Bolshevist principle or slogan which was formulated by Lenin in 1921.
Lenin is supposed to have stated at the second All-Russian Congress of Political Education Departments, on 17 October 1921,
Весь вопрос — кто кого опередит?
"The whole question is — who will overtake whom?"
For the tattoo, I suggest using a short version: Кто кого?
Answer: The verb опережать/опередить is quite neutral and common. It is derived from перед (fore, front) and means "to overtake, to be faster/ahead of smb.". It is by no means taboo/offensive/colloquial/weird/obsolete, or in any other way inappropriate. You can safely use it on a tattoo, if you wish.
I'm not sure about the historical context, but in general the meaning of кто кого опередит is more narrow than of simply кто кого. The first phrase literally means "who will be ahead of (faster than) whom", and the last one - just "who will win whom", not necessarily by being faster, but maybe stronger, smarter or something else.
Answer: For a Russian, the verb опередит is close to the colloquial, moderately taboo, verb пердит (farts, singular first face of пердеть). You can even add a prefix о-, making a verb опердит (will fart on (somebody), or will fart all over (somebody), in third face singular).  Russians will laugh to this tatoo, because, changing one letter, it means "who will fart on who".
I doubt that this semi-taboo verb existed in time of Lenin.
The word опередить means to be first by scores (mostly in sports, games, and other competitions) or by time (in any environment).


Extract data from Http rest api, How to configure http request header for cookie authentication

Question: I need to extract data from Http web API. However it requires cookie authentication. I can get the cookie information when I inspect the chrome browser. But I don't know how to configure the headers and authentication type on Azure Data Factory V2. Can you please provide some details ? (for the token based authentication, I have successfully extracted the data. But cookie one, I don't know how to do it)
Comment: hi,if my answer is beneficial for you,would you please accept it for answer.Thanks.
Answer: Based on the official document, ADF REST Linked Service only supports below authentications:

Anonymous,
Basic,
AAD service principal,
managed identities for Azure resources.

cookie authentication is not supported by ADF.
Comment: Thank you. is there any plan MS will support this?
Comment: @Edison ADF is azure cloud service,it only could be accessed with rest api ,powershell,sdk etc. So,i'm afraid it won't support cookie auth. However, you also could contact with azure team to ask some official answer. If any progress,you could post here for others' references on the forum. Appreciate that.
Answer: So far, the only way Id found to do such thing is to create an Azure Function and do the API call within using HttpClient, and then just add the cookie to the request object.
You will need to optimize how the call to your api is made and also what type of data you will return from the Azure Function Activity.


Importing one photo into another photo?

Question: I am brand new to photo editing. I am trying to import a picture of my late brother into a picture of my family. Like have him very light on the side of us or behide us. Can anyone tell me a good photo editing program that I could do this with? Thank you!
Comment: This is not a simple process for someone new to photo editing. There are different ways of doing this, and different programs that allow you to do it. But getting a pleasing result is the difficult bit. You will have trouble finding a "one-click" solution. Consider having a professional (or at least someone with experience) do this for you.
Comment: I don't want to post this as an answer, nor would I want anyone to consider this as self-promotion [I will clear this comment if it proves unpopular], but here are a few examples of what can be done with a little care & attention to detail in Photoshop, using the methods outlined by Corey. The backgrounds are [very obviously] not my property, these were done for a family calendar, purely for amusement, not profit. https://imgur.com/a/G1Cw1
Answer: I'm sorry for your loss. I've done this exact project with an image of my cousin and am most familiar with Photoshop, though other programs exist (GIMP comes to mind). Given that Adobe now offers a 1 month license through their Creative Cloud for $10 (Photography Edition for Individuals) - it's not that bad a cost to use, even if just for this one project.
The basic process is:
You'll want to load up both images once you get Photoshop open. Go to the image of your brother, select all, and copy. (CTRL + A, then CTRL + C)[On Mac, use the command key in place of ctrl]
Go to the image of your family, and paste (CTRL + V)
This will create a new Layer containing your brother on top of the layer containing your family. Make sure the top layer is selected, and add a layer mask by clicking the icon in the layer palette that looks like a circle inside a rectangle.(instructions here)
Mask out the portions of your brother's layer until you've got just what you need. You'll also most likely need to re-position it, maybe transform it a bit to be smaller or larger, and maybe also adjust the color or contrast.
Using layer masks can be a tedious process but it does get easier as you get more practice with it.

Importing one photo into another photo?


What's the worst someone could do with my phone unlock code?

Question: When someone is using my cell phone, I will sometimes give them the PIN number to unlock it so they don't have to ask me. Clearly, I only tell the code to people I trust not to mess up my phone. However, let's say an attacker overhears me telling someone I trust (or the person I trust later turns evil and plots to take over my phone). Either way, the attacker doesn't have physical access to the phone. What can he do? I don't think phones OS' are like laptop and desktop OS' in that the "user password" can also be used to gain remote access, but I'd like to make sure. My phone is a Windows Phone (8.1), but I'd appreciate answers for iOS and Android too.
Answer: Short Answer: For Windows phone, Android and iOS he would not be able to do anything. A PIN would only be useful to a attacker physical access or if he had remote access to your phone. If you are the average person and not high up in government you have nothing to worry about.
Comment: If he already had remote access, why would he want my PIN?
Comment: As an example: You may have a application on your phone that stores data and encrypts it on your phone. So you could not view that information without going through the correct application which that data belonged too. If the attacker had shell access he could install a VNC server application. He could then view your phone screen and use your PIN to gain further access to the phone.
Answer: The PIN code can only be used for unlocking the phone locally. For credentials storage, the PIN/pattern is internally translated into a password, using a phone-unique key.
Theres no way to remotely access a cell phone except for: Using Google Administrator - this uses your Google Account password to remotely access your phone, or if you install a app that allows remote access - and in this case, you configure the access password in the app itself.
And you are wrong about laptop/desktop OS too. In w7 and later, NO remote access is enabled per default. This means a password cannot be used to remotely access your laptop/desktop, unless you specifically enable remote access in the Control panel.
There is a thing called "Remote assistance", but that is configured so you need to confirm (permit) the person helping you. During Remote assistance, the controlling indivual will not be allowed to input a password to bypass permit.
Remote assistance is enabled per default and can be disabled in the Control panel.
However, some Linux OS:es do have a sshd running remote-accessible to allow for debugging. However, if you put your machine behind a router, any remote access will not be possible unless you specifically open the port.
Back to cell phones again: Normally, when connected to your mobile operator, your operator NATs the traffic behind their firewall (and you get a external shared IP - that is shared between multiple customers, and a non-public IP assigned to your phone), thus even if any remote access would be default open on your phone, nobody would be able to use it anyways.
Google Administrator works by having the phone "poll" the google website at regular times to check if the device should be locked, erased or tracked.
Comment: I don't do Mac much, but I'm pretty sure you can SSH into that, too. As for Windows, you can still do some stuff with the user password (I haven't tried the remote assistance bit myself, but what about uploading malware via shared folders, using Telnet, or simply annoying me by remotely shutting it down?). Still, thanks for your answer, I found it quite instructive!
Comment: Shutdown is only allowed with the administrator password if UAC is enabled. Also, Another thing to consider is that nothing is accessible if your´e behind a NAT, unless you specifically configure the NAT to forward traffic on certain ports. The NAT acts in other Words, as a natural firewall that blocks all incoming requests. Same with phones, since most 3G operators do NAT their customers behind a CGN.


Strange dark scabbing near cat's nose

Question: My male cat is about 10 months old and I noticed a strange dark spot forming in/around his nose the past couple days. Originally I thought it was simply Feline Acne, as he had some on his chin that the Vet pointed out before. His chin has cleared up, but now this nose spot has appeared. I was going to ignore it as I thought it would pass like the chin acne, but my SO thinks it looks bad enough for a trip to the Vet. It is a crusty texture like the chin acne was.
Thoughts? Acne or maybe not?
Comment: i think a vet should take a look at this,it might be normal but it can be a sign of an infection or some bleeding too,so again it is best to let the vet have a look at this.
Comment: It might be a fungal infection, which commonly starts from nostrils and spreads quickly if left untreated. It is easily curable with over the counter ointments but of course you have to consult to a professional vet before trying anything.
Comment: Yeah, the paranoia was ramping up so I made an appointment for the vet. Will be taking him in tomorrow, I'll post an update with what the vet says. Thanks to both of you for the responses!
Answer: We took our cat to the vet and she took a sample of his skin by pressing a small piece of plastic against the irritated areas. She then ran a test on those samples and found some bacteria present within them. She believed this bacteria was due to an allergy.
Her guess was that he is allergic to his plastic water bowl, and the allergy spread from this chin to his nose (possibly from licking his face). The vet gave him a shot of antibiotics and we bought him a new stainless steel water bowl. It has only been a week now, but it looks like his face is starting to clear up. The vet told us to wait two weeks to see if he really cleared up, so we have one week to go. It is looking promising though.
Answer: If it is blood then it needs to see the vet immediately as cats should never bleed from their nose, could also be a sign or respiratory infections or parasites
Answer: One of our 4 cats gets the same crusty stuff around his nose.
Our vet thinks it is a food allergy condition.
For him, food testing appears to target chicken as a link.
When food containing chicken is removed from his diet the spots (slowly) reduce or disappear.
If he eats a lot of chicken based food the spots appear, and increase, and he eventually starts wheezing a little from congestion.

Strange dark scabbing near cat's nose