technical rendering drawing in qt3d

Question: Is it possible to display objects imported from blender in a style of technical drawing as shown here on the picture (right):
All the best,
Özkan
Answer: I am assuming that you already have your scene set up in Qt3D just with the wrong materials (i.e. the objects are displayed but without your desired effect).
To achieve this effect you have to create a new QMaterial that makes use of your custom shader and attach it to your entity. If you don't know how to create a custom material have a look at the QPhongMaterial. You probably don't need the specular, diffuse and shininess parameters but could keep the ambient parameter.
You then have to write your shaders to detect edges. There is a good explanation here which should get you started. There is an example of a shader at the bottom of that page. A simpler solution is this one but I'm not sure if the effect is as good as in the first link.

technical rendering drawing in qt3d


What will be the mass of the sun when the core is depleted of hydrogen about 5 billion years from now?

Question: Our sun converts 600 million tons of H to He every second, that is 5 million tons of matter into energy through nuclear fission. However, as the core of the sun continues to shrink the outer layers of the sun move closer and experience a stronger gravitational force. This causes more pressure on the core, which is resulted by increases in the rate at which fusion occurs. Hence the rate at which our sun losses its mass is not continuous. I want to know the mass of our sun when the core is depleted of hydrogen about 5 billion years from now (Mass loss as a result of nuclear fusion only an not due to stellar wind). I also want to know its composition, at present 73% of our sun's mass is Hydrogen and 25% is He.
Comment: @RobJeffries Thank you, I have done the necessary edit.
Comment: Well I don't understand. The mass of the Sun necessarily is changed by mass loss by a wind. And that is dominant in the post main sequence phase. So you mean what is the mass of the sun at the end of the main sequence?
Comment: @RobJeffries Yes, I mean mass of the sun at the end of the main sequence.
Answer: The Sun's mass will be approximately $0.9994M_{\odot}$ at the end of the main sequence.
I refer you to https://astronomy.stackexchange.com/questions/35632/replenishing-hydrogen-in-the-core-of-the-sun/35636#35636 where I calculated that approximately $2\times 10^{29}$ kg of H will be turned into He during the main sequence lifetime of the Sun.
However, you want to know what changes between now and the end of the main sequence.
The plot below (by RJ Hall https://creativecommons.org/licenses/by-sa/3.0/deed.en ) shows a plot of how the solar luminosity (red line) changes with time to the end of the main sequence. If we assume that the avergae luminosity during the period between now and the end of the main sequence is $1.5 L_{\odot}$, then on average, 900 million tonnes of H is turned into He every second and thus $1.4 \times 10^{29}$ kg of H to He is converted between now and the end of the main sequence.
If the Sun is 73% H and 25% He now (with a mass of $2\times 10^{30}$ Kg), then the mass of H decreases by $1.4\times 10^{29}$ kg and the mass of He increases by almost the same amount. Tis changes the abundances to 66% H and 32% He.
Since the pp-chain is 0.7% efficient, the mass lost by the Sun corresponds to 5 billion years $\times 1.5L_{\odot}/c^2 = 10^{27}$ kg (or $5\times 10^{-4}M_{\odot}$)

At the same time, the Sun is losing mass through the solar wind. The mass loss rate is variable, it depends to some exten ton the solar cycle, and probably scales with the magnetic field of the Sun (which in turn depends on rotation) in poorly understood ways.
The current solar mass loss rate probably averages out at something like $2\times 10^{-14} M_{\odot}$/year. If that were maintained, then the Sun would only lose a further $10^{-4}M_{\odot}$ over the next 5 billion years via this route, but in all likelihood the mass-loss rate will diminish with time during the main sequence, so mass loss via a wind is negligible on the (late) main sequence.
However, in post-main-sequence evolution, mass-loss via winds becomes dominant.
Comment: Thank you! The answer was very helpful.


Calculate sum of an infinite series

Question: I have been struggling with this functional series. $$\sum_{n=1}^{\infty}{(-1)^{n-1}n^2x^n}$$ I need to calulate the sum.Any tips would be appreciated.
Comment: This sort of sum can be done by "differentiating/integrating under the sum". Try differentiating or integrating each term with respect to $x$ to get rid of the factors of $n$; if it doesn't work out as is, you might need to pull some power of $x$ outside the sum first. Then when you've gotten rid of the $n^2$, you can evaluate the sum, and then you can do the inverse of the integration/differentiation that you did before to get the final result.
Answer: Try considering what happens when you differentiate the following with respect to $x$:
$1/(1+x) = 1-x+x^2-x^3+x^4...$
That should get you thinking in the right direction.
Answer: Note that $n^2=n(n-1)+n$ and hence the given series $\displaystyle\sum\limits_{n\geq 1} n^2 x^n=: f(n;x)$ can be written as
$f(n;x)=\displaystyle\sum_{n\geq 1} n(n-1)x^n+\displaystyle\sum_{n\geq 1} n x^n=f_1(n;x)+f_2(n;x)$ respectively. Let us determine these $f_1(n;x)$ and $f_2(n;x)$ separately.
Now $f_1(n;x)=x^2 \displaystyle\sum_{n\geq 1} n(n-1)x^{n-2}=x^2 \frac{2}{(1+x)^3}=\frac{2x^2}{(1+x)^3}$ by using the fact $(1+x)^{-1}=\displaystyle\sum_{n\geq 1} x^n$ and two times successive differentiation.
On the other hand $f_2(n;x)=-x \frac{1}{(1+x)^2}=\frac{-x}{(1+x)^2}$.
Therefore $f(n;x)=\frac{2x^2}{(1+x)^3}-\frac{x}{(1+x)^2}$
Answer: Hints:
If you divide your series by $x$ and then integrate it, it might be a little simpler.
Then ask yourself what you can do to make it even simpler.  If you are lucky you will eventually end up with a geometric series where you know the answer.
Then undo all the steps you have taken (in reverse order), and you should have a solution to your original question.
Answer: Incorporate $-1$ into $x$. Now consider the derivatives of $\sum z^n$. How can you get $n^2$ to show up?
Answer: The ratio of convergence is
$$\limsup_{n\to\infty}\frac{1}{\sqrt[n]{n^2}}=1,$$
so the series in convergent on $(-1;1)$. Now if move one $x$ factor before the sum, so that the exponent of $x$ in the sum is $n-1$, what happens if you integrate elementwise? Repeat!

Calculate sum of an infinite series


How can electrons manage to be at the same distance from the nucleus at all positions in p, d and f orbitals?

Question: In quantum mechanics electrons are arranged in certain orbitals namely s, p, d and f orbitals.The position of the electrons are determined by 4 sets of quantum numbers n, l, m and s. Electrons can only be at a fixed distance from a nucleus which is determined by the quantum number n, but in p, d and f orbitals how  does it manage to be at a fixed distance at every point in the region of these orbitals?(here is an example of p orbital in image)
Comment: There is no fixed distance.
Comment: Hm, it's not very hard to guess what the OP's misunderstanding is: The *average* distance only depends on n in hydrogen-like atom, as the energy levels of all l,m,s quantum states are *degenerate*.
Answer: I think you're confusing what the orbital shapes represent. The shapes are probability distributions-which means that you're most likely to find the electron somewhere within the shape.

Electrons can only be at a fixed distance from a nucleus

This is false

which is determined by n quantum number

The n quantum number tells you how big the orbital is-not precisely how far away the electron is.
In reality, the electron is moving around the atom, and is probably somewhere within the orbital shape.


Converting odds to probabilities

Question: Gambling odds on sports betting are designated with a number in the set $(-\infty , -100) \cup [+100 , +\infty)$. If one places a wager of $w$ dollars at $p \in (-\infty , -100) \cup [+100 , +\infty)$ odds and your bet is successful, then your winnings $E(w , p)$ are calculated as follows:
$$
E(w , p) : = \begin{cases}
\left( 1 + \dfrac{100}{p} \right)w & p < -100\\
\left(1 + \dfrac{p}{100} \right)w & p \geq +100.
\end{cases}
$$
So large positive odds correspond to events that are less likely to happen and thus have greater payouts while large negative odds correspond to events that are more likely to happen and thus have smaller payouts.
+100 odds on an event correspond to a 50% chance of that event occurring, but how does one convert odds to the probability that event will occur in general? Basically, is there a function $L : (-\infty , -100) \cup [+100 , +\infty) \rightarrow [0,1]$ that takes the odds $p$ of an event and maps it to the probability it will occur?
I am particularly interested in applying this to betting on who will score the first basket of a basketball game. Betting on a single player scoring the first basket has relatively high (positive) odds and therefore a good payout should the bet be successful. While betting on a single player is risky and not the most likely to happen, betting on multiple players increases the likelihood of winning while good individual odds can offset the losses on the other bets.
Take for instance the following odds (which are real, but writing out the names will take too long) on who will score the first basket in tomorrow's Bulls v. Cavaliers game:

Player 1: +490
Player 2: +500
Player 3: +550
Player 4: +600
Player 5: +850
Player 6: +850
Player 7: +1000
Player 8: +1100
Player 9: +1300
Player 10: +1500

Is there a function $L$ with the properties I have described above and satisfies
$$
1 = L(490) + L(500) + L(550) + L(600) + L(850) + L(850) + L(1000) + L(1100) + L(1300) + L(1500)?
$$
Will I need to adapt the function $L$ if I was to look at a different game with different odds?
Comment: Odds are not quite probabilities in disguise.  Are you sure you want to do it?
Answer: Assuming the bet has zero expected gain, and let $q$ be the probability of winning, then we must have:
$$ q \times E(1,p) = 1$$
or equivalently:
$$ q = \frac{1}{E(1,p)}$$
Now of course, gambling houses set the odds in such a way that $q \times E(1,p) < 1$, at least in their estimation of the true probability $q$.
As to whether your final equality $1 = \sum L(blah)$ is possible, I am too lazy to go through the calculation.  But if these are actual odds posted by a gambling house, you can be sure $1 < \sum L(blah)$ because otherwise they would lose money guaranteed, vs a sharp bettor.

Converting odds to probabilities


tracker-miner-fs is taking 90% of CPU

Question: tracker-miner-fs is taking 90% of CPU. I am using Ubuntu 20.04.
Answer: Have some patience. It eventually will go over.
Tracker is an indexing system. It searches all files for words, which are included in a database so you can quickly find files containing specific words.
The first time, tracker needs to index all files. On subsequent times, only changed and new files are also included in the index. It is typical for Tracker to require some minutes of high processor activity to check the file system for changed files and update the index.
‣ If, despite your patience, tracker keeps using high cpu, then there may be an issue with the database. In that case, clearing the database and having tracker reconstruct it may help:
tracker reset --hard ; tracker daemon --start

Beware, all files need reindexing, so there will be some processor useage for a while.
‣ It may be that you have a folder with frequently changing content, e.g. a Downloads folder. You can selectively disabling tracking a folder by placing a hidden file .trackerignore in the folder, or disable searching the folder in the Settings - Search dialog (button "Search locations:" in Ubuntu 20.04, gear wheel in older versions).
‣ If Tracker overall annoys you, you can disable it completely. File name based search in nautilus will still work (and be quite a bit faster).
Comment: Zeitgeist indeed is different and independent. Gnome-Shell (Application overview) and gnome applications (Files, Documents, Photos) use it. Despite the impression my answer here may suggest, I always disable tracker right away.
Comment: Phew. I just happened to have been on a torrent tracking website which coincidentally has the name "tracker" in it. While I was downloading a huge torrent, the service kicked in. I thought I had been infected hahaha. Phew :D
Comment: tracker reset --hard ; tracker daemon --start worked for me on 20.04. Previously extract and store work taking vast amounts of CPU time and "tracker status" said to would take 84 days to complete. Finished indexing in a matter of minutes once database cleaned up. You do have to go past the "danger this will delete everything" bits on the reset command though!
Comment: @vanadium : Does tracker-miner-fs has something to do with Zeitgeist or are these 2 different software? What software/components make usage of tracker-miner-fs? It is not clear to me.
Answer: Tracker (and miner) has plenty of configuration options accessible via dconf-editor under /org/freedesktop/tracker/.
Specifically to make miner less CPU aggressive org.freedesktop.Tracker.Miner.Files throttle value can be set to anything between 0 and 20, the higher the slower.
Also, setting org.freedesktop.Tracker.Extract wait-for-miner-fs to true should prevent running tracker-miner-fs and tracker-extract in parallel.
Comment: There is also a switch that prevents indexing while on battery.
Answer: Run the following commands in a shell:
echo -e "\nHidden=true\n" | sudo tee --append /etc/xdg/autostart/tracker-extract.desktop /etc/xdg/autostart/tracker-miner-apps.desktop /etc/xdg/autostart/tracker-miner-fs.desktop /etc/xdg/autostart/tracker-miner-user-guides.desktop /etc/xdg/autostart/tracker-store.desktop > /dev/null

# Interval in days to check whether the filesystem is up to date in the database. 0 forces crawling anytime, -1 forces it only after unclean shutdowns, and -2 disables it entirely. Default: -1
gsettings set org.freedesktop.Tracker.Miner.Files crawling-interval -2
# Set to false to completely disable any file monitoring. Default: true
gsettings set org.freedesktop.Tracker.Miner.Files enable-monitors false

tracker reset --hard # Remove tracker database

Related

Similar answer: CPU load - tracker-store and tracker-miner-fs eating up my CPU on every startup
Standard desktop entry keys: Hidden should have been called Deleted. It means the user deleted (at his level) something that was present (at an upper level, e.g. in the system dirs). It's strictly equivalent to the .desktop file not existing at all, as far as that user is concerned.
FAQ - Tracker: How can I control what Tracker indexes?
Comment: Could you please explain the details of what this command does?
Comment: On Ubuntu 22.04 is Tracker3: `org.freedesktop.Tracker3.Miner.Files`
Comment: @azmeuk stop to autostart of tracker-miner related processes and remove the existing indexing database

tracker-miner-fs is taking 90% of CPU


Video glasses suitably capable of reading pdf

Question: We have seen a couple of RPi + video glasses combo's the last year. A lot of them wanted some kind of AR result, with a monocular display. My use case, however, would be different. Basically, I would like to be able to do some

PDF reading (A4 / US letter),
work in a terminal.

Further, I would like to do this while waiting for my train and during my commute. Especially the "waiting for the train (standing)"-scenario would profit from video glasses (as opposed to tablets and laptops).
Note: I really want to do this with non-Apple, non-Google, non-(big company trekking my whole life) stuff. (So no semi-Android powered glasses, etc...)
Since the terminal work I want to doesn't put large constraints on the resolution, we can basically leave it out of consideration.

I am particularly impressed by http://www.instructables.com/id/RaspberryPi-Powered-Wearable-Computer/ (using the Vuzix Wrap 920, 640x480).
Based on my experience with reading PDF's on my Nokia N900, I think 800x480 is just a little bit to small. I want to be able to read without sideways scrolling (but an entire page on screen is not needed). This gives me the impression that the Vuzix Wrap 1200 (852x480) might just be big enough (though I think it is on the edge).
I would like to hear if people have other ideas. On Amazon there are a lot of other glasses and brands, but I guess most of them don't even come close to what they claim to do.
So all in all, I am looking for video glasses:

compatible with the RPi,
suitable for PDF reading,
(USB-powered would be very cool, but not necessary).
Answer: So just buy the V720 from the same company mentioned in your link. ( This is not a rpi specific question)


Scrobble shoutcast station on Ubuntu?

Question: Is there any player/plugin/hack that works on Ubuntu and would scrobble "now playing" info from shoutcast radio station ID3 tags to last.fm?
Answer: Songbird can probably do that, I'm not 100% sure, but it scobbles and can play shoutcast radio (both of these via an addon) Its not sure this will work, but its worth a shot. there are songbird .debs out there, a quick google search will find them.
Comment: Will give it a shot.
Although by the same token, Rhythmbox also can both play stations and scrobble, but it has explicit checks in code not to scrobble podcasts, short tracks, etc. Also, Rhythmbox scrobbles on "song change" event, but radio stations don't generate these.
Answer: When I needed to perform similar operations in Windows some time ago I used Winamp with StreamRipper plugin. I think there should be some similar programs for Linux available.
The methodology requires some program to rip (and tag) the shoutcast stream and append the tracks to music player's que from where they get scrobbled as ordinary pieces.
Comment: Yeah, that's a solution -- hackish and brittle but works:
 * streamripper is also available on linux,
 * set up automatic playlist in Rhythmbox with 4 rules:
 ** Only songs from streamripper dump directory
 ** No songs from "incomplete" subdirectory
 ** Only songs added to library in last hour
 ** Only songs with play count = 0

Scrobble shoutcast station on Ubuntu?


Forcing Web Front Ends (WFEs) to load content locally with SSL Offloading in place

Question: I have come across an unusual issue.
We have SSL Offloading and Load Balancing using F5.  This all works fine for both external and internal client requests, but now I find I wish to have the WFE's reference themselves (127.0.0.1) when loading pages while on the specific WFE.
Right away, I looked at the Alternate Access Mappings (AAMs) for our SharePoint 2010 farm.  It was set for all requests to point to the default, SSL-secured version:
Internal URL: https://site.mydomain.com

Zone: Default

Public URL for Zone: https://site.mydomain.com

Internal URL: http://site.mydomain.com

Zone: Default

Public URL for Zone: https://site.mydomain.com

Now, obviously my first thought was to change the Public URL for the http:// entry to point to HTTP: directly:
Internal URL: http://site.mydomain.com

Zone: Default

Public URL for Zone: http://site.mydomain.com

This seems to have broken the ability for document libraries to expand/collapse groups for some reason.  I reverted it back for now.
I still need to find a way to have local WFE's point to themselves when attempting to load pages though.  Does anyone know what method I can use to allow for this?
I have disabled loopbacks on both WFE's already using the following blog entry for guidance:
http://blogs.technet.com/b/sharepoint_foxhole/archive/2010/06/21/disableloopbackcheck-lets-do-it-the-right-way.aspx
Answer: Add an additional zone to the web app and configure the AAM for the new zone.   You can specify different bindings to allow access via http.


Can I mod a vanilla minecraft server, or do I have to get a server that is specifically for mods?

Question: If I look on Nice Servers: Nice Servers.com it will have the option of buying a vanilla server or a 'Modded' server, can I buy the vanilla one and mod it or do I have to get the modded one to be able to have a mod on the server?
Comment: I'm voting to close this question as off-topic because it is about a third party's server options.
Comment: Out of interest, why buy a server rather than host your own?
Comment: @imulsion I am having trouble hosting a server, so I thought buying one would be more straightforward for me. (This is my first time trying to get a server)
Answer: It always depends on what the host provides. The difference between "vanilla" and "modded" server is that modded server uses Forge jar, but vanilla server uses only original server jar. Forge has also original server jar file, but the thing is that servers are normally setupped so they start one particular JAR file, by NAME. (when server starts, it calls one given name in the start command) But usually you can rename any server jar to get it called, when you alter it for another one.
If the host provides FTP access, you still can change it to whatever you want (spigot, forge, bukkit, vanilla..... ). There is normally no other difference between those servers, except that modded servers might be more expensive, but can have allowed higher hardware limits, because they do need more RAM and so, so it is reasonable to give them more that way.
BUT it fully depends on what that particular host provides. You should go and ask their tech support, to get detailed information, because this varies from host to host.
IF you want mods on your server, you need modded version. If host provides you preinstalled setup, you as a begginer might want to get advantage from that.


Why does work done ultimately culminate as wasted heat?

Question: Come to think of it, the work done on a body is converted into some form of energy.But why is it that it ultimately tends to produce heat? In physics we all talk about energy dissipation in the form of heat,but why not electricity, or even light(somehow or the other it tends to form heat,exceptions barred).Why is thermal death,so prevalent a term for non usable energy, and not, say 'electrical death'?What specific mechanism, if any, exists to see to it that all energy is wasted as heat,and not as some other non usable form ?
Comment: All forms of energy conversion are limited by thermodynamics, we just don't talk about that at the high school level of physics education because the necessary level of knowledge of the second and third law of thermodynamics can not be taught. For the conversion of sunlight to electricity, for instance, we can calculate a maximal thermodynamic efficiency of 95% based on a radiation temperature of sunlight of 5800K and a solar panel temperature of 300K. In the general case one always has to take the temperatures of the systems into account that store the different forms of energy.
Comment: Heat _can_ be converted to do other work. https://en.wikipedia.org/wiki/Steam_engine
Comment: Sure it can be,but my question is that why is heat a major form of relased energy in so many processes
Answer:
Heat means collisions.

Energy can be dissipated by radiation (light or photons). The coined term is "radiative losses". It is a very important source of losses for circular beam accelerators (or any sort of device accelerating charged particles, say an antenna) and for spacecraft re-entering the atmosphere before crashing/landing on Earth. A very import notion regarding radiatives losses it that of black bodies. A human body dissipates more energy through radiation as a black body (to keep its temperature at 37°C) than by doing work (moving, talking, thinking, etc.).

A key notion for your further reading: entropy.

Entropy is studied through statistical physics (from which can be derived thermodynamics as a limit case).
Transfer of momentum from particles can be considered as a random process with an uncertainty about how much momentum is transferred from one particle to another.
The transfer of momentum depends on the angle of collision, the momentum of particles colliding and the cross section of the collision. The cross section contains information about the physical interaction (hard spheres, coulomb force, etc.) that we call a collision.
Also the collisions between particles happens at such a small scale that quantum mechanical Heisenberg uncertainty theorem must be taken into account, meaning that we can't be sure how two particles will exactly exchange momentum.
All of this results in a spreading of the input energy given to a physical system among its many many components (1 mole = $10^{23}$ particles). That's what we call energy dissipation. To describe the state of a system we then use distributions of momentum, speed and energy (see Maxwell-Boltzmann distribution).
Entropy is the quantity that monitors the behavior of those distributions. Heat then describe a transformation of the distribution (displacement of the distribution mean, flattening of the distribution) that is allowed by how the entropy should evolve (2nd principle of Thermodynamics).
To sum up:
Heat <=> collision <=> random momentum transfer process + uncertainty about quantity of momentum exchanged => change in entropy + modification of the energy distribution <=> dissipation (or waste) of energy
Comment: A small note: "heat means collisions" is certainly true when the only interactions are contact interactions, but if there are also long-range interactions present in the material, then heat can also be transferred without colliding, per se.
Comment: Do you mean radiation by long range? Because then it is photon collisions (elastic or inelastic). One particular aspect of this sort of heat transfer is that they don't need a solid media to propagate and that makes them long-range in that sense. But eventually, if there is interaction, there is collision of photons with matter. And I have already mentioned this type of heat transfer in my answer...
Answer: This can be attributed to the Second Law of Thermodynamics which talks of Entropy. Entropy is disorder. What is heat? Heat is in fact used to quantify entropy.
For any process to occur, the entropy of the whole system must increase. That means the process should result in an ultimate increase in disorder - which can be thought of as an increase in temperature since this increase in disorder is the 'heat production' you talk of.
Heat is an internal form of energy. It is energy in transit, or in fact a means for transfer of energy. Don't get me wrong here - heat definitely is energy but I would prefer it being thought of as a vehicle rather than a store. The other vehicle being work.
Heat is transfer of energy in a very crude and randomised manner. Providing heat, increases the temperature and increases random motion of the molecules. Hence you can attribute the heat released - unusable form of energy - to an increase in entropy.
Comment: Heat definitely is energy. I meant to stress on the 'form' part. It is energy in transit. It is comparable to work. Would you call work a form of energy? It is just a mode of delivering energy. What the 1st Law says is that this energy can be delivered to the system either as heat or work. Its just a matter of semantics. guess i should clarify this up there :)
Comment: The first law of thermodynamics clearly states that heat is a form of internal energy and that the energy conservation law applies. At the microscopic level one can identify heat with kinetic and potential energy of the atoms or molecules of the system.
Comment: "Heat is not a form of energy" is not semantics but simply a false statement and what you "prefer" is completely irrelevant. We are trying to explain physics correctly around here. You have your own workable interpretation of physical quantities, but you should not be using language that is plain false when a student would use it in a test.
Comment: Right.. I guess I should be deleting it. By calling it energy, it implies its a form of energy. But then how do i convey the point? should i be calling it a 'special' form??
Comment: Heat is an "internal form of energy". That is how physics defines it and it works perfectly that way. In statistical mechanics we make the connection to ordinary kinetic and potential energy.
Comment: @CuriousOne, the first law of thermodynamics *does not* state that heat is a form of internal energy. In thermodynamics, heat is not a form of energy but a mode of transfer of energy. You can say how much heat was transferred during a process, but you cannot say how much heat is in the body at the end. There is no connection between heat transferred and kinetic or potential energy in the body at the end.
Answer: There are two main types of energy, potential and kinetic.  Potential energy is energy that has the potential to perform work. Kinetic energy is the energy associated with motion. Kinetic energy can take macroscopic forms such as  translation or rotation of a solid body, large vibrations within a system of particles, flow of a fluid, or wave motion. Kinetic energy can also take microscopic forms such as molecular vibration, incoherent molecular motion, microscopic vortexes, microscopic waves, or electromagnetic radiation, which I will call thermal energy. All accessible forms of energy can be inter-converted to other forms of energy in one or more steps with the exception of thermal energy at equilibrium, which cannot be converted to any macroscopic form of energy. Note: In many cases, the effective equilibrium temperature of the Earth may be taken as the ambient air temperature, but when considering the thermal radiation from space the night sky the equilibrium temperature is at 2.7 K, so that some useful work can be recovered from the thermal radiation of Earth.)
The number of states of motion or molecules that move in a simple coherent macroscopic fashion are minuscule compared to the number of states moving in some  complex "disordered" way.  As a result, systems of molecules are much more likely to be in a state of "disorder" than a state of macroscopic order, meaning that ordered kinetic energy naturally becomes thermal energy (disordered kinetic energy).  As the temperature naturally settles to equilibrium (ambient temperature), it becomes impossible to convert thermal energy to another form.  Consequently, thermal energy at thermodynamic equilibrium is the local end state of all energy.
Energy flows from sun to Earth and eventually to space.  A small amount of this energy is captured by photosynthetic organisms, convective thermodynamic engines (air and water convection), and solar panels for useful work, fluid flow, growth, and reproduction.
Comment: Well note that the 2.7 K temperature is the temperature of the cosmic microwave background, so way out in the middle of nowhere, that would be the temperature. But within the solar system, the temperature will vary greatly depending on factors such as in the sun light, bodies radiating heat, etc.
Answer: Thermodynamics, and reversibility of processes.
Most of ways energy can be stored are reversible. Kinetic energy to potential  gravitational energy and vice versa. Electric to magnetic and vice versa. Chemical to electric, and vice versa. Energy stored one way will eventually be recovered and transformed into another.
Transforming thermal energy into any other form takes a lot of effort though - you need a heat engine like peltier cell or stirling engine to extract other forms of energy from thermal - and if it's randomly distributed in objects all around collecting it is simply not viable. So, thermal energy tends to stay thermal, occasionally transforming to electromagnetic (infrared photons) which are sent in random directions and end up transformed into thermal energy elsewhere. Simply, very lousy reversibility of transformations of other forms into thermal energy means most of "free energy" end up trapped there - and stays there.


