How to scale an image source at a specific resolution

Question: The scale node use a multiplier, 0.5 to reduce the image size by half and 2 to increase by 2. What should i use if i want to convert any image source at the desired resolution, for example i want to input a 4096*4096 or 512*512 and always get a 1024*1024 output and get the entire image not cropped.
Comment: This question is kind of strange.  Blender texture coordinates by default go from 0..1.  If you UV unwrap a square and put a texture on it, you'll see the entire texture whether it is 4k, 2k, or 1k.  If that texture isn't square, it will be squished into a square.  In what context does the resolution of this texture really matter?
Comment: did you try changing the scale from *relative* to *absolute*?
Comment: In absolute i can downscale correctly but if i upscale to a given resolution the image is cropped.

Yes it's important to get a specific resolution because i am making a node setup to check if a 2k texture is seamless and it translate a 2k texture for that: http://blenderartists.org/forum/showthread.php?383624-Dark-Blender-(Official-Thread)-optimized-for-sculpting-and-game-asset-creation&p=3058915&viewfull=1#post3058915
Answer: You can set the Resolution Size (in pixels) to the desired output size in the Scene Dimensions section of the properties window..
Using a Scale Node,  will rescale an image connected to it to the predetermined output resolution.

If you want to double the number of pixels just render at 200% (in this example rendering a 512 x 512 pixel image will result in an image of 1024 x 1024 pixels). To cut the number of pixels in half, render at 50%.

Note that if the images are a different aspect ratio than the output, you have three choices:
stretch: deform the image to match within the aspect ratio of the container)
Fit: keep the images proportions but fill the remaining either with a transparent background or with black (if the "Use Alpha" option is unchecked)
or Crop Not stretching the image, resizing to fit vertically center cropping horizontally.


Calculate p-value of multivariate normal distribution

Question: I want to calculate $p$-values by using the statistics program R.
I want to test multiple groups to a placebo group and thus I want to test the nullhypothesis $H^{11}_0 : \mu_1 = \mu_2, \ldots H^{1m}_0 : \mu_1 = \mu_m$. My test statistics $T^1,\ldots,T^m$, where $T^1$ is the test statistic to test $H^{11}$ and so on, are asymptotically normal distributed and my vector of test statistics $(T^1,\ldots,T^m)$ has multivariate normal distribution with mean $\mu=(0,...,0)$ and a Covariance-matrix Cov under the nullhypothesis.
Let's say $m=3$ and $\mu=(0,0,0)$ and
\begin{align}
Cov =
\begin{pmatrix}
1 & 0.5  & 0.1
\\
0.5 & 1 & 0.1
\\
0.1 & 0.1 & 1
\end{pmatrix}.
\end{align}
Now I've for example observed $T_1 = 0.2, T_2=1.3, T_4=-0.4$.
I've thought about something like
$$p_1 = 1-pmvnorm(lower=(-T_1,-Inf,-Inf),
upper=(T_1,Inf,Inf),mean=\mu,sigma=Cov).$$
But I'd get the same $p_1$ for any Covariance-Matrix with diagonal elements equal to 1 and this obviously seems kinda false since the correlation between the test statistics aren't considered. But I actually don't know how else to calculate the $p$-value. So any advice would be helpful.
Thank you!
Comment: This question needs clarification: what is $R$? What are the relationships between the $t_i$ and the $T^i$?  What is the hypothesis to which the p-value is associated?
Comment: I edited my question. I hope it is clearer now.
Answer: I'm not very good at drawing in 3 dimensions, so here is a 2D view of what you're calculating with that definition of $p_1$:

This is a rectangular region going to infinity and just touching the observed point $(T_1, T_2, T_3)$ at the corner. While that is certainly a value that can be calculated, it is not particularly meaningful.
It is much more common to construct a hypothesis test by calculating something like this:

Where the measure of the orange region is now the probability that a random point would have been "less likely" (e.g. have a lower probability density) than $(T_1, T_2, T_3)$. This can also be interpreted as the probability that a random point would be further from the origin in the the Mahalanobis metric.
The formal test statistic is then:
$$ d = \sqrt{({\mathbf x}-{\boldsymbol\mu})^\mathrm{T}{\boldsymbol\Sigma}^{-1}({\mathbf x}-{\boldsymbol\mu})} $$
Where $\Sigma$ is the covariance matrix, $\Sigma^{-1}$ is the precision matrix, and $\mathbf{x}$ is the vector $(T_1, T_2, T_3)$ in your notation. If true population parameters $\mu$ and $Sigma$ are known then $d^2 \sim \chi^2_1$ (read as $d^2$ has the Chi-square distribution with one degree of freedom). If, on the other hand, $\mu$ and $Sigma$ are empirical estimates from the same sample, then $d^2$ has the Hotelling's T-squared distribution.
Of course, only you can know exactly what hypothesis you want to test. I'm just showing you one common way that other people have approached this problem, but I can't know your specific situation in detail; I'm just guessing. Think carefully about which definition is most useful for what you are trying to accomplish!


adding facets to extruded text

