Looping around, getting no where :(
How do I compare strings in Java?
Can independent variables with low correlation with dependent variable be significant predictors? I have eight independent variables and one dependent.  I have run a correlation matrix, and 5 of them have a low correlation with the DV.  I have then run a stepwise multiple regression to see whether any/all of the IVs can predict the DV.  The regression showed that only two IVs can predict the DV (can only account for about 20% of the variance though), and SPSS removed the rest from the model.  My supervisor reckons that I have not run the regression correctly, as due to the strength of the correlations, I should have found more predictors in the regression model. But the correlations were tiny, so my question is: if IVs and the DV hardly correlate, can IVs still be good predictors of the DV? In D&amp;D 4E as with many RPGs, characters have a fixed armour value or AC. When attacking, the attacker must roll a die to overcome the target's AC. In 4E offensive magic works the same way: the target has a fixed Fortitude/Reflex/Will defence determined by their stats, and in order to hit, the attacker rolls to overcome whichever defence is relevant.   However it was not always like this. Some spells in 3E and now again in 5E work the opposite way. In those editions the target is the one who rolls against a fixed value determined by the caster's stats, in order to avoid spell-damage.  Both methods compare the attacker and target's stats, and have an element of randomness. I personally like the 4E system as it simplifies combat without leaving anything out. Why was the decision made, when designing the early D&amp;D editions (and still when iterating upwards into (A)D&amp;D 1e&ndash;3e), to use saving throws to control spells?  Answers should consist of designer quotes and not personal opinions. US Election results 2016: What went wrong with prediction models? First it was , now the US election. Many model predictions were off by a wide margin, and are there lessons to be learned here? As late as 4 pm PST yesterday, the betting markets were still favoring Hillary 4 to 1.  I take it that the betting markets, with real money on the line, should act as an ensemble of all the available prediction models out there. So it's not far-fetched to say these models didn't do a very good job.  I saw one explanation was voters were unwilling to identify themselves as Trump supporters. How could a model incorporate effects like that?  One macro explanation I read is the rise of . The question then is how could a statistical model capture a macro trend like that?  Are these prediction models out there putting too much weight on data from polls and sentiment, not enough from where the country is standing in a 100 year view? I am quoting a friend's comments. Math.cos() gives wrong result Include external subtitles while converting video with FFmpeg Is it possible to use subtitles from an external file while converting a video with FFmpeg? The file extension of the subtitles is .stl or .vob. How to calculate the confidence interval of the mean of means? Imagine that you repeat an experiment three times. In each experiment, you collect triplicate measurements. The triplicates tend to be fairly close together, compared to the differences among the three experimental means. Computing the grand mean is pretty easy. But how can one compute a confidence interval for the grand mean?  Sample data:  Experiment 1:   34, 41, 39  Experiment 2:   45, 51, 52  Experiment 3:   29, 31, 35  Assume that the replicate values within an experiment follow a Gaussian distribution, as does the mean values of each experiment. The SD of variation within an experiment is smaller than the SD among experimental means. Assume also that there is no ordering of the three values in each experiment. The left-to-right order of the three values in each row is entirely arbitrary.  The simple approach is to first compute the mean of each experiment: 38.0, 49.3, and 31.7, and then compute the mean, and its 95% confidence interval, of those three values. Using this method, the grand mean is 39.7 with the 95% confidence interval ranging from 17.4 to 61.9.   The problem with that approach is that it totally ignores the variation among triplicates. I wonder if there isn't a good way to account for that variation. Why prefer the 18-55mm and 55-250mm lenses vs 18-200mm? Converting a string to a tuple in python If $X$ is compact and $T:X \to Y$ continuous and bijective, show that $T$ is homeomorphism. Let $X$ and $Y$ be metric spaces, $X$ compact, and $T:X \to Y$ bijective and continuous. Show that $T$ is a homeomorphism.   My attempt:  We need only show that $T^{-1}$ is continuous.  Let $M \subset Y$ be closed. Then, from the surjectiveness of $T$, there exists a $A \subset X$ such that $T(A)=M$. Since $M$ is closed, by the continuity of $T$, we must have that $A$ is closed.  Now $$T^{-1}(T(A))=T^{-1}(M)$$ i.e, $A=T^{-1}(M)$. Since $A$ and $M$ are closed, we must have that $T^{-1}$ is continuous.  My problem with this, however, is that I am not using the fact that $X$ is compact anywhere in the proof. Is there perhaps another way that I can show this, using the compactness of $X$?   Any hints will be appreciated. When starring a message from the star board, it's not reflected in the main chat window Get referenced node fields in twig Bash One Liner: copy template_*.txt to foo_*.txt? Say I have three files (template_*.txt):   template_x.txt template_y.txt template_z.txt   I want to copy them to three new files (foo_*.txt).    foo_x.txt  foo_y.txt  foo_z.txt   Is there some simple way to do that with one command, e.g.   cp --enableAwesomeness template_*.txt foo_*.txt Random operators Let $(\Omega, \mathcal F,P)$ be a probability spaces and $H$ be a Hilbert space. By a random operator $A$ from $H$ to $H$ we mean a linear continuous mapping from $H$ into the Frechet space $L_0^H (\Omega, \mathcal F,P)$ of all $H$-valued random variables. My question is: How Can we define $|A|$ and the adjoint $A^*$? Clipboard for copying and pasting files in command line? In Bash, suppose I visit a directory, and then another directory. I would like to copy a file from the first directory to the second directory, but without specifying the long pathnames of them. Is it possible?   My temporary solution is to use /tmp as a temporary place to store a copy of the file. cp myfile /tmp when I am in the first directory, and then cp /tmp/myfile . when I am in the second directory. But I may check if the file will overwrite anything in /tmp.  Is there something similar to a clipboard for copying and pasting a file? Do I have to leave the Schengen area if I have a short term (C) visa that will expire right before my National Visa (D) officially starts? System.ListException: Before Insert or Upsert list must not have two identically equal elements - Deep Dive I had the following exception thrown at me when trying to process more than one selected records via a custom button in the list view.    Class Code  global class MerchandiseInventoryClass {      webservice static void ConverttoInventory(String[] merchandise_id)    {        //Convert Merchandise collection into Inventory Collection...         Merchandise__c[] merchandise_collection = [SELECT ID,Author__c,Book_Title__c,Edition__c,Publisher__c,Total_Merchandise_QtyTotal_Qty__c,Status__c FROM Merchandise__c WHERE ID = :merchandise_id];          Inventory__c i = new Inventory__c(); //Line 1        List&lt;Inventory__c&gt; newInventory = new List&lt;Inventory__c&gt;();        for(Merchandise__c m : merchandise_collection )        {            if(m.Status__c !='Fully Converted')            {            i.Author__c = m.Author__c ;            i.Book_Title__c = m.Book_Title__c;            i.Edition__c = m.Edition__c;            i.Publisher__c = m.Publisher__c;            i.Qty_Available__c = m.Total_Merchandise_QtyTotal_Qty__c;            i.Merchandise__c = m.Id;            m.Uninventoried_Qty__c = 0;            m.Status__c = 'Fully Converted';            newInventory.add(i);            }        }        insert newInventory;        update merchandise_collection;    }  }   By moving the Line 1 to within the for loop solved the issue for me.  Thanks to this post (refer the Best Answer in that post)    What puzzles me is that WHY i have to instantiate "i" for every iteration within the loop.  Why the list collection ("newInventory") is complaining that are duplicate elements and why should it even confuse in the first place when I am performing an "insert" even ? We know that the maximum level a dweller can train to on any SPECIAL skill is 10, however this does not consider bonuses given from their outfit.    Is there any additional benefit for going over 10? For example, a dweller with an Intelligence skill of 10 wearing a lab coat that boosts Intelligence by 3?   If it is a hard cap, would it be more useful to use outfits that raise a secondary characteristic instead? Would it be possible to have a "community accepted" feature? Permanently mounting loop device I created a file   touch /datastore/virtual/pseudoblock   created a loop device with it  sudo losetup /dev/loop0 /datastore/virtual/pseudoblock   (although I got a warning about its size)  and then initialized it with random data  dd if=/dev/urandom of=/dev/loop0 bs=1M count=100   My questions are  a) why is it not displayed yet in my block devices' list?  NAME                     MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINT sdb                        8:16   0 489.1G  0 disk   ├─sdb2                     8:18   0   488M  0 part  /boot ├─sdb3                     8:19   0 488.1G  0 part   │ └─sdb3_crypt           253:0    0 488.1G  0 crypt  │   ├─ubuntu--vg-root    253:1    0 472.2G  0 lvm   / │   └─ubuntu--vg-swap_1  253:2    0  15.9G  0 lvm   [SWAP] └─sdb1                     8:17   0   512M  0 part  /boot/efi sda                        8:0    0 931.5G  0 disk   └─sda1                     8:1    0 931.5G  0 part     └─sda1_crypt           253:3    0 931.5G  0 crypt      └─store--vg-store1tb 253:4    0 931.5G  0 lvm   /datastore   b) how can I permanently mount it via /etc/fstab since I cannot get its UUID?  $ blkid /dev/mapper/sdb3_crypt: UUID="fSHjbj-51K2-QfhI-G0Wb-o3lN-4pE1-BB4wCP" TYPE="LVM2_member" /dev/mapper/ubuntu--vg-root: UUID="9e452886-4d8g-fj54-854c-80bc171826e8" TYPE="ext4"   working on   $ lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description:    Ubuntu 16.04.5 LTS Release:    16.04 Codename:   xenial   with  $ uname -a Linux pkara-pc01 4.15.0-42-generic #45~16.04.1-Ubuntu SMP Mon Nov 19 13:02:27 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux In the Wikipedia article , it says     After Newtonian gravitation was found to be inconsistent with special relativity, . . .   I don't see how Newtonian gravitation itself is inconsistent with special relativity.  After all, Newton's Universal Law of Gravitation is completley analogous to Coulomb's Law, so it would seem that, if there were an analogous "gravitational magnetic field", one could formulate a theory of gravitation in exact analogy with Maxwell's Theory of Electromagnetism, and of course, this would automatically be consistent with Special Relativity.  What about this approach to gravitation does not work?  The only problem I could see with this is the lack of evidence for a "gravitational magnetic field".  That being said, gravity is "weak" as it is, and my guess is that it would be extremely difficult to set up an experiment in which a massive body were moving fast enough for this "magnetic field effect" to be obsevable.  EDIT:  As has been pointed out to me in the answers, Newton itself is inconsistent with SR.  Similarly, however, so is Coulomb's Law, yet, electromagnetism is still consistent with SR.  Thus, how do we know that it is not the case that Newton's Law is the special "static" case of a more general gravitomagnetic theory exactly analogous to Maxwell's Theory:  Let $\mathbf{G}$ be the gravitation field, let $\rho$ be the mass density, and $\mathbf{J}$ be the mass current density, let $\gamma _0$ be defined so that $\frac{1}{4\pi \gamma _0}=G$, the Universal Gravitation Constant, let $\nu _0$ be defined so that $\frac{1}{\sqrt{\gamma _0\nu _0}}=c$, and suppose there exists a field $\mathbf{M}$, the gravitomagnetic field, so that the following equations hold: $$ \vec{\nabla}\cdot \mathbf{G}=-\frac{\rho}{\gamma _0} $$ $$ \vec{\nabla}\cdot \mathbf{M}=0 $$ $$ \vec{\nabla}\times \mathbf{G}=-\frac{\partial \mathbf{M}}{\partial t} $$ $$ \vec{\nabla}\times \mathbf{M}=\nu _0\mathbf{J}+\gamma _0\nu _0\frac{\partial \mathbf{G}}{\partial t} $$ where theses fields would produce on a mass $m$ moving with velocity $\mathbf{v}$ in our inertial frame the Lorentz force $\mathbf{F}=m\left( \mathbf{G}+\mathbf{v}\times \mathbf{M}\right)$.  This theory would automatically be consistent with SR and would reduce to Newton's Law of Gravitation for the case of gravitostatics:  $\frac{\partial \mathbf{G}}{\partial t}=\frac{\partial \mathbf{M}}{\partial t}=\mathbf{J}=0$.  (To be clear, you can't just set the time derivatives equal to $\mathbf{0}$ as it seems I have done.  Upon doing so, you obtain the corresponding static theory, which is technically incorrect (as you can easily see because it won't be relativistically invariant), but is nevertheless often a useful approximation.)  My question can thus be phrased as:  without appealing directly to GR, what is wrong with this theory?