is frozen hamburger ok to eat after the sell by date?

Question: I have a pound of hamburger meat that has not been opened yet. The sell by date was on may 23 2013. Is it ok to eat?
Answer: Assuming you didn't buy it frozen, the sell by date is for when it's just in the fridge. As long as you froze it before that date, and you use it immediately after thawing, it'll be safe to eat. If it was already frozen when you bought it, the sell by date is just for quality, not for safety.
In either case, if it wasn't wrapped tightly it may have lost some quality. Things do slowly dry out in the freezer if the packaging or container isn't airtight, so the texture can deteriorate, and they can also take on odors from the rest of the freezer.
Answer: If it is frozen then sure, it should be fine. If it isn't throw it out without opening it, if you pierce the packaging the stench will be awful.


Multithreaded downloading with shell script

Question: Let's say I have a file with lots of URLs and I want to download them in parallel using arbitrary number of processes. How can I do it with bash?
Answer: Have a look at man xargs:

-P max-procs --max-procs=max-procs
         Run  up  to max-procs processes at a time; the default is 1.  If
         max-procs is 0, xargs will run as many processes as possible  at
         a  time.

Solution:
xargs -P 20 -n 1 wget -nv <urs.txt

Comment: Oh, that's very slick. did not know about -P
Comment: In case the original link vanishes, the recommended command (with useless use of cat removed) is: `xargs -P 20 -n 1 wget -nv <urs.txt`
Answer: If you just want to grab each URL(regardless of number) then the answer is easy:
#!/bin/bash
URL_LIST="http://url1/ http://url2/"

