Efficient way of generating all combinations of 12 numbers that add to 100 in Java
How to iterate through array combinations with constant sum efficiently?
Creating a single index from several principal components or factors retained from PCA/FA I am using Principal Component Analysis (PCA) to create an index required for my research. My question is how I should create a single index by using the retained principal components calculated through PCA.  For instance, I decided to retain 3 principal components after using PCA and I computed scores for these 3 principal components. What is the appropriate ways to create, for each respondent, a single index out of these 3 scores?   Is it relevant to add the 3 computed scores to have a composite value? Or to average the 3 scores to have such a value?  Or should I just keep the first principal component (the strongest) only and use its score as the index?   Alternatively, one could use Factor Analysis (FA) but the same question remains: how to create a single index based on several factor scores? If I have a PATH variable that (when exploded onto multiple lines) contains something like this (with a few notes added by me):  /Users/brandon/.rvm/gems/ruby-2.0.0-p353/bin /Users/brandon/.rvm/gems/ruby-2.0.0-p353@global/bin /Users/brandon/.rvm/rubies/ruby-2.0.0-p353/bin /opt/local/bin /opt/local/sbin /usr/local/sbin /usr/local/bin   # &lt;&lt;--- notice this path appears again later /usr/bin         # &lt;&lt;--- notice this comes AFTER /usr/local/bin /bin /usr/sbin /sbin /usr/local/bin   # &lt;&lt;--- here it is again! /usr/local/git/bin /Users/brandon/bin /Users/brandon/.homebrew/bin /usr/local/mysql/bin /usr/local/share/npm/bin /Applications/Postgres93.app/Contents/MacOS/bin /Users/brandon/.rvm/bin   is it possible for the presence of the second /usr/local/bin/ to cause the /usr/bin to take precedence over /usr/local/bin?  This seems crazy (to me: I've never heard of such a thing) but that's exactly the behavior I'm seeing.  I've just installed PHP with Homebrew, and yet the system PHP (from /usr/bin) is taking precedence:  $ which php /usr/bin/php   BUT, after manually altering the PATH (rather than digging through all the files sourced by my .zshrc to try to figure out why &amp; where the duplication is coming from) to remove the second instance of /usr/local/bin, I find that /usr/local/bin is taking precedence over /usr/bin as I would have expected it to in the first place:  $ which php /usr/local/bin/php   What would cause this?  Is this normal? One of whom destroys the Earth, perhaps accidentally, while fighting another... the plot also involves a human colony ship or planet that loses contact with the Earth; I think a small boy is also involved with the plot, although it's been 20-30 years since I read this story.  Any help would be appreciated!  It's driving my brother and me a bit batty.  Here's the batty brother's take: the main being has created others who are now at war, exploding stars. To escape, the main being accelerates the star of the human colony as a decoy. However, most of the story centers on some guy who winds up living forever, as they keep sticking him in cryogenic sleep and reawakening him. If memory serves me right, they abandon the colony planet for a while and move to asteroids as the star is weakening because it is using it's energy to accelerate. When it decelerates, it is the only star left in the universe. The one "being" was almost reduced to living off the energy of a black hole when it appears, and he sees it and sets off to go there, with a cryptic ending that the humans very well might fight him off. no space left in '/' but a lot space left in '/home' i install ubuntu and followed a guide to put 20gb in '/' and the rest (150gb) in '/home'. Now i just found out that a lot of the things installed in ubuntu usually goes to '/' instead of '/home'. I have a lot more things to install.  So what is the point of '/home' ? How do I fix this ? Should I transfer 150gb from '/home' to / ?  Filesystem      Size  Used Avail Use% Mounted on udev            7.8G     0  7.8G   0% /dev tmpfs           1.6G  9.5M  1.6G   1% /run /dev/sda6        19G   16G  1.8G  91% / tmpfs           7.8G  676K  7.8G   1% /dev/shm tmpfs           5.0M  4.0K  5.0M   1% /run/lock tmpfs           7.8G     0  7.8G   0% /sys/fs/cgroup /dev/sda2        96M   29M   68M  31% /boot/efi /dev/sda8       159G  1.1G  150G   1% /home tmpfs           1.6G   56K  1.6G   1% /run/user/1000   what is /boot ? Its not '/' or '/home' Auxhook warning cannot patch document using AtBeginDocument instead I'm using subfiles within my report (written on sharelatex), when I compile a subfile it produces a warning. Am I doing something wrong or is this normal?  Example  \documentclass[report.tex]{subfiles} % \usepackage{acronym} \begin{document}  some text  \end{document}   Error     /usr/local/texlive/2015/texmf-dist/tex/latex/oberdiek/auxhook.sty   Package auxhook Warning: Cannot patch \document, using \AtBeginDocument instead.   When I compile the main document it does not produce this warning.  The raw log file produces this warning     ......   Package: auxhook 2011/03/04 v1.3 Hooks for auxiliary files (HO)   Package auxhook Warning: Cannot patch \document,   (auxhook)                using \AtBeginDocument instead.   ) (/usr/local/texlive/2015/texmf-dist/tex/latex/oberdiek/kvoptions.sty   Package: kvoptions 2011/06/30 v3.11 Key value format for package options (HO)   ....    Packages  I'm using the following packages:    \documentclass[whitelogo]{tudelft-report}   % Used for referencing   \usepackage{natbib}   % For writing remarks in the text (is this going to be used?)   \usepackage{changes}   % used to write and render different subfiles   \usepackage{subfiles}   % used to draw boxed problems   \usepackage{mdframed}   % for subcaptions in combined figures   \usepackage{subcaption}    % used for Epigraphs of course   \usepackage{epigraph}   % Makes weblinks clickable   \usepackage{hyperref}   % used to display pictures   \usepackage{graphicx}   % used to add urls with strange symbols   \usepackage{grffile}   % used for H command in figures   \usepackage{float}   % used for tickz pictures (Causes a warning)   %\usepackage{pgfplots}   %used for the acronym page [printonlyused,withpage] are options   \usepackage{acronym}    % ######################### open section for code appendix #######################   \usepackage[utf8]{inputenc}   \usepackage{listings}   \usepackage{color}   \definecolor{codegreen}{rgb}{0,0.6,0}   \definecolor{codegray}{rgb}{0.5,0.5,0.5}   \definecolor{codepurple}{rgb}{0.58,0,0.82}   \definecolor{backcolour}{rgb}{0.95,0.95,0.92} show that $\sum_{i=0}^l \dfrac{{l\choose i}}{{n\choose k + i}} = \dfrac{n+1}{(n-l+1) {n-l\choose k}}$ Show that $\displaystyle\sum_{i=0}^l \dfrac{{l\choose i}}{{n\choose k + i}} = \dfrac{n+1}{(n-l+1) {n-l\choose k}}$ for all $k,l, n\geq 0$ with $k+l \leq n.$  The $k+l\leq n$ part doesn't seem that important. The claim clearly holds for $n=0,$ and in that case $k$ and $l$ must both be zero. I think the claim can be shown by induction, but I'm not sure how to do so; I'm not sure how to use the inductive hypothesis to prove the inductive step. The sum on the LHS is not always an integer, so finding a combinatorial argument doesn't seem very feasible. For $n = 1,$ we can have $(k,l) = (0,0), (1,0), (0,1),$ and in each case the sum holds. Perhaps multiplying both sides by a number (idk ${n-l\choose k}$) might be useful? Why is the inclusion of the tensor product of the duals into the dual of the tensor product not an isomorphism? Let $V$ and $W$ be vector spaces (say over the reals). There is a linear injection $V^* \otimes W^* \to (V \otimes W)^*$ which sends $\sum_i f_i \otimes g_i \in V^* \otimes W^*$ to the unique functional in $(V \otimes W)^*$ sending $v \otimes w \mapsto \sum_i f_i(v) \cdot g_i(w)$ for all $(v,w) \in V \times W$. In the finite dimensional case it is easy to see this is an isomorphism by comparing dimensions on both sides. I'm aware that this is not an isomorphism in the infinite-dimensional case (see Relation with the dual space in the  on tensor products) but I must admit that I'm not sure why. Cardinal arithmetic does not seem help here and, even if it did, I would be much happier to see an explicit example of a functional in $(V \otimes W)^*$ outside the range of this map. I'm having trouble cooking one up myself.  Added: Let me elaborate on my comment about cardinal arithmetic. Suppose that $X$ and $Y$ are infinite dimensional vector spaces over a field $k$. I'm confident that $\dim (X \otimes Y) = \dim X \cdot \dim Y$ holds. It is clear that $|X^*| = |k|^{\dim X}$ since we may identify a functional on $X$ with a function from a basis for $X$ to $k$. Also I think I've convinced myself that if $\dim X \geq |k|$ then in fact $|X| = \dim X$ ie. the cardinality and dimension of a vector space agree when the dimension is larger than the cardinality of the ground field. Consequently, assuming say that $|k| \leq \dim X \leq \dim Y$ it seems we have $$ \dim(X \otimes Y)^* = |k|^{ \dim X \cdot \dim Y} = |k|^{ \dim Y} = \dim Y^* = \dim X^* \cdot \dim Y^* = \dim (X^* \otimes Y^*)$$  which implies that in fact $(X \otimes Y)^*$ and $X^* \otimes Y^*$ are isomorphic but, rather frustratingly, the obvious map does not do the job. Did I make a mistake here? If not, is it generally true (ie without making assumptions about $|k|$) that there exists some isomorphism $(X \otimes Y)^* \to X^* \otimes Y^*$? Using echo "20+5" literally produces the text "20+5".  What command can I use to get the numeric sum, 25 in this case?  Also, what's the easiest way to do it just using bash for floating point? For example, echo $((3224/3807.0)) prints 0 :(.  I am looking for answers using either the basic command shell ('command line') itself or through using languages that are available from the command line. I'd like to find a Windows batch counterpart to Bash's $@ that holds a list of all arguments passed into a script.   Or I have to bother with shift? I have a select control, and in a javascript variable I have a text string.  Using jQuery I want to set the selected element of the select control to be the item with the text description I have (as opposed to the value, which I don't have).  I know setting it by value is pretty trivial. e.g.  $("#my-select").val(myVal);   But I'm a bit stumped on doing it via the text description. I guess there must be a way of getting the value out from the text description, but my brain is too Friday afternoon-ed to be able to work it out. Is $\frac{1}{\sqrt{2}}$ a fraction or not?   I just came across a Grade 8 student's class work where the teacher has given the above as an example to differentiate fractions from rational numbers. I think this is wrong fundamentally, as $\sqrt2$ is irrational while all fractions would be rational. Please advise. Thanks! In  they've somehow created "wireless" networks, meaning networks that connect two components but don't have an actual wire in the schematics.  What are these called, and how can I create them in Eagle Cad 6.5? Is time travel possible? Is it possible to go back in time? I read somewhere that according to relativity, it is possible - involving black holes and other stuff - to jump into the past. Is it possible for anything to go back in time either continuously or by jumping? Looking at the picture below, it's easy to see why the perimeter of a polygon inscribed in a circle is an underestimation of the circle's perimeter. This follows from the triangle inequality: Any side (say $AB$) of the polygon is shorter than the circular arc with the same endpoints ($\stackrel{\frown}{AB}$). Summing all these inequalities shows the perimeter of the inscribed polygon is indeed smaller than that of the circle.  I'm wondering if there is proof that the perimeter of a circumscribed polygon always overestimates the perimeter of the circle, which is as simple as that of the inscribed polygon case. Thanks! How do you reset timers? I have a DSLR (Canon 550D) and since I'm taking my first steps in the world of RAW photography I don't know which would be a good program to use to edit these files. I've tried  and  but wasn't satisfied. I'm sure there must be better software out there... Finding information on German soldiers from World War I and World War II? Where can I find information on German soldiers from World War I and World War II?   I am curious to find out about my ancestors' role in the wars, i.e. what rank they had, where they where fighting, with whom and anything else. Differentiability implying continuity Theorem: If $f$ is finitely differentiable at $c$, then $f$ is also continuous at $c$.  But according to the definition, for a function to be differentiable at $c$, it need not even be defined at $c$, just that it should have a finite value in the vicinity of $c$.    My question: If function is not defined at $c$, how can it be continuous at $c$?  For example, say we have a straight horizontal line function which is broken at $x=1$, the function is defined at all the points except $x=1$, it has a finite value at all the points except $x=1$, since it is having a value in the nearby region of $x=1$ we say that it is differentiable at $x=1$ but can we say that it is continuous at $x=1$? Is there a closed form expression for $\text{n}^{\text{th}}$ coefficient of Maclaurin series of  $$\ln(1-x+x^2)$$ OBB vs OBB Collision Detection Say you have two Bounding Box Objects each of them storing the current vertices of the box in a vector with all the vertices of the object rotated and translated relative to a common axis.  Here is an image to illustrate my problem:   How can I work out if the two OBB's are overlapping any links to help explain the solution to the problem would be welcome. Nothing too convoluted please...