I'm a developer working a lot with Android Studio. When it compiles the Java classes it spins up 4+ threads of CPU intensive work. Often I play music in the background when that goes on. Here's what happens:   The music skips or completely stops at the most intensive section of the compilation The mouse point jitters or stops responding altogether   Most often things normalize after compilation is done, but other times the computer freezes totally and I have to hard reset it. How come? Is not Linux/Ubuntu/Unity designed to prioritize the UI thread? How does it allow Java to take 100% of the CPU resources? Is there any way I can throttle this?  Disclaimer: I don't know much about OS code.
The responsiveness is really bad on a newly installed Ubuntu 14.04 LTS.  Here's the specs of my laptop:  Quadcore Intel i7-4600U CPU @ 2.10GHz 12GB Ram 1TB Samsung EVO SSD   And when gradle is compiling, my entire system slows to a crawl, videos begin stuttering, browser scrolling lags... etc.  The same goes when a page refresh occurs in another window in Chrome, and while it refreshes, the HTML5 video in another tab begins stuttering.  How can I fix this?  Here are some logs:  $ vmstat -a 1 5 -   $ iostat -x 1 5 -   $ top -b -
PHP conditionals, brackets needed? I was just browsing a forum and someone asked about a PHP file they had found on the web.  It has several spots like this in the code:  if ($REMOTE_ADDR == "") $ip = "no ip"; else $ip = getHostByAddr($REMOTE_ADDR);  I have always thought brackets are needed to enclose what you want to do if the condition is true.  Is there some other alternative, such as if it is on the same line you don't?  There is also another line like this: if ($action != ""): mail("$adminaddress","Visitor Comment from YOUR SITE",  My instinct is to say this wouldn't work, but I also don't know if it is an outdated PHP file and it used to work? List of all "partitions"/ "cuttings" of a list How to correctly enable Desktop Cube in Unity 3D? Is there a constructive way to exhibit a basis for $\mathbb{R}^\mathbb{N}$? Assuming the Axiom of Choice, every vector space has a basis, though it can be troublesome to show one explicitly. Is there any constructive way to exhibit a basis for $\mathbb{R}^\mathbb{N}$, the vector space of real sequences? What is a NullPointerException, and how do I fix it? So, i want to make a timer that will turn on/off a circuit. I want to turn on the connected device at 08:00 and stop it at 20:00, so the interval is 12 hours. Correct me if i'm wrong but i can't use IC 555(or another IC), i'll need some huge resistors/capacitors. Is there another way to build that other than using a microcontroller? What is a contrast matrix? What exactly is contrast matrix (a term, pertaining to an analysis with categorical predictors) and how exactly is contrast matrix specified? I.e. what are columns, what are rows, what are the constraints on that matrix and what does number in column j and row i mean? I tried to look into the docs and web but it seems that everyone uses it yet there's no defition anywhere. I could backward-engineer the available pre-defined contrasts, but I think the definition should be available without that.  &gt; contr.treatment(4)   2 3 4 1 0 0 0 2 1 0 0 3 0 1 0 4 0 0 1 &gt; contr.sum(4)   [,1] [,2] [,3] 1    1    0    0 2    0    1    0 3    0    0    1 4   -1   -1   -1 &gt; contr.helmert(4)   [,1] [,2] [,3] 1   -1   -1   -1 2    1   -1   -1 3    0    2   -1 4    0    0    3 &gt; contr.SAS(4)   1 2 3 1 1 0 0 2 0 1 0 3 0 0 1 4 0 0 0 I have this alias set in my system /etc/bashrc file:  alias root="sudo !!"   The intention of this being to run the last used command using sudo of course. When used, it of course appears to substitute the last command in history to the bashrc file upon shell initialization, and not the actual command that you would get if you were to run sudo !! in an interactive shell. I've also tried alias root="sudo fc -s" to no avail.  I realize this is probably something to do with how the BASH does command substitutions, but can someone explain why this is, and provide a usable substitute?  I'm running BASH version 3.2.51(1)-release (x86_64-apple-darwin13). Proof of a limit for a recursively-defined sequence I have a sequence defined by $$ a_1=1,\quad a_2=1,\quad a_n=\frac{1}{a_{n-1}}+\frac{1}{a_{n-2}}\text{ for } n\ge2. $$ Now, if $\lim_{n\to \infty}a_n=g$ then $\lim_{n\to \infty}a_n=\lim_{n\to \infty}\Bigl(\frac{1}{a_{n-1}}+\frac{1}{a_{n-2}}\Bigr)=\frac{2}{g}$ so $g=\sqrt{2}$ or $g=-\sqrt{2}$ but $a_n&gt;0$ so $g=\sqrt{2}$.  Now, how do I prove that it has an actual  limit? Also, it can be proven that $1\le a_n\le2$, and it's not monotonic because $a_4 \gt a_5 \lt a_6$. Also, it's not monotonic after some $N\in\mathbb N$ Black body radiation and spectra lines My understanding was that all objects emit light of continuous spectrum when hot ( black body radiation) but then you see discreet wavelengths in spectra lines and I am confused. I know I am making a mistake somewhere but not able to point it I was up late working with my red LED headlamp on and when I was looking at the black part of my LCD (Apple Retina Macbook Pro) screen I noticed this interesting diffraction pattern. I'm confused because all I can think of that would cause this are Fourier and Fraunhofer patterns which I thought required more advanced optics the light to be collimated. One friend suggested it might be the polarizer. Any thoughts?  Unfortunately, the picture doesn't show this, but along the x and y axes there were discrete points not a continuous streak. Sorry for the horrible photo quality. What is the value of $\sum\limits_{i=1}^\infty\frac{1}{p_{p_i}}$ where $p_{i}$ is the $i$th prime? msiexec is command prompt software that installs an  program. But I have found that you can install an MSI file from the command line by just typing in the name of the MSI file on the command line.  But in order to uninstall the MSI file, it seems you have to call the msiexec program and give it a /x or /uninstall.  How can I uninstall an MSI from the command line without using the msiexec routine? $a+b+c =0$; $a^2+b^2+c^2=1$. Prove that: $a^2 b^2 c^2 \le \frac{1}{54}$ If a,b,c are real numbers satisfying $a+b+c =0; a^2+b^2+c^2=1$.  Prove that $a^2 b^2 c^2 \le \frac{1}{54}$. I process all my photos to black and white. Although I use a polariser where possible, I often find myself wanting to drop the luminance of the sky further which I do using a Black and White adjustment layer (in Photoshop). This usually results in a lighter halo following the line of the horizon, where the blues of the sky meet whatever the colour of the land is.  My current solution to this problem is to run a brush along this margin with a colour set to the same as the sky and the blend-mode set to Darken. This effectively paints in the lighter band with the sky colour while not laying down the colour on top of the darker horizon. Whilst this is effective, it is very time consuming.  Is there a better approach to dealing with these halos?  Here is a video that illustrated the Darken solution that I mention: What are the prerequisites to encounter the legendaries in ORAS? There are a lot of legendaries available in ORAS, however a lot of them will only show up/be available if certain prerequisites are met.  I know Groudon/Kyogre are available through the Story, and      Rayquaza &amp; Deoxys   through the postgame Delta episode, but what about the other available legendaries? What do I need to do to catch them? Prove a graph Containing $2k$ odd vertices contains $k$ distinct trails Suppose I am running a regression $Y \sim X$. Why by selecting top $k$ principle components of $X$, does the model retain its predictive power on $Y$?   I understand that from dimensionality-reduction/feature-selection point of view, if $v_1, v_2, ... v_k$ are the eigenvectors of covariance matrix of $X$ with top $k$ eigenvalues, then $Xv_1, Xv_2 ... Xv_k$ are top $k$ principal components with maximum variances. We can thereby reduce the number of features to $k$ and retain most of the predictive power, as I understand it.   But why do top $k$ components retain the predictive power on $Y$?   If we talk about a general OLS $Y \sim Z$, there is no reason to suggest that if feature $Z_i$ has maximum variance, then $Z_i$ has the most predictive power on $Y$.   Update after seeing comments: I guess I have seen tons of examples of using PCA for dimensionality reduction. I have been assuming that means the dimensions we are left with have the most predictive power. Otherwise what's the point of dimensionality reduction? give a variable to an operator For a workflow tool I made a panel in which it displays each separate library that is linked in my file. For each library I want to add some buttons that does stuff to the library in question.  So in this example I have my panel which shows for example 2 libraries and for each one it creates a "reload" button.  Now my question is.. How do I make it so the reload button only reloads the library I want to reload? I would probably have to give the button an id or something so it knows for which library it was created...  my code so far:  import bpy  libs = bpy.data.libraries  class Reloadlib(bpy.types.Operator):     """Reloads the current Library"""     bl_idname = "my.reload_lib"     bl_label = "Reload"      def execute(self, context):         libs[?????].reload()         self.report({'INFO'}, 'Reloading ' + libs[?????].name)         return {'FINISHED'}  class LibPanel(bpy.types.Panel):     """Creates a Panel in the scene context of the properties editor"""     bl_label = "Scene Libraries"     bl_idname = "SCENE_PT_layout"     bl_space_type = 'PROPERTIES'     bl_region_type = 'WINDOW'     bl_context = "scene"      def draw(self, context):         layout = self.layout         scene = context.scene         layout.label(text="Libraries:")          for i in libs:             layout.label(text= i.name.replace(".blend",""))             row = layout.row()             sub = row.row()             sub.operator("my.reload_xref", icon = "FILE_REFRESH")  def register():     bpy.utils.register_class(Reloadlib)     bpy.utils.register_class(LibPanel)  def unregister():     bpy.utils.unregister_class(Reloadlib)     bpy.utils.unregister_class(LibPanel)  if __name__ == "__main__":     register()   Where the question marks are is where I should be able to make the difference between the first [0] or second [1] library in the libs[] array.  In future I would also like to ad an 'open' and an 'unlink' button for each library so I can make changes to the other file. But this works by the same principle as the reload button. Is there an MD5 Fixed Point where md5(x) == x? Is there a fixed point in the MD5 transformation, i.e. does there exist x such that md5(x) == x?