for url in $URL_LIST ; do
    wget ${url} & >/dev/null
done

If you want to only create a limited number of pulls, say 10. Then you would do something like this:
#!/bin/bash
URL_LIST="http://url1/ http://url2/"

function download() {
    touch /tmp/dl-${1}.lck
    wget ${url} >/dev/null
    rm -f /tmp/dl-${1}.lck
}

for url in $URL_LIST ; do
    while [ 1 ] ; do
        iter=0
        while [ $iter -lt 10 ] ; do
            if [ ! -f /tmp/dl-${iter}.lck ] ; then
                download $iter &
                break 2
            fi
            let iter++
        done
        sleep 10s
    done
done

Do note I haven't actually tested it, but just banged it out in 15 minutes. but you should get a general idea.
Answer: You could use something like puf which is designed for that sort of thing, or you could use wget/curl/lynx in combination with GNU parallel.
Comment: Which would looke like this: cat urlfile | parallel -j50 wget
Answer: http://puf.sourceforge.net/ puf does this "for a living" and has a nice running status of the complete process.
Answer: I do stuff like this a lot. I suggest two scripts.
the parent only determines the appropriate loading factors and
launches a new child when there is
1. more work to do
2. not past some various limits of loadavg or bandwidth

# my pref lang is tcsh so, this is just a rough approximation
# I think with just a few debug runs, this could work fine.