Question: I am trying to convert extruded text letters to a low poly version (see image). I can extrude the text but even though I've been playing around with the decimate modifier, I haven't been able to get the desired results. I am still new to blender so any advice on how to achieve this look would be greatly appreciated! Thank you!
Comment: @MartyFouts: You can fix the image link by removing the `!` in front of the link, just FYI.
Comment: Hello and welcome. Instead of having users go through links and external sites please use the builtin tools to embed images in your post. See [How to upload an image to a post?](https://meta.stackexchange.com/questions/75491) or [GIFs](https://blender.meta.stackexchange.com/questions/963)
Comment: @SylvesterKruin I approved your edit but something went wrong and another reviewer has to approve it.
Comment: @DuarteFarrajotaRamos: Using the built-in image tool _does_ save your image to an external site: [i.stack.imgur.com](https://i.stack.imgur.com). But it still enables users to view the image directly on the post (visually equivalent of embedding it), if the correct image-link syntax is used. In this case, it wasn't correct, because it provided a link to [imgur.com](https://imgur.com), not [i.stack.imgur.com](https://i.stack.imgur.com).
Answer: Once you've converted your letters to meshes, you can first display the wireframe in the Viewport Overlays panel:

Then select your letter and in Edit mode, select alla and press X > Limited Dissolve to simplify the topology (set the Angle value in the Operator box):

Then press CtrlT to triangulate the topology:

You can also give your object a Decimate modifier/Collapse mode and play with the Ratio value:

You can add some edges with the knife if necessary.
In Edit mode, go into the Select panel > Select Random, choose the Ratio value in the Operator box in order to select more or less vertices, and move the selected vertices on the Z axis:

Here is the kind of result you get:

adding facets to extruded text


File History vs Backup & Restore

Question: What is the difference between Backup & Restore that was present on Windows 7 and the "File History" feature on Windows 8?
Answer: File history keeps multiple copies of files in a backup location where they can be easily accessed via the properties>file history menu or via direct access to storage location.
Backup and Restore saves a single incremental backup to a location. Backup and Restore can also save a complete system image (note: not quite complete). You can use the system image to restore your computer to a previous state. As far as I know you can only use a backup to restore files while on the Windows DVD not file history.
Comment: As far as I have seen, no. You could use a combo like I do. I use file history and make regular backups. Although it does use a lot more space it is the easiest solution for me. Have a look at this: http://lifehacker.com/5958865/how-to-use-windows-8s-new-file-history-backup-aka-time-machine-for-windows
Comment: Thanks for the answer. Is there a way to store a complete system image using File History so that I can restore back to a particular date and time? Or is it just versions of individual files?

File History vs Backup & Restore


How does gravity cause acceleration? Also what means spacetime?

Question: Since gravity only curves spacetime, how does it give kinetic energy to an object eg when an object falls to the ground. Since it only curves spacetime we shouldn't move towards it without kinetic energy. So when an object goes up why does it come down?
Comment: *"Since gravity only curves spacetime"* - gravity doesn't curve spacetime.  Mass-energy curves spacetime and gravity *is* spacetime curvature.
Comment: Hi, welcome to Physics SE! Can you re-check your formatting and grammar, clarify your specific problem or add additional details to highlight exactly what you need? As it's currently written, it's hard to tell exactly what you're asking.
Answer: This is a very intuitive explanation and I am trying to make it easy to understand rather then to match the math.
First, you have to learn that it is stress energy that bends spacetime.
Gravity itself has an effect of spacetime curvature.
Then you need to learn about the four speed vector.
The four speed vector is set up so that the magnitude has to be c.
Now you are asking about how it gives kinetic energy to an object. The object will move along a geodesic towards the center of mass.
If as you are asking the object is at rest relative to the earth, it is still moving in the time dimension.
Now as per GR, if the object is in the Earth's gravitational field, gravity will slow down the object in the time dimension. The object's vector component in the time dimension will decrease.
But the four speed vector's magnitude has to be c, so the spatial components of the vector will have to compensate, the spatial vectors will change. The object will start moving in space. It will move along a geodesic towards the center of mass.
Now you are asking what spacetime itself is. It is the mathematical model of 4D continuum, where time as the 4th dimension is just treated as another spatial dimension. Until the 20th century, they thought that time was independent of the spatial dimensions.


How does the unit circle work for trigonometric ratios of non-acute angles?

Question: How does the unit circle work for trigonometric ratios of obtuse angles? I know that the x coordinate is $cos (\theta )$ and the y coordinate is $sin (\theta )$. But I understand these in context of only acute angles? I don't understand why the unit circle definition works for other than acute angles? Somebody please provide me some good intuition.
Comment: Your question seems a little odd -- part of the reason for the unit circle definition is that it yields a definition in an obvious way for all angles. I suspect you mean to ask something different: can you try to state your question more precisely? e.g. maybe what you mean by "work" needs clarification.
Comment: Note that the coordinates of the circle is given by $(\cos\theta,\sin\theta)$ for acute angles. Try understanding now as, that we extend the acute angle's definition to all the angles by the fact that it gives the coordinates.
Comment: I had a similar difficulty, while exploring trig functions. But, when I deeply thought about it, I realised these definitions are indeed correct. Yes, they are DEFINITIONS, not proofs of some kind. This convention is flexible with all the triangles, obtuse, acute, any triangle. And the question is , why did we go beyond $\dfrac{\pi}{2}$, and the answer is just because we can. One more important thing to note is the though the name trigonometry, trig functions are not only about triangles, it has a deeper meaning.
Comment: https://math.stackexchange.com/questions/136543/trigonometric-ratios-for-angles-greater-than-90-circ
Answer: The "magnitude" of $\cos \theta, \sin \theta$ of an obtuse angles can be measure in terms of the acute angle its terminal arm forms with the $x$-axis, positive or negative. So an angle of, say, $\theta = \frac 34 \pi$ has its terminal arm pointing in the direction of Quadrant II, and the absolute values of $\cos\theta$, $\;\sin \theta$ are the same as the values of $\theta' = \pi/4$, the angle formed by the terminal arm of $\theta$ with respect to the negative $x$-axis: $\theta' = \pi - \frac{3\pi}{4}$.
The sign of that magnitude can be determined by the quadrant in which the angle's terminating ray is directed. (Recall that $\cos \theta$ corresponds with the $x$ coordinate, $\sin \theta$ with $y$):
Quadrant I: $\cos \theta, \sin \theta \gt 0$
Quadrant II: $\cos \theta \lt 0$, $\;\sin\theta > 0$
Quadrant III: $\cos \theta \lt 0,\;\;\sin\theta \lt 0$.
Quadrant IV: $\cos \theta \gt 0,\;\;\sin\theta \lt 0$.
Comment: Your answer does tell me how to find the cosine and sine of all sorts of angles, but I don't understand "why" this "how" works.
Answer: This intuition can be found in the history of trig. Looking into my history of math notes (a course mandatory for my degree) I learned that once upon a time there was a man Hipparchus. He is regarded as a ofundaing father of what's now known as trig. Apparently there was a desire at that time to have tables that would convert any point on a unit circle expressed in Polar form, into corresponding Cartesian form. Hipparchus made those tables and assigned "functions" to the idea how every angle (measured from the pos. x-axis) of a point P on the circle would "correspond" to (x,y) coordinates. That's how the modern cosine and sine could be defined. Right triangle geometry is then derived from here. In this realm, the functions cosine and sine are born from the desire to have a "translation" from Polar to Cartesian form. In this light, all quandrants of the unit circle are covered and thus the sign of cosine and sine are understood accordingly.


Is there any SEO benefit to having blog post links on home page?

Question: Should blog posts be linked on the home page or is it sufficient to have a <code>/blog</code> page with all the links on it?
I know the home page generally has the largest page authority so I was wondering whether this would be the best approach or merely keep it to one page/feed?
Would Google recognize the dynamic nature of the home page as a benefit to its searches?
Comment: Well, that really depends on how important these particular "blog posts" are to the site and whether being "linked to" from the home page makes sense within your site structure.
Comment: Understood, my question was more catered towards SEO, would Google recognize the dynamic nature of the home page as a benefit to its searches?
Comment: Dynamic is only important for some searches.  If Google determines that the search is news related then it says the query deserves freshness.  So what nice is your site?  What would you out on the home page of not blog content?
Comment: There are a few things that happen. One is you signal the importance of the blog post by being one link from the home page and within content. Second, you signal the importance of the home page with ever changing contents. Third, you keep the home page fresh. However, for this to really work well you will need to create enough content each week to encourage search engines to visit the home page daily but not knock too many links off the page too quickly so that the link has real value. So... Yes! There is some SEO value.
Answer: There is very little to no direct SEO benefit. As other have alluded to in the comments, it's more of a UX consideration.
Assuming you have a direct path from your home page to the blog entries (example.com -> example.com/blog/ -> example.com/blog/sample-post) which will likely exist in the navigation, search engines should be able to crawl and index these posts just fine, noting where they are in the site hierarchy. You can link to these posts from other pages on your site, such as your home page or other deep content pages, but we're talking internal links rather than inbound, so at any rate they carry far less value.
Furthermore, the URL that the crawler will follow to your blog page will still be example.com/blog/sample-post. (If it's different than the canonical URL, there's a problem.) It will thus still see the same hierarchy, and most likely treat it the same. However, if the dynamic nature of the home page is a benefit to the users, it's still a win.
Answer: If you mean SEO benefits in terms of crawl rate or faster index, then yes it's benefit, because Google crawl your homepage often, because you've link to it from many places like header, navigation or bottom.
But there is no any ranking benefits for permanent, once those links are goes to other page like page 2 then it will get very less juicyrank(PageRank), so it is not permanent benefits, but sometimes temporary benefits helps you, when those blog post are about new trends.
So dynamic nature is answer in itself. Google give value to your latest post and when they disappear from your homepage, then it will give less important to those links. And re-calculate PR again to give more importance to your new links.
So PR is calculate every time when Googlebot crawl your pages. When any pages drop some links then Google cut their aid to those links. It's that simple to understand. Google does not care it's homepage or not, it's pure maths.


did the International Criminal Tribunal for Rawanada have the power to grant pardons and remissions?

Question: the information on it that I've found so far doesn't have any information on this aspect. it appears they had desvretion to decide which setances to pass up to life imprisonment but did it have broad powers of pardon ?
Answer: Yes. Article 27 of the Statute of the International
Criminal Tribunal for Rwanda, made under UN Security Council Resolution 955 (1994) states the following:

Article 27
Pardon or commutation of sentences
If, pursuant to the applicable law of the State in which the convicted
person is imprisoned, he or she is eligible for pardon or commutation of
sentence, the State concerned shall notify the International Tribunal for Rwanda accordingly. There shall only be pardon or commutation of sentence if the President of the International Tribunal for Rwanda, in consultation with the judges, so decides on the basis of the interests of justice and the general principles of law.


Is running Linux through a VM as fast as running it natively on MacBook?

Question: I am trying to decide whether I should run Linux natively or through a VM on MacBook 7,2? How much performance difference would I observe? Is it worth installing Linux natively or is running it through a VM sufficient?
Comment: A couple of things. First, as both Linux and OS X are on the Unix family tree, lots and lots of things are the same, but there are differences (sometimes seemingly for the sake of being different, but I digress...). So if you just wanted to become familiar with Unix, Mac OS X would work fine. However, being you're reading a book targeted to Linux, even though maybe 80% of things would be the same, the 20% would be frustrating and confusing, so I agree, stick to Linux. However, nothing you'll be doing should require maximum performance, so a VM will work fine.
Comment: OSX uses BSD-derived command line utilities; Linux uses GNU tools. There are differences. You can compare man pages ([OSX](https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/), [Ubuntu](http://manpages.ubuntu.com/manpages/trusty/en/)). You might want to check out [homebrew](http://brew.sh/) to add GNU tools to your Mac.
Comment: I haven't read the book, so I can't say. I'd suggest you install the VM and then do all the exercises on both your Mac and the Linux VM.
Comment: The rule of thumb I've seen is that VMs have about 80% of the performance of running natively. Of course it depends on the mix of operations, native code runs natively on the hardware, but I/O, graphics, etc. often have a layer that slows things down. So it really depends on what you want to do on Linux, is it something where every last drop of performance is important? Or can you stand slightly less performance for the convenience of a VM? Also, what do you need Linux for specifically? Mac OS X is very "Unixy".
Comment: @blm To be honest, currently I am going to learn how to use the command line. Specifically, I will be using the book: ["The Linux Command Line: A Complete Introduction"](http://linuxcommand.org/tlcl.php). Would OS X would work just fine to follow the book or do I really need a Linux distro?
Comment: @glennjackman If I added GNU tools with homebrew, would it be sufficient or would I still need a Linux distro?
Answer: If you do not need real performance, you should run a VM. It's MUCH easier to install and the support with mac is better. For instance, you won't have any problem with your trackpad under a VM.
However, if you need some huge performances or direct hardware access, you should run linux natively, if you want to run Kali Linux and do some pen testing, using a VM would be a pain because it would slow down a lot cryptography and access to the wifi drivers for exemple.
So for what you want to do, I suggest you to install a nice linux distribution on a VM, for instance a Debian based linux like Ubuntu. If you can afford a paid VM software like VMWare it would be much smoother and better integrated with your Mac, but for your purpose, I think VirtualBox would do the job !


storing medications in checked baggage

Question: I have medication that should not be stored in temperatures below 59 degrees or above 86 degrees (F) - can these be put in my checked luggage? This is Lodocaine/prilocaine
Comment: Consider that while luggage usually doesn't get lost, sometimes it does. Many of us carry in hand luggage stuff that's really important and shouldn't be lost...like medicines or a laptop computer.
Comment: Where are you flying from/to/through? In Miami or Phoenix, it is hotter than that. In Anchorage or Novosibirsk, it's colder than that. Luggage is not air-conditioned, but sits around on the tarmac or kn the airport for a while usually.
Answer: No
Checked luggage spends a fair bit of time outdoors, on the tarmac, and in storage facilities that are not climate controlled. So temperatures can vary quite a bit depending on weather and environment.
Also temperature in the baggage hold is on average significantly colder than in the passenger cabin. Temperature varies quite a bit but the average is around 45 deg Fahrenheit. https://bestcheckedluggage.com/cold-luggage-plane/
No one knows for sure, but it's very likely that the drugs will see temperature outside the recommended range if you check them

storing medications in checked baggage


How to add an extra light to an existing light

Question: I have a question that I think is really simple for you experts (naturally I'm a novice) so hopefully someone can help me out. I want to add an additional light to an existing light already installed in my basement about 10 feet away. At the existing fixture location, there is a 2-wire cable and 3-wire cable as shown in the attachment, and wired the same way. How is the proper way to connect a new light to the existing fixture. Is it as simple as me installing new 14-2 wire cable from a new light, and attaching to the neutral, hot (red), and ground wire at the existing fixture?  Any advise or confirmation is greatly appreciated. Thank you.
Comment: Which wires in the light box are connected to the existing light fixture?
Comment: Just like in the image, there are 2 wires on the existing light (Red and White). The red attaches to the 3 wire cable (red wire), and the white neutral goes to a pigtail with 3 neutral wires. It's literally exactly like the image.
Answer: Great job for a first post!  Excellent diagram.
Yes, you can easily add another fixture in the manner you described, assuming it's a 15 amp circuit (which is likely), if a 20 amp circuit, you'd need 12/2. You got it right.
Comment: Thank you so much for the feedback. I really appreciate it!
Comment: Congrats also to do-it-yourself-help.com for updating their diagrams for 2011 Code.


How can I further diagnose "bluscreen/~restart on awakening" problems that take place after upgrading HDD or RAM?

Question: I've got 2 similar problems with hardware/drivers/?? which I'm not sure how to address or diagnose, both with the same (Lenovo ThinkPad 460 Yoga) laptop.
The first one took place when I tried to switch the (1TB) HDD with a (1TB Samsung 850 Pro) SSD. The laptop started to bluescreen (or restart as if the power was switched off and on) frequently after awakening (each time I noticed BSODs' code it was either DPC_WATCHDOG_VIOLATION or IRQL_NOT_LESS_OR_EQUAL). After 2 or 3 weeks of working with that I've noticed that if I close all apps that consume some resources (well, notepad++ is not among them), it doesn't bluescreen. However, that wasn't an acceptable limitation and I gave up and migrated back to HDD.
Now, 3 days ago I've switched 8GB RAM with 16GB RAM from Crucial with the same speed and frequency as the original one. And the "bluescreen/restart on awakening" problem arose again. Unlike with SSD which may have some problems with data migration and be not compatible with the laptop (officially Lenovo writes compatibility with HDD up to 1TB and SSD up to 512MB), the RAM shouldn't have any compatibility problems (same form-factor, SODIMM, same type, DDR3L, same frequency and speed, I've seen even a video on YouTube where they switch RAM to that very model by Crucial), and I'm suspecting I should try to tweak some settings to make things work. Unfortunately, I have no idea what settings to try to tweak.
Do you have any idea what could be wrong, what I can try to tweak or how to diagnose the problem further?
PS I've checked BIOS, it shows the correct amount of RAM and also run some Lenovo diagnostics for RAM and those went well..
Answer: I'll give a sad answer, albeit may be useful.
Assuming swapping your storage media made you do a reformat / clean install.
If you get a BSOD, on Win10, after a clean install and updates:
95% - it's a hardware problem.
If it started happening with yet another component, I would point towards a faulty motherboard.
Good luck, computers are finicky.
Comment: well, I didn't clean install, but the problem with 16GB RAM (with HDD) may suggest a hardware problem indeed.. The question is, how to diagnose it?
Comment: Clean install...


Image formation by convex lens

Question: If an image of an object formed by convex lens is simply meeting of the rays of the object due to refraction,then why do we require a screen to reflect these refracted rays?If we observe the image formation from the side the image is forming,shouldn't the rays of the image reach our eyes without a screen?
Answer: Your form an image of your object on the screen. Your eyes, to see things need to do the same. Do not forget that when using the screen there are no more lenses. But if you look into the rays coming from the lens, you now include also your own eyeball lenses into the optical beam path. Your retina, at the back of your eyes IS the screen.
Putting it in different words, when you look at an object, your eyes and retina are doing exactly the same as the lens and screen you proposed. In a way, you are seeing how your eye works!! Except that instead of having a screen you have cells which are sensitive to light!
Answer: Right, you see the image in the same place when the screen is removed (You don't need the magnifying glass).

Fun Science Gallery
Comment: What if your eye is in the imaging plane? This is not completely accurate! Specially considering the question. He asked if the image would form in your eyes, from what I gather the confusion is that our eyes are like the screen. And also why is it that we need the screen. You answered none of those questions, you simply said "Your eyes see things in an imaging setup, heres an example of an experiment that you can do by yourself". While he could do it, it still did not answer why is it like that. Just explain then why does he need to be far away from the screen.

Image formation by convex lens


Why von Neumann entropy requires diagonalization and linear entropy doesn't?

Question: The linear entropy for a state $\rho$ is defined as $S_L = 1 - Tr[\rho^2]$, while as von Neumann entropy as $S_{N} = -Tr[\rho \ln \rho]$. According to quantiki, the computation of $S_{N}$ requires diagonalization but $S_L$. But this is not clear to me why.
Comment: Well how would you compute $\rho \log \rho$ and $\rho^2$? .
Answer: The linear entropy $S_L = 1 - {\rm Tr}[\rho^2]$ certainly doesn't need diagonalization because $\rho^2$ is straightforward to calculate, as is its trace.
The von Neumann entropy $S_N=-{\rm Tr}[\rho \ln\rho]$ seems to require diagonalization because of the factor $\ln \rho$. Taking logarithms is not a "natural" operation for a matrix, and it's not at all clear at first glance what it should even mean.
But, physicists find it useful to say that any scalar function $f(x)$ can be applied to any matrix $A$ in the following way:

Factor (or "diagonalize") the matrix: $A = U\Lambda U^\dagger$, so that $U$ is a unitary transformation and $\Lambda$ is a diagonal matrix.
Apply the function $f(x)$ on each element of $\Lambda$. Call the resulting matrix $f(\Lambda)$.
Define the matrix $f(A) \equiv U f(\Lambda) U^\dagger$.

Essentially we have applied the scalar function to each element of $A$ when represented in its eigenbasis.
So, the very definition of $\ln \rho$, and therefore $S_N$, implicitly includes a diagonalization.
But as @Rammus points out in a comment, the joys of calculus do let us sometimes use alternate means of calculation such as Taylor series. Actually, it seems the function $f(A)$ is often (maybe usually!) defined in terms of the Taylor series. See for example:

https://en.wikipedia.org/wiki/Logarithm_of_a_matrix
https://en.wikipedia.org/wiki/Analytic_function_of_a_matrix

I was a little embarrassed to find that even a mathematical physics textbook defines it that way. My physics teachers are perhaps a little iconoclastic. ;)
Comment: @jecado don't be so quick to dismiss your physics teachers: you can have operator functions that are not analytic! They are then *defined* by their action on eigenstates. When $A|\psi_i\rangle=\lambda_i|\psi_i\rangle$, we define operators $f(A)$ by $f(A)|\psi_i\rangle=f(\lambda_i)|\psi_i\rangle$, plain and simple. Then if $f$ happens to have a Taylor series expansion we can do other things too
Comment: That looks cool! Could you suggest some reference(s) regarding the above 3 steps?
Comment: That is an excellent question. In fact I've just checked three different sources and they all contradict me, defining $f(A)$ in *terms* of the Taylor series! ^_^ I'll edit the end of my answer to acknowledge this and give a couple links.


Will it help or hurt (or neither) to showcase irrelevant talents such as musicianship on a software engineering resume?

Question: I am curious whether including a link to my music projects would help or hurt on my software engineering resume. Assume for the sake of the question that the music projects showcase a major talent. For the sake of generalization, suppose the showcased talent may be in any other area which is unrelated to the job that one is applying for.
Comment: Does this answer your question? [Should I list skills on my résumé if I have no interest in using them again?](https://workplace.stackexchange.com/questions/19625/should-i-list-skills-on-my-r%c3%a9sum%c3%a9-if-i-have-no-interest-in-using-them-again)
Answer: A resume is supposed to be a targeted list of items / accomplishments which showcase why one is fit for a particular role. IMHO, unless a hobby or a skill is related to the job post / role you're applying for, it's better to leave it out of the resume.
For example, in general, hobbies like reading, travelling etc. help grow a person (mentally and physically), and a positive sign. They can be included in the resume.

A hobby of watching cartoon series may not be relevant, even indirectly, to the role of a software development for banking sector.
However, if the job role is for animation / VFX sector, having exposure to various cartoon series may be a plus.

So, the bottom line is: include the information only if relevant.
Real estate is limited!
Comment: +1: unless you can relate hard skills (or soft skills if you're desperate / junior) from the hobby, don't mention it. Eg: using machine learning to generate the music. Github repository available on…
Answer: Most likely, it would be neutral to negative.
If I'm reviewing a resume, I'm probably spending 60 seconds looking through it to figure out if this person is worth having a phone call with.  If I spend 6 of those 60 seconds looking at irrelevant information that doesn't show me that you're worth having a phone call with, you've only got 54 seconds left to sell me.  And that means that I probably won't see some other tidbit of information you've included in your resume that would be more likely to merit a call.
From an optics standpoint, having irrelevant information will tend to make a hiring manager question whether you're really right for the role.  I'd rather not hire a software engineer that is really focused on being a professional musician and is just taking a software role as a way to pay the bills in the short term.  If you're including irrelevant content, you're liable to needlessly introduce that sort of doubt.
Of course, it is possible that someone will see that link, think "great software developers frequently excel at their chosen hobbies", and conclude that excellent musicianship shows skills that are transferrable to software development.  Fleshing that sort of thought out would be a good way to get a viral LinkedIn post.  Practically, though, the vast majority of people are too busy during the day dealing with all the work they have to do and all the deadlines they're dealing with to invest a lot of time and effort reviewing the pile of resumes HR just dropped on their desk.
Answer: Answer from the Netherlands here, which isn't as 'hard' as US work culture. I've been the interviewer for software development roles and I wouldn't see this as a negative. If you have some interests outside of work, list them, but briefly. It provides an opening during the getting-to-know-each-other talks, and a way to let someone speak passionately about something they like.
And keep in mind software development is an employees market. People talking about sifting through resumes in a minute… well let's say that doesn't really match my experience as a developer of being approached several times a week. Software developers are in high demand, recruiters are desperate, don't worry about letting them spend another few seconds, the resume is ALSO something a team lead or scrum master or whatever will read, and they have an important say about whether someone is a fit for the team and company culture.
Answer: I'm in the software industry for over 30 years and have had quite positive experiences working with musician-tinged software developers. I'd add it, but put it bottom e.g. "Other experience" or  "personal".  Tangentially I also happen to look positively at strong relatively current athletic achievements since that reflects discipline and drive.
Responding to some other answers about "not interested in people who first want to be a musician and the software development is just to pay the bills":  I have seen that happen a couple of times. One of the persons made no bones about it but he was quite effective on the job so what's the harm?  The second person was also quite effective and after fifteen years of software development as well as managing a wide variety of teams he went into composing for the motion picture and gaming industries. He's gone from software development but he was valuable for a number of years in it so again where's the harm in that? Note: i am [most certainly] not a musician so this is not self serving to promote these strange and wonderful folk.
Answer: Many talents can be a "plus" for aspects of many jobs.
If your involvement in "music projects" ws being responsible for backups of the digital material then computer knowledge or specific software may be a plus.
If the music project involved creation then concentration and focus may be a plus for the job.
So, it is worth listing talents, but make sure they are in the most suitable section.
Comment: I sift CVs and later interview for finance admin & governance roles, and I read everything. One time we had a bunch of fairly similar CVs where many applicants listed sports as hobbies. One woman mentioned listening to Mozart. Other panel members had the opinion that this was irrelevant. She has turned out to be one of our most successful appointments ever.
Answer: Personally, I've never seen any value in, nor understood the reasoning for including superfluous information in a resume. If it isn't related to the job, your career, or your education then I don't see why you'd want to include it.
You: "I was a first chair flautist in my local symphony orchestra."
Person reading your resume: "This is a software development position. That isn't relevant and I don't care."
Answer: Listing hobbies is ok.  In longer interviews, they can serve as ice-breakers or chit-chat topics to lighten the mood of the interview.
However, no one needs a link to your hobby page cluttering up your resume.  If you want a section called "Other Interests: music, fast cars, dinosaurs", that's fine.  None of those should begin with https://
Comment: These days resumes are digital PDFs, so there's no clutter involved in making the word a link.  It's hardly going to be deal-breaker either way though.
Answer: Reporting in from Germany. It is common practice to include some things you are interested in into your CV. The most common things are traveling, exercising, learning about new technologies, etc.
They can serve as nice ice breakers during the interview and help to humanize you a bit beyond the spreadsheet of accomplishments and experiences you have. As for your specific example, I think including a link would be overkill. It almost feels like you are trying to sell your music, not you yourself. You can most definitely feel free to include the hobby but it shouldn't look like you are trying to sell your hottest mixtape to the recruiter.
Answer: I see no harm in mentioning hobbies, etc, on a CV - as long as it's no more than a sentence or two at the end.
Note one thing, however: if you list something on your CV, then you must be prepared to answer questions on it, no matter how niche and obscure it may seem to you.
This applies whether you once used an esoteric programming language, or did a course in underwater basket weaving. For all you know, your interviewer created the language, or is a basket weaving expert.
Obviously, musical skill is likely to be more mainstream. Your interviewer may ignore it completely, or may want to chat about it at the end of the interview. Either way, my view is that it's harmless.


Helping colleague's annoying behavior

Question: One of my colleagues is helping me on a project, as he has prior experience with such a project, and the product is pretty new for all involved. I asked him about small doubts I had during the functionality stage. However I am able to code and make the project work. He is so annoying these days when he tries to poke into my system to check my code. He says that he just wants to make sure that he is not giving me bad advice. He comes to my workspace and starts conversations. During the conversation he will grab my mouse and switch between tabs to check how I have coded which I find very annoying. I am very thankful for his help but I don't like his actions. How can I politely express my concerns to him?
Comment: Could you be clearer on what the problem is?  Is it that he grabs your mouse and uses it without asking?  Or that he reviews your code as part of his assistance?
Comment: Politely ask him not to grab your mouse. But also don't be overprotective of the code, it is not your code but the company's. He is doing nothing at all wrong by wanting to look at the code.
Comment: My guess is that he is not trying to be annoying or overbearing, but he is looking for clues on how to do his job.
Answer: Implement a Concurrent Versioning System:
Does your company use a CVS system like Subversion, TFS, or Git?  My co-workers and I commit our code often (usually several times a day, as we complete project tasks).
Formalize Code Review Processes:
We routine check each others code in the Code Vault to ensure it's readable and maintainable, since any one of us could be called to repair issues during the product lifecycle.
We also use tools within our environment to explicitly send code to one-another for private feedback and code reviews.
I love it when my co-workers all are familiar with a project.  It's frustrating as you move on to the next project to have to jump back and fix something because you're the only guy who knows how to fix it (and it's irresponsible to do that to your employer).
Protect Your Employer's Investment:
I'd encourage you to help your company move towards more formal code management.
Although I agree his behavior is bit overbearing, rude, and a personal invasion, You don't own your source code created while at work, your company does.
Who knows, you may get some great visibility in your company for encouraging them to go down the path to development excellence.
And the obligatory office friendship:
I would encourage you to speak with him, and tell him that his behavior is invasive.  I'd hope he'd understand, and start using the Vault to protect the corporate assets.
Comment: Very nice answer.
Answer: If he wants to check version control and see your code for himself, that's fine. However, coming over to your desk and invading your personal space by grabbing your mouse is completely unacceptable.
I have a couple of suggestions for you which may work:
Locking Your Workstation
The absolutely simplest way to deal with this behavior is to lock your workstations before you turn around to speak to him (WinKey + L).
This sends a pretty clear message that he interrupted you, and that what you're doing is private. The reason I mention this as being the simplest way of dealing with him is because it sends this message without your having to say anything at all.
Bring Up A Different Window
Another thing you could do is open a different window and cover the programming IDE up before turning around to speak to him. For example, as he walks up to chat open up a fresh copy of Chrome and full screen it.
The problem here is that he may still try to grab your mouse and look at your work, so you're not really preventing his behavior, just giving him a subtle hint.
Speak to Him
At the end of the day this person may not get it unless you throw it out there:

Excuse me, I was doing something before you walked up. It makes me feel very uncomfortable for other people to use my mouse, and to poke around my workstation.

At that point you can't be any more clear. If he tries to justify his behavior simply hold your ground:

I understand what you want to accomplish, but if you'd like to see the code maybe we should set up a review session, or you can look at it after I submit it to version control.

Set boundaries!
Comment: It's all about personal space.  In a modern office, us cube-dwellers have little enough of that.
Answer: I'd just keep my hand on my mouse, and if that didn't work I'd just tell him/her to stop with varying degrees of politeness depending on my relationship with them.
But if someone is continually annoying me, I just tell them that, they usually get the picture although they might cross me off their Christmas card list.

Helping colleague's annoying behavior


Calculating arbitrary sines/cosines

Question: Can you calculate arbitrary sines/cosines by using angle addition and double angle formulas? I thought that Taylor Series was the standard for calculating the sine of arbitrary angles.
What is I mean is an angle like $59$ is the same as $118=90+28...$ and through successive splittings we can break our angle into angles, like $90$, we know the value of sine/cosine at.
Comment: Tables are actually quite common for fast computing like graphics.  A friend of mine had a nice idea once (he probably wasn't the first) to represent the angle in binary and use half angle and sum formulas.
Comment: See [exact trigonometric constants](http://en.wikipedia.org/wiki/Exact_trigonometric_constants#Table_of_constants).
Answer: The famous CORDIC algorithm (last seen discussed here) actually implements this idea.
A more primitive version is that one knows some trig. values algebraically, with some effort for all multiples of $3°$. Also, the complex square root can be reduced to real square roots, so halving an angle is also possible.
So for example, to compute (approximate) $\sin$ and $\cos$ for $59°$ you could split it as $60°-1°$ and then use the binary expression of $1°/3°=(0.010101...)_2=\frac14+\frac1{16}+\frac1{64}+...$ to compose $\cos1°+i\sin1°$ starting with the values for $3°$ as obtained from the known exact expressions for $90°-15°-72°$, and then using fractions of it obtained by repeated angle bisection, for $3°/4=0.75°$, $3°/16=0.1875°$, $3°/64=0.046875°$ etc.

Calculating arbitrary sines/cosines


When concurrently filing, should in include a copy of documents previously filed?

Question: I previously files online an I-130, and I-130a. Now I'm going to file concurrently the I-485 and necessary other documents. When I send these to the USCIS lockbox and include the receipt that I filed the I-130a, should I send an additional copy of the I-130 and other evidence that I already filed?
Comment: What does the instructions say?
Comment: @littleadv nothing: https://www.uscis.gov/sites/default/files/document/forms/i-485instr.pdf at least the i-485 instructions don't mention if you should resubmit the i-130 stuff you already sent.
Comment: So why are you asking?
Answer: For the I-485, you only include the documents listed as required in the I-485 instructions. Since you are filing I-485 separately from I-130, you need to include a copy of the I-130 receipt, because it is required by the I-485 instructions, What Evidence Must You Submit with Form I-485? #5. Documentation of Your Immigrant Category, which contains:

If you are filing as a principal applicant and your immigrant category
allows you to file Form I-485 before your petition is approved, you
may submit your Form I-485 together with:
A. Your immigrant petition; or
B. A photocopy of Form I-797, Receipt Notice, for your immigrant
petition.

A is for people who file I-130 an I-485 together. Since you filed I-130 first and I-485 later, you would include B, a copy of the I-130 receipt.
You do not need to include a copy of the actual I-130 form or any of the documents required by the I-130, unless they are also listed as required by the I-485 instructions.
Comment: So it's better not to send things that have already been sent so long as they're not required. Basically, more isn't better here.


When someone can speak a language very well, they are "fluent". What if you can only understand it?

Question: When someone can speak a language very well, they are fluent. Is there a word to describe a situation where you can understand the language when spoken to you perfectly, but just can't speak it as well? I'm looking for a word or phrase to describe it.
Comment: Do you mean "you can understand the language perfectly when it is spoken to you" or "you can understand the language when spoken to you perfectly"? In either case, 'fluency' and 'proficiency' are matters of degree, so adjectives of degree can be added to produce a phrase: "semi fluent", "half fluent", etc. You've got some good suggestions in the answers given; unfortunately, most anything you might use will require explanation, such as "I understand but do not speak the language well" to communicate your meaning.
Comment: You're looking for something like *fluently receiving but limitedly expressing*, right? You might be in a pickle here because there are more aspects to the linguistic fluency. What if one can **write** fluently but not **speak** as well? Are you referring to the fluency as the ability to find words, form grammatical entities or the quality of pronunciation? Or even, perhaps, the knowledge of cultural influence on the language (mine is impossible to speak if you don't know a lot about the "national soul" and you'll be misunderstood frequently).
Answer: You could consider using passive speaker as defined in Wikipedia:

A passive speaker (also referred to as a receptive bilingual or
  passive bilingual) is someone who has had enough exposure to a
  language in childhood to have a native-like comprehension of it, but
  has little or no active command of it.

As it is not a broadly used term, you might have to add something after saying it for example:

He is a passive speaker in French. He does understand it very well, but
  can't speak it fluently.
Comment: +1 Language skills are often parsed into *receptive* and *expressive* - the ability to understand vs. communicate.
Answer: I'm not sure that there is a generally accepted word for this, though in the book 500 Years of New Words: the fascinating story of how, when, and why these words first entered the English language, author Bill Sherk wrote:

The author of this dictionary coined the term sesquilingual in 1975 to
  describe people who know one language and part of another, a term that
  probably applies to the majority of Canadians, who know English and a
  smattering of French, or vice versa. The Latin prefix sesqui- is
  sufficiently unfamiliar to most people that if you describe yourself
  as sesquilingual, they'll often think that you speak 6 languages
  instead of one and a half.

Quite so. The OED definition of the prefix sesqui- is:

Denoting one and a half

Accordingly the word sesquilingual is not a bad description of this situation (the possessed "half" in this case being the ability to comprehend and the missing half the ability to speak), but it has the disadvantage of being effectively a neologism and therefore it's not at all certain that your audience will understand what you mean if you use it. (Not without doing a web search, anyway; such a search will generate a decent number of hits pointing to this definition.)
Answer: As mentioned in a comment, "most anything you might use will require explanation".
To describe what you mean in a succint way, the best I can come up with is "good listening comprehension but poor oral production"
Comment: All you have to say is 'good listening comprehension' because one will always present the best of one's talents and if you could do more than just understand, you'd say that.
Comment: @Mitch Good call.
Answer: This is current in a C.V.
Languages:
english : read/write
french  : fluent
spanish : understood
N.B read/write (may have some crazy accent like mine)
Answer: To speak broken language
Or
To speak brokenly: means to speak with lot of pauses and incomplete phrases.
Hope this can help.
Answer: There is a medical condition called expressive aphasia that fits your definition:

Expressive aphasia (non-fluent aphasia) is characterized by the loss of the ability to produce language (spoken or written).

Although I guess you were thinking of a second language ability, still in a context it might work. Or maybe I'm suffering from expressive aphasia today.
Comment: Interesting term, though it seems to imply brain damage which isn't a common cause for the situation that the OP mentions. In my experience it more commonly comes down to someone with a functional brain who just hasn't taught themselves to think in the language. They've studied the grammar and have a working vocabulary but they don't practice creating original thoughts in their head. They therefore understand, but can't express. If I'm grinding my gears speaking Italian I usually realise that I'm thinking in English without being aware of it. A self-administered slap to the head works.
Comment: Never heard of this term +1) Merry Christmas!
Comment: @Rathony That might be a sign of *receptive aphasia* ;-) Merry Christmas to you too.
Comment: Yeah, my brain sometimes doesn't work as if it were damaged. :-)


Can I reduce the money to be spent during my visit to the uk for that was why I was denied visa

Question: I was refused a uk visitors visa because the money I stated to be spent on my travel was higher than my last salary received. And also I'm a continuing student and gave no documentation on next semester's course term and start date. I was also told I intend to visit the uk for tourism for 1 month six days, what does that mean ?
How do I address all these please
Comment: Please post a copy of the refusal letter (with personal information blacked out). It is very important to see the actual text of a UK visa refusal.
Comment: You can reduce it somewhat, but they're going to expect the amount to be credible. Just saying your trip will cost less isn't that helpful, because it still costs a certain amount to buy plane tickets, find accommodations, buy food, etc... Building up your savings is likely a better plan. But please post a copy of the refusal letter so we can see the whole picture.
Comment: Reducing the amount you intend to spend could just be seen as a ploy to try to get your application approved, especially if the change doesn't correspond with your stated itinerary/plans for the trip. If you're a continuing student, all you have to do is provide evidence of your attendance to date and your ongoing enrolment. The reference to the purpose and length of your visit can only be related to the information you stated in your application.
Answer: Tourism is a luxury. Tourists pay money for happy memories and pictures.
Economic illegal immigration is an investment. Workers pay money for the chance to earn more money later on.
To be credible as a tourist, your tourism expenses must be an amount you can reasonably afford as a luxury. This is not just a question of money in your bank account, it is a question of the balance between income and expenditure.
If someone else pays for your tourism, it must be credible for them to pay that much.


How to force nginx proxy_next_upstream with Node.js Express?

Question: I have a Node.js Express server deployed via nginx proxy_pass. I have two paralell daemons on different ports loadbalanced using upstreams. The initialization of Express server takes time, so I send Error 500 until it is ready. And I want the nginx to use the other upstream server until the first one is ready and vice versa.
I tried to use proxy_next_upstream, but it is not working well. There is always at least one Error 500 that is displayed to the user.
Maybe the reason is hidden in the following sentence from nginx doc: "One should bear in mind that passing a request to the next server is only possible if nothing has been sent to a client yet."
Here is the proxy_pass configuration:
proxy_pass   http://node_servers ;
proxy_set_header Host $http_host;
proxy_set_header x-forwarded-for $remote_addr;
proxy_read_timeout 60;  proxy_connect_timeout 60;

These are the upstreams:
upstream node_servers {
    server 127.0.0.1:12005;
    server 127.0.0.1:12006;
}

And this is how I send the Error from Node Express:
res.status(500).send('The server is not ready yet!');

Answer: You must configure nginx to use next server when "error 500" is received.
By default, nginx uses next server on "connection error" and on "timeout" only, so you must tune your configuration:
   proxy_next_upstream error timeout http_500;

"Use the docs, Luke!"
http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_next_upstream
Comment: I used proxy_next_upstream, but even then it doesn't work. I suspect the Express to send something before the error and therefore it gets to the user.
Comment: and use tcpdump to assert your suspection


Is it better to only use float instead of mixing float and int in an large calculation?

Question: I have a pretty large formula that has to be calculated about 300 times per second. Most of my variables are float, but some variables are just parameters that go into that formula. In some cases, float is not needed. I could use int parameters. But I wonder if mixing int and float types in an calculation would cause the system to cast types around, instead of saving performance.
Answer: First of all, yes, the system will cast variables so it can do calculations in a common base type.  Second, this isn't what you should be most worried about unless you've benchmarked your program and you know that this is your bottleneck.
Just to clarify the first part, though, if you have
double a = 10.0;
int b = 5;
int c = 2;

and your formula is
double d = a + (b / c);

most systems that I know of will use integer math where they can, for the division operation in this case, then switch to floating point math where it's needed.  So in short, the decision between integer and floating point math is done at the operator level.
Comment: Note that on some CPUs, integer division can actually be /slower/ than fp division. For example, on the Intel Atom, IDIV m32 takes 57 cycles, while FDIV is 25-65. However, those operations are likely on seperate functional units, so they could execute simultaneously.
Answer: Be careful about assuming that int operations are always faster than float operations. In isolation they may be, but moving data between a float register and an int register is shockingly slow on modern processors. So once your data is on a float, you should keep it on a float for further computation.
Answer: Depends ... Is the correctness of the result important to you?
#include <stdio.h>
#include <stdlib.h>

int main(void) {
    int x = 5;
    int y = 2;
    float z = 12.3f;

    float result = z + (x / y);
    printf("%f\n", result);

    result = z + ((float) x) / y;
    printf("%f\n", result);

    return EXIT_SUCCESS;
}

C:\Temp> t
14.300000
14.800000

Do what will give you correct results.
Answer: I doubt there are good rules of thumb.  It can depend heavily on the processor, the compiler, and the specific combinations of operations you are doing.  Set up a timer to run before and after your calculation, and do various tweaks and see which runs faster.
In principle, converting from float to int often would slow you down because an extra instruction is required to do it, but in practice the only way to tell is to measure.  Looking at assembler dumps of your various changes can help you get a good intuition, but even then the processor may be pipelining or even reordering instructions in non-obvious ways.
Also, be sure to investigate gcc's floating point optimization switches and ensure you are using the best ones for you.
Answer: I would say that it depends on what is more imporant for you. Performance-wise it is better to use float as by doing it you won't cast the ints number of times (about 300 times per second ;) ).
If it is something that is used very often in your code then you can be concerned about it otherwise there's no need to implement any changes. If you haven't hear of or read "The Fallacy of Premature Optimisation" doing so now may help you. The rule is 20% of code takes 80% of performance.


Image Processing: What are occlusions?

Question: I'm developing an image processing project and I come across the word occlusion in many scientific papers, what do occlusions mean in the context of image processing? The dictionary is only giving a general definition. Can anyone describe them using an image as a context?
Answer: Occlusion means that there is something you want to see, but can't due to some property of your sensor setup, or some event.
Exactly how it manifests itself or how you deal with the problem will vary due to the problem at hand.
Some examples:
If you are developing a system which tracks objects (people, cars, ...) then occlusion occurs if an object you are tracking is hidden (occluded) by another object. Like two persons walking past each other, or a car that drives under a bridge.
The problem in this case is what you do when an object disappears and reappears again.
If you are using a range camera, then occlusion is areas where you do not have any information. Some laser range cameras works by transmitting a laser beam onto the surface you are examining and then having a camera setup which identifies the point of impact of that laser in the resulting image. That gives the 3D-coordinates of that point. However, since the camera and laser is not necessarily aligned there can be points on the examined surface which the camera can see but the laser can not hit (occlusion).
The problem here is more a matter of sensor setup.
The same can occur in stereo imaging if there are parts of the scene which are only seen by one of the two cameras. No range data can obviously be collected from these points.
There are probably more examples.
If you specify your problem, then maybe we can define what occlusion is in that case, and what problems it entails
Comment: Thank you kigurai!!! I'm implementing SIFT algorithm for an embedded processor. I understand now that SIFT has the capabilities to an extent to recognize even such objects which are partially covered (occluded).
Comment: Glad to have helped. Good luck!
Answer: The problem of occlusion is one of the main reasons why computer vision is hard in general. Specifically, this is much more problematic in Object Tracking. See the below figures:

Notice, how the lady's face is not completely visible in frames 0519 & 0835 as opposed to the face in frame 0005.

And here's one more picture where the face of the man is partially hidden in all three frames.

Notice in the below image how the tracking of the couple in red & green bounding box is lost in the middle frame due to occlusion (i.e. partially hidden by another person in front of them) but correctly tracked in the last frame when they become (almost) completely visible.

Picture courtesy: Stanford, USC
Answer: Occlusion is the one which blocks our view. In the image shown here, we can easily see the people in the front row. But the second row is partly visible and third row is much less visible. Here, we say that second row is partly occluded by first row, and third row is occluded by first and second rows.
We can see such occlusions in class rooms (students sitting in rows), traffic junctions (vehicles waiting for signal), forests (trees and plants), etc., when there are a lot of objects.
Answer: Additionally to what has been said I want to add the following:

For Object Tracking, an essential part in dealing with occlusions is writing an efficient cost function, which will be able to discriminate between the occluded object and the object that is occluding it. If the cost function is not ok, the object instances (ids) may swap and the object will be incorrectly tracked. There are numerous ways in which cost functions can be written some methods use CNNs[1] while some prefer to have more control and aggregate features[2]. The disadvantage of CNN models is that in case you are tracking objects that are in the training set in the presence of objects which are not in the training set, and the first ones get occluded, the tracker can latch onto the wrong object and may or may never recover. Here is a video showing this. The disadvantage of aggregate features is that you have to manually engineer the cost function, and this can take time and sometimes knowledge of advanced mathematics.
In the case of dense Stereo Vision reconstruction, occlusion happens when a region is seen with the left camera and not seen with the right(or vice versa). In the disparity map this occluded region appears black (because the corresponding pixels in that region have no equivalent in the other image). Some techniques use the so called background filling algorithms which fill the occluded black region with pixels coming from the background. Other reconstruction methods simply let those pixels with no values in the disparity map, because the pixels coming from the background filling method may be incorrect in those regions. Bellow you have the 3D projected points obtained using a dense stereo method. The points were rotated a bit to the right(in the 3D space). In the presented scenario the values in the disparity map which are occluded are left unreconstructed (with black) and due to this reason in the 3D image we see that black "shadow" behind the person.
Answer: As the other answers have explained the occlusion well, I will only add to that. Basically, there is semantic gap between us and the computers.
Computer actually see every image as the sequence of values, typically in the range 0-255, for every color in RGB Image. These values are indexed in the form of (row, col) for every point in the image. So if the objects change its position w.r.t the camera where some aspect of the object hides (lets hands of a person are not shown), computer will see different numbers (or edges or any other features) so this will change for the computer algorithm to detect, recognize or track the object.

Image Processing: What are occlusions?


Short story about humans as beasts of burden for another race, read about 30 years ago

Question: Short story or possibly book where humans on a planet are work animals for a different race. It turns out that it was a human colony that was overrun by this race a long time ago. I believe it is the song "Twinkle Twinkle Little Star" that has importance in this story. A man and woman end up entering tower that turns out to be human space ship and launching it. They are on their way back to Earth with a message "colony {colony name} needs assistance."
Comment: what kind of species is this other race, are they humanoid, ect.
Comment: They are definitely not humanoid, but I can't remember for sure how they are described. It is possible they were some kind of big insect, but I'm not sure.
Answer: This is The Silk and the Song (1956) by Charles L. Fontenay.
A preview may be found here.
It was released in The Magazine of Fantasy and Science Fiction, July 1956
It's about a group of humans who are enslaved by aliens, generations
after a disastrous landing on their planet. They teach their kids a song to
the tune of "Twinkle, Twinkle, Little Star" which turns out to contain
instructions for operating the dormant rocket.

Twinkle, twinkle, golden star,
I can reach you, though you're far.
Shut my mouth and find my head,
find a worm that's striped with red,
feed it to the turtle shell,
then go to sleep for all is well.
Answer: This is also a partial match with The Lani People by Jesse F. Bone.
The Lani are humanoid alien species with long tails on the planet Kardon, where they are kept as work animals. They are used to perform manual labour on farms etc. and even such things as serve food in houses and act as assistants to doctors. They are highly attractive and apparently all female.
A new vet, from an old established Earth colony called Beta, is employed to look after the Lani on the island where they are found/kept and he discovers that the Lani are intelligent, completely anatomically human except for a long tail, and have a spoken language, which he hears the Lani using to recite/sing some song he doesn't know, but which sounds familiar. He is assured that tests have been performed which showed "not human" and the Lani are legally recognized as non-human aliens by the courts on Kardon, so can be used as animals.
The vet discovers that Lani are not all female and the males are all kept isolated on a secret island to stop competitors breeding their own Lani. Looking down a microscope at the fluid he receives for artificial insemination he finds out there are males and the fluid is semen/sperm and from this he works out that the the Lani are human. The vet also becomes intimate with his Lani assistant and gets her pregnant, something that has never happened with other human men who have had sex with Lani. It turns out that as a Betan he has a mutation that also causes him to have a short tail and this is enough to make him genetically compatible with the Lani.
His Lani assistant teaches him some of the Lani language learned as songs and he recognizes it as a garbled version of English catechism of the creation story in Genesis:

Without warning her voice changed to a rhythmic, cadenced chant that was almost a song. Her face became rapt and introspective as she rocked slowly from side to side. The rhythm was familiar and then he recognized it—the unintelligible music he had often heard coming from the barracks late at night when no men were around—the voiceless humming that the Lani sang at work.
First there was Darkness—starless and sunless
Void without form—darker than night
Then did the Master—Lord of Creation
Wave His right hand, saying, "Let there be light!"

The tale also tells of the founders of the Lani. These founders were called "Ulf and Lyssa", and the story tells of Ulf trying to communicate with "Heaven" from a tower:

He went into Lyssa's tower—where Ulf and Lyssa tried to call Heaven—and with his foolish meddling set the tower alight with a glow that all could see.

He then finds out that the tower was destroyed by the "discoverer" of the Lani, the ancestor of the current owners after he was attracted to it by the signal sent by Ulf. He also discovers that Ulf and Lyssa came in a "God egg" which it turns out is a landed spaceship with a very old form of drive on a hill nearby. The old drive leaks radiation when in use and in its landed form. The vet fixes up the spaceship and launches himself and his assistant back to Beta, where he gets for freedom of the Lani from slavery by recognition of their human status.
The tails that Lani have are a result of mutation from a founder effect and the radiation Ulf and Lyssa were exposed to as they came through space from Earth using their old drive:

Kennon nodded. "Now let's check—oh! oh! what's this?" He pointed to a metal-backed book lying on the control panel.
"It looks like a book," Copper said.
"I'm hoping it's the book."
"The book?"
"Yes—the ship's log.
And that's what happened to this ship. According to this log it was bought by Alfred and Melissa Weygand—a missionary couple with the idea of spreading the Christian faith to the heathen.
"Alfred and Melissa—Ulf and Lyssa—they were a part of this ancient explosion that scattered human seed across parsecs of interstellar space. It seems that they were a unit in a missionary fleet that had gone out to the stars with flame in their hearts and Gospel on their lips to bring the Word to the benighted heathen on other worlds."


How to increase voltage of induction detector

Question: I've built a project from the design here, however the voltage is far too low to light the LED. Using a multimeter, I've measured only up to 0.33 volts across the LED and only while my phone was charging on a Qi charger. How can I either increase the voltage or find a low-voltage LED?
Comment: In the video on the page you linked to, the LED barely flickers when the antenna is right next to a transmitting cell phone. What are you using as a radiation source?
Comment: @circuitbird My phone, both when transmitting and when wirelessly charging.
Answer: You must build it exactly as shown in that youtube video, do not remove any wires or change any wire position or length.  This circuit acts as a 2-element dipole antenna for GHz microwaves.  But there is no dipole counterpoise or second wire, or "ground wire." The entire circuit itself behaves as the second antenna wire.  Your long capacitor leads and different overall shape, that's a bad change, and has removed much of the second antenna-element.  (Microwave RF is weird that way.)
To start fresh, copy the shape of the circuit in the Youtube video exactly.  Then, to even more increase the RF coupling, connect a few-inches wire to the spot where the LED connects to the capacitor.  Perhaps even hold this second wire against your phone: placed far from the phone's internal antenna (so, place the extra wire against the spot where your face usually touches the phone.)
Better: get rid of the LED and replace it with a DC panel meter: the moving-needle type.  Most sensitive is a 50uA DC microamperes meter.  See Jameco or All Electronics for these.
Finally, perhaps the nearby cell tower and "number of bars" will tell your phone to reduce its power.  If you're in a city with good phone reception, your phone transmitter sets itself to lower milliwatts.   Instead, move to a location with poor coverage, one bar, where your phone has trouble connecting.  It must turn up its transmitter to maximum output.
Answer: You have an error in your circuit and or antenna.
Red LEDs have the lowest forward voltage.  Deep Red and Far Red even lower.
All other colors and white are made from blue LEDs with a forward voltage of 3+ volts.
Use a super bright LED that pushes 50-100 lumens. Cree (XPE) and Lumiled (Rebel ES Color) both make very efficient LEDs.


Java program consumes too much memory

Question: Hi i'm relatively new to java programming. The following program i've written seems to be taking a lot of memory(around 240 MB, is it normal? - I don't think so!)
Please suggest some ways to optimise this program so to reduce memory storage.
Program -
 You have 2 sorted array suppose arr1[4] and arr2[3]
          now we have to combinely sort them using very little extra space(i.e. in-place sort)
          ex..arr1[4]={5,8,11,14,16}
          arr[2]={1,7,10}
          then result should be--in arr1[4]={1,5,7,8,10}
          in arr2[3]={11,14,16}

Code -
import java.util.*;

class sort_in_place
{
    public static void main(String args[])
    {
        // input 2 sorted arrays
        int []a = {5,8,11,14,16};
        int []b = {1,7,10};

        System.out.println("initial array: a = "+Arrays.toString(a)+"   b = "+Arrays.toString(b)+"\n");

        // use extra space to store the array 'a' elements.
        int key = 0, i=0;

        for( i=0; i b[0])
            {
                int j = 1;
                a[i] = b[0];
                while(j b[j])
                {
                    b[j-1] = b[j];
                    j++;
                }
                b[j-1] = key;
            }
        }
        System.out.println("final array: a = "+Arrays.toString(a)+"   b = "+Arrays.toString(b)+"\n");
    }
}

Comment: Define "uses 24M"; how have you arrived at that number? Plus that's hard to read.
Comment: @abhey That's ~240M, not 24M, FWIW.
Comment: What is your performance goal numbers and (as Dave commented) what exact value (perf counters on Windows,...) you are using? It is not good idea to "optimize" something when you have no good measurable goal.
Comment: @DaveNewton see the following link,[link] (http://ideone.com/pUszr)  memory taken is 245632 kB.
Comment: .. and in addition please edit your question so your code is well placed inside code snippet.
Comment: You can't measure the exact amount of memory your own code is using unless you profile it. The process includes the JVM and all other stuff which consume memory even if you print a simple string in the system output. Don't rely on what the OS tells you, and do a carefully-controlled profiling.
Comment: Ok. Thanks all. So, That it's normal in java program to take up this much memory. I just wanted to confirm this through my question.
Comment: 24 MB is worth about 40 cents of memory.  That doesn't sound like a lot to me. Most of the memory used is shared libraries not the application itself as such.
Answer: Even to run a simple Helloworld program java will be needing 300+ classes to be loaded. What I mean here is Java intializing needs memory. Java has Xmx and Xms options for defining the memory usage. For more details go through Java documentation
Answer: 24 MB is normal for a jvm process.
Answer: You need to remember that a Java program cannot run on its own, but need the Java Virtual Machine platform to handle memory, byte code execution and other tasks.  The Oracle JVM uses quite a bit of memory to speed up execution so even trivially small programs come with a large start-up penalty.
This is why small utilities are rarely written in Java.
You need to measure inside the JVM to determine if you use too much memory.  Use a profiler for that.  JVisualVM in the JDK is a good, free starting profiler.
Answer: Your program uses far less memory than the 240 MB ideone reports. I just ran it on my notebook, inserted System.in.read(); at the end of main() to delay termination, and looked at the corresponding process with the windows task manager. Reported peak memory use was 9 MB ...
Most of that will be the infrastructure of the JVM (such as the just in time compiler), and completely unrelated to your program.

Java program consumes too much memory


Questions about the Gravitron ride and how centripetal force works

Question: Hi just have a basic question. Just went to the local fair yesterday and road the Gravitron ride.  The ride that sucks you to the walls.  I became curious on the physics that cause you to get stuck to the wall so I have been researching centripetal force.  Now it seems that the seats are exerting a force on me directly towards the center of a circle.  I also understand that if hypothetically all of a sudden the walls disappeared on the ride I would move perpendicular to the force (tangental to the point on the circle).  To me this makes little sense as I always thought I would move in a straight line directly in the opposite direction of the center of the circle.  IF you have a force pushing you towards the center wouldn't that mean you would fly away from the center in a straight line assuming the walls suddenly disappeared.  Please clarify this?
Answer: Your momentum, at any given time, is in a straight line, in the straight-line direction you were spinning; this is the momentum that holds you against the wall, creating centripetal force.
The sense of being pressed straight outward is because the motion is curved; the correction to your momentum caused by the wall is in the direction of the center of the circle.  If you draw a circle, and draw a line along one tangent (your momentum now), and then the next tangent (your momentum in a moment), the center of the angle between them is pointed directly at the center; this is the direction of force necessary to change the path to keep you in place.


How to calculate the required concentration for sodium sulfite to remove oxygen as an oxygen scavenger from a solution?

Question: If I know the amount of oxygen in such a solution, how can I know the required concentration of sodium sulfite to be used and react as oxygen scavenger?
Answer: From the equation
\[\ce{2SO3^{2-} + O2 -> 2SO4^{2-} } \]
you could conclude that you need (at least) 2 moles of sodium sulfite $(\ce{Na2SO3})$ for each mole of oxygen in solution.


Punches do more damage than sword?

Question: Is it bad that my punches do more damage than a sword (9, as opposed to 6)? Am I missing something? This is with perks, but still seems odd.
Comment: Did you obtain any perk?
Answer: After playing this a bit more I found out that punches only count at one weapon, and you can only attack one punch at a time. More than one weapon can be used at once, allowing for more damage to be dealt in a smaller period of time.
Comment: With martial artist perk, though, punch cooldown is 1s and damage is 15 or so. That means you can deliver punches faster than you could perform attacks with a whole bunch of weapons, and each punch will deal as much damage as strongest of weapons. This requires obscene amounts of unarmed fight training though.

Punches do more damage than sword?