Can I keep making mead from the same brew?

Question: I have recently started making mead as a bit of a hobby to use up our honey supply. Making the mead has been quite a fun experience but I was wondering. Since your using yeast and feeding it sugars to keep it alive. Could you just keep part of a batch each time as your yeast source? It works for bread starters and it's relatively the same concept just with a drink.
Answer: Yeah absolutely! Just need to make sure you give a chance of staying alive, so feed it some nutrients and keep it at a temperature where it can thrive.
Answer: Yes, you can reuse the yeast, under some conditions.
If you use it quickly enough, there's nothing to worry about. I brew a batch of beer, let it ferment for 2 weeks, bottle it, and keep the leftover trub and yeast sediment for the next batch. It sits on the counter or in the chest freezer I use for fermenting for a bout a day or two. This is basically a big starter: you have lots of healthy yeast cells ready to go. Keep them at the same temperature as your fermenter, if possible. I've brewed four batches (of usually ~5% abv beers) from the same pack of Saflager / Safale dry yeast without any problems. Fermentation is really quick. I didn't try a fifth batch as this maxed out my storage capacity.
If you want to keep yeast for a longer period, it gets more complicated. You can either get lab equipment and harvest only the healthy cells, discarding the dead ones and the trub, and put them on a growth medium in the fridge. This goes beyond my chemistry skills and the effort I want to put in.
You could also try feeding it on a regular basis and see how that works. I don't know how much you need to feed and if there are any negative consequences in the long run from dead yeast cells or lack of nutrients (assuming you just feed sugar).
AFAIK you should not freeze yeast, as ice crystals can puncture the cells, destroying them.
Comment: Apparently you can freeze yeast, but need to do so in a 15% glycerine solution (to avoid the ice crystal issues). I have not (yet) tried this, but your search engine can find lots of information about this.
Answer: Short answer: Yes
Just rack the new batch over the old "fresh" cake. Best to rack on it asap.
No need to oxygenate, it's a full pitch yeast will go directly into feeding phase. The resulting batch will be very clean almost no yeast profile.  if you want the yeast profile then only use some of the old cake and oxygenate so you get a new growth phase to produce esters.
You can reuse the same cake as a full pitch about 5 times before viable cell count goes down and it needs oxygen again for a new growth cycle.
You can do the partial indefinitely since there's always new yeast.
Lack of O2 triggers yeast to stop reproducing and enter feeding phase. If you have the cell count needed to complete the batch in x time then no need to add O2.
Answer: As the others have already responded, yes, you can reuse the yeast from a previous batch. There's a caveat though.
Depending on the gravity of your mead, your yeast may or may not be usable. High gravity, high ABV meads will either kill off your yeast or leave it in poor condition, deteriorating the quality of your future meads. So as a general rule, if you want to reuse yeast, make a low gravity mead, rack it (collecting the yeast) and then add more honey.
As for keeping a portion of mead, as opposed to collecting yeast cake, you need to ensure there's enough yeast there to kickstart a new fermentation. I'd say it's more difficult to pull off after racking to secondary.


Thermal Management in Raspberry Pi Clusters

Question: I've been looking through several posts (on the internet) about building Raspberry Pi clusters- and my major question is something rather simple- what about the heat management? Would they overheat when operating as a cluster system (because each Pi is in close proximity with one another)? So is it possible to create a cluster even without cooling?
Comment: Can you please state how you want to build the cluster? I have built one and can tell you it very much depends on the details (how close together, encasing of the individual pi, what hosts the whole setup, other devices involved)
Comment: I plan to place them ~5cm atop each other, and ~2cm apart. Encasing is not present as they are placed on a rack, and all of them are connected to a router. Devices are pis and a separate computer which is linked via Ethernet to a router.
Answer: Unless you are using it in an unusually hot environment, I do not think the pi can generate enough heat to hurt itself.  The max temperature is apparently 80 C, and the normal operating temperature 45-55 C.  It does not really require anything in the way of ventilation or cooling, and I've seen a few people report using it in airtight enclosures.
Someone here posted this prolonged temperature test using a probe in an enclosure.  I have mine in an unventilated case, it's been on for days (mostly idle) and just now opt/vc/bin/vcgentcmd reported 53.5 C; this is the on-chip sensor which will be hotter than an external probe.  I maxed the processor (but not the video core) out for 5 minutes and it reported 57.3 C.  The ambient temperature here is ~23 C, although the pi is shoved together with some other warmth generating electronic gear.
My enclosure is actually double -- there's the made for the pi sized (~1.5" deep) plastic case I bought with it screwed inside a wooden box.  I've never noticed the inner plastic case be anything beyond luke warm to the touch.
WRT packing a bunch of them together, I guess it would depend where and how tightly you have them packed, but realistically it seems very unlikely to become an issue.
Comment: A note. The pi is cool a lot of the time due to the large surface area. The largest being the top and bottom. If they are stacked together, even half a centimeter apart, the pi loses its largest surface area for heat dissipation and could cause an exponential curve in the internal temperature
Answer: I build a cluster with 16 PI's, and left it 'unventillated'.
After a while, one of them 'died',
so I had to dismantel the whole cluster to replace the PI.
To avoid this in the futur, I ventillated a little,
and wrote a script to monitor the cluster's temperature.
This is how it works:
description:
16 slave PI's connected to a Master PI (MRPI)
IP add's:
MRPI 192.168.1.70
slaves 71 -- 78 & 81 -- 88
requiered:
SHH installed on all PI's and keys shared both ways,
MRPI to all slaves,
all slaves to MRPI.
on each PI a script to check the T° and send it to the MRPI:
#!/bin/bash
mip=`hostname -I`
mip=${mip:10:2}
tfile="/tmp/"$mip".txt" #using the IP add to make a file name
temp=`/opt/vc/bin/vcgencmd measure_temp`
temp=${temp:5:4}
echo $temp >$tfile
#echo $tfile
#cat $tfile
scp $tfile email@example.com:$tfile   # SSH won't "cat > " from a script

#################################################################

on the MRPI a script to ask the T° of the slaves,
and graphically display the cluster's T°:
#!/bin/bash
ssh 192.168.1.71 "./send70temp.sh" >/dev/null
ssh 192.168.1.72 "./send70temp.sh" >/dev/null
ssh 192.168.1.73 "./send70temp.sh" >/dev/null
ssh 192.168.1.74 "./send70temp.sh" >/dev/null
ssh 192.168.1.75 "./send70temp.sh" >/dev/null
ssh 192.168.1.76 "./send70temp.sh" >/dev/null
ssh 192.168.1.77 "./send70temp.sh" >/dev/null
ssh 192.168.1.78 "./send70temp.sh" >/dev/null
ssh 192.168.1.81 "./send70temp.sh" >/dev/null
ssh 192.168.1.82 "./send70temp.sh" >/dev/null
ssh 192.168.1.83 "./send70temp.sh" >/dev/null
ssh 192.168.1.84 "./send70temp.sh" >/dev/null
ssh 192.168.1.85 "./send70temp.sh" >/dev/null
ssh 192.168.1.86 "./send70temp.sh" >/dev/null
ssh 192.168.1.87 "./send70temp.sh" >/dev/null
ssh 192.168.1.88 "./send70temp.sh" >/dev/null

MA=( "/tmp/71.txt" "/tmp/72.txt" "/tmp/73.txt" "/tmp/74.txt" "/tmp/75.txt" "/tmp/76.txt" "/tmp/77.txt" "/tmp/78.txt" )
MA+=( "/tmp/81.txt" "/tmp/82.txt" "/tmp/83.txt" "/tmp/84.txt" "/tmp/85.txt" "/tmp/86.txt" "/tmp/87.txt" "/tmp/88.txt" )
START=1
END=16
HT=35
LT=25
SP=".."
ST=\|\|
clear
for (( p=$HT; p>=$LT; p-- ))
do
    MV=$p" "
    for i in "${MA[@]}"
    do
    LL=`cat $i`
    T=${LL:0:2} # get rid of the decimals
    #echo $T " " $p
    if [ "$p" -gt "$T" ]
    then
        MV=$MV$SP
    else
        MV=$MV$ST
    fi
    done
echo $MV
done
echo -n "   "
for i in "${MA[@]}"
do
    echo -n  ${i:5:2}
done
echo

#############################################

A sample :
35 ................................
34 ................................
33 ................................
32 ||............||................
31 ||............||....||||....||||
30 ||||........||||..||||||....||||
29 ||||..||||||||||||||||||||||||||
28 ||||||||||||||||||||||||||||||||
27 ||||||||||||||||||||||||||||||||
26 ||||||||||||||||||||||||||||||||
25 ||||||||||||||||||||||||||||||||
   71727374757677788182838485868788

Enjoy clustering !!
MuteOn
B6180 Belgium


How to avoid azure-quantum ionq simulator computing a probability distribution of exponential size?

Question: I am running a 3-qubit simulation using ionq.simulator in azure-quantum. When I send the task, I get the result from one shot + probability distribution that includes all the possible 8 bitstrings. I am not interested in getting a probability distribution, just the result from 1 shot. This is a big problem when I try to do 29-qubit simulation, because I cannot even retrieve the results from Azure; the results are 12GB!
Here is the 3 qubit example:
from azure.quantum.qiskit import AzureQuantumProvider
from azure.quantum import Workspace
from qiskit import QuantumCircuit

workspace = Workspace(resource_id = "", location = "")
provider = AzureQuantumProvider(workspace)

circuit = QuantumCircuit(3, 3)
circuit.name = "Qiskit Sample - 3-qubit GHZ circuit"
circuit.h(0)
circuit.cx(0, 1)
circuit.cx(1, 2)
circuit.measure([0, 1, 2], [0, 1, 2])

device = provider.get_backend("ionq.simulator")
job = device.run(circuit, shots=1)
res = job.result()

The results are:
Result(backend_name='ionq.simulator', backend_version='1', qobj_id='Qiskit Sample - 3-qubit GHZ circuit', job_id='...', success=True, results=[ExperimentResult(shots=1, success=True, meas_level=2, data=ExperimentResultData(counts={'000': 1}, probabilities=defaultdict(<class 'int'>, {'000': 0.5, '111': 0.5})), header=QobjExperimentHeader(qiskit='True', name='Qiskit Sample - 3-qubit GHZ circuit', num_qubits='3', metadata={}, meas_map='[0, 1, 2]'))], date=None, status=None, header=None, error_data=None)