# presumes a file with one url to download per line
#
NUMPARALLEL=4 # controls how many at once
#^tune above number to control CPU and bandwidth load, you
# will not finish  fastest by doing 100 at once.
# Wed Mar 16 08:35:30 PDT 2011 , dianevm at gmail

 while : ; do
      WORKLEFT=`wc -l  < $WORKFILE`
      if [ WORKLEFT -eq 0 ];
           echo finished |write sysadmin
           echo finished |Mail sysadmin
           exit 0
           fi
      NUMWORKERS=`ps auxwwf|grep WORKER|grep -v grep|wc -l`
      if [ $NUMWORKERS -lt $NUMPARALLEL]; then  # time to fire off another 1
           set WORKTODO=`head -1 $WORKFILE`
           WORKER $WORKTODO &  # worker could just be wget "$1", ncftp, curl
           tail -n +2 $WORKFILE >TMP
           SECEPOCH=`date +%s`
           mv $WORKFILE $WORKFILE.$SECSEPOCH
           mv TMP $WORKFILE
        else # we have NUMWORKERS or more running.
           sleep 5  # suggest this time  be close to ~ 1/4 of script run time
        fi
  done

Comment: Oh, also, unless you have separate ISPs, or bandwidth limitations or something, you USUALLY are not going to have any total faster download speed, by doing it in parallel


With respect to what we are saying space is homogeneous or space-time is isotropic?

Question: I don't really understand what we are talking about when we say space is homogeneous. What we are measuring? My notion is: it should depend on the entity and with respect to that entity one can decide space is homogeneous or not!
May be I'm asking stupid question, actually the fact is I don't understand the phrase "space is homogeneous" or "space-time is isotropic"
Answer: Suppose we measure the density of matter as a function of position. Then we will come up with some function for the density $\rho(r, \theta, \phi)$ where $r$, $\theta$ and $\phi$ are polar coordinates with ourselves at the origin.

The density is isotropic if it is the same in all directions i.e. it is independent of $\theta$ and $\phi$ and just a function of distance, $\rho(r)$.
The density is homogeneous if we can move our origin, i.e. move to any other point in the universe and our density function $\rho(r)$ is unchanged.

The simplest such function is if $\rho$ is just a constant since it then automatically the same in all directions and the same at every point.
I've used density as an example, but this applies to any property of the universe that is a function of position.
Our universe is obviously not isotropic and homogeneous because in same places there is a vacuum while in others there are stars. However we know it started out as very close to isotropic and homogeneous from measurements of the cosmic microwave background radiation. And if we take average density on a large enough scale then we believe it is still on average isotropic and homogeneous (though this is a somewhat controversial issue).
Comment: I don't think the OP is asking about the distribution of matter in the universe.
Comment: Great answer @John Rennie. +1. But one item I think it overemphasizes an issue which is more detail than the basic idea. The controversy on homogeneous/isotropic in the large scale has to do with small deviations. The microwave background settled the big issue, the smaller variation we now can see and model for the universe evolution is not a controversy, it is precision cosmology doing better.
Comment: @John Rennie: that means one always decides homogeneous/isotropic w.r.t physical entity, like in your example you used density. I find no meaning of only saying "space is homogeneous", rather it sounds meaningful to me of saying"space is homogeneous with respect to ..."
Comment: @sid: *space*, or rather *spacetime*, isn't a thing. It's a mathematical construction so it can't be homogeneous. It's the stuff that fills spacetime, whatever that stuff may be, that is homogeneous and isotropic. So assuming I understand you correctly you are quite correct that it is meaningless to say *space is homogeneous*.
Comment: Thanks a lot Sir! that is the answer I was expecting. It has been disturbing me since past couple of weeks. Thanks by Heart! :)
Answer: You are correct in the sense that there are physical quantities, observables, like scalar and vector fields that are, in general, varying in space.
However, that's not what the phrase "spacetime is isotropic" is meant to convey. What this means is that, in the absence of anything to break the symmetry, each point in spacetime is no different than any other point in spacetime.
Without reference to anything else, spacetime is considered as homogenous everywhere.


webserver on VPS (Ubuntu or Debian)

Question: I have a VPS server, I want create a webserver, and host php, ruby sites. What do you think, i need a isp control panel or lampp server (xampp for linux) is enough?
I have some domain names and I want redirect they the new server, how can I do this?
Answer: Do not use lampp, xampp, or any of the other bundled LAMP stacks. Those are meant for development only, not for production use. The maintainers of these bundled stacks configure the server applications as to stay out of the way of the development process. This works great for development, but leaves you open to many security issues if used in production.
It should be easy enough to install a full LAMP environment using your linux distro's package repository. Edit your question to include which distro you're using and we'll be able to better point you in the right direction.
--Edit--
Since you're using Debian, you'll use the apt system to install your LAMP packages:
$ sudo apt-get install apache2 php5 libapache2-mod-php5 mysql-server php5-mysql

Comment: I use Debian based distros
Comment: What do you think, ISPConfig it's a better way? This is knowing all lamp feature + dns, mail and ftp server
Comment: I've never used ISPConfig, so I can't give a definitive answer. From what I can tell, ISPConfig gives you a control panel for apache/postfix/bind/etc, once they're already installed - it doesn't install the packages itself. There's a tutorial here that seems pretty comprehensive: http://www.howtoforge.com/perfect-server-debian-lenny-ispconfig3-p3
Answer: EDIT: I know this doesn't answer your question completely. It is in reference to setting up the LAMP stack, not to the question of setting up domains to point to your VPS.
You can use the tasksel command to quickly install a LAMP server as well.
sudo tasksel will take you to an ncurses interface. Very easy.
tasksel --list-tasks will show the tasks available for install.
tasksel --task-packages will show what packages are pulled for a particular task.
sudo tasksel install <task> installs the task from the command line.

webserver on VPS (Ubuntu or Debian)


Posting an android game to market/Google play

Question: i am almost finished with my first android game which i would like to earn some money on. I am wondering if i should upload it for a couple of bucks or if i'll upload a free and paid version with adds on the free one. What do you think i'll earn most on??? Please share your thoughts and let me now. Best regards
Answer: You will earn almost nothing (I rule out that you already are successful and experienced game designer able to provide something unique).   If you upload paid version, you will get no downloads.  If you put free version and promote properly - you will get some downloads. And if game hits you will get some more downloads etc.  So your best income source would be advertising - but do not expect much out of it.
Comment: Thanks both, i'll make a free and paid version with ads on the free one
Answer: The answer is you need both.  You need to provide a free trial of some sort, so people can see if they like you product.  This one could contain ads.  In order to make money on ads, you need to get lots and lots of views in your app.
You should also offer an "ad free" version so people who do like your app can support you, and get rid of the ads.
Comment: Thanks both, i'll make a free and paid version with ads on the free one
Answer: I am about to jump into the "publishing games in android" thing, and I am kind of in the same phase you were when you wrote this post(am almost finished coding the game, thinking of publishing)
Now that its one and a half years since you had posted this game(I assume you did),
I would love to know how did everything go- could you share your experience?
Comment: HI! It's a tough market, did'nt make much Money on This one, but I'm working on something big now - which will hopefully sell. Create a trial app, and a paid ad free version - and also spread the word. Let people know of your app - that's the biggest problem, to stand out of the crowd


Does my Feature module have to explicitly define the body field in it's components?

Question: When a new content type is created in Drupal it is automatically given a title and body field. Now that I am defining my components for my feature to I have to select it as one of the components of the feature module?
Answer: ... I always do. :)  It should be no problem -- and if for some reason the field doesn't exist on the destination server it will then be created (the Minimal install profile for instance I don't think has the body field by default). If you look in /profiles/standard/standard.install you'll see it creates the fields and basic content types in code, eg:
<code>// Around line 229 of standard.install where $type is
// essentially 'page' or 'article'.
node_add_body_field($type);
</code>


How to detect tampering with Tor binaries downloaded from unofficial sources?