The troublesome element for me is probabilities=defaultdict(<class 'int'>, {'000': 0.5, '111': 0.5}) since it grows exponentially with system size for an arbitrary circuit.
Then, my question is, how do I avoid Azure computing the probability distribution? Which includes $2^n$ elements, with $n$ being the number of qubits.
Answer: This is currently unsupported scenario in Azure Quantum. Right now, you always get the complete job results back, which include the probability distribution.
(I forwarded your question to the dev team, I think it's an interesting use case to consider.)


If I have a Indian visa should I need transit visa

Question: I have a Indian tourist visa . So if I want to fly form Indian to another country I need a transit visa or not? I am from Bangladesh n I will go to Kyrgyzstan .
Comment: It depends on which country you would be transiting through, and most likely on your citizenship.  Can you edit your question to add this information?
Comment: @Sazzat For clarity, you are a Bangladeshi citizen currently in India on a tourist visa, wishing to travel from India to Kyrgyzstan, transiting via which country(ies)? For what purpose? When do you plan to leave Kyrgyzstan and/or return home? Please edit your question to provide more information (don't just post a new question).
Answer: Your question is still a bit unclear, but this information may be useful:

If you are in India with a tourist visa, and you will fly from India directly to Kyrgyzstan, you do not need a transit visa because you will not be in transit anywhere; you're just leaving India following a stay that was covered by your tourist visa.
If you are not in India, and you will be flying to Kyrgyzstan through India, and your transit is a "direct transit through an airport," you do not need a visa.  I do not see any formal definition of "direct transit through an airport," however.
If you are not in India, and you will be flying to Kyrgyzstan through India, and your transit is not a "direct transit through an airport," you may need a transit visa.  Most countries allow people who hold tourist visas to use the tourist visa for transit.  I could not find anything online that unambiguously says that India also follows this practice.
If you will be transiting through any country other than India, the question of whether you need a transit visa for that country depends on which country it is.


Simulate massive network traffic

Question: We want to stress test our pfsense box with a massive amount of connections and traffic. Right now we are using iperf, but reaching a number of more than ~300 parallel connections the test clients reach their limit regarding open tcp connections. But we need to simulate ~4000 clients running at least one TCP connection per client. What would be the best practice?
Comment: For typical HTTP/HTTPS traffics I would use jMeter, I don't know any iperf alternatives unfortunately :(, maybe some scripting using nmap would be useful ?
Comment: What kind of traffic ? HTTP/HTTPS ?
Comment: All kinds of traffic. HTTP, HTTPS, Videostreaming via UDP, etc. Best would be variable packet sizes.
Comment: Yes, scripting could be a solution for some random connection types. I will have a look a jMeter. Otherwise I'll stick with iperf and add some clients to the test network.
Answer: I don't think iperf is be flexible enough to simulate user activity for various traffic types. Depending on how you're using pfsense (routing, gateway, proxy, whatever) it will experience different load types.
So I would rather stick to one of the following tools:

Apache JMeter - this one have GUI and doesn't require programming skills
Grinder - this guy has TCP proxy for recording tests
Gatling - this has quite pleasant Scala-based DSL so it's easy to create and read the tests
Tsung - known for ability to create more load on less powerful hardware

See Open Source Load Testing Tools: Which One Should You Use? for more information on the tools.
Comment: I vote for IxChariot from Ixia Communications

Simulate massive network traffic


Probability that a family with $n$ children has exactly $k$ boys

Question: Let the probability $p_n$ that a family has exactly $n$ children be $\alpha p^n$ when $n\geq1$, and $$p_0=1-\alpha p(1+p+p^2+\cdots).$$ Suppose that all the sex distributions have the same probability. Show that for $k\geq1$ the probability that a family has exactly $k$ boys is $2\alpha p^k/(2-p)^{k+1}$.
Comment: Please don't write your questions as if you are giving us a homework assignment! Show us what you already tried and where you got stuck.
Comment: Assuming the probability of a boy being born=probability of a girl being born=1/2, I am getting Required probability$=\Sigma\alpha p^n nCk*(1/2^n)$.,summation over n extending from 1 to infinity.Is it the correct interpretation?
Comment: Shouldn't $p_0$ be $1-\alpha(p+p^2+\dots)$?
Comment: Summation over n should be from k to infinity in my last comment.
Comment: I have made the correction as suggested by B. M scott
Answer: Extended hint:  We sketch an argument that uses only basic notions.
Note that the probability $b_k$ of $k$ boys is, by a conditional probability argument, given by
$$b_k=\sum_{n=1}^\infty \alpha p^n \binom{n}{k} \left(\frac{1}{2}\right)^{k}\left(\frac{1}{2}\right)^{n-k}.$$
This simplifies to
$$b_k=\sum_{n=1}^\infty \alpha \binom{n}{k}\left(\frac{p}{2}\right)^n.\qquad\qquad(\ast)$$
(We define $\binom{n}{k}$ to be $0$ if $n<k$.)
There are many tools for evaluating $(\ast)$. We do it using not much machinery.
Recall the combinatorial identity
$$\binom{n}{k}=\binom{n-1}{k}+\binom{n-1}{k-1}.$$
Substitute for $\binom{n}{k}$ in $(\ast)$.
We obtain
$$b_k=\sum_{n=1}^\infty \alpha \binom{n-1}{k}\left(\frac{p}{2}\right)^n +\sum_{n=1}^\infty \alpha \binom{n-1}{k-1}\left(\frac{p}{2}\right)^n.\qquad\qquad(\ast\ast)$$
The first term in $(\ast\ast)$ is just $\dfrac{p}{2}b_k$. The second term is $\dfrac{p}{2}b_{k-1}$.
So we have derived the recurrence
$$b_k=\frac{p}{2}b_k+\frac{p}{2}b_{k-1}$$
or equivalently
$$b_k=\frac{p}{2-p}b_{k-1}.$$
This almost settles things: each time we increment $k$ by $1$, the probability gets multiplied by $\dfrac{p}{2-p}$.  To get the process started, we need $b_1$.  We have
 $$b_1=\alpha\sum_{n=1}^\infty n \left(\frac{p}{2}\right)^n.$$
There is a  trick for finding $\sum_{n=1}^\infty n x^{n}$. Using the fact that for $|x|<1$,
$$1+x+x^2+x^3+ x^4+ \cdots=\frac{1}{1-x},$$
we find, by differentiating, that
$$\frac{1}{(1-x)^2}=1+2x+3x^2+ 4x^3+\cdots.$$
It follows that
$$x+2x^2+3x^3+4x^4+\cdots =\frac{x}{(1-x)^2}.$$
Comment: Alternately, one could evaluate the sum $(\ast)$ by a repeated differentiation argument that generalizes the method we used for $b_1$.
The recurrence $b_k=\dfrac{p}{2}b_k+\dfrac{p}{2}b_{k-1}$ can also be obtained directly, bypassing the series manipulation.
Comment: There is a minor typo:It should be $b_1=\alpha\Sigma_1^{\infty}np^n$. The coefficient $\alpha$ has been left out. This does not reduce the elegance of the proof
Comment: There is a minor typo:It should be $b_1=\alpha\Sigma_1^{\infty}n(p/2)^n$. The coefficient $\alpha$ has been left out. This does not reduce the elegance of the proof
Comment: @Anamitra Palit: Thank you for noticing the typo, and telling me about it. Fixed.
Answer: Required probability=$\alpha \Sigma [(p/2)^n *nCk]$
[Summation on  "n" running from k to infinity]
The above expression=$\alpha \Sigma [(k+r) Ck *(p/2)^{k+r} ]$
[Summation on r running from zero to infinity]
Expression
     =$\alpha (p/2)^k \Sigma (p/2)^r (k+r)Ck$  -------(1)
Now,
$\Sigma (p/2)^r (k+r)Ck$
=The coefficient  of $x^k$ in the sum given below:
$(p/2+x)^0+(p/2+x)^1+(p/2+1)^2 ……..$ ------- ---- (2)
[We have an infinite number of terms in the above series].
We choose x such that:
$p<p/2+x<1$    --------[inequality A]
$=>0<p/(2-p)<2x/(2-p)<1$   --------[Inequality B]
The series given by (2)  evaluates to
$1/(1-x-p/2) = 2/(2-2x-p)$
$=2(2-2x-p)^{-1}$
$=[2/(2-p)]  [1-2x/(2-p)]^{-1}$
Inequality A ensures the convergence of the series expressed by (2).
Coefficient  of $x^k$ in the above expression is:
$2/(2-p) 2^k/(2-p)^k$  ----(3)
Inequality B ensures the workability of the binomial expansion to obtain (3)
Using expression (3) in (1) we obtain the probability=
$\alpha (p/2)^k*2/(2-p) 2^k/(2-p)^k$
$=2\alpha p^k/(2-p)^{k+1}$
Comment: Your writing style and presentation leave much to be desired.
Comment: I have put out my calculations over  here just to assert that I have been working on the problem
Comment: @Anamitra Palit: Nice work.  The convergence issues you spent some time on turn out not to matter, since yours is essentially a generating function argument.
Comment: @AnamitraPalit Why is sumation running from $k$ to $\infty$ ?
Comment: @Mathematics :we are considering the probability of exactly 'k' boys out of 'n' children[n>=k].Probability of 'n' children=alpha*p^n. The stated probability for n childeren tends to zero for n tending to infinity, p being a fraction.This is apparent from the series defining p_0: the series can converge only if p is a fraction.Now 'n' could be any integral value greater than or equal to k. So we have considered the summation from n=k to n=infinity
Comment: @Mathematics:We are considering the probability of exactly 'k' boys out of 'n' children[n>=k].Probability of 'n' children${\eq\alpha\p^n}$. The stated probability for n children tends to zero for n tending to infinity, p being a fraction.This is apparent from the series defining p_0: the series can converge only if p is a fraction.Now 'n' could be any integral value greater than or equal to k. So we have considered the summation from n=k to n=infinity


War of the JRE versions

Question: At our company we have a few applications running through java applets from various outside vendors. Our problem is this: app1 can only run on JRE 1.6.05 whereas app2 needs 1.6.16. Is there a way that we can specify which applet gets which JRE instead of picking just one JRE for all applets (and hence all users)? I don't believe that we should mandate one JRE for all users since any of these vendors because even if we find a solution, one of the vendors will release a new patch at some point that will restart this entire cycle again.
Comment: Are you hosting the applets and do you can you change the APPLET / OBJECT / EMBED tag that loads them?
Comment: Yuck.  I've never had to deal with that.  I've run across a couple apps that only run on 1.4.2, but all the rest seem to run on whatever the latest is, with no problems.
Comment: We are hosting the applets.
Answer: This sort of dependency incompatibility is one of the things that application virtualization is great for sorting out.
Using application virtualization you can package each difficult app along with it's particular version of the JVM into one virtual 'bubble' on the machine where it won't even see that there are other virtualized apps with their own versions of JVM installed in their own walled-off bubbles.
Application virtualization is provided by systems like Microsoft's App-V (formerly Softgrid), Symantec/Altiris's Software Virtualization Solution (SVS), Citrix XenApp or VMWare ThinApp.
Comment: If you have externally-driven security requirements (policy, regulation, etc) you need to be careful with this model. Virtualization is a great way to get everything working, but the downside is that you may have security exposure to Java flaws.
Comment: True, but equally it can massively reduce your exposure. If you have apps/sites that require specific older versions of Java, you can give that app the exact version it wants, whilst making the main system wide Java install the latest security patched version. The alternative would be to only install the version that works with your apps and never upgrade the system-wide version to anything newer than that.
Answer: You also have the added problem of widely exploited security vulnerabilities that make it a high risk to continue to run outdated java applets.
The solution is to stop using client-side Java, disallow internet access for users with admin rights, or deploy some sort of security appliance/proxy.
Answer: Prior to 6u10, the PlugIn JVM ran inside the browser. You can only have one JVM instance per process, so applets using different versions wasn't about to fly. Since 6u10, applets are run in a different process. With multiple external processes, version selection for applets is possible. The information is somewhere on the Sun websites...

War of the JRE versions


timer555 single pulse

Question: I'm having a quiz show project with LEDs, and a buzzer. One LED must be lit up and the buzzer should work for about 0.5 sec.
I am stuck on the problem that using circuit output state (which gets high and remains high till reset comes), I will set the trigger pin of timer555 low, but since it's continuously low, the buzzer, which is connected to the output of timer555, buzzes repeatedly.
 I'm wondering what I could do to convert a constant output to a fixed 0.5 pulse using a timer555.
Comment: Single pulse = monostable.
Comment: I know how to make use of monostable mode generally, but with my problem the trigger part is constant low (thus not a pulse), and that makes it buzz repeatedly...
Answer: You need to turn the input from a level to a edge trigger:

by adding a capacitor as shown to create a differentiator.  Try using 0.1 µF to start.  The pullup resistor, Rd can be 10K or so.  The diode is a 1N4148.
The 555 will not re-trigger until after the input has been restored to Vcc and then goes low again, no matter how long the original pulse is.

timer555 single pulse


Microsoft or Open Source?

Question: Why do some companies prefer private Microsoft solutions when in the majority of cases there are open source solutions or free software for them? What does Microsoft offer that the open sourece or free software communities do not offer?
Comment: @immibis: what planet do you live on? Clearly not Earth.
Comment: For the record, open source is being embraced by pretty much everyone these days. Even MSFT is open sourced various parts of the .NET runtime. So it's hard to figure out what you're really asking on this site.  Surely your question on a site for programmers is not about choosing to use Excel in the marketing department. If this is about tools, or programming languages, or platforms, most companies these days probably choose something other than MSFT. Java is open source. Companies choose that all the time. I think the question is based on a false premise.
Comment: Companies does not choose between "Microsoft" and "open source", they choose between actual product like Microsoft Office and Libre Office. The price tag certainly makes a difference, but there are also other important considerations like compatibility, the quality of the products, cost of retraining personnel and so on. Same issue when say designers are choosing between Adobe Photoshop and Gimp.
Comment: Sometimes Microsoft just has the better product (for example, it's hard to dispute that MS Office is better than Open Office). Sometimes open-source software is better. (GIT vs TFS).
Comment: @whatsisname One where I've used lots of open source software that doesn't *quite* do what you want, and lots of commercial software that does (usually because our company paid them to make it do what we want)?
Comment: Support is an even bigger one.
Comment: For the OP: look up the phrase "Nobody ever got fired for buying IBM". Same ideas.
Comment: see [Gorilla vs. Shark](http://blog.stackoverflow.com/2011/08/gorilla-vs-shark/) -- _"if you... don't want your question to get instantly closed... - try to keep Gorilla vs. Shark in mind."_
Answer: Here are a few reasons why a company may choose Microsoft solutions over open source:

Integration with Microsoft Windows. Company plans to target Microsoft Windows as a platform, and the company supposes that Microsoft products offer best integrations with Microsoft Windows.
Support and maintenance. By paying Microsoft, you get some level of support for the product you're paying for, and there should be bug fixes and maintenance on the software you buy.
Ease of acceptance/popularity. Most companies have some Microsoft products already deployed (e.g. Windows or Microsoft Office), so it's less difficult to convince others that buying a Microsoft product is a worthwhile investment.
Availability of human resources. Here in New Zealand Microsoft dominates the software market, so most engineering jobs are for Microsoft languages and software is deployed on Microsoft platforms. If a company were to choose an alternate language/platform it may be more difficult to find engineers to work on them.
Open source indemnification. Some companies may be concerned about legal issues of using open source software. They may suppose proprietary software is safer from a legal perspective.
Comment: Nop if you put into the market Android or iOS :-)
Comment: @Laiv: PCs (desktop or laptop) are still predominant for writing documents, technical presentations, developing software, and so on. You can sell so many smartphone as you want, but companies are still using PCs for most production tasks.
Comment: I think this sentence summarizes it: "Microsoft dominates the software market"
Answer: This is a difficult one, because different organizations will have different reasons. The reasons I have heard cited the most are:

"Everyone already knows how to use it." This is usually used as an explanation for why Windows or Microsoft Office were chosen over competitors.
"We need support and Microsoft has support contracts." This usually overlooks the fact that most major competitors to Microsoft products also offer support contracts (and frequently for less). Other times, someone performed an analysis (of some sort) and decided that Microsoft's support would better suit their needs.
"[Microsoft product name] has features that [competitor] doesn't have." I hear this one a lot with Microsoft Office when comparing to LibreOffice. This may be a valid reason for some organizations, but in my experience, the features in question are usually things that almost no one uses. If people used the features, then the open source competition would replicate them (when not patent protected).
"Our customer uses [Microsoft product] and we need to ensure compatibility." Where I work we use Microsoft Visual Studio, because a lot of our customers use Windows, so using Microsoft's compiler is a logical choice. (We also use open source tools on Linux to ensure cross-platform compatibility.)
"Because we were told to use this tool." This is the worst one I hear (usually within large organizations) and it means that someone high up the chain of command chose a tool, mandated that the organization use it, and failed to explain why. (I have a coworker who once spent months trying to find out why a proprietary software suite had really been chosen after hearing this reason.)
"[Microsoft product name] just works better." I have a bias towards open source on this point. I find that very few of Microsoft's products are significantly more stable or functional than the competition. However, I'm sure that a few of Microsoft's products do in fact work at least a little better than the competition and the experience of the decision maker may be different than mine.

Another reason that I have not heard, but that may factor in to decisions at some organizations is "trust/reliability". By this I mean that we know exactly who provided the software, we trust them not to cause too many problems, and we can rely on them being around if things suddenly get bad. Microsoft is unlikely to go bankrupt overnight. Some open source providers may.
On the one hand, if the provider of open source goes under, you can always try to maintain it yourself. An option that is not available with proprietary software, as RibaldEddie pointed out. On the other hand, if the software causes damage to your organization in some way, it's nice to know that your lawyers will definitely be able to find the right person to blame. That may not be comforting to the engineers, but managers seem to like knowing who they can blame.
As a final note, I'll address the comment by immibis. As I pointed out before, proprietary software does sometimes have a feature that some organizations need. These features usually are not widely needed, so the open source organization doesn't bother with it. However, many open source organizations are open to the idea of "bounties" where a pledge of money will result in a feature being worked. Some companies will even assign engineers to work on open source software to ensure that the features they want are there. Whether this type of arrangement works better than a proprietary license depends on the specific dynamics of the company in question.
Comment: The idea that some small or medium size company is gonna sue MSFT for anything at all is absolutely ludicrous. In fact pretty much every proprietary software license doesn't allow the user to sue anyone and the software is expressly licensed under terms that claim it's unfit for any purpose.
Comment: The OP did not specifically ask about small or medium sized organizations. Most of my experience has been as an engineer working for large organizations, so I answered from that perspective. Most lawsuits regarding software will involve larger corporations, but if the development of software were to involve gross negligence, lawsuits could involve smaller parties. (Yes, it's unlikely that Microsoft would ever be that negligent.) Also, the EULAs that we all scroll through have not always protected companies from lawsuits. EULAs have been partially invalidated by courts before.
Answer: Microsoft has a fix for everything and it is a safe bet. The dependency is there but it works both ways. With open source... not so much.
Businesses want software that just works, like you want your coffee maker to just work. You are not interested in being able to get parts from different vendors, you want to be sure it is fixed the next day if there is a problem.
MS is a big well known player offering proven technology. Businesses like that, it is stable and safe. You jump on the same boat a lot of others are happy on. They cannot be all wrong.
Depending on your infrastructure, with a few exceptions it is easy and cheap.
If you want to hand pick an OS solution for any of your problems and then try to make them work together, keeping an eye on updates, hoping they will continue to flow and not break any of your interfaces, go ahead. You better know what you are doing. Most people would choose to leave that responsibility to a party that has shown it can handle that sort of thing. Sort of.
OS is not the better or worse choice, it serves a different purpose and a different market at this moment in time. People chosing propriety over OS are typically not stupid, they just take into account more factors than your question suggests you are aware of
Comment: `Microsoft has a fix for everything and it is a safe bet. The dependency is there but it works both ways. With open source... not so much.` WannaCry :-) - Sorry I had to say it.
Comment: @Laiv WannaCry is a poor example because Microsoft *did* offer a fix. Take instead all the *other* vulnerabilities in older products for which *no fix exists* nor will ever exist.
Answer: Technically speaking, the answer is nothing. Even free and open source software can be purchased with support contracts and the like. And, indeed, since MSFT software is generally closed source, you are hitching your company's wagon to MSFT and are at their whim. If a piece of software becomes mission critical for a company and the vendor, like MSFT, decides to stop supporting it, you have zero chance of supporting or improving it yourself. With open source you can always take the code, learn it, and keep it improving indefinitely. So it's almost idiotic to run a business on proprietary code.
You'd have to ask the companies who choose MSFT software why they do.  Otherwise this question's answers are based on opinion.
Comment: For most companies it is totally unrealistic (and a waste of resources) to continue developing abandonware on their own. It is simply not a relevant consideration for anybody except perhaps governments and major IT-companies.

Microsoft or Open Source?


Materials & methods in multi-phase experiment

Question: I'm about to write my thesis (which will also be the basis of a journal article, though not written by me). I was wondering how the materials & methods section should be written, when an experiment has multiple phases. I personally find it clearer, when for each sub-experiment, the materials are listed separately. There will be some repetitions of general materials (i.e. pipets, containers, etc.), however. I was just wondering what can be considered the best way to do this.
Another thing - during my studies, lab assistants sometimes insisted the materials section should list exactly how much of a certain material is used (i.e. 10µl solution). Is this necessary, when the exact amount is already mentioned in the methods section?
Comment: Ask your thesis adviser?
Answer: Unless you are specifically precluded by the regulations of your institution, in your thesis there is typically great latitude to present material in whatever form you find clearest.
As such, if you think that it is clearer to separate each method into its own sub-section, you should do so.  Likewise, if you have separated materials and methods cookbook-style and you think it is clearer to say a measurement one rather than twice, then let clarity of presentation be your guide.  If your readers or your institutional regulations disagree with you, however, then you will likely need to change to a form that they prefer.
Answer: You usually have a lot of latitude. I'd do the following:

Introduction. Overview of the work, overview of the following chapters.
State of the art. Critical review of the relevant literature.
Overview of the experiment, phases, objectives of each, how they fit together.
Phase 1 of the experiment.
4.1. Discussion of method.
4.2. ...
Phase 2 of the experiment
5.1. Discussion of method
5.2. ...

and so on. Keep each phase as a coherent whole, Think of your gentle reader, who might just be interested in details of phase 3, and couldn't care less for the rest (they want to adapt it to a different setting, whatever).


Best practice to target an element during SharePoint branding

Question: When we customize the SharePoint site and brand it, we sometimes need to do CSS styling for the elements of the page. What is the best practice to target an element? Is it by id or class or other means? I heard that using id's we could end up in trouble when the environment of site is moved to other environment.
Answer: Styling using classes is usually the preferred way.
Especially if you see IDs in HTML in ASP.NET control format, like "ctl00_ContentPlaceHolder1_CustomUserControl1_NestedExampleLabel", you should absolutely not bind styles to those ID's as they may change, even within the same environment, as controls get added/removed from the page.
If you have control of the IDs in your custom Page Layout, Master Page, Web Part, then there is nothing wrong in binding styles to those IDs as they will be static even if you move your customizations to other environments.
Of course, when SharePoint major versions change, UI (including HTML element classes and IDs) tends to change drastically, so at that point you can kiss your style sheets goodbye.
Answer: If the page in question is a custom page, then you can use class to target the styles. That is the best practice.
On the other hand if you are talking about SharePoint elements, then we should be careful with using class, because it might be used across and will have a global impact. In those cases we used to target the control's id for styling purpose.
In some cases we relied on jQuery to get specific element and style it.
As part of branding a SharePoint site, below are the key elements you can target as part of master page

Top Navigation
Left Navigation aka Quick Launch
Site Logo
Main Content PlaceHolder
Small Search Box
Ribbon
Site Actions menu
Adding a footer
Comment: That explains it


is it possible that an attacker catch a page name from history?

Question: like if an attacker sets a dns rebinding would he be able to get the router name from the history so he can make his attack more accurate .

Comment: Are you asking specifically about DNS re-binding attacks?  Or is your question more general, such as "Is it possible for an attacker to determine if a URL is in the browser's history?"
Comment: i think  this "Is it possible for an attacker to determine if a URL is in the browser's history"
and not just determine  ... but get the  cached name of that url just like the photo .
.....
but it would  be a  really hack if it's combined with DNS  re-binding ...
Answer: I think you've confused a few things.
What kind of attacker?  What access do you mean they have?
DNS only does domain resolution - it deals with turning names into IP addresses, for what's in the URL before the first slash, when it's not an IP address.
What you posted is IP addresses, which shouldn't even touch DNS, other than potential reverse-resolves.
Comment: "What kind of attacker"

does it matter ?

"What access do you mean they have"
 outside of the network

i mean maybe when the victim visits malicious page that runs a code to get the router vendor using a dns rebinding attack
can a malicious code get the name that is shown before the ip  in the results ?
Comment: yes it matters - your question doesn't make sense since it seems to suppose parts of an attack that isn't possible or doesn't make sense, so its not clear whether you think this is someone with MitM access, someone on your network, someone coming from the internet.
Maybe edit your questions to include bulletpoints of what scenario you're worried about, since I suspect we can help correct some of your bulletpoints - something in your understanding isn't right about how stuff works.
Comment: i am talking about just like the auto fill hack
Comment: ask the question properly, but hyou can just disable autofill if you're worried about that.


Voltage drop regulator 12 V to 5 V, voltage reference with zener diodes

Question: I try to build a low voltage drop regulator to bring the voltage down from 12 V to 5 V (ignore everything right of the capacitor C3). I have a 12 V voltage supply and I want to feed my OpAmp with a voltage below 5 V. To do this I put 3 bzx84c3v3 zener diodes in series (U3, U4, U5), everyone of them has a breakdown voltage of 3.3 V. So theoretically, the voltage should drop from 12 V to 2.1 V, but it drops to only 5.56 V. Putting more zener diodes doesn't really help. Does any one have an idea why the voltage doesn't drop accordingly to the breakdown voltage?
Comment: Why not use an integrated LVDO regulator? Cheaper, simpler, more accurate, etc. than attempting to do this yourself.
Comment: @Reinderien It's homework, I needed to build a LDO myself.
Comment: Apart from the specific issue this attempted subtraction of a fixed amount from the input voltage seems an odd design.  Typically a regulator compares the *output* to a reference while trying to be immune to the *source* voltage variation.
Answer: If you observe the datasheet, you would find the appropriate working conditions where zener diode provides 3.3V drop across it on reverse breakdown. Just observe the below image from the datasheet. Bottom curve shows for 3.3V.

Closely looking at the given values, maximum voltage drop it would observe is 2.9V at 1mA current flow.

And the op-amp that you used, generally have input currents in the range of µA. That would mean the voltage across zener diode goes even low. From the result you posted. 5.56/3 = 1.85V drop is there.
For proper 3.3V. appropriate amount of current should flow through the diode.
Try looking at datasheet for in-depth reference.
Solution: Try putting pull-down resistor at opamp input(Proper value has to be selected).


How loud would a supernova, kilonova, and hypernova be?

Question: If we could hear the sounds of these explosions directly where it was happening, how loud would each of these events be?
Comment: Hi. We are expected to show some research effort with our Questions. [What would happen if you were near a supernova?](https://www.google.com/search?client=ubuntu&hs=G0n&channel=fs&q=What+would+happen+if+you+were+near+a+supernova)
Comment: A related question on our sister site: [Would we be able to hear the sun if space were full of air?](https://physics.stackexchange.com/q/107195/123208)
Comment: Sound is a compression wave, and highly compressed things get hot and squashed, it's safe to say that the gas and water would instantly be expelled from your planet and your body, so your ears would perhaps turn into hot dust within a few seconds. It would depend if you are looking forward or sideways if your ears would be squashed together or blown away in different directions. Because the planets would actually change orbits and disintegrate it's not really sound.
Answer: This is a kind of silly question because you are dealing with object (stars, etc) that cannot exist in an atmosphere so treat the whole below as a bit of a lark.
The decibel scale is logarithmic. 120 dB is one joule of sound energy. 130 Joules is ten times more: 10 Joules, 140 is 100 Joules etc. (Source)
The loudest sound on Earth is said to be Krakatoa at 180 dB.  This is a megaJoule of sound energy. (source) But Krakatoa released 840 PetaJoules in total (source) or 840 billion MegaJoules.  So 1/840000000000 of the energy was converted to sound.
If we suppose that the same fraction of a supernova's energy is converted to sound, and a supernova releases 1044 joules, That means that about 1044/(840 billion) = 1032 Joules of sound energy, thirty-two orders of magnitude greater than 120 dB,  or about 440 decibels.  This means that the sound energy would be enough to vaporise the Earth.
A kilonova is smaller, by a factor of 10 to 100, so 420 to 430 decibels, and a hypernova (really just a very large supernova) might be bigger by a factor of 10, so about 450 decibels.
These are all "silly numbers".  You can't actually put that much energy into sound waves.  So there is nothing "realistic" about this calculation.
Comment: If someone created an artificial wormwhole leading into the body of hte exploding supernova, a recording device and transmitter sent though the wormhole into the supernova could record the sound inside the supernova for a tiny fraction of a second before being destroyed.  There is no vacumn inside a star, so there should be some unimaginable type of sound within a supernova.  Of course creating artificial wormholes is almost certainly impossible.


Laurent expansion for sin(1/z)

Question: I know the Taylor expansion of $\sin(z)$, but I still don't understand how to expand it into the Laurent series. If I use the Taylor expansion $$\sin(z)=\sum_{n=0}^{\infty}\frac{(-1)^nz^{2n+1}}{(2n+1)!},$$ it still is centered at $0$. Maybe I need an example of it. Does $\sin\left(\frac{1}{z}\right)$ have a Laurent expansion centered at $0$?
Comment: Hello, there. What exactly do you know about Laurent expansions?
Comment: The singularities of $\sin\left(\frac{1}{z}\right)$ occur at $z_n=\frac{1}{n\pi}$ for $n\in\mathbb{Z}$. $0$ is the accumulation point of $z_n$ because $\lim_{n\to\infty}z_n=\lim_{n\to-\infty}z_n=0$. So it is unclear to me that the Laurent series expansion centered at $0$ converges anywhere at all. However, this also seems off to me, so I must be missing something. It would be helpful if someone could tell me if I am correct or not.
Comment: Wait, never mind. Obviously I am wrong. I was confusing the singularities with the zeroes. That was quite the brain fart.
Answer: The series you have tried to write (look it up as it is not written correctly) converges for every complex value of $z$. So, if you replace $z$ with $\frac{1}{z}$ in that formula, you get a Laurent series, the one you are looking for, obviously converging for every $z$ except $z=0$.
$z=0$ is called an essential singularity of $\sin{\left(\frac{1}{z}\right)}$. This type of series contains an infinite number of negative power terms.
Comment: If by "remnant" you mean the residue, the series does have a residue because the residue is the $a_{-1}$ coefficient of the series. So what is the value of the residue here?
Comment: Yes ,i agree with you on that .Can I think that the singularity of nature has no remnants?is it correct?

Laurent expansion for sin(1/z)


If a server is lagging, why is a sound made when blocks are broken, but not placed?

Question: I have a server I have access to via SSH. I compiled craftbukkit and am now running Craftbukkit 1.8.3 on the server. I started the Minecraft server, but I wanted to do some other stuff in the terminal, so I pressed Ctrl + Z, and backgrounded the process. The server then timed out, but I noticed, when a server times out, you can still break blocks, but the information won't be sent to the server. But, if you break blocks, you still hear the noise of the block being broken. However, when you place blocks, you don't hear the noise of the block being placed. Why does this happen?
Comment: Could it be the way the block-breaking and block-placing code was written?
Comment: Why is it marked as off-topic? (The Minecraft Source code is open for anyone to look at)
Answer: When your server times out block updates are no longer sent.
There are no block updates on destroy block commands until the corresponding item inside the block (ore/cobblestone) is dropped, or the player with moderator hulk fists removes it's presence from the data stream of the server.
But placing blocks results in an immediate block update call, which cannot happen since the server has timed out, since the code has probably been written so that the sound plays on success or something similar, that's where you get the issue.
Or so I believe.
Correct me if there's a more appropriate answer.
P.S.: Why are you wondering about this, does it have significance to you specifically?
Comment: It doesn't really have any significance, I was simply wondering about Minecraft mechanics. Thanks for the good answer, +1'd and selected. :)


How to fix laptop audio

Question: I have an IBM ThinkPad z61t and the audio cuts in and out almost on a monthly basis - it'll work for about a month then not work for about a month.  I've tried multiple operating systems and figured out that drivers aren't the problem - when it works it works on all of them and when it doesn't it doesn't.  I know its a hardware issue, but I can't see anything wrong with it when I open it up and look at it.  Help please.
Comment: Does this hold for all audio? As in does it happen for both the audio jack as well as the speakers?
Comment: Yes, all audio cuts out - built-in microphone/speakers, auxiliary out, and mic in all cut out
Comment: Wow thanks I was not expecting such a detailed, intelligible answer.  I will definitely try it, and even if it doesn't work, thanks for such a great answer :)
Comment: You're welcome. I expanded the answer a bit and put it up as an answer. Beware that you should be prepared to replace the motherboard if this goes wrong.
Answer: That does sound like your audio chip has some sort of faulty connection. One thing you could try is to locate it on the motherboard and use a hair dryer or heat gun to reflow the connections. Stop blowing hot air just after seeing some solder melt. Also, make sure to cover any components you're not trying to fix with aluminium foil, because you might accidentally break a connection or damage a component. The challenge is to direct enough (and not too much) heat towards the chip. Also, you'd should find the location of the chip on the internet before trying.
If the above solution does not work, you can try reflowing the whole motherboard in the oven. I've seen reports of people putting the whole mainboard in the oven at 190 degrees for a similar repair, yielding mostly positive results. This is much more work, as you have to remove the CPU, CMOS battery, any tape and similar, thermal pads, wires and antennas etc. Find a description of how to do it here [1], or google "how to reflow a motherboard".
If neither solution works, getting a new mobo is the only solution that will get things back to how they were. A second hand motherboard can typically be found for 30-60 euro's for a similar machine, but availability might be an issue. Count 20 minutes to 6 hours labour depending on your experience (it takes me 20 minutes now, but 6 hours the first time, being very careful).
If you don't care about the microphone so much, you could buy a cheap USB external soundcard. There are options out there for <30 euro's which sound pretty decent (most likely better than the built in one). That can also have RCA output should you want to connect to an amplifier. If you have a bit more money and do care about a microphone you could get a similar USB interface, but one that includes a mic input.
ref [1]: https://www.computerrepairtips.net/how-to-reflow-a-laptop-motherboard/
Comment: Thank you so much this worked and fixed all my problems and I am no longer sad thank you thank you thank you
Comment: I upvoted the answer but I don't have enough rep
Comment: Np, glad you could fix it. What exactly did you do in the end? This could be useful information for the next person to have the issue.
Comment: I used the blow dryer for 5 minutes then I put the laptop back together and pressed the power button and got really worried because it wasn't working but I realized the problem was from something else I did that had nothing to do with blow drying it (the screen came unplugged while I was wiring in some fans and I didn't realize).  After I fixed the other problem and turned it on, I wasn't expecting anything to happen, so that if nothing did I wouldn't be disappointed.  But it did work.

How to fix laptop audio


Prerequisites for Geneterating functions

Question: Well Ill try to be as short as I can - I have an exam in descrete maths, but sadly our discrete maths course isnt compatible with general courses because it has other stuff included in the course aswell. I have prepaired the entire exam 3 times for now, but every time I had just 1 part left that I couldnt finish, which is recurent relations and generating functions. I complete all the other parts and get so overwhelmed when I get to this one that I cant even describe it. The problem is that there is so much stuff I know nothing about, that I dont even know where to start. I passed my calculus exam without deep study, just did it to pass the exam and that left me crippeled for many courses to come. I do have planned to revisit the Calculus parts from scratch, but now its simply not the time because the deadlines are coming closer. I need to know, in detail, which are the prerequisites that I must learn before being able to tackle generating functions, because just knowing what I have to do would make the whole thing so much easier. Study resources are welcome aswell, but I dont want to be greedy here. Tnx in advance!
Answer: The main prerequisite for ordinary generating functions would be a concrete understanding of sequences, Sigma notation / manipulation and the various closed form expressions for common sums, basic differential calculus including Taylor Series and knowing what a power series is.
Assuming you have a decent Maths background you shouldn't have too much trouble in covering / refreshing these topics in a day or so.
I would also add that while not a prerequisite, an understanding of Recurrences (Divide & Conquer and Linear) may help you understand why Generating Functions are used.
MIT have a great 25 page document on Ordinary Generating Functions that you may find helpful. It is part of their wider Discrete Mathematics course.
Link here


How do I add freeglut to a Visual Studio project?

Question: I am working on making a game for Windows in c++. I have previously made games for Ubuntu using freeglut, and I found freeglut for windows, but when I added it to the Configuration Properties\VC++ Directories\Library Directories tab in visual studio, visual studio complains about 'undefined reference' whenever I use a freeglut method. Does anyone have a solution?
Answer: When you right click on the project you have to also add the filename of the library under "Linker->Input->Additional Dependencies".
Just in case: You also have to tell Visual Studio where to find the header files in case you haven't yet. This can be done under "VC++ Directories->Include Directories"
Make sure you define the right libraries for Debug and Release builds. Most libraries have libraries/dlls with d added to the name that can be used for debugging. Switch the Configuration between Debug and Release in oder to set input files. Of course you can use the release libraries for Debug too.


How do I get a society that is very isolated but doesn't lose much because of it?

Question: I want to have a society that is very isolated (physically) and has been for long enough that it doesn't really believe that there's anyone else out there. I also don't want the society to be in any way motivated to explore outside of its area. General background info about society (still up for change): The land where the people live is warm and fertile. They live in a river valley surrounded by mountains except at one end, where the river flows out. The society itself is matriarchal and has a polytheistic religion. There is one government, a monarchy lead by a queen but that also has a small aristocratic class. Most of the people there are farmers, fishing people, or artisans. There are other people who live not too far away on the other side of the mountains, but the occupants of the river valley are unaware of their presence.
Comment: A society which lives on a populated continent but which doesn't know that there are other people around? Talk about stretching the readers' ability to suspend their disbelief. You do realize that even if this society is made up of particularly uncurious humans _the other_ societies will puncture their bubble? After all, both China and Japan tried to keep themselves isolated from the world and then the European navigators happened...
Comment: Sounds like [Moana](https://en.wikipedia.org/wiki/Moana_(2016_film)) only with mountains. Just forbid exploration with the good old traditional reason: We always did it like this and bad things will happen if we change.
Comment: The classic example is China. It was big enough geograghically, rich enough in wealth and resources, had enormous cultural diversity, and was the most technically advanced society for much of its history. Europeans only discovered when it was in regressive phase (China was occupied by a Manchurian regime). To the Chinese it was the centre of the world. They weren't isolated and the rest of the world offered effectively nothing. Japan chose to isolate itself from the world. So it is quite different, but interesting.
Answer: Internal struggles would probably be the best reason for why the society would be unmotivated to explore.Exploration costs money and other government resources, which is why explorers like Christopher Columbus had trouble raising money for their proposed expeditions. If the government was facing instability, it would likely be reluctant to give any resources to an expedition, because there is no guarantee the expedition would prove fruitful. As AlexP pointed out in his comment though, it is incredibly unrealistic that a society would be unaware of another civilization living just beyond the mountains, even if they didn't explore. The only reason I could think of is that the surrounding area must be so dangerous, that it makes any communication difficult.
Comment: If the mountains were very high and dangerous, how much would that prevent people from voyaging? Also, if the valley already basically had what it needed, would that be enough to prevent people from seeking more?
Comment: Welcome to WorldBuilding! If you have a moment please take the [tour] and visit the [help] to learn more about the site. Have fun!


How to perform GPS post-processing

Question: I'm new to the GPS world. I need to know how to perform post-processing with DGPS. I found definitions on the net of what DGPS, post-processing, etc. are, but, couldn't find clear steps on how to actually do DGPS post-processing. While searching for providers, I found that CORS data Rinex files are available to the public for free download from NOAA.
I don't get what I should do to use the downloaded data to post-process my GPS data. Is any free post-processing software available? Also, I use an Android phone (HTC Magic) as my GPS receiver, and I need to figure out how to enable GPS logging into a file in my Android application so that the GPS data can be used for post-processing.
Answer: RTKLIB has many nice features and produces reliable results.

How to perform GPS post-processing


Access Database not updating with OleDb

Question: Here's my update method
<code>public void Update(string query, List<OleDbParameter> parameters)
        {
            OleDbCommand cmd = new OleDbCommand();
            OleDbTransaction transaction = null;
            query = "UPDATE " + query;

            foreach (OleDbParameter parameter in parameters)
            {
                cmd.Parameters.Add(parameter);
            }

            this._Connect();

            transaction = _connection.BeginTransaction();
            cmd.Connection = _connection;
            cmd.CommandText = query;
            cmd.Transaction = transaction;
            cmd.Prepare();
            int linesUpdated = cmd.ExecuteNonQuery();
            transaction.Commit();

            this._Disconnect();

        }
</code>
Full class
<code> public class DBAdapter
    {
        private OleDbConnection _connection;

        private void _Connect()
        {
            this._connection = new OleDbConnection();
            _connection.ConnectionString = ConfigurationManager.ConnectionStrings[1].ConnectionString;
            _connection.Open();
        }

        private void _Disconnect()
        {
            _connection.Close();
        }

        public void Update(string query, List<OleDbParameter> parameters)
        {
            ...
        }

    }
</code>
When I launch my application, this works well :

I select user by id
I store data in an object, I display the user's name. Then I modify user's name property.
I save it to database
I select again the same user
I display again the user's name : value displayed was changed, so the update method works.

But when I close my app and launch it again, It displays me the old value, then the new value, like I didn't make any changes. What's wrong with my code ?
EDIT : I found the problem. My .mdb file is located in //Assets/Database/, when I run my app, the file is copied in bin/Debug/assets/Databases/.
How should I update the original file ?
EDIT (2) : Solved! Can I commit changes to actual database while debugging C# in Visual Studio?
Answer: just you can change path of connection string to update you'r original file but i dont recommend you i recommend you to right click on original file in solution explorer and select properties and set "Copy to out put directory" to "Copy if newer"
Comment: That's exactly what I did! (:

Access Database not updating with OleDb


Maximum likelihood estimate of Gaussian given rounded observations

Question: Suppose there is a hidden gaussian with mean $\mu$ and variance $\sigma^2$, and that $X_i \sim \mathcal{N}(\mu,\sigma^2)$ where the $X_i$ are i.i.d.  If I can only oberve the rounded value of $X_i$, i.e. $Y_i = \lfloor X_i + 1/2 \rfloor$, is there an effective means of computing the maximum likelihood estimates of $\mu$ and $\sigma$?
Comment: Maximize the log of the likelihood:  $\log L=\sum _{i=1}^n \log \left(\Phi \left(\frac{\left(y_i-\mu +\frac{1}{2}\right){}^2}{2 \sigma ^2}\right)-\Phi \left(\frac{\left(y_i-\mu -\frac{1}{2}\right){}^2}{2 \sigma ^2}\right)\right)$.
Comment: That makes sense.  I have accepted the answer from @JimB.  I am in a situation where I want to update mu and sigma for 50000 different gaussians 15 times a second on commodity hardware, so I doubt that a numerical solver will be fast enough.
Comment: Not sure what you mean by "I doubt that a numerical solver will be fast enough."  There is no simple closed-form solution for such censored data.  All approaches will be iterative.  But if there's a wide range of integers, then just calculating the usual sample mean and standard deviation might be good enough.  (And "good enough" is a subject matter issue and not a statistical issue.)
Comment: Any statistical software they let's you specify that data are censored to lie in intervals or that lets you specify your own likelihood should do the job.
Answer: As @Björn suggests, using package software is likely to work best in that the code is (again, more likely to be) debugged, have better documentation, be repeatable, less prone to numerical precision issues, and gives you someone else to blame.
But if you need to write your here is a bare-bones approach using R:
<code># Generate data
  set.seed(12345)
  x = rnorm(100, mean=20, sd=2)

# Round data
  y = round(x)

# Define log likelihood function
  logL = function(p, z) {
    mu = p[1]
    sigma = p[2]
    sum(log(pnorm(z+0.5, mu, sigma)-pnorm(z-0.5, mu, sigma)))
  }

# Initial values
  mu0 = mean(y)
  sigma0 = sd(y)

# Find maximum likelihood estimates
  sol = optim(c(mu0, sigma0), logL, z=y, control=list(fnscale=-1), hessian=TRUE)

# Show results
  cat("MLE of mu: ", sol$par[1], "\n")
# MLE of mu:  20.46009

  cat("MLE of sigma:", sol$par[2], "\n")
# MLE of sigma: 2.277309

# Estimates of standard errors and covariance
  cov = solve(-sol$hessian)
  cat("se of MLE of mu:", cov[1,1]^0.5, "\n")
# se of MLE of mu: 0.2295532
  cat("se of MLE of sigma:", cov[2,2]^0.5, "\n")
# se of MLE of sigma: 0.1636504
</code>
Comment: Note that this can be made more efficient if the frequencies of each integer are tabulated.  But unless you're also doing a bootstrap or have a huge sample size, there might not be much improvement in speed.
Comment: Nice touch with the Hessian. I think that is in the spirit of what the OP was asking. :)
Comment: @PeterLeopold.  Gotta have measures of precision with every estimate.  One of my standard soapbox speeches/sermons.
Answer: (My solution is basically the same as what @JimB suggested in his comment.)
First, some theory:
We can think of $[x]=x+\epsilon$ where $f(\epsilon) \sim (1-\delta)+2\delta\epsilon$ for $1/2\le \epsilon \le 1/2$. This is a sloping distribution that approximates $N(x|\mu,\sigma^2)$) by a line with slope $2\delta=N'([x]|\mu,\sigma^2)=-\frac{[x]-\mu}{\sigma^2} N([x]|\mu,\sigma^2)$. We see that $\delta$ is nearly zero when $x \sim \mu$ or when $x\gg\mu$ or $x\ll\mu$. $\delta$ is a maximum value around the inflection points $[x] \sim \pm \sigma$, which is where a lot of the action happens.
The mean of $y$ is found to be an unbiased estimator of $\mu$.
$$E(y)=E([x])=E(x+\epsilon)=E(x)+E(\epsilon)=E(x)=\mu$$
where I have used $E(\epsilon)=0$ since $E(\delta)=0$ by symmetry.
For variance,
$$var(y)=var([x])=var(x+\epsilon)=var(x)+var(\epsilon)$$
where $var(\epsilon)$ is estimated as a function of $\delta$ to be
$$var(\epsilon) \sim 1/12 - \delta^2/36=\frac{1}{12} (1-\delta^2/3).$$
This would now have to be averaged over the distribution of values of $\delta,$ which is doable but tedious.
On 10,000 simulations of 1000 random normals with means around 50 and variances around 100, I find

which contains at least one big surprise. The average value is $1/12$ as perhaps expected, but this figure shows that for about half of the simulations, the effect of rounding the data to integer is to underestimate $\sigma^2$ rather than to overestimate it, as would be expected from basic probability theory.
Perhaps this is because there is assumption that $x$ and $\epsilon$ are independent is false!
Regardless, now to the optimization problem in $\mu$ and $\sigma$
Here is an example, in R.
<code>rm(list=ls())

mu=50
sigma=10
N=1000
data=rnorm(N,mu,sigma)
idata=round(data,0)

indices<-seq(round(mean(idata)-5*sd(idata)),round(mean(idata)+5*sd(idata)))

logLike<-function(pars,idata,indices){
  mu=pars[1]
  sigma=pars[2]
  imin=min(indices)
  ps<-pnorm(indices+.5,mu,sigma)-pnorm(indices-.5,mu,sigma)
  logps<-log(ps)
  -sum(logps[idata-imin+1])
}
startingPars=c(mean(idata),sd(idata))
oo<-optim(startingPars,logLike,idata=idata,indices=indices,control=list(reltol=1e-12))
print(paste("target Sigma",sigma))
print(paste("sample sigma",sd(data)))
print(paste("sample integerized sigma",sd(idata)))
print(paste("optimized sigma",oo$par[2]))
</code>
One example of this gives
<code>[1] "target variance 127.743486150357"
[1] "sample variance 124.050532385344"
[1] "sample rounded variance 124.173364364364"
[1] "optimized variance 123.965644616766"
</code>
In this one case, we see that rounding increases the variance and that optimizing reduces the estimate to a value closer to the original sample variance, which is the best linear unbiased estimator of the target variance.


Pendant Light on Track Light System

Question: I'm trying to install a pendant light to my halo style track fixture. I purchased a pendant light from ikea and an adapter for the track light system. The name of the pendant is the nymane and I purchased a Nora lighting NT368 adapter. My question centers around the wiring of the pendant into the adapter. In the cable that attaches to the ceiling, there is only a live and neutral wire while the ground is attached to the mount. In the adapter, there is a live, neutral and ground wiring. Is there any way that I could attach the pendant without the ground and still not cause any safety issues or is it possible to just leave the wiring of the ground our altogether?
Comment: Are you mounting the pendant light to the ceiling and powering it from the existing track?  Or mounting the pendant light to the track?
Comment: If there is no ground in the downwire then the fixture itself doesn't need a ground. What is the construction of the fixture?  Plastic?  The mounting plate that you will be discarding needs to be grounded  because it's metal.
Comment: I was going to mention what Tyson just said but I do have a few questions. First is the plate showing in the last picture part of the fixture at the end of the cord? Second is the fixture supported from the track by the cord only? Third, does this fixture have a UL or CSA stamp anywhere?
Answer: If the pendant fixture has a metal connection to that plate under normal installation, then I would recommend adding a wire somewhere inside the fixture to connect with the ground wire in the adapter.  If, however, the pendant is designed to hang purely from that 2-wire cable, then clearly the fixture doesn't need to be grounded, so just attach hot and neutral to the adapter.

Pendant Light on Track Light System


Any real use of pointers in C#?

Question: What is a situation while coding in C# where using pointers is a good or necessary option? I'm talking about unsafe pointers.
Comment: Ahhh man, I saw the question and got all happy because I would get to explain that in C# you use pointers all the time but you had to go and ruin that by explicitly saying the unsafe keyword. Dang it! :)
Answer: From the developer of C# himself:
The use of pointers is rarely required in C#, but there are some situations that require them. As examples, using an unsafe context to allow pointers is warranted by the following cases:

Dealing with existing structures on disk
Advanced COM or Platform Invoke scenarios that involve structures with pointers in them
Performance-critical code

The use of unsafe context in other situations is discouraged.
Specifically, an unsafe context should not be used to attempt to write C code in C#.
Caution:
"Code written using an unsafe context cannot be verified to be safe, so it will be executed only when the code is fully trusted. In other words, unsafe code cannot be executed in an untrusted environment. For example, you cannot run unsafe code directly from the Internet."
You may go through this for reference
Comment: "unsafe code cannot be executed in an untrusted environment." Did you mean "trusted"?
Answer: yes, there are real uses, when performance is critical and the operations are low-level
for example, i've only needed to use pointers in C# once, for image comparison. Using GetPixel on a pair of 1024x1024x32 images took 2 minutes to do the comparison (Exact match). Pinning the image memory and using pointers took less than 1 second (on the same machine of course).
Comment: I have you used LockBits for that... ( http://msdn.microsoft.com/en-us/library/system.drawing.imaging.bitmapdata.aspx )
Comment: Sure it did, it existed since 1.0...
Comment: @configurator: this was .net 2, LockBits didn't exist
Comment: @configurator: my error, i got confused navigating the MSDN documentation (when i changed to .net 2 in the droplist it went to a completely different page that did not mention lockbits). Yes, that's how you pin the image memory.
Answer: You have to remember that the designers at Microsoft are smart people and everything they add to C# has at least 1 use case. The FParsec project uses unsafe code to bring out every last drop of performance that C# is capable of. Take notice of the usage of fixed and stackalloc.
private char* ReadCharsFromStream(char* buffer, int maxCount, out string overhangChars) {
    Debug.Assert(maxCount >= 0);
    fixed (byte* byteBuffer = ByteBuffer) {
        overhangChars = null;
        try {
            while (maxCount >= MaxCharCountForOneByte) {// if maxCount < MaxCharCountForOneByte, Convert could throw
                int nBytesInByteBuffer = FillByteBuffer();
                bool flush = nBytesInByteBuffer == 0;
                int bytesUsed, charsUsed; bool completed = false;
                Decoder.Convert(byteBuffer + ByteBufferIndex, nBytesInByteBuffer,
                                buffer, maxCount, flush,
                                out bytesUsed, out charsUsed, out completed);
                ByteBufferIndex += bytesUsed; // GetChars consumed bytesUsed bytes from the byte buffer
                buffer += charsUsed;
                maxCount -= charsUsed;
                if (flush && completed) return buffer;
            }
            if (maxCount == 0) return buffer;

            char* cs = stackalloc char[MaxCharCountForOneByte];
            for (;;) {
                int nBytesInByteBuffer = FillByteBuffer();
                bool flush = nBytesInByteBuffer == 0;
                int bytesUsed, charsUsed; bool completed;
                Decoder.Convert(byteBuffer + ByteBufferIndex, nBytesInByteBuffer,
                                cs, MaxCharCountForOneByte, flush,
                                out bytesUsed, out charsUsed, out completed);
                ByteBufferIndex += bytesUsed;
                if (charsUsed > 0) {
                    int i = 0;
                    do {
                        *(buffer++) = cs[i++];
                        if (--maxCount == 0) {
                            if (i < charsUsed) overhangChars = new string(cs, i, charsUsed - i);
                            return buffer;
                        }
                    } while (i < charsUsed);
                }
                if (flush && completed) return buffer;
            }
        } catch (DecoderFallbackException e) {
            e.Data.Add("Stream.Position", ByteIndex + e.Index);
            throw;
        }
    }
}

Comment: Raymond Chen has often said that features at Microsoft start at -100 "points". In order a feature to be implemented, it "has to have a significant net positive effect on the overall package for it to make it in". Here's ericgu's blog post about this c.2004: http://blogs.msdn.com/b/ericgu/archive/2004/01/12/57985.aspx
Comment: I'd say the developers (at Microsoft or any other companies) would be an idiot if they included some feature because it has 1 use case. A feature should have much more than just 1 use cases; otherwise it is a bloat.
Comment: I'm pretty sure some String operations internally use unsafe code. So, FParsec may not have been the priority.
Answer: I once had to use pointers (in the unsafe context) in a C# based windows application that would act as an interface to a headset. This application is a user interface that would allow agents (at a call center) to control their headphone settings. This application acts as an alternate to the control panel given by the headset manufacturer. Thus, their ability to control the headsets were limited when compared to the options available. I had to use pointers because I had to use the API (a Visual C++ dll) provided by the headset manufacturer using P/Invoke.

Any real use of pointers in C#?


How do I move a product attribute (size guide) closer to the product description?

Question: We have a client website which has been built on Magento 1.9 by a third-party. We would like to move the size guide attribute further up the page so it's closer to the size drop down or product description. We've been able to display the attribute label by adding some code to the required product view template but we can't seem to get the size guide text and link appearing.
Comment: Check the code you are calling is correct for attribute value or find some solutions to call the attribute value using attribute identifier. As you are doing fine by adding custom code to call the size guide in the view file.
Answer: You will be using the same code to output your item's attribute-value.  Some variations will work, but if your attribute is called size_guide it would generally look like this:
<?php echo $_product->getData('size_guide'); ?>
That said, there are a couple of ways that you can put the code.

Option 1  (quick & dirty):
Add the code-snippet to an existing file within your theme's fallback.
copy the contents of app/design/frontend/ultimo/klog/template/catalog/product/view/type/options/configurable.phtml to app/design/frontend/[vendor]/[theme]/template/catalog/product/view/type/options/configurable.phtml
Then just place your snippet at the bottom of the file:
<?php echo $_product->getData('size_guide'); ?>
This might require some editing depending on what the actual data is for your attribute

Option 2 (longer, but cleaner):
Add the code-snippet to a new block added through layout XML.
In app/design/frontend/[vendor]/[theme]/layout/local.xml add the following snippet:
<catalog_product_view>
    <reference name="product.info.options.wrapper">
        <block type"catalog/product_view" template="path/to/your/template.phtml" name="sizeguide" />
    </reference>
</catalog_product_view>

Then in app/design/frontend/[vendor]/[theme]/template/path/to/your/template.phtml place the following snippet:
<?php $_product = $this->getProduct(); ?>
<?php echo $_product->getData('size_guide'); ?>

Again, you might need to do some editing depending on what the actual data is for your attribute and how you want to present it.
Answer: I've tried using
<?php echo $_product->getData('size_guide'); ?>

but it outputs the attribute label and ID.  Not the actual data. Which should be a string of text which is a hyperlink to the size guide modal window.
The theme has no layout.xml file.  So whoever made the theme has modified it using other methods.

Ok, so i used <?php echo $product->getAttributeText('attr_id')  ?>
where attr_id is the 'size_guide' and it's now working perfectly fine.


Schenghen visa enquiry

Question: I am an 18 year old who has been a UK resident for about 11 years. I just finished my alevels and I am about to
go to uni. Planning to apply for a Spanish schengen visa for my prospective travel in September. However, I am struggling to provide evidence of my student status as I am yet to receive my results so I am not officialky enrolled. Can I just use my offer letters as proof of my student status?
Comment: Do you yet qualify for British citizenship? If so, obtaining it will make your future international travels much easier.
Comment: Unfortunately not. Just realised i made an error in my post. Actually been a resident for about 7 years. Due to the system and the format of my residency. Have about 10 years to go
Comment: Additionally, I am also struggling to prove financial subsistence. Babysitted all through my time at school so saved up quite a bit for traveling. However i stupidly never opened a bank account until recently so only have about 2 months worth of bank statement and the Spain schengen visa requires 6 months. Was thinking if it it was possible to use a guardians or will it really matter?
Comment: I'm not familiar with the details, but as a long term resident, isn't there some form of free movement that applies here? What kind of paperwork do you hold?
Answer: No, not according to the Consulate of Spain in London, whose website states the following for required documents:
"Students: Recent, official and signed letter from the UK school / college / university on headed paper stating date of issue, name of the applicant, type of studies, number of lessons (hours) per week and confirming attendance record (a letter of enrolment is not acceptable). The minimum attendance must appear on the letter. "
http://www.exteriores.gob.es/Consulados/LONDRES/en/Consulado/Pages/DocumentsRequired.aspx

Schenghen visa enquiry


How do I install CVXOPT for Python 2.7 on Windows 10?

Question: Ultimately I am trying to install CVXPY for Python 2.7. CVXPY has a few requirements including CVXOPT. I have tried two approaches, installing from Gohlke's website, where he hosts Windows Binaries for Python Extensions: http://www.lfd.uci.edu/~gohlke/pythonlibs/ and building from source myself.
When using the binaries provided from Gohlke, I get the following error when trying to import in python:
import cvxpy
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
...
File "C:\Python27\Lib\site-packages\cvxpy\interface\cvxopt_interface\dense_matrix_interface.py", line 26, in <module>
import cvxopt
File "C:\Python27\Lib\site-packages\cvxopt\__init__.py", line 32, in <module>
import cvxopt.base
ImportError: DLL load failed: The specified module could not be found.

I have checked that the base.pyd file is present in cvxopt/
When building from source I followed the instructions from the site and when eventually building CVXOPT with python setup.py build --compiler=mingw32 I got the following error:
C:\MinGW\bin\gcc.exe -mdll -O -Wall -Isrc/C/SuiteSparse/AMD/Include -Isrc/C/SuiteSparse/SuiteSparse_config -IC:\Python27\include -IC:\Python27\PC -c src/C/SuiteSparse/SuiteSparse_config/SuiteSparse_config.c -o build\temp.win32-2.7\Release\src\c\suitesparse\suitesparse_config\suitesparse_config.o
src/C/SuiteSparse/SuiteSparse_config/SuiteSparse_config.c: In function 'SuiteSparse_tic':
src/C/SuiteSparse/SuiteSparse_config/SuiteSparse_config.c:358:21: error: storage size of 't' isn't known
 struct timespec t ;
                 ^
src/C/SuiteSparse/SuiteSparse_config/SuiteSparse_config.c:359:5: warning: implicit declaration of function 'clock_gettime' [-Wimplicit-function-declaration]
 clock_gettime (CLOCK_MONOTONIC, &t) ;
 ^
src/C/SuiteSparse/SuiteSparse_config/SuiteSparse_config.c:359:20: error: 'CLOCK_MONOTONIC' undeclared (first use in this function)
 clock_gettime (CLOCK_MONOTONIC, &t) ;
                ^
src/C/SuiteSparse/SuiteSparse_config/SuiteSparse_config.c:359:20: note: each undeclared identifier is reported only once for each function it appears in
src/C/SuiteSparse/SuiteSparse_config/SuiteSparse_config.c:358:21: warning: unused variable 't' [-Wunused-variable]
 struct timespec t ;
                 ^
error: command 'C:\\MinGW\\bin\\gcc.exe' failed with exit status 1

I did some research into this and error: storage size of 't' isn't known but i can't determine if it's CVXOPT's fault or Windows?
I'm using Python2.7 on Windows 10. Any suggestions or clarity on some of these issues would be great. Like I mentioned, just trying to get CVXPY working, but seem to be hung up on CVXOPT. Thanks!
UPDATE
I was able to get a working installation of CVXOPT by uninstalling the current numpy version I had and downloading / installing the numpy-mkl whl from http://www.lfd.uci.edu/~gohlke/pythonlibs/#numpy. I then installed CVXOPT and CVXPY from the site as well. Finally was able to get a successful import cvxpy without the cvxopt.base DLL error.
Still would be curious about the compilation error I was having.
Comment: Thanks for saving my day using wheels from gohlke. Still curious why the numpy version in anaconda doesn't work.
Answer: thank you for this. My 2 cents on this:
With Anaconda on Windows 7 I just used the omnia repo conda install -c omnia cvxopt. It looks like it's working. Will update here if it breaks.


Save Channels in PS separately

Question: Is there a way to save channels in PS separately with transparent whites like in this picture – resp. Does anyone know how this is done if not with separated channels?
Answer: you can save your Photoshop file included the main CMYK or RGB channels and you may export one channel separately by switching off all channels that you don't want and export the visible result to a separated file.
also you can do the same effect with any colors you want (not the main CMYK or RGB) by using the "Duotones" mode.
for converting a full color image to a duotone one please do the following.

Convert the image to grayscale by choosing Image > Mode > Grayscale. Only 8‑bit grayscale images can be converted to duotones.
Choose Image > Mode > Duotone.
In the Duotone Options dialog box, select Preview to preview the image.
For the Type option, select Monotone, Duotone, Tritone, or Quadtone.
Click the color box (the solid square) to open the color picker, then click the Color Libraries button and select an ink book and color from the dialog box.
Answer: If anybody else is looking for the same: After I followed hsawires's steps, I managed to get the whites transparent by doing the following things:

Select all (Cmd+a), copy (Cmd+c)
Go to the Channels-Panel, create a new Alpha Channel Paste the picture (Cmd+v), Invert it (Cmd+i)
Go back to the Layer-Panel, Select > Load Selection > Choose your new created Alpha-Channel
All white areas should be selected and you can just add a new Layer Mask
Answer: Yes you can do it manually.

Make MODE > CMYK.
Flatten the image and go to channels.
Click the icon right above and click split channels
(it will now create 4 grayscale CMYK windows).
You may go with the 1st window, the CYAN. Convert it to MODE > CMYK.
Go to LAYERS. Create a new fill layer with CYAN color on top and click the blending mode to SCREEN.
Do the same with the rest (MYK).

Save Channels in PS separately


Creating a bootstrap Dockerfile that automatically exposes files to the host operating system

Question: I'm trying to create a bootstrap Dockerfile for web development.
I would like any containers to allow for access of my code from within and also from the host operating system (Mac OS X).
I cannot tell from the Docker reference what is the best way of automating this process.
Answer: Use a volume that mounts the code on the host into the container e.g:
docker run -d -v /Users/me/code:/code IMAGE
You should now find the /Users/me/code is accessible at /code in the container. The boot2docker VM has shared your home directory, so there should be no problem mounting a volume from there.
Refer to the official docs for more information: https://docs.docker.com/userguide/dockervolumes/


Changing coordinate systems in python

Question: I am working on a visual python program that is meant to model the orbit of an electron around the core of a Hydrogen atom.  In order to avoid the singularity at r = 0 in the equation for coulomb force, I am modelling this scenario in semi-parabolic coordinates.  My question then is how can I change from cartesian coordinates to semi-parabolic coordinates within python?
Answer: I'd start with a pair of functions that converts from one coordinate system to another:
<code>rho, tau = fromCartesian(x, y)
x, y = fromParabolic(rho, tau)
</code>
I hope you have the formulas and won't have trouble implementing the functions.
Then you convert the coordinates where it's convenient. I suppose that you should read input values, convert to parabolic, do your calculations, convert back to Cartesian and output.
Comment: I would add that to avoid accumulating rounding errors between the two coordinate types, it may make sense to implement a data type that stores one and converts to the other as needed, perhaps with caching.
Comment: Do you mind elaborating on what you mean by implementing a data type?  I'm not sure how I would do what you said although I agree that I need a way to minimize the rounding errors in between the two systems.
Comment: @Snowman: Unless you make great many transformations of the same coordinate pair to and fro, and the coordinates themselves being close to the ends of the range of 64-bit floating-point value, I'd suspect that rounding errors of _this type_ can be neglected. I suspect that the actual electron simulation will introduce much more. OTOH it's wise to keep the computation data in one coordinate system and only translate it to the other sparingly (e.g. for output each frame of animation).
Comment: @BB'18: "Premature optimization is the root of all evil" (q), so hold to the simplest correct algorithm you can produce, identify its problems (if any) and address them. When can easily predict what can be a problem (using an O(n²) algorithm instead of a linear one, getting your values very close to 0, etc), address it outright. When you only _suspect_ that something could be a problem, measure first, optimize later; human intuition is easily fooled in this respect.

Changing coordinate systems in python


Linkedin company name

Question: I worked for a company through an outsource company, but I have nearly no relation with the outsourcing company except they paid the salary. It was all done on a contract basis so I was never employee of the outsourcing company.
In my linkedin profile I put I worked for the company that actually I was doing the work for and now the outsourcing company demands I'll update that I worked for them.
Can they ask me to do so?
Comment: `Can they ask me to do so?` - Anyone can ask anyone to do anything. Do you mean in a legal sense?
Comment: An example of mine that would date from the mid 1990s would be worded as follows: 'Work on TPIPT project at Brooks AFB as member of CSC support organization as a Manpower temp'.  My programming project was for the Air Force, CSC was the government contractor, and they in turn had hired me through Manpower.  Such 'chain of custody' is common these days, many fingers are in the pie.
Comment: @AdamRabinovitch - Your Linkedin profile is your property just like your resume is your property.  They can ask and you can tell them to quickly kiss your shinny metal...well you get the point.  That is exactly what I would say to anyone that demanded I update my work history.
Answer: They can ask. They cannot demand.
But it is your profile that you created to show your work.
It is completely up to you - you can give them a mention if you think they deserve it - how prominent or not is also up to you (a short - outsourced via companyname, for example).
Personally, I have had many jobs through recruiters/umbrella companies and such and most of these I have never mentioned in LinkedIn or my CV - they are not relevant to showing my career.
In short - up to you what you do here. They have no legal basis to force you to do this.
Comment: Just make sure that what you write is factually correct. You worked at/for company C but was not employed by them. The same could be said for the outsourcing company O.
Comment: @JanDoggen in Linkedin you need to choose a company name. I can elaborate around that. The reason I didn't put the outsource company name is because I had nearly no interaction with them, so I didn't see the point to make it too complicated and mention them.
Comment: @JoeStrazzere I don't want to post here the email I received, but they kind of demanded it and said there is something in the contract. I got the email from the recruitment agency a few weeks after I left. The thing I've had nearly no interaction at all with the outsourcing company besides they paid me when I issued my agency the invoice.
Comment: @AdamRabinovitch: Sounds like you need to re-read the contract.
Comment: @AdamRabinovitch - If the contract is over. I am not sure what grounds they have. If it is in the contract then perhaps you should update it. In the end I would depending on the length of the contract, just remove it from my work history entirely, no sense in keeping negavity ( this type of behavior from them is negavity ).
Answer: If your contract doesn't mention anything about such social media postings, you may not be at legal risk.
Although it may sound fancy to list that company (since you are doing it, am assuming its a big name), if I were you, I will honor the outsourcing company's request. For all you know its in the outsourcing company's contract with the company you are listing.
I had no hand in acquiring the client. I simply worked for the outsourcing firm and they paid me for it. It is only right to do so, as you really were engaged by the outsourcing firm.
If a future employer asked you for a proof of employment with the company you mentioned in your linkedin profile, you will only be cutting sorry pictures and explaining that you never really worked for the company you listed on your linkedin profile. It just puts you in a not so positive light with the future employer.
Comment: If I'm a contractor I wasn't employed, but worked and issued an invoice and the outsourcing company paid me.
I'm actually still shocked they asked to change it. I'm pretty much sure it's the outsourcing company and not the actual company.

Linkedin company name


Does swimming experience help to adapt to weightlessness?

Question: In the story I currently write, I have a character who has been a passionate swimmer for decades. Now, she goes to space. I wonder how she would adapt to weightlessness, and would her swimming experience help?
Comment: I would expect it to be more of a hinderance if anything.  You use the resistance of the water to move yourself around, which you can't do in just air.  Competitive swimmers spend an enormous amount of time optimizing their breathing, which would be of no help on a space ship.  Closest thing that might help is divers learn to hold their breath for long periods, which might be helpful if there was an air supply issue.  But even that relies on the "dive reflex" which also doesn't work in air.
Comment: Swimming at the surface of water, a movement in 2 dimensions only would not help, a free movement in all 3 dimension is need. But moving by arm- and leg strokes is possible only in water but not in in air and zero gravity. In a training facility called Neutral Buoyancy Laboratory swimming is forbidden during a training, you have to move like in zero gravity by pushing or pulling at a structure close to you. If you are too far away and could touch no structure at all, you have lost and need help from others. Neutral buoyancy for the torso as well as all arms and legs is impossible for a swimmer
Comment: Swimming is good exercise anyway.
Answer: I don't see a specific reason why swimming would help someone adapt to weightlessness, although space health and "how well someone can adapt to a microgravity environment" is still a very active field of research.
That said, generally someone who pursues athleticism with dedication is going to be healthier and have a generally better quality of life. They're likely to have a stronger immune system, and be more resilient. Additionally, the discipline required to pursue athleticism with regularity might translate well to the fitness regimen required for long-term exposure to microgravity environments.
If you are looking for sports that might offer an edge:

Scuba diving or other underwater activities: Someone who's spent a lot of time underwater might be more skilled at "thinking in 3d" and have better spatial reasoning or navigation instincts/skills in a microgravity environment.

Gymnastics, Acrobatics, Martial arts, Dancing: These all have a heavy focus on body and kinesthetic awareness along with movement and flexibility. Knowing where all your limbs are and having the dexterity and flexibility to, for example, grip a handhold with your foot might be useful on a space station. Furthermore, these sports often teach specific movement techniques that can be used while flying or falling that might be applicable to a microgravity environment.

Rock climbers: Upper body strength to pull yourself around or tightly grip on even the smallest of ledges might be a useful skill aboard a space station, although generally astronauts have problems maintaining strength because everything is so easy.

Skydivers, bungee jumpers: Probably the only group of people besides astronauts that have really any significant experience in free-fall/microgravity
Answer: Swimming is excellent exercise in any case, but it does not really simulate weightlessness. If you simply do a dead-man's float you will be weightless at equilibrium, but in actual swimming more of your body is out of the water than would be the case in this equilibrium. So you still have net weight, which is supported by the currents you create around you in the water. Having to create this support under your own power actually makes swimming more like mountain climbing than space travel.


find a transaction

Question: I made a bitcoin transaction and while I was typing in my email the window closed, so I didn't get my receipt. I have the phone number I used, one time password, wallet address, and the machine location. Can I find this transaction because it has not went thru.
Comment: From the sounds of it, you were using some sort of Bitcoin ATM. You'll need to contact the ATM business' customer service for help, nobody here will be able to provide you any assistance in the matter.
Answer: I assume that you used some service to purchase and withdraw bitcoins.
If you sent the bitcoins to yourself, the wallet that you used to generate the receiver address should notify you of the incoming transaction.
If you sent to another network participant, and the "wallet address" you mention is the recipients invoice address, you can use a block explorer (e.g. Blockchair) to find the transaction by searching for the wallet address.
If the transaction does not show up on a blockexplorer, there are essentially two possibilities:

the purchase was interrupted before it was finalized:
verify that this is the case and try again later once you are sure
the service has not yet delivered their side of the deal:
the service may have a technical issue, or more likely, the service is actually a scam

Either way, you should look to contact the customer service as we don't have insight into their internal processes. Under no circumstances, give them any more money if they don't deliver on their first service offering.

find a transaction