Question: If I've download a Tor binary from an unofficial source is there a way to verify that the binaries haven't been tampered with?
Comment: @Hiroto Only if it's in Git, and only if source is provided (and you then build that source yourself). This is about binaries, not source :)
Comment: You can just `git diff` the `source/` folder of the package.
Comment: You should be building from source regardless, or using offical sources.
Comment: @Hiroto I don't disagree with you, but for the purpose of this question assume the user is not, or cannot, for some reason.
Comment: What do you mean by "tempered with"? Do you mean the distro maintainer injecting a backdoor prior to uploading the binary to the repository? Or do you mean the evil hacker changing the binary on the way from the repository to your machine? Or even the evil twin who booted your machine off an USB drive and replaced the single executable on your disk?
Comment: @zhenech Sure; doesn't matter when / where the tampering happened, just the fact that the end result is not the same (maybe it's not even malicious; just a distro maintainer applied an experimental patch that's not in the official source tree before building).
Comment: I've modified the question to be a bit more generic, and also hopefully clearer. People seemed to be focusing on the parts that really had nothing to do with the question.
Answer: If you're using your distro's binaries to install Tor then you have to trust the package maintainer of your distro as you do with every other package of your operating system. If you don't trust maintainers and/or developers of your distro then I guess there is a bigger problem since that means you can't trust the operating system in which you run Tor.
Mind that Tor project suggests using its own repositories since most Linux distro's repositories have an outdated version of Tor.
If you're installing Tor from Tor project's repositories (e.g. https://www.torproject.org/docs/debian.html.en for Debian and Ubuntu machines) then you will also have to add and trust the GPG key which was used to sign the packages.
So the question is how can you trust that the GPG key mentioned in torproject.org is owned by Tor developers. One could say that as long as you trust the HTTPS connection and certificate of torproject.org you can trust that you're getting the correct GPG key.
Another way GPG key trust is established is through the Web Of Trust. That means you have to check the key's signatures recursively and find a signature of a person you know.
When you're sure it is the correct GPG signing key, then trust is passed to Tor developers, who we do trust (or not) from the beginning.
Comment: As accurate as this answer is for its situation, it doesn't really answer the question which specifically specifies that they're using OS repositories, as opposed to Tor Project repositories.
Answer: As you asked for every possible way of tampering, the list is going to be kinda long, but let's start anyway.
The package maintainer adds strange patches...
...or uses a weird build system.
I would say this kind of tampering happens all the time a package is being built (or prepared in case of a source distribution!) for you by a third party. However this is usually not harmful tampering.
On Debian (sorry, I am kind of biased here), you can observe what happens to a certain package in various ways:

the patches are listed on the patch-tracker, if they can be easily extracted
the build-logs are archived for later inspection
there is a general overview of the happenings in the package at the package tracking system
you can view the source used for the build via git or by calling apt-get source tor on your machine (comparing it to the pristine upstream source is up to you then)

These measures however do not prevent an evil build-machine from injecting malicious code into the binary without logging it. Or the maintainer injecting something bad into the binary he uploads together with a pristine source (maintainer uploaded binaries are not rebuilt in Debian [at least at the moment]).
The evil hacker changing the binary on it's way from the repository to your machine
This is something that should not happen in today's distributions, as the whole chain from the maintainers machine to yours is guarded by signatures (and the maintainer of course checked the signature of the tarball he/she got on the internet ;)).
[ example is again heavily Debian biased, sorry ]

Maintainer uploads of sources and binaries are signed using PGP.
Uploads from the build machines are singed using PGP.
The repository and it's contents are signed using PGP.

[ on a side note: break PGP and the whole world is fucked :) ]
The evil twin/government who pokes around your disk
This is probably the most effective and targeted way in my list.
Start with encrypting your disk (the whole disk, yes, that includes /boot or they will poke your kernel/initrd). An encrypted disk does not only save your kinky pictures, it also prevents strangers from writing to it. Using a read-only medium for the super-secure stuff is an alternative (did I mention Tails already?).
After you think your system is secure, check it on a regular basis. debsums and aide could help you here. So would a backup suite like bacula which can verify disk contents (that should never change).
Comment: This doesn't have much to do with the question; I've tried to modify it to make it clearer and less distro focused. It doesn't matter where the binary gets modified, just the fact that it is. It's also not about trying to prevent a binary from being modified. Hope that helps, and thanks for the answer anyways!
Comment: That sounded different in this comment: http://tor.stackexchange.com/questions/111/how-to-detect-tampering-with-tor-binaries-not-downloaded-from-official-sources/285?noredirect=1#comment120_117
Sorry. But then the answer is easy: you cannot :)
Comment: That very well may be until the deterministic build process graduates from alpha. That comment was made by someone not-me. It does apply though; it can be from repos (my initial intent) or downloaded from somewhere online; it's the same thing. Just a binary from a non-official source.
Comment: Oh, Sam vs Samuel, sorry.
Answer: Recently, Tor's build process was rewritten to be deterministic (currently only available in alpha builds). This means that builds produce byte-for-byte identical binaries for each OS/architecture combination that the build targets regardless of what OS/architecture you're currently running on.
Because of this you will (eventually) be able to take a hash of the official binaries and make sure that it matches those provided by your distro (eg. sha1sum tor).
For more information on deterministic builds, see this blog post.
Comment: As I understand it the build would be identical byte-for-byte with any build targeting the same architecture/OS. Naturally a binary built targeting x86-64 on Windows would be different from one targeting x86 (32 bit) on Linux. It's simply that you should be able to produce that build on any os or architecture
Comment: Heh, correct; I worded that poorly. Obviously an EXE for Windows is going to be different from the binary for Linux. No idea if you can cross compile. Reworded.
Comment: It looks like you can cross compile. https://gitweb.torproject.org/builders/tor-browser-bundle.git/blob_plain/49db54d147bd0bccc26f1d4f859cf9fe97e5f14c:/gitian/README.build - A readme for the 3.0.0 alpha build which introduces this system says that it will "then start the build process to produce localized Linux bundles, followed by Windows bundles, followed by Mac bundles."
Comment: This doesn't actually work yet on distributions. No distro creates a deterministic build, and sha1sums are not posted for the tor client itself (only TBB).
Comment: Oops, thought I said that this was an upcoming feature. Will correct; thanks. You can still just download a binary from the Tor site and compare checksums.
Comment: In theory a user could migrate to the TBB 3.0 alpha releases, so deterministic builds could be used. (Although migrating to such an unstable version has its own drawbacks).
Comment: Yah, I wouldn't recommend that... it's just a solution that will work soon.
Comment: As far I know there are also no attempts yet to make deb.torproject.org deterministic.
Comment: @adrelanos Hence my disclaimer about this being in "alpha". I guess I could have made it clearer that it doesn't work yet.
Answer: This issue is not specific to Tor packages.  RPM can verify integrity of installed files.  For systems that use APT, the debsums utility works similarly.
Comment: Your question said nothing of source code.  You asked how to determine if binaries have been tampered with.
Comment: The question is about checking if the binaries match the original Tor source or have other things added. This answer doesn't really answer the question.


Why are normal subgroups called "normal"?

Question: Why are normal subgroups called "normal"? And who is credited with naming them this?
Comment: Because it's crazy that $G/H$ is not a group! :P
Comment: "Is $A<B$ normal?" (from a Galois-spoof project of Mel Brooks, never realized)
Answer: The following is a quote from http://jeff560.tripod.com where you can find some of the "Earliest Known Uses of Some of the Words of Mathematics":

NORMAL SUBGROUP. According to Kramer (p. 388), Galois used the adjective "invariant" referring to a normal subgroup.
According to The Genesis of the Abstract Group Concept (1984) by Hans Wussing, "The German Normalteiler (normal subgroup) goes back to Weber [H., Lehrbuch der Algebra, vol. 1, Braunschweig, 1895. p.511] and is possibly linked to Dedekind's term Teiler (divisor), which was employed in ideal theory" [Dirk Schlimm].
Normal subgroup is found in English in 1908 in An Introduction to the Theory of Groups of Finite Order by Harold Hilton: "Similarly, if every element of G transforms a subgroup H into itself, H is called a normal, self-conjugate, or invariant subgroup of G (or 'a subgroup normal in G')."
G. A. Miller writes in Historical Introduction to Mathematical Literature (1916), "In the newer subjects the tendency is especially strong to use different terms for the same concept. For instance, in the theory of groups the following seven terms have been used by various writers to denote a single concept: invariant subgroup, self-conjugate subgroup, normal divisor, monotypic subgroup, proper divisor, distinguished subgroup, autojug."

See here for the sources.
Answer: In Latin, "norma" means "set square" ("triangle"), whose chief purpose is to draw a right angle or, more straightly, two adiacent right angles. Such a construction has a left-right simmetry, just like the cosets of a "normal" subgroup have, indeed ("$aH=Ha,\space\forall a\in G$"). By extension, "normal" means "inducing some regularity/order"  and hence "some structure": think of the group structure induced in the quotient when the subgroup is (indeed) "normal". Of course this is just my guess.


How Can I Delete Temporary Internet Files/Content.IE5/Index.dat?

Question: Without purchasing someone elses software, how can I as a software engineer, delete index.dat?  What OS Voodoo hoops do I have to jump through to accomplish the simple deletion of a single file on my own computer?  I have windows Vista.
Comment: @ Joshua ask this qusetion in superuser.com
Answer: System files are normally locked by explorer.exe. Since this is Stackoverflow you'll get a solution in the form of a program:
Enter the following code into a new file purge.bat:
taskkill explorer.exe
del %1%
%system%\explorer.exe

From the command prompt (cmd.exe), execute as follows:
> purge "yourpath\Index.dat"

and presto, your file is gone.
The same thing can of course be done using the task manager (to kill and then run explorer.exe), but where's the fun in that?
Answer: You can login as admin and delete index.dat. If  you are currently admin, just create a second admin account, log on and delete anything you want. Or you can delete it using a startup script which runs before the users logs-on and acquires a lock on index.dat. Or you can use Unlocker, a free software which can forcefully unlock any file in your account while you are being logged on.


Putty highlighting copying

Question: I currently use Putty at my work and I am always fascinating by how useful the highlight copying tool is. Is there any kind of program I can download on my System 76 laptop that I can use when I am in the terminal that will allow the same feature?
Answer: You can copy and paste by following method for terminal:

Select/Highlight text and Middle-Click mouse button to paste it in Terminal or somewhere else in Ubuntu.
Select text and copy by (i) Ctrl+C from another app (ii) Ctrl+Shift+C from Terminal and Paste by Ctrl+Shift+v into terminal.
Comment: Thanks but I am looking for a way to highlight text that will copy it to the buffer and allow me to paste using the mouse instead of the keyboard.
Answer: Highlight the text you want to copy, then you can paste it anywhere by clicking on the mousewheel.
Comment: I am looking for something more automated where the highlight can automatically copy the text just like in Putty
Comment: It does automaticly copy it. The buffer it uses is just a different one than the strg+c buffer. Just paste it with middle-click.

Putty highlighting copying


Selecting multiple columns and rows for formatting - Excel

Question: I have a report which I used the command subtotals. Aesthetically, I just want to make these subtotal rows (columns A to P) filled with color, be in Bold and have a surrounding border. There are hundreds of totals generated in my report. And they do not have a recurring row position. So basically in order for it to look good, I do it manually per row. Is there a faster way? Thanks!
Comment: What are you using to generate the reports?
Answer: Use either Range.Interior, or Range.FormatConditions.
Answer: If you plan on continuing to do it manually, you should set up one cell or row exactly how you want it. Bold, color and border and then double click on the paint brush icon on your standard toolbar; then just highlight your next row or cell and the formatting will appear. Once you are finished formatting, click back on the paint brush to stop the formatting. This a great time saver and makes all totals aesthetically identical.


MLE for Parameter Estimation using Mathematica

Question: I am using Mathematica (MMA) 10.0.0.0 with MathStatica do determine parameters using MLE for several PDFs. I have tried the approach below for several PDFs but I keep getting messages that Mathematica & MathStatica cannot analytically solve for the parameters. Although this may indeed be the case, I can solve for some analytically. So I think I may have some issues with my MMA code.
As an example, let $X_1,...X_n$ be i.i.d random variables from the hyperbolic secant distribution with location and scale parameters $\mu$ and $\sigma$:
\begin{equation*}
 f(x|\mu,\sigma) = \frac{1}{2\sigma} sech\left(\frac{x-\mu}{\sigma}\right)I_{(-\infty,\infty)}(x)
\end{equation*}
I was able to show (analytically) that $\tilde{\mu}$ and $\tilde{\sigma}$ are respectively:
\begin{equation*}
\tilde{\mu} = \bar{X}
\end{equation*}
\begin{equation*}
\tilde{\sigma} = \sqrt{\bar{X_n^2}-\left(\bar{X_n}\right)^2}
\end{equation*}
If I run the following MMA code with MathStatica addon I do not get this (for readability, \[Sigma] and \[Mu] are replaced by sigma and mu):
f = 1/(2 sigma) Sech[(Pi (x - mu))/(2 sigma)];
domain[f] = {x, -Infinity, Infinity} && {sigma > 0};
logLc = Log[Product[(f /. x -> Subscript[x,i]), {i, 1, n}]]
score = Grad[logLc, mu]
solc = Solve[score == 0, mu]
Hessian[logLc, mu] /. solc

I receive the following output:
MMA Output
I suspect I am missing something or I am having issues since I am dealing with multiple parameters. I did try removing the location parameter and trying that for this example but I am still getting the issue.
Recall that I am trying to figure out why this does not work in this instance because I am planning to use this code for a couple more distributions. Therefore I cannot just use the mean and variance commands in MMA.
Comment: What is $I_{(-\infty, \infty)}$?
Comment: Also, pictures of code is really quite unhelpful. If you want us to debug code, please post… well, code, rather than pictures.
Comment: Should this be moved to Mathematica SE?
Comment: $I_{(-\infty,\infty)}(x)$  is the indicator function.
Comment: Subscripts are bad for indexing in Mathematica, for various reasons [1]. Is there any reason you are using `Subscript[x, i]` instead of `x[i]`? [1]: https://mathematica.stackexchange.com/questions/94294/what-are-the-requirements-for-a-well-behaved-indexed-variable-subscript-toexpr
Answer: Just do
Variance[SechDistribution[m, s]]
Mean[SechDistribution[m, s]]

Comment: This will only work for this distribution. There are several other distributions I am working with where the parameters are not the mean and the variance.


Is it possible for one player to experience lag and not the other in the same online match?

Question: Some times, players complain about lag in an online match (normally when they lose), but I have never had that problem. Is it possible (in a P2P connection)?
Comment: I forgot to say that Street Fighter 4 uses P2P connections.
Answer: Yes, it's possible. There are a number of scenarios and factors that could take place to introduce lag, and they're unique to each individual connection.
Step 1: Computer to Router

Wireless generally runs slower than Wired connections.
With many devices connected to Wireless, they all have to "compete" for the same wavelengths in order to send data.
If you connect to your router via Wifi, a number of things could disrupt this connection: Concrete walls, Electric Cabling, Microwave Ovens etc.

Your best bet is to use a wired connection, straight from your computer to the router - whilst still susceptible to some interference, it's definitely less so.
Step 2: Router/Modem to ISP
Routers

The quality of your router/modem can have an effect on internet speeds.
Some routers can better handle multiple connections & constant use compared to others.

ISPs
Your Internet Service Provider (ISP) maintains your connection to the outside world. Your router knows how to talk to your ISP, which knows where everything else on the internet is.
You pay them to maintain a 'list' of where everything is on the net (it's a little more complicated than that, but the explanation will do for this purpose), as well as physical infrastructure, like copper/fibre cables and in return, they provide you access to the wider internet.

Someone on a low-speed internet plan will be restricted in the amount traffic they can send at once, which is a form of 'lag'.

Step 3: The Internet

Traffic. Just like cars on the road, the internet has 'busy' times and 'less busy' times. Your game will lag more if everyone else in your neighborhood is streaming Netflix at the same time. However, someone else might not live in your neighborhood, and might have (relatively) little traffic between them and the server.

Step 4: Destination Server
The game server might be experiencing lag. Too many people connecting at once, or issues with the physical server itself (such as overheating, hard drives dying, or having running processes & programs that have just crashed)
Comment: There are also games where one person's PC *becomes* the server, meaning their lag will be way less than other people's.


Why is the order of white/grey matter different in the brain and spinal cord?

Question: In the brain proper, grey matter forms the outer layer of the brain, and white matter forms the inner layer. In the spine, this is reversed: white matter forms the outer layer of the spine, and grey matter the inner layer. Is there a developmental or functional reason for this?
Answer: I'll tackle this question from a functional point of view.
Gray matter are cell bodies, white matter are myelinated fiber tracts.
In the brain, the gray matter is basically the cortex, the white matter lies mainly underneath it. The Cortex is the place where all the higher mental processing takes place (Fig. 1).

Fig. 1. Cortical functions. Source: Penn Medicine
The white matter in the brain connects the various parts of the cortex so that information can be transported for further processing and integrated.

Fig. 2. Central white matter. Source: NIH Medline
Since the cortex is the 'processor', it makes sense to connect the parts subcortically (more efficient as it leads to shorter connections). However, the cortex has been expanding very late in evolution, so this 'endpoint reasoning' can be contested, because from an evolutionary perspective, more cortex was needed and hence it was expanded right where it happened to be, namely in the outer part of the brain.
In the spinal chord things are pretty much reversed; grey matter within, white matter around it (Fig. 3).

Fig. 3. Section through spinal chord with central grey matter and surrounding white matter. Source: University of Michigan
The white matter, again, is formed by various tracts (Fig. 4) and the grey matter with parts that are processing information (fig. 5).

Fig. 4. Section through spinal chord showing the spinal tracts forming the white matter. Source: Biology.SE

Fig. 5. Section through spinal chord showing the spinal reflex arches forming the gray matter. Source: APSU Biology
The white matter in the spinal chord constitutes the various sensory and motor pathways to and from the brain, respectively. The gray matter constitutes basic processing nuclei that form the reflex arches in the spinal chord. These reflex arches process incoming sensory information (e.g. pain) and govern motor output (e.g., pulling the hand away from the fire).
Again, the structure makes sense in terms of efficiency, as the reflex arches combine the sensory and motor tracts to govern reflexes, and therefore processing them from within saves space.
Answer: This is a simple logic to understand.
In the brain the grey matter is on the cotex.Grey matter is a tissue made of the cytons due to which the cotex is pinkish Grey in colour. The White matter,the tissue made of axons is inside to the brain.
   Cortex is the processing centre which has cytons. In the spine the processing is to be done internally. So the cytons concentrate inside the spine which we call the Grey matter.Similarly the axons are to be around the Grey matter to transfer messages from and to other organs.They form the White matter outside the spine.


Constructing Intersections from Google Maps API

Question: Problem:
I am trying to reverse geocode a lat/long into a closest street intersection using Google Maps API V3. Also, for now, this doesn't have to be super accurate-- as I am just trying to anonymize an address as opposed to providing directions.
I have seen that the Geocoding Results data contains an Address Component Type of "Intersection", but this doesn't seem to be consistent at all in the return results-- and is more often that not blank.
I have also done some looking on SO for the best way to construct this barring getting it from Google directly, and the closest I have seen is: How can I find the nearest intersection via the Google Maps API?, which doesn't really resolve my issue. In light of this I have come up with my own solution, and would like some opinions, optimizations, constructive criticism, or other options entirely.
My Tentative Solution:
After playing around with the API, I decided to give the following algorithm a shot (just for context, this is written in C# within a console app):

I take an address and resolve that into a lat/long.
I then add or subtract a certain amount of lat or long from the
coordinate-- on the order of a city block (a distance which is adjusted given your
latitude) and get walking directions between the points. I do this for up to all four    directions-- so the first modification would be to keep the latitude the same but subtract some longitude. Then the next modification would be to keep the latitude and add some longitude, etc.
After getting the directions, I parse the results and check the start
and end address. If they are different, I pull out the street names
and treat them as an "intersection" (even though sometimes this
results in parallel streets-- again just trying to get a ballpark).
If I don't find two different streets, I widen the distance of the end destination and repeat the process.

So far this working well enough, but obviously it is an expensive process both in terms of time, and in using up my allotted query limit. Also, I checked the API terms of service, and as long as I include their disclaimer and display the results on a Google Map I think that I am ok.
My questions for the community are:

How can I improve the efficiency of the algorithm? Specifically, in
the number of times I call the API (the implementation code is not a
problem)
Is there another way entirely to do this using the Google Maps API?
In the SO question referred to above, the solution was to loop
over building numbers. I am not sure exactly what that means-- so any
clarification would be great.
As referred to above, I do not believe this is breaking the terms of service-- but am I mistaken?
Is there another web-based API to use that may meet my needs better?
Perhaps Bing, or some other provider?

Thanks a lot for any help.
UPDATE:
I have run into my query limit for the day, so I won't be able to test any suggestions against Google today, but I am also still open to using a different API. Thanks.
Answer: Old question, but since the original poster stated they were open to solutions other than Google, Geonames has a web API for this for the U.S. See GeoNames WebServices overview and http://www.geonames.org/maps/us-reverse-geocoder.html#findNearestIntersection


Px last in Bloomberg

Question: This is my first post to this forum. I want to calculate security returns , so therefore, I have downloaded the PX last price from Bloomberg. My question is:
What is PX last in Bloomberg? Is this Adjusted closing price of a security?
Answer: What is px_last is rather complex and will depends on the terminal options installed where you downloaded it. Type DPDF  to see what are your settings. You can adjust closing price to account for Splits/Spin offs (and many other things) or not, adjust to account for dividends or not.
If you are downloading this data through the api (say excel), you can manually overrides all those fields.
Hope it helps
Answer: If you are interested in a Total Return Index, rather than a Price, you could also let Bloomberg compute it for you by retrieving the field TOT_RETURN_INDEX_NET_DVDS (instead of PX_LAST). An advantage of this is you do not have to worry about the details of return calculation (let Bloomberg handle it, they can do it more accurately than other people) and possibly you make your code more readable as it is independent of DPDF settings. (I prefer to leave those settings to their default values).
Comment: This is a great suggestion by nbbo2. An useful alternative in the gross space is to use the field 1)  *DAY_TO_DAY_TOT_RETURN_GROSS_DVDS* 2) Or if you are just doing index work then I recommend try find the *total return index equivalent*, e.g. SPXT Index for SPX Index.   (Downside is this can give you less history for some indices.)
Answer: When unsure about the meaning of a field, type FLDS < go> and find the field you are referring to (PX_LAST in this case) to find Bloomberg's definition
Answer: In general, "PX_LAST" is the last traded price for a security.   This updates when you set up the BDP/BDH formula and when you refresh the workbook.   If you want a live, streaming, price, use "LAST_PRICE".
As mentioned above, the DPDF settings will affect corporate actions adjustments for equities when looking at price history.
Answer: PX last is the adjusted closing price of a security on Bloomberg. This price takes into account any corporate actions such as stock splits or dividends that have occurred since the last trading day.
Comment: This is not correct. Firstly, as mentioned in other answers, there is a setting that allows you to choose how it is calculated for equities. Secondly, PX_LAST also works for eveything that has a value (Inflation, GDP, IRS, (implied) volatility,

Px last in Bloomberg


redis throws an error even though extension is loaded just fine

Question: Its my fifth day trying to fix this on my mac mountain-lion.
I used home brew to install phpredis using this http://www.astonishdesign.com/blog/native-lamp-stack-mac-os-x. By the way home brew was also used to install redis.
My php info shows
redis
Redis Support   enabled
Redis Version   2.2.3

when I run this code
$redis = new Redis();
$redis->connect('127.0.0.1', 6379);

$redis->set('key', 'val');

echo $redis->get('key')

;
I get this error
 Fatal error: Uncaught exception 'RedisException' with message 'Redis server went away' in /Library/WebServer/Documents/test/index.php on line 6
    ( ! ) RedisException: Redis server went away in /Library/WebServer/Documents/test/index.php on line 6

What am I missing
Comment: I think 2.2.3 refers to Redis extension version, not Redis server.
Comment: Redis 2.2.3 is awfully old.
Answer: Are you sure the Redis Server is running?
If you go to the Mac command line and type redis-cli, do you get a prompt like:
redis 127.0.0.1:6379>

If not, your server isn't running. You can start it manually by running redis-server, then test your script.
There are probably better ways of running redis server on a mac, but at least you'll know if it's just a matter of starting the server.


Drop-off in British English?

Question: As I understand, the term drop-off can mean a steep decline in, say, sales; however, an abrupt cliff is not called a drop-off. Only in American English is drop-off used to describe a cliff's steep gradient. What would the proper British English term be for an all but vertical cliff gradient?
Comment: A "sheer drop" is what I think I would call it.  You are right that we would not use "drop-off" in Britain for this. Apart from your sales example, it is most often used in the sense of a delivery - "Please would you drop-off these samples XYZ Ltd on your way home".
Answer: In British and American English, a 'sheer drop' is common if the cliff is vertical or nearly so.
Sheer (Cambridge)

Drop-off in British English?


ASP.NET - Is it possible to trigger a postback from server code?

Question: Is it possible to to programmatically trigger a postback from server code in ASP.NET?  I know that it is possible to do a Response.Redirect or Server.Transfer to redirect to a page, but is there a way to trigger a postback to the same page in server code (i.e. without using javascript trickery to submit a form)?
Answer: Asp.net Postbacks are initiated from the client (typically form submission). I am not sure what you are trying to achieve. Some of the server side page lifecyle events are already executed and what you are trying to do is raise the previous event handlers again.
Comment: Link is broken. I am trying a hack here: http://bumbasblog.blogspot.com/2010/04/how-to-keep-session-alive-in-your-site.html, I'll update my comment if it works. Although, this is to keep the session alive, and not related to OP's question. I am trying a different approach.
Answer: Postbacks are caused by a FORM submission. You need to initiate them from the client.
Answer: You could do it with an Ajax request.  You'd have to have the page polling the server.  There isn't any way for the server to push information out to the browser without requesting it.  But having some Javascript that runs in the background and polls the server every 5 seconds (or more, depending on your needs) would probably be the best solution.
APPEND
If you go this route, you can have the server send back just a yes or no, or even just 0 or 1 depending on whether or not the postback should be performed.  Depending on your needs, there many be no reason to actually use the XML part of AJAX.  Just run a simple Asynchronous request, possibly with a few querystring variables, and get back a simple one word, or even a number as a response. That way you can keep the javascript for creating and parsing the XML out if it isn't needed.
Answer: If you are looking to initiate communication from the server, rather then polling, have a look at Microsoft's SignalR.  The easiest context for this, and one the SignalR has as part of its example code is a chat application.  You will be able to initiate messages from code behind and receive them as javascript events on your page.
Server Code To Send:
using System;
using System.Web;
using Microsoft.AspNet.SignalR;
namespace SignalRChat
{
    public class ChatHub : Hub
    {
        public void Send(string name, string message)
        {
            // Call the broadcastMessage method to update clients.
            Clients.All.broadcastMessage(name, message);
        }
    }
}

Client Code to catch server messages is the override of 'chat.client.broadcastMessage':

Answer: For those using newer versions of .NET, you have to use Page.ClientScript.GetPostBackEventReference since 'this.GetPostBackEventReference(...)' is obsolete. Also probably Page.ClientScript.RegisterStartupScript(...


Using interactivity from multiple layers produced in TileMill in a single map

Question: I have a MapBox.js map with several layers here .  I would like to be able to use TileMill's teaser and full interactivity on a few of the layers, but I have only been able to accomplish this for a single layer.  How can I have interactivty for multiple layers in this map?  The code for the map is here. I saw an example from MapBox.js but I don't know exactly how to implement it into my HTML code.
Answer: I see you have enabled interactivity on your map by the line:
map.gridControl.options.follow = true;

...but have not used any grid layers at all.
Include the following lines below all declarations:
var gridlayer1 = L.mapbox.gridLayer('slugis.ii9na2o6').addTo(map);
map.addControl(L.mapbox.gridControl(gridlayer1));

I had the same problem where my clicks wouldn't open the desired pop-ups and I solved this way.
Comment: Thank you that is exactly what I was looking for! The bounty is yours!


iPhone viewDidLoad

Question: When I override the method viewDidLoad, should I call it first and then write my code or is it the other way around?
Comment: It sounds like this is the same question as http://stackoverflow.com/questions/2148450/viewdidload-unload-messages-to-super http://stackoverflow.com/questions/824695/do-i-always-have-to-call-super-viewdidload-in-the-viewdidload-method and a number of other questions.
Answer: Call super's implementation. The approach is FIFO:
- (void)viewDidLoad
{
 [super viewDidLoad];
 // code...
}

- (void)viewDidUnload
{
 // code...
 [super viewDidUnload];
}

To gain a little more insight, look at Apple's documentation on View Controller: http://developer.apple.com/library/ios/#featuredarticles/ViewControllerPGforiPhoneOS/BasicViewControllers/BasicViewControllers.html
Also see this similar (dup?) question and answer: `[super viewDidLoad]` convention
Answer: No, you don't need to call [super viewDidLoad].
Let's be real here: Apple is not going to break thousands of apps, including those based on their published sample code, by deciding an event they're not currently handling suddenly needs to do something that developers may or may not want to stop and it's critical that if you don't need different behavior you not stop the event.
If Apple needs to do something like this, they'd add a specific new event. For example, and this is a ridiculous example, viewConvertTo3D.
Call the super if it matches your pattern. In fact, you probably should make the effort to learn Apple's standard nesting pattern. Don't call it if it doesn't, or if you care more about keeping your sources small. Extra code is not future proofing.
from: here

iPhone viewDidLoad


How do you rough in lighting for drop ceilings?

Question: I have a basement office that I intend to put a drop ceiling in. I was also planning to use the can lights that rest on the drop ceiling track itself rather than between the floor joists above. How would I rough in these can lights in this scenario since the drop ceiling supports won't exist until after drywall is up? Also, are there better alternatives for lighting?
Comment: Wisconsin. I can use nm but I'm unsure of I can use it to a "movable" device like a can in a drop ceiling. I probably can
Comment: Are you in an area that requires conduit or are you able to use NM cable (aka Romex)?
Comment: I've realized that this question has already been asked before: https://diy.stackexchange.com/questions/101556/what-is-common-practice-when-doing-electrical-rough-in-for-recessed-lights-in-a
Answer: Not an electrician.
My first thought would be to do the rough in by putting an electrical box on the actual ceiling.  In this box wire your conventional wire to a short length of romex.  The romex then is wired to your fixture when you hang the drop ceiling.
I don't think conduit would be required for the supply to these boxes, but it's not covered in my "Alberta Electrical Code Simplified" Doing a quick google finds that NM is fine for above suspended ceilings.  What is frowned upon is running the wire just on top of the support tracks.
My thought is that romex is more tolerant of being bent, and since you can't guarantee it be secured within 1 foot of the fixture, whatever you put in should tolerate bending.
I also know that when fiddling around with hanging ceiling you bump tiles into things.
Answer: Also not an electrician...
There are two ways to go about this. The one I see in commercial buildings (where my job is just low-voltage telephone & networking cables) is conduit to a junction box and then (typically) armored cable to the individual fixtures. I think that's overkill for residential for a bunch of reasons, including the much shorter distance between the drop ceiling and the rafters/floor above/etc. But the equivalent here would be conduit or NM to junction box(es) in the ceiling and then NM to the individual fixtures. Note that any NM except for the last bit going down to the fixture needs to be secured - can't just lie on top of the grid/tiles. Unlike a solid ceiling, with a drop ceiling you can install junction boxes above the ceiling, because it is removable without tools. For ease of assembly, if I did it that way then I would (a) install fewer-but-larger boxes so that I could run multiple fixtures from a single box and/or chain one box to the next (i.e., either way only one run going back to the switch) and (b) connect the NM for each fixture to the boxes before installing the ceiling grid. Leave a few feet extra, coiled up, on each NM section so that you don't have to worry about running short. Then, after installing the grid, you connect each fixture to its section of NM.
The second option is a separate NM run from each fixture back to the switch box. That is simpler than multiple boxes above the ceiling, but you do have to watch out for box fill issues where everything comes together.
Keep in mind that the usual NM chain between fixtures doesn't work so well here because each section of NM would need to be secured a foot or two above the ceiling between fixtures - and once you do that, you are probably better off with boxes.
Comment: At the moment I have a ceiling box with power going to a switch box and coming back to the ceiling box. I was hoping I could just cap that until I'm ready to install lights but I'm not sure I can consider that "roughly installed" since I wouldn't be running any of the light legs yet
Comment: I think it would be easier to attach the cables to the junction boxes before putting up the supporting grid than after.


Cross-level correlations in a Multilevel Model

Question: I'm currently running a daily diary study, where participants first complete a baseline survey and then complete the same survey each day for 10 days. My data has a nested structure (days nested within persons), where the measures assessed in the daily surveys are at level 1 (within-person level) and the measures assessed in the baseline survey are at level 2 (between-person level). I'm trying to identify which variables to control for in my multilevel regressions. I understand that we generally want to control for variables that correlate with the predictors and outcome in the model. I want to assess if I should control for any level 2 variables in my model (e.g., gender, age, ethnicity, etc.) but I am unsure how to obtain correlations between level 2 and level 1 variables. I was wondering if anyone may have an idea of something I could try?
Comment: This should work via interactions between respective level 1 and 2 variables for which you assume interrelations. So I would search for 'interaction effect', if you are not familiar with this.
Answer: To my knowledge, there is no clear-cut way of obtaining basic correlations between L1 and L2 variables. You can run preliminary multilevel regression(s) with your outcome as the dependent and your L2 potential covariate(s) as predictors to see if they are related. But I don't see a problem in just adding the covariates that are theoretically meaningful into your main model. One way to analyze and report data like this is to run and report several models, for instance one with no covariates, one with demographic covariates, and one with demographic + other possible covariates, and report all of these in parallel in the same table.
Answer: Your question reminds me of the following. An L1 predictor X can be split into two components, a between component $X_B$ and a within component $X_W$. The between component is constructed by taking the average of all X values for a given person. In R:
XBetween <- ave(X, id)

XBetween is a new variable with as many values as X has; if a person has 10 values over time for X, then XBetween contains 10 values, all equal to the average of X for that person. Next, the within component $X_W$ is created by:
XWithin <- X - XBetween

If there exists a correlation between some L2 variable, say Age, and X, this can only be because there is a correlation between $X_B$ and Age. If you would use as model:
$Y = b_{0j} + b_BX_B + b_WX_W + b_3Age + b_4Gender + ...$
then $b_W$ gives you the so called within-effect of X: what happens with Y if X increases 1 unit within a given person! On the other hand, $b_B$ shows what happens with Y if the average of X increases 1 unit, being a between-person interpretation.
The $b_W$ effect cannot be confounded by your L2 variables, but $b_B$ can, if there exists a correlation of the L2 variable and $X_B$! So you may want to check for such correlation.
The within effect $b_W$ is often considered to be more interesting than the between effect is. Suppose you would use dummies for you persons (instead of the random $b_{0j}$). Then you would not be able to include Age en Gender of course, but only X, and the effect of X would then be equal $b_W$, as it is the effect controlling for person.
These kind of multilevel models for longitudinal data are called "hybrid models" or "within-between models". See Paul Allison's blog on hybrid models


do I require Transit visa for Amsterdam since I am travelling from Delhi- Amsterdam- Havana and my layover time at Amsterdam is 1.45 hrs

Question: I am travelling from India to Havana via Amsterdam.the layover time at Amsterdam is 1.45 hrs. Do I require to obtain Transit Visa?
Answer: Depending on your query ot seems like you are holding Indian passport and ONLY landing on Amsterdam just to boarding another flight destine towards other destinations.
Have a look on https://www.netherlandsandyou.nl/travel-and-residence/visas-for-the-netherlands/airport-transit-visa
There is details of requirement for anyone touching ground even if for 1.45 hours of time for transit via their airport.
Another details discussion on various aspects of transit system can be found on this answer for other similar query:
https://travel.stackexchange.com/a/30570/48220


Should I use SHA-512 with many rounds or bcrypt/scrypt

Question: I am currently using SHA-512 with 100000 rounds because of the easier implementation. The algorithm generates passwords from a service (e.g amazon) and a master password. Would I benefit from switching to bcrypt/scrypt?
Comment: Are you using this to generate passwords, or to create storable hashes of them? If the latter, are you salting them?
Comment: I am generating passwords from services (e.g. stackexchange) and a master password.
Answer: Based on clarification from the OP, I will change my answer.
So you're doing something equivalent to:
sha-512x100000("stackexchange.com"|"master password")

... that's really not a great idea. Your choice of hash function is not your biggest problem here. As an attacker, once I crack one of your passwords and recover the master password, it becomes trivial for me to crack all your other accounts.
I would suggest you switch to using passwords derived from /dev/random, or using a proper password manager.

ORIGINAL ANSWER
Yes, please do not use SHA-X hash functions for password hashing. You'd be better to switch to something designed to be a password hashing function.

SHA-2 hashes (which include SHA-224, SHA-256, SHA-384, and SHA-512) were designed for performance: it was part of the design requirement that software and hardware implementations of these hash functions be as fast as possible. Assuming that your server is using a software implementation of SHA-512 and the attacker trying to brute-force the passwords is using either a GPU rig, or dedicated SHA-512 hardware, then you are giving the attacker an advantage over you because they can perform guesses with much higher efficiency than the server can generate the hashes in the first place.
In short, SHA hashes are designed to be fast - especially in hardware. A very bad property for a password hashing function.
bcrypt, scrypt, and to a lesser extent PBKDF2, are designed to be slow and inefficient in hardware -- very good properties for password hashing functions.
Of those three (bcrypt, scrypt, and PBKDF2) it looks like scrypt is the most modern and the best choice. Though, from the results of the 2013 - 2015 Password Hashing Competition, it seems that Argon2 (and the runner-ups Catena, Lyra2, yescrypt and Makwa) blow scrypt out of the water, so use one of those if you have it available.
Comment: Note that NIST corrently recommends PBKDF2 for password vitrification usage.
Comment: Removed my answer as you have updated yours in response to the OP update. My answer no longer is relevant. Up voted yours.
Comment: Minor nitpick: /dev/urandom is preferred over /dev/random - though in some implementations they are apparently the same (FreeBSD & macOS).
Comment: @Sas3 Yeah, minor and flame-war-y for sure. I think they're also the same in Solaris. The differences matters a lot on headless or embedded  systems. On workstations with lots of human-input events (mouse / keyboard), /dev/random is more than good enough.
Comment: I like PBKDF2, it is easy to scale for more powerful CPU by adjusting number of cycles.