Mergesort: getting java.lang.StackOverflowError for 100000 numbers but not for 10000

My code works fine for 10000 but not for 100000 numbers.  The error occurs at  result.add(next); result.addAll(mergeInt(left,right));   Here's the code:  private static ArrayList<Integer> mergeSortInt(ArrayList<Integer> array)     {         if (array.size() <= 1) return array;          ArrayList<Integer> left = new ArrayList<>();         ArrayList<Integer> right = new ArrayList<>();          for (int i = 0; i < array.size() / 2; i++)         {             left.add(array.get(i));         }         for (int i = array.size() / 2; i < array.size(); i++)          {             right.add(array.get(i));         }          return mergeInt(mergeSortInt(left), mergeSortInt(right));     }      private static ArrayList<Integer> mergeInt(ArrayList<Integer> left, ArrayList<Integer> right)     {         if (left.size() == 0) return right;         if (right.size() == 0) return left;          ArrayList<Integer> result = new ArrayList<Integer>();          int next;          if (left.get(0) > right.get(0))         {             next = right.get(0);             right.remove(0);         }         else          {             next = left.get(0);             left.remove(0);         }          result.add(next);         result.addAll(mergeInt(left,right));          return result;     }   What exactly is a StackOverFlowError? And why does it only occur for a larger amount of numbers?  Thanks in advance :)  EDIT:  I don't really see how this is a duplicate since I'm also asking for help specifically with my  code.


What is the best way to clean out bath toys that store water?  Specifically, we have quite a few toys that have a hole in the bottom and can suck in water and squirt it out when squeezed. A few of those toys are next to impossible to empty of water completely and hence have started growing some mildew.   We're considering squirting vinegar (or possibly a diluted vinegar solution) into the toys and leaving them to stew for a while, but is there a Good Way of doing this? Naturally, any solution ought to be child-safe.


Why does multi-user exist in Android if it doesn't work?

/sdcard -> /storage/sdcard0 /storage/sdcard0 -> /storage/emulated/legacy /storage/emulated/legacy -> /storage/emulated/0   Based on the above, if all the locations point to the same virtual storage, what's the point in having separate storage locations for each different user?   If /storage/emulated/0,1,2,3,etc. all point to /storage/sdcard0, and saving files in any storage location make it appear in all other locations, how is it possible to have user designated storage if all information is the same for all users?  Or is it not supposed to be designed this way...that every user's storage should be the exact same, but if that were the case, then why does having multiple folders with different numbers for multiple users exist? Am I missing something here? Am I missing some key piece of information? Why allocate folders for a specific user if they all point to the same location and contain the same exact information?


Trajectory of a projectile in 3d coordinate knowing the angle, the target position and with possible height offset

I'n not that good in math and physics sadly but I want to understand one problem I'm facing right now. I am in a situation with a projectile shoot from a random height on direction of a target with position $(x_2,y_2,z_2)$ there $y_2$ could be offset in height. I know the initial angle of shooting and the distance. Now if the situation is in 2D I did menage to understand how to solve it following this nice video.  so using the formula  $$Y=Y_0 + V_{0y} t -\frac{1}{2}gt^2$$ $$X=X_0 + V_{0x} t -\frac{1}{2}at^2$$ where $a=0$ on $x$  I did solve it change $t=x/V_{0x}$ and substitute it on $y$ and managed to find the initial velocity $V_0$ that I used on the motion part of my script. The problem is that my target could be set as well as my projectile on a $X,Z$ horizontal position, so how I could get the velocity component on $X$ and $Z$ to reach my target and of course I guess will change even my $V_0$ formula.  Thank you for everyone who will help me.


Does following relation holds for an interacting vacuum of QFT

For a non-interacting vacuum of QFT we have $$\hat{P}^\mu|0\rangle=0$$ where $\hat{P}^\mu$ is the $4$- vector momentum operator having eigenvalue and eigenvector given by $$\hat{P}^\mu|p\rangle=p^\mu|p\rangle$$ Does this relation also hold for an interacting QFT vacuum $|\Omega\rangle$ i.e. $$\hat{P}^\mu|\Omega\rangle=0$$


I have a field in a list that accepts an SPFieldUser object. I have an SPUser object that I would like to populate that field with, but I cannot implicitly convert from one to the other.  How would I do this conversion?


How to record screen on graphicdesign.stackexchange?

I've seen some answers on graphicdesign.stackexchange.com where people have made small recordings of how they navigate menus to show someone where a particular item is located. These are usually animated gifs and not videos.   What software is being used to create these?  What is this type of video called? It isn't an animated gif because animations aren't being used. Someone recorded a small section of their screen and uploaded the recording as a gif.  Here is an example:


What I know about blender's V.S.E. is that it can cache a certain amount of frames before dropping frames(). But, on my Ipod I have video editors like Imovie, and Cute Cut and there is never a delay with the videos, even with different FPS. (maybe because Cute Cut and Imovie have a ?) So what method do they use, or does Blender just use an out-dated version of Caching? Also my Ipod has much smaller RAM so it wouldn't be able to Cache much. Then when I'm finally done making a video why do  have to I render it? With other Video editors, like lightworks or Filmora or Imovie or CuteCut or WindowsMovie maker or pretty much everything else, I export it. So is Blender's VSE outdated- or the opposite, it's so good that normal pc's can't handle it? Which begs the question, why not have a dumbed down version for normal pcs?   Wow, ok that's a lot a questions, sorry, but to narrow it down to one(two) question(s):  How does Blenders VSE work, what makes it so slow?


Inconsistent offensive/spam flag format on flagging summary page

First time I had to use the offensive flag. The answers were obviously offending/spam but it took quite a while to delete them. I was interested in how long it actually took, because an off-topic question posted later got closed much faster.  Instead of finding this information, I noticed the offensive (and also spam) flag's description is formatted very different. It also contains less information.      "flagged as" seems redundant - I know that I flagged it, and I'm on the flag summary page after all. The normal flagging doesn't tell me that. It is Helpful, but a normal flags are helpful. (fixed) There is no information about the time I flagged it. The normal flag's "helpful" text contains a tooltip showing the time of it's acceptance, the offensive/spam flags don't.   I like that it's red, but I think the format should be more like that of the other flags. It should show the time somewhere.


I have a requirement to change the Top bar titles for my team site and community site. For example I need to change the “Page” to be “Page options”.so from where I can change these titles.? Second question I have three different types of lists inside my team site, and each list have a Page tab, so can I change the title per list, or I only can do this for the whole site. As inside the document management library  I want the Page to be “Document library options”, and for the announcement list I want it to be “Announcement Options “instead of being “Page” for both.    EDIT I have created the following script insde my Style library folder:-  $(document).ready(function(){$("#Ribbon\\.WebPartPage-title span").first().html('PAGE OPTIONS'); $('.ms-cui-tts').click(function() {     $('#Ribbon\\.WebPartPage-title span').first().html('PAGE OPTIONS');  }); $('#Ribbon\\.WebPartPage-title a').click(function() {         $('#Ribbon\\.WebPartPage-title span').first().html('PAGE OPTIONS');});  });   then i reference the script inside my master page as follow , before the  tag :-  <script  type="text/javascript" src="/sites/Intranet/Style Library/JS/changetitles.js" ></script>  </head>   But it did not chnage the title ?


After upgrade from 16.02LTS to 18.04LTS, I get the Ubuntu .... screen and then blank with possibly a slightly different color. Booting in recovery mode and selecting option to continue in default graphics there is a box on screen that says the screen, graphics card, and input device settings can not be detected and I need to configure them myself.  How can I accomplish this? I have looked at similar ?'s and nothing offered there even mentions configuring the options manually.   The possible duplicate of 17.10 to 18.04 may be applicable but the number of different steps/changes mentioned don't seem applicable.    Adding nomodeset in the grub command makes no difference except that after the Ubuntu splash shows, it drops to a terminal-like display with commands beginning with [OK] and eventually hangs.  I may be able to select the root option from the recovery menu and use it to try to update the i915 drivers.  But at this point I may just throw in the towel and admit that 5 year old hardware that worked with 14 and 16 just might not be compatible with 18.


i am having problems with the java double data type

I am having problems with the java double data type. The problem is that for some cases the result obtained is very large number of digits after the decimal point. the same calculation done on the calculator, manually hardly reached 2 digits after decimal.  the code is as follows:  public class Calculater {      public static void main(String[] args) {         // TODO Auto-generated method stub         String quantityInString="700g";         int indexOfg=quantityInString.indexOf("g");         String onlyQuantityInString=quantityInString.substring(0, indexOfg);         int onlyQuantityInInt=Integer.parseInt(onlyQuantityInString);          double perUnitCostOfThisItem=29.00;         double returnFloat=0;         returnFloat=(onlyQuantityInInt/(1000.00))*perUnitCostOfThisItem;         System.out.println("returnFloat="+returnFloat);      }  }   The program output is: returnFloat=20.299999999999997  The answer using a calculator is 20.3  I have no idea why this is happening?  I have tried it in an eclipse running on laptop and also on an Android phone both show same result.


How to prove by induction that $|\sin(nx)| \leq n|\sin x|$?

Here $n$ belongs to natural numbers. Firstly, I proved the relation by putting $n = 1$ . Then, taking $$|\sin(mx)| \leq m|\sin x|$$ true, I had to prove $$|\sin(m + 1)x| \leq (m + 1)|\sin x|$$  Now, here I got stuck. How to prove it?? Please help.


Is there a way to view the number of unique views for a question on a mobile device?

I'm using an iPhone, but I would imagine it's the same for other mobile devices as well.  If you browse to any stack exchange site, you get a very well made mobile site.  The only gripe that I have is that I can't find any way to view the number of visitors to my questions?  Am I missing something or could this possibly be integrated into the mobile renderer?


Use of "a user" as the antedecent of "they"

Is it correct to say "The list of reports a user will see may depend on the permissions group(s) they are in."?  I have asked the writer to change the text to say "users" to match "they", but he is resisting.


Is it true that $aH = bH$ iff $ab^{-1} \in H$

Let $H$ be a subgroup of a group $G$. The I know that for $a,b\in G$ we have $aH = bH$ if and only if $a^{-1}b \in H$.  My question is if it is also true that $aH = bH$ if and only if $ab^{-1} \in H$? Does it matter where the $-1$ goes?  I am guessing that this is not true since we keep putting the $-1$ on the left element, but I am also thinking that it might be true because they look like the same.  If $G$ is abelian, then it doesn't matter, so a possible counter example would have to involve a non-abelian group. If $H$ is a normal subgroup, then it should also be true because then $a^{-1}bH = Ha^{-1}b$.


How can I access a deleted open file on Linux (output of a running crontab task)?

I have an hourly hour-long crontab job running with some mtr (traceroute) output every 10 minutes (that is going to go for over an hour prior to it being emailed back to me), and I want to see the current progress thus far.  On Linux, I have used lsof -n | fgrep cron (lsof is similar to BSD's fstat), and it seems like I might have found the file, but it is annotated as having been deleted (a standard practice for temporary files is to be deleted right after opening):  COMMAND     PID       USER   FD      TYPE     DEVICE  SIZE/OFF       NODE NAME ... cron      21742       root    5u      REG      202,0      7255      66310 /tmp/tmpfSuELzy (deleted)   And cannot be accesses by its prior name anymore:  # stat /tmp/tmpfSuELzy stat: cannot stat `/tmp/tmpfSuELzy': No such file or directory   How do I access such a deleted file that is still open?


Is this sentence grammatically correct? "If I were a flower I would bloom" Or should it be "if I was"?


If a $\{a_n\}$ diverges, so $a_n \rightarrow + \infty$, how to find sequence $\{b_n\}$ such that $\sum |b_n|<\infty$ but $\sum |a_n||b_n|$ diverges?

If we are given any sequence of real numbers $\{a_n\}$ diverges, so $a_n \rightarrow + \infty$, how can we find a sequence $\{b_n\}$ such that $\sum |b_n|$ converges but $\sum |a_n||b_n|$ diverges?  I want to use this fact in another problem but don't immediately see how to prove it.


We were ask to prove that $|A \cup B| = |A| + |B| - |A \cap B|$. It was easy to prove it using a Venn diagram, but I think we might be expected to do if more formally. Is there a formal way?


macOS: App icon remaining in Dock even after closing app

Every time I connect my iPhone to my MacBook, the system launches iTunes which I don't use. After I close it, the icon remains in the Dock and I have to right click and remove it. I don't move the icon in the Dock and I don't touch the Dock at all in this process.  Note that I am very aware that applications may be on the dock unless they are fully closed. In this case, not only is the app closed but the Activity Monitor does not list the process running.  Staying in the Dock also happens with other applications after I start them, but not all applications. Skype opened itself on reboot and after closing that application, it remained in the Dock. I also verified it is not listed in Activity Monitor. I removed the option to launch Skype on start and that one won't spin up each time, thankfully. But if I launch Skype manually it has the same behavior, it will place itself persistently into the Dock after it is closed.  How does an application put itself in the Dock? Is there a way to turn that off? Is it a setting?


Why do I receive unhelpful results for subtractions?

double foo = 3; double bar = 2.1;  System.out.println(foo - bar + "");   Output:  0.8999999999999999   Why? Is this some Java joke, which is not understandable for mere mortals?


I found some months ago that there are the Polya's enumeration theorem to compute number of colorings of dodecahedron. I got interested to find how to show by using only Burnside's lemma that there are 9099 ways to color dodecahedrom by three colors. How can I do the computation?


How to make break values which are outside of the value range?

I want to compare mean temperatures for three future periods (2011-2040, 2041-2070, 2071-2100) with the measures mean temperatures of 1971-2000.  My resulting shapefiles will show the difference between the simulated and measured temperatures for each period.   I want to have a classification from -1°C. to +3°C. So I would like to have manual break values like -1,0, -0,8, -0,6 and so on. But how can I realize it? For example The difference between 1971-2000 and 2011-2040 is found within a range of -0,69 and +1,88. So the the "coldest" class begins at -0,69°C.   How can I create classes which are outside of the range of the values (for example -1,0 - -0,8)? When I try to edit the break values manually, it automatically jumps back to the coldest existing value (-0,69).


Showing $x \in R$ is invertible if and only if $x$ is not contained in any maximal Ideal

Here $R$ is commutative. $\Rightarrow$ is fairly easy to prove as every Ideal containing a unit must be the entire Ring so it cannot be maximal. But I'm having some trouble with $\Leftarrow$, this is what I got so far: We want to get a contradiction, so assume $x$ is not a unit so $xR$ is a proper Ideal, let $A$ be the set of proper Ideals containing $x$, $A$ is not empty and partially ordered by Inclusion. I want to use Zorn's lemma here but I cant figure out what the supremum of a chain in $A$ is, I know that the union of the Ideals in the chain is an Ideal containing $x$ but I cant figure out why it must be a proper Ideal i.e. not $R$.


I am going to start work with a company that works on a .NET framework and i am a professional java developer and i think i should switch to .NET because i cant see any bright future with java anymore. My questions: Now i have decided to move to .NET, what things i should learn as a total beginner. Should i learn C# or i should understand basics of .NET first?? as i know only that .Net is a framework and c# is one of language run on it. I am only interested in C# as it like java not in VB or any other. please tell me what i am suppose to learn and please refer to me some books. thanks


jQuery - tell when page has been scrolled to, and is viewing, a specific DIV

I'm building a one-page website, each different "page" is a different div. Each div is placed below one another, so only one div is viewable at time. I want to be able to tell when a user scrolls to, and is viewing, one of the divs, and based on which div ID alter the CSS of a correpsonding link in my navigation. Any guidance is appreciated. Thanks!


Disabling auto bcc address population for send email from portal users

Currently, when our Portal users send any emails from Salesforce, they are automatically BCC on each email. While they are able to delete their email address out of the BCC field, we would like to turn the automatic BCC off for all of our Portal users (but not org-wide; so we don't want to go with the option of enabling the Compliance BCC Email). We just want to change this setting for Portal users. Is there a way to do that?      trigger UserTrigger on User (before insert) { //This trigger is used to disable autobcc on email for portal users.     if(trigger.isBefore && trigger.isInsert) {         List<User> lstUsers = new List<User>();         Set<Id> setUserLicenceId = new Set<Id>();         List<Profile> lstPortalUserLicense = [SELECT Id,Name FROM Profile WHERE Name = 'Partner Community User Custom'];         System.debug('Debug Log for lstPortalUserLicense'+lstPortalUserLicense.size());         if(lstPortalUserLicense.size() >0){             for(Profile profile : lstPortalUserLicense) {                 setUserLicenceId.add(profile.ID);             }             for(User u : trigger.new){                 System.debug('Debug Log for userLicence '+u.ProfileID);                 System.debug('Debug Log for email bcc preference'+u.EmailPreferencesAutoBcc);                if(setUserLicenceId.contains(u.ProfileID)) {                    u.EmailPreferencesAutoBcc = false;                      lstUsers.add(u);                 }             }         }         System.debug('lstUsers size'+lstUsers.size());      } }


How many of Naruto Shippuden episodes are dubbed?

I would like to know how many episodes of Naruto Shippuden are dubbed because I've only seen about 388 in all my anime streaming websites?


Epigrafica font for sections and chapter using pdflatex

I want to use epigrafica font as "sans serif" in sections and chapters but I don't have any idea how to do it. I found here a solution in pdftex. Is there a chance to do something similar using pdflatex?


Series with denominator that is square of product of consecutive numbers

Evaluate $\sum_{k=1}^{\infty} \frac{1}{k^2(k+1)^2}$.   I've tried to use a telescoping approach, but it doesn't seem to work. It doesn't also seem to converge to a "pretty" value as well.


I bought an ipad app TeX writer and I am wondering if I can draw a commutative diagram.  It includes the packages   amslatex revtex4-1 IEEEtran babel cyrillic graphicx color xcolr geometry algorithm2e listings.   I could draw commutative diagram using a package amscd but  it does not produce commutative diagram with a diagonal arrow. Is there any package that I can use on TeX Writer with which I can draw a commutative diagram with a diagonal arrow.  It seems that one can add other packages and I tried but it did not work for me.  (I am not familiar those technical language.)


In javascript why name a variable equal to a function

I'm learning Javascript and am told setting a variable equal to a function is done all the time.  I'm trying to figure out why.  Below is sample code that suggests there is no advantage.  What am I missing?  <script type="text/javascript">           var  addVar =  function() {             var myTemp = 0;              for(i=0; i< arguments.length;i++){                myTemp+=arguments[i];             }             return myTemp;          }           function addFunc() {             var myTemp = 0;              for(i=0; i< arguments.length;i++){                myTemp+=arguments[i];             }             return myTemp;          }           function addTwo(first,second){             return first+second;          }           alert( addTwo(addVar(1,2,3),addVar(1,2,3)) );          alert( addTwo(addFunc(1,2,3),addFunc(1,2,3)) );   </script>


Journals selection - alternative criteria to impact factor

While trying to select the journals I can submit my present work and future work, I realize the time between the date the authors send the article to the journal and when the revised article is submitted. Usually this is something between 6 months and more than 12 months.  Althought I am focusing on the Impact Factor (IF) to select journals, I think that 12 months to have a feedback that might include "add more variables analysis","this article will be more valuable if you test also model x,y and z", can have a huge impact on you work. It will make you stop what you are currently doing and possible spend up to 2 months making the changes. This might make a big mess on your work if you have deadlines to respect, however this happens to everyone in academia.  My question is, besides the IF journal based selection, how can we select a journal with enought quality with lower IF? What alternative criteria should one use to select the journal? Should we choose newly created Journals?


I want to identify each element by it's name attribute. Each element has the same class and will ultimately contain differing dynamic information.  For example I would want the following code to alert the individual element's name value:  html:
this is p #1

this is p #2

this is p #3
   jquery:  $('p').on('click', function() {     if ($('p').attr('name') !== undefined) {         alert($('p').attr('name'));     } })   Here is a jsfiddle..   This code however only alerts the initial elements name value. Help is greatly appreciated.


What is the difference between: "I have eaten a banana" and "I have eaten banana"?

I can't understand if "banana" or "a banana" has the same meaning. I can understand that "the" and "a" are for definite and indefinite nouns. But what about those which aren't preceded by either of them?


Attempting to close as duplicate on mobile unleashes chaos

Voting to close as duplicate on mobile is pretty painful with the recent changes to the duplicate selection dialog, especially due to .  However, at least on iOS, it's even worse than that. Pasting in a duplicate link to the overly-wide text field causes all sorts of crazy horizontal scrolling as well:    You'll also note that the OP's user card is encroaching on the question tags' personal space. Similarly, selecting a duplicate via direct link or through one of the options in the dialog causes crowding to the left, smushing the title up against the "similiar/back to questions" link and cramping the "votes" text's style:    I know that there's only so much space to work with on mobile, but at the moment it feels like this just has been overlooked. Presumably with some slight style tweaking, a lot of these more quirky behaviours could be avoided.  Finally – perhaps the most important issue of all – there's no space between "Closing" and the > sign:


Change the passphrase of an ecryptfs directory

I want to have an encrypted directory (not homedir!) let's say /testdata.  I have used the following command and parameters to encrypt it:  root@pc:~# mount -t ecryptfs /testdata/ /testdata/ Passphrase:  Select cipher:   1) aes: blocksize = 16; min keysize = 16; max keysize = 32  2) blowfish: blocksize = 8; min keysize = 16; max keysize = 56  3) des3_ede: blocksize = 8; min keysize = 24; max keysize = 24  4) twofish: blocksize = 16; min keysize = 16; max keysize = 32  5) cast6: blocksize = 16; min keysize = 16; max keysize = 32  6) cast5: blocksize = 8; min keysize = 5; max keysize = 16 Selection [aes]:  Select key bytes:   1) 16  2) 32  3) 24 Selection [16]:  Enable plaintext passthrough (y/n) [n]:  Enable filename encryption (y/n) [n]: y Filename Encryption Key (FNEK) Signature [b9fc92f854a4c85b]:  Attempting to mount with the following options:   ecryptfs_unlink_sigs   ecryptfs_fnek_sig=b9fc92f854a4c85b   ecryptfs_key_bytes=16   ecryptfs_cipher=aes   ecryptfs_sig=b9fc92f854a4c85b WARNING: Based on the contents of [/root/.ecryptfs/sig-cache.txt], it looks like you have never mounted with this key  before. This could mean that you have typed your  passphrase wrong.  Would you like to proceed with the mount (yes/no)? : yes Would you like to append sig [b9fc92f854a4c85b] to [/root/.ecryptfs/sig-cache.txt]  in order to avoid this warning in the future (yes/no)? : yes Successfully appended new sig to user sig cache file Mounted eCryptfs   This command creates this file:  root@pc:~# cat .ecryptfs/sig-cache.txt  b9fc92f854a4c85b   Now I want to change the passphrase I used before. I found the ecryptfs-rewrap-passphrase command but I am not sure if I am on the right path:  root@pc:~# ecryptfs-rewrap-passphrase .ecryptfs/sig-cache.txt  Old wrapping passphrase:  New wrapping passphrase:  New wrapping passphrase (again):  Error: Unwrapping passphrase failed [-5] Info: Check the system log for more information from libecryptfs   /var/log/syslog says:  Jul 13 13:16:19 pc ecryptfs-rewrap-passphrase: ecryptfs_unwrap_passphrase: PK11_CipherOp() error; SECFailure = [-1]; PORT_GetError() = [-8188]   I have a newbie status in regards to ecryptfs and I would appreciate some enlightenment here.


How many physical processors does Windows 8.1 Support?

This question was already asked for windows 8 and i'm hoping (albeit fairly sure that no) that microsoft changed their policies. Does anyone know if windows 8.1 now support > 2physical CPU in any form? I'd like to build a monster but have it dual boot windows server & windows 8.1 for development purposes (by monster i mean 80 to 160 cores), i know i will be limited to 512GB of ram but i can live with that, but 2 physical CPU is way way low.


Clusering based on categorical variables?

I am working on a project and currently experimenting cluster analysis. The dataset is mainly categorical variables and discrete numbers. Please pardon my poor programming skills as I am not very familiar with MathJax, but I will try to summarize the data set in words in the following three examples.   imagine column 1 is participants names of course, from column2 - 5, each column's value range from 1 (least important) - 5 (most important). so in this case, column 2-8 only have discrete data.  column 6 for example, since this is a multiple choice question. row 1 chose "nice" as an answer, however, row 2 chose "poor". In this case, we have one column that contains multiple categorical answers. for column 7-9, this is another type of multiple choice questions. However this time, each column represents only one answer. column 7 only allows string values "true", column 8 only allows string "somewhat". So in this case, we have multiple columns that represent multiple answers of the same question.    Any ideas how to solve this? Thankful to any input!   A2       A3       A4       A5       A6       A7         A8         A9 1        4        5        4        nice     true       somewhate  false 2        4        3        1        poor     true                  false 1        5        2        1        nice                somewhate     3        2        1        5        nice     true                  false


Iterate a Map in order of second operator (integer) [JAVA]

Map<String,Integer> map; map.put("hey",1);  map.put("k",0);  map.put("thanks",12);   How can I iterate the map entries in order of the second operator (the numbers)? thanks


Why is it necessary to use the imaginary number in QM?

My professor argues that one of the fundamentally unique properties of Quantum Mechanics is that the imaginary unit i is not removable (you can't avoid using it, unlike in other areas of physics like AC circuits where it is merely a convenience).   However, I'm not convinced. Isn't the reason i appears in the schrodinger equation that the equation needs to relate the wavefunction to its derivative? For convenience, we represent the wavefunction as a (possibly infinite) linear combination of complex exponentials, and this makes taking the derivative extremely easy which is where the factor of i comes from. However, can't complex exponentials always be replaced by sines and cosines? Wouldn't there be some way to state schrodinger's equation without using i as a result? The i merely represents the phase shift between the wavefunction and its derivative, so it makes the schrodinger equation much easier to write down (it would be more difficult to write a differential equation with an explicit phase shift). However, I don't see why a version of the schrodinger equation communicating the phase shift directly rather than by using i would be any less correct. Can you provide an argument for why the use of complex numbers is essential in quantum mechanics?


which is the probability that $Y_1>Y_2$ with $Y_1, Y_2$ i.i.d

I think that the answer is 0.5, independently of the common distribution of $Y_1$ and $Y_2$. Attempt to a proof, assuming continuous random variables:  $P(Y_1>Y_2)=\int_{\Omega}f_{Y_1,Y2}(y_1,y_2)dy_1dy_2=\int_{\mathbf {R}} \left( \int_{-\infty}^{y_1} f_Y(y_2)dy_2 \right) f_Y(y_1)  dy_1 = \int_{\mathbf {R}} F_Y(y_1) f_Y(y_1)  dy_1 $  Now, integrating by parts:  $ \int_{\mathbf {R}} F_Y(y) f_Y(y)  dy = \left[(F_Y(y))^2\right]_{-\infty}^{+\infty} - \int_{\mathbf {R}} f_Y(y) F_Y(y) dy$   (EDITED because some users didn't understand the equation layout)  This implies that   $ 2\int_{\mathbf {R}} f_Y(y) F_Y(y) dy= \left[(F_Y(y))^2\right]_{-\infty}^{+\infty} = 1-0 \implies \int_{\mathbf {R}} f_Y(y) F_Y(y) dy =0.5 $  Is this correct? Does it hold for generic random variables too? With generic I mean $Y_1$ and $Y_2$ not necessarily continous, but still i.i.d.


How do I create a 32-bit Wine prefix on Ubuntu 12.04 64-bit?


How easy is it for an English only speaker to navigate Iceland

I am visiting Iceland in July and am interested in knowing how difficult it will be for an English and Spanish speaker to navigate the country?


Do photons generate gravitational waves since they affect with their energy the stress tensor?

The gravitational waves are fact. They are produced in a way predicted 100 years before by Einstein. Anything with energy affecting stress tensor of space time produces them. What does it happen with moving photon losing its energy in a way creating gravitational waves? Eventually it will dissapear. So finally when all matter decays and becomes in form of energy respectivly photons and they decay becoming gravitational waves in the end we will finish with vibrating spacetime? Is that the case?


How to search for a package with pacman?

I just installed Archlinux and want to install netstat. However using the command pacman -Ss netstat outputs irrelevant package names. A search on internet revealed that netstat is owned by net-tools. Installing net-tools gave me access to netstat.   How should one proceed to find the package name to install with pacman when only the final bash command is known ?


Proving that $\operatorname{rank}(AB)$ is smaller or equal to $\operatorname{rank}(B)$

I am struggling with proving the theorem that if $A$ and $B$ are $n\times n$ matrices, then:     $$\operatorname{rank}(AB)\leq \operatorname{rank}(B)$$   Could anyone suggest me a hint? Any help is greatly appreciated, thank you very much.


I want to break blocks far away (e.g. A piece of glass 50 blocks away) with commands, but I don't know if there's any way.  Is it possible to break a block (literally break a block, which means with sound & with particles) with a command? Or should I use the /particle /sound and /fill command to "break" the block? (/particle will create the glass-breaking particle, /sound will play the glass-breaking sound, and the /fill command will fill the glass with air.)


What is the rule on the use of commas in a series?   Is it medical, dental, and behavioural or medical, dental and behavioural?


Segmentation fault when accessing a page with belongs to the process

I have executed this dumb code for some testing: int main(){      char a[4];     a[3000] = '2';  //no problem     sleep(30);     printf("wake up\n");     a[20000] = '2'; //segmentation fault     printf("No segmentation fault!\n");     while(1);  }  I know that this is so dumb (creating a 4 bytes array and wanting to store at the position 3000 and at the position 20000) but, as I said, it's only for testing. What I wanted to test is if accessing to a page reserved for stack space will result in a Segmentation Fault. It shouldn't, but it did! How I know that the page that belongs to the a[20000] is a reserved page for this process? Well, during the sleep(30) time I watched the content of /proc/pid/maps and I got this: 7ffdce868000-7ffdce889000      rw-p 00000000 00:00 0                          [stack]  If you look at starting and finishing directions of the stack, you will see that an access to a[20000] is covered by this directions, since OS has assigned for that moment 33 pages of stack (which is 135168 Bytes). On those pages the process has reading and writing permision. So, why did I got segmentation fault??


How can I filter messages from Google Calendar?

Google calendar messages (meeting invites and updates, not meeting reminders) have the header  mailed-by:  calendar-server.bounces.google.com   Alas, filtering by mailedby:calendar-server.bounces.google.com or mailed-by:calendar-server.bounces.google.com does not work.  How can I filter the Google Calendar messages?  At this time I am using   subject:("Invitation:" OR "Canceled Event:" OR "Declined:" OR "Accepted:")   but this does not include meeting updates because their subject sometimes starts with [Update] and Gmail filters cannot handle brackets (even with backslashes &c - believe me, I know regexps).


How do I convert between the various measurements?

I found a recipe that's using one or more measurements that I don't recognize. How can I convert it to a unit that I use locally?     Alternative question template: (to improve searchability): How can I convert an Imperial weight or volume measurement (tsp, tbsp, cups, ounces, pints, quarts, gallons, pounds) to an equivalent Metric measurement (g, kg, mL, L)?


An inequality involving 2n complex numbers

This is a problem I saw on another website and that didn't have a solution. I also suspect it doesn't have a trivial solution, hence why I post it here: let $\{x_i\}_{i=1}^n$ and $\{y_i\}_{i=1}^n$ be complex. Then, the following inequality holds  $$\sum_{i, j = 1}^n |x_i-y_j|+|x_j-y_i| - |x_i-x_j| - |y_i-y_j| \ge 0$$  I don't see how induction would work here, but it might. One idea I had was to get the sum in the form $\sum (\dots) \frac{x_i-y_i}{|x_i-y_i|}\frac{x_j-y_j}{|x_j-y_j|}$ since the summation terms are antisymmetric under the exchanges $x_i\Leftrightarrow y_i$ and $x_j\Leftrightarrow y_j$. But I couldn't do it even if the x's and y's are real. Any ideas for either the real or complex case?


Ubuntu 15.04 to 16.04 Migration (skip 15.10)

Regrettably now I've been working with a 15.04 build for awhile, all changes and services are working perfectly and I'd hate to start fresh and rebuild them from scratch.  It appears that I can no longer upgrade to 15.10 and then subsequently upgrade to 16.04 and so on.  I've tried a number of the suggested methods to get this done but this appears to be dependent on referencing old-releases.ubuntu.com repositories for vivid and wily, which they do not appear to.  So none of it's working. Is there some "nice" way to migrate without a fresh install and reconfiguration that anyone can suggest?


Fail to reproduce results in a published paper. Is this an academic misconduct?

I've downloaded the source code and data published in a paper. I've followed their methods, in particularly, copied and pasted their sample code. Unfortunately, I've failed to reproduce the figures in the paper with their software. For example, the variance accounted by the first principal component reported in the paper is about 10% more than I can see on my computer.  My generated figure:    Their reported figure in     The difference is small but the medians are different in the paper to my generation. The figure in the paper looks better and more aligned to the medians (a good thing). I did a PCA plot (they also did that for the paper), the eigenvalues are different to reported.  I followed their methods in   I simply copied and pasted their code and used their R-package.  Can I consider this as an example of data-manipulation (to make the figures look better) and therefore academic misconduct?   EDIT:  The method is non-stochastic, it involves computing singular value decomposition for factor analysis. There is nothing stochastic, no random number is generated. Identical data-set (downloaded from their R-package).


For $A_1 A_2\cdots A_{11}$ a regular $11$-gon with circumradius $2$, and point $P$ at distance $3$ from the center, find $\sum PA_k^2$

Let $A_1 A_2 \dotsb A_{11}$ be a regular $11$-gon inscribed in a circle of radius $2$. Let $P$ be a point, such that the distance from $P$ to the center of the circle is $3$. Find $$PA_1^2 + PA_2^2 + \dots + PA_{11}^2$$  This kind of reminded me of roots of unity, because of a regular polygon inscribed in a circle, but I'm not sure on how to work this problem.


If a couple has 3 girls, what is the probability that their 4th child is a son?

As a child is boy or girl; this doesn't depend on it's elder siblings. So the answer must be 1/2, but I found that the answer is 3/4. What's wrong with my reasoning? Here in the question it is not stated that the couple has exactly 4 children


Jasper community edition with java, convert inputStream to String

Im trying to  integrate jasper community edition with java,      RestClientConfiguration configuration = RestClientConfiguration.loadConfiguration("jasper.properties");     configuration.setAcceptMimeType(MimeType.JSON).setContentMimeType(MimeType.JSON).setJrsVersion(JRSVersion.v6_0_0).setLogHttp(true);     configuration.setRestrictedHttpMethods(true);     configuration.setHandleErrors(false);     configuration.setLogHttp(false);     configuration.setLogHttpEntity(false);     JasperserverRestClient client = new JasperserverRestClient(configuration);     Session session = client.authenticate("jasperadmin", "jasperadmin");     OperationResult<InputStream> result = client             .authenticate("jasperadmin", "jasperadmin")             .reportingService()             .report("/reports/interactive/CustomersReport")             .prepareForRun(ReportOutputFormat.HTML, 1)             .run();     InputStream report = result.getEntity();   Every thing is fine, im  getting response as some Object, which i can save in file also, Now my question is i want to convert the InputStream to toString, so that i can get actual html content and i can print it in my jsp page,  I have tried   but its not working for me, can any one help?


I have the following code, trying to match if there is a speed using PhraseMatcher, eg., "44 mph" in a sentence.     import spacy from spacy.matcher import PhraseMatcher import re  nlp = spacy.load('en_core_web_sm') speed_flag = lambda text: bool(re.search(r'(?i)\d+\s?mph', text)) IS_SPEED = nlp.vocab.add_flag(speed_flag)  matcher = PhraseMatcher(nlp.vocab) matcher.add('MPH', None, [{IS_SPEED: True}])  doc = nlp(u'Car was going 44 mpH.') matches = matcher(doc)  print(matches) for match_id, start, end in matches:     span = doc[start:end]     print(span.text)   This returns an empty list, however, re.compile(r'([M-m][P-p][H-h])') returns the right answer for "Mph", "mpH", "mPh", etc. and re.compile(r'([0-9]+)') returns any digits in my document.  I am using the example here to construct this: ... also, I tested my regex pattern, ([0-9]+) ?([M-m][P-p][H-h]) in a python interpreter and it does work.   I realize the original example is done using Matcher and I am trying to use PhraseMatcher, which does not accept the correct input (viz., a list of dictionaries) to do this.  Any idea as to how to achieve this.


Reviewed suggested edit view for title-only edits takes body of last revision?

Yesterday I was pointed at some rejected suggested edits. Some of the corrections were valid, so I edited the posts accordingly, while making several further edits. Looking at the suggested edits now however, it seems that for those posts where only changes to the title were originally suggested, the post mortem suggested edit view now incorporates the body of the latest revision. (Or at least it appears like that to me)  Take for example . If you take a look at  of that post, you will see my later edits. The edited body seems to have been incorporated in the suggested edit view. For edits where originally changes to the body were suggested, there is no such confusion.   Why does this matter? In the case of some post mortem discussions or explanations it might help to see the actual situation as it was when the edit was suggested. Especially in the case of edits that might be considered too minor.   So have I stumbled upon a bug here?


What are all the published objects that require the Use an Object action?

I am looking for an exhaustive list of all objects that can be used with the Use an Object action. RAW, official printed material only.  Depending on what falls in under the Use an Object action, the thief (sub class of rogue) could either be very good or nearly useless.     In  I found a list saying that the following items all require the use of an action in their descriptions:        Acid   Alchemist's Fire   Ball Bearings   Caltrops   Climber's Kit   Healer's Kit   Holy Water   Hunting Trap   Lantern, Hooded   Oil   Poison, Basic   Tinderbox      Is that all?


Samsung S7 - Developer options not showing after build number pressed 7 times

Developer options not showing after build number pressed 7 times. It even says that the developer is turned on already, but when I search for it under "about phone" on the setting app, it doesn't show up. My purpose is to turn on OEM.  Can someone help? thanks!!


How to install TP-LINK USB Driver from CD

I have the driver of my wireless USB adapter (tp-link TL-WN725N) from CD and currently the machine has no internet. I'd like to install the driver from CD via the command-line to be able to use the wireless capability in the basement. I have no long network cable. Thanks!


What is the difference between executing a Bash script vs sourcing it?

What is the difference between executing a Bash script like A and sourcing a Bash script like B?  A > ./myscript  B > source myscript


How to create a typing text-object animation ?

As for the video editor in Blender, I would simply make the five pictures in the drawing and put them one after the other onto a channel. But how to make the same animation if the text is made out of 3d objects in the default layout ? (for instance in order to make them rotate while they are typed )


In Game of Thrones S07E06 when Jon and his group have a standoff with White Walkers we see a few White Walkers (4-6) along with the Night King.   Are they all the White Walkers in the world? Are some of them in some other place? If so, where?


Can Arcane Trickster/Wizard use their Arcane Trickster's Spell Slots to cast Wizards spells that are not Enchantments or Illusions?

Can multiclass Arcane Trickster/Wizard use their Arcane Trickster's Spell Slots to cast Wizards spells they know that are not Enchantments or Illusions?


As far as I understand the number of protons in a nucleus is limited because Coulomb forces grow faster with the number of protons than the nuclear force. So alpha/cluster decay limits the size in this case.  But why can't we have nuclides with very numbers of neutrons? Is this limited by beta- minus decay?


Do you capitalise "North" and "South" of England?

When referring to the regions in England, do we refer to them as the "South of England" or the "south of England"? Same with "South" and "south" - is it capital (or not capital) when using this noun to refer to the regions in the UK? Regions meaning: London, South West and South East etc. Also, for the "North-South" divide, is that also capitalised or not? Thanks.


The soap opera effect occurs when frame interpolation is used. For example, if a movie is shot at 24 frames per second and then shown on a TV screen which is capable of displaying 60 frames per second then it is possible to use a computer to do motion interpolation. In other words the computer can average (interpolate) two frames and create a synthetic third frame and stick it between the two real frames.  This interpolation makes the picture look unnatural and plastic, somewhat like soap operas look on TV, hence the name.  My understanding of why soap operas have the soap opera effect has something to do with the fact that many of them are shot using camcorders instead of film, but I am not completely sure.  Why do soap operas have the soap opera effect?


Does anyone know what the current status of this  is? I am very eager to try it out, but there does not seem to be any available download, nor information on which handsets/hardware to use.


Windows 8.1 manual DNS on a per wifi network basis?

How to configure Windows 8.1 with a specific manual DNS that is only valid for the current WiFi network?  The setting seems to associate with the WiFi card, not the network, resulting in a laptop that moves from site to site having the wrong manual DNS on every network except the original.  It appears the same would be true for manually assigning an IP address. I am accessing this from Control Panel:Network and Internet:Network and Sharing Center:(link next to my connection name):Properties:Internet Protocol Version 4 (TCP/IPv4)/Properties and here I see the manual DNS entry which is erroneously being preserved from the previously connected network.  I also tried Control Panel:Network and Internet:Network and Sharing Center:Set up a new connection or network:Manually connect to a wireless network, but after I entered the password info it didn't provide any options to configuring the TCP/IP settings but instead just said the connection was created. (Although, strange enough, it doesn't show up from the Control Panel:Network and Internet:Connect to a network link which just brings up a side panel containing discovered WiFi networks!)


Why are plurals ‘*humen’ and ‘*Germen’ not conventional?

Studying English in school as a second language, I learned that human being would be the proper noun to describe a member of the Homo sapiens species, but it seems human is perfectly acceptable in English nowadays. It can even sometimes substitute (supposedly gender-specific) man where that was used in a gender-neutral way, e.g. in humankind, but not in *chairhuman, *firehuman etc.  The gender nouns man and (derived) woman, however, have their plurals as men and women, respectively, so why is umlauted *humen not acceptable at least as an alternative to the regular plural morphem +s which is used to form humans? The same question applies to some peoples or tribes, e.g. the Germans and Normans, not *Germen and *Normen.   The question even applies if human and man have different actual etymologies (Romance vs. Germanic), because perceived or folk etymology is often at least as important.  Also, does this effectively render these words , although they seem to contain the gender-specific morpheme man (in singular)?


TikZ externalize fails to recognize changes

Using XeTeX(xelatex) [i got the same using pdflatex] on Debian I am trying to save some compilation time using tikz external. Yet, the figures are never updated unless I delete the corresponding files. Otherwise I get     ===== Image 'figures/mwe-figure0' is up-to-date. ======   eventhough I changed something, e.g. labels or coordinates  \pgfversion gives me 2.10  mwe:  \documentclass{scrartcl} \usepackage[english]{babel} \usepackage{tikz} \usetikzlibrary{external} \tikzexternalize[prefix=figures/] \tikzset{external/system call={% xelatex \tikzexternalcheckshellescape -halt-on-error -shell-escape -interaction=batchmode -jobname "\image" "\texsource"}} \begin{document} \begin{tikzpicture} \node (f) at (0,0){d}; \end{tikzpicture} \end{document}   Interestingly, when I add   \tikzset{external/up to date check=md5}   to the preamble I get     ! Package pgfkeys Error: I do not know the key '/tikz/external/up to date check   'and I am going to ignore it. Perhaps you misspelled it.   What could be the cause of that?  PS: If it provides any insights to you, the *.dpth files are empty.


I have a Contacts.arc file which took from a nokia phone as a back-up of contacts.Now my mobile is lost and i want to see some numbers.Is there any application to open .arc file in ubuntu?. I searched in google but didn't get any answer.


Probability that n people collectively occupy all 365 birthdays

The problem is quite simple to formulate. If you have a large group of people (n > 365), and their birthdays are uniformly distributed over the year (365 days), what's the probability that every day of the year is someone's birthday?  I am thinking that the problem should be equivalent to finding the number of ways to place n unlabeled balls into k labeled boxes, such that all boxes are non-empty, but C((n-k)+k-1, (n-k))/C(n+k-1, n) (C(n,k) being the binomial coefficient) does not yield the correct answer.


"#include" a text file in a C program as a char[]

Is there a way to include an entire text file as a string in a C program at compile-time?  something like:   file.txt:  This is a little text file  main.c:  #include <stdio.h> int main(void) {    #blackmagicinclude("file.txt", content)    /*    equiv: char[] content = "This is\na little\ntext file";    */    printf("%s", content); }    obtaining a little program that prints on stdout "This is a little text file"  At the moment I used an hackish python script, but it's butt-ugly and limited to only one variable name, can you tell me another way to do it?


How to use only \diamondplus and \diamonddot from MnSymbol?

Can you please post the specific code for using \diamondplus and \diamonddot from MnSymbol without loading this package?   The answer to the question  gives a general procedure. To implement this procedure for a specific symbol different from the symbol used there requires understanding of  document. For those who do not understand fntguide, help asked here is essential. Also, more specific examples can help others gain better understanding of the general method.


Factorization of a map between CW complexes

I've been working on problem 4.1.16 of Hatcher's Algebraic Topology and am at a complete impasse. The problem is as follows:  Show that a map $f:X→Y$ between connected CW complexes factors as a composition $X→Z_n→Y$ where the first map induces isomorphisms on $π_n$ for $i≤n$ and the second map induces isomorphisms on $π_n$ for $i≥n+1.$  I applied Proposition 4.13 on the pair $(M_f,X)$ to get an $n$-connected CW model $(Z_n,X)$. Because $M_f$ deformation retracts to $Y$, this gives the desired isomorphisms for the second map. Moreover, because $(Z_n,X)$ is $n$-connected, the inclusion of $X$ in $Z_n$ gives the desired isomorphisms for the first map, with the exception of $π_n(X)→π_n(Z_n)$ (this map is, however, surjective). How do I prove injectivity? Any help would be appreciated.


Why does $F=ma$? Is there a straightforward reason?

Why is force = mass $\times$ acceleration? I have searched in many sites but didn't actually get at it. Simply I want to know that if a mass in space moves (gains velocity thus further accelerates), how can I think, postulate and further believe that force = multiplication  of mass and its acceleration ?


Proof for "The sum of the observed values $Y_i$ equals the sum of the estimated / fitted values $\hat Y_i$"

I needed some help trying to understand why the sum of the observed values $Y_i$ equals the sum of the estimated values $\hat{Y}_i$.


LaTeXing cup product over an indexed set

\[\smile_{i\in I}\alpha_i\]   I write this code and the summation variable i comes as subscript, to the right of the smile (cup product symbol in algebraic topology). I wish to have the index i underneath the cup product symbol, like it does with union, intersection or summation operation in place of the cup product.  Any ideas?  Thanks in advance!


As someone with dual U.S. and Dominican nationality without U.S. passport, but with Dominican passport can I make connection to U.S. soil from DR ?


I have two OpenID accounts. So what I want to do is delete or remove my private email from the StackExchange OpenId, but the problem is I can't find the remove, delete or deactivate button?  I want to remove my private email from OpenID because I only use that email for my family, friends and love ones.


Is there any difference in meaning between the definite, the indefinite, and the zero article when we make generic nouns?

I learned in class that:  a. A tiger is a dangerous animal. b. Tigers are dangerous animals. c. The tiger is a dangerous animal.  These three sentences are used generically. But I just saw:   The tiger is in danger of becoming extinct. Tigers are in danger of becoming extinct. A tiger is in danger of becoming extinct.   the previous sentences and number '1' and '2' are used generically but example 3. is not. Is there anyone who can tell me why the latter examples are different from the former ones?  Also, is there any difference in meaning depending on the article?


Switch to mobile view from search page leads to opening page with no search bar

If you open  and switch to mobile view it leads to opening search page without search bar:


Custom icons work when example is run in TextEditor, but fail in my add-on code?

I've been trying to make an addon in Blender 3D, and have basically started out making a custom button that's going to generate a mesh. I want a custom icon for the mesh I'm going to generate, and I can get it to work as a script, but not as an addon. So when I click 'run script' a button shows up with my icon (which is in a folder called 'icons')  I've seen one code template that looks promising for an addon, but I can't get my icon to load when I try it:  If anyone has any examples of working addon code (like an example addon with a custom button with a custom icon) it would be very helpful.  I've already tried using one solution I found on this site, but it only works as a script, and not as an addon. Here's the code that works as a script:     #---------------------------------------------------------- # File hello.py #---------------------------------------------------------- import bpy  # #    Menu in tools region # class ToolsPanel(bpy.types.Panel):     bl_label = "MyAddon"     bl_space_type = "VIEW_3D"     bl_region_type = "TOOLS"       def draw(self, context):         self.layout.operator("hello.hello", icon_value=custom_icons["custom_icon"].icon_id)         global custom_icons  #  class OBJECT_OT_HelloButton(bpy.types.Operator):     bl_idname = "hello.hello"     bl_label = "Generate MyMesh"     bl_icon= "custom_icons[custom_icon].icon_id"     country = bpy.props.StringProperty()      def execute(self, context):         if self.country == '':             print("Hello world!")         else:             print("Hello world from %s!" % self.country)         return{'FINISHED'}      # #    Registration #   All panels and operators must be registered with Blender; otherwise #   they do not show up. The simplest way to register everything in the #   file is with a call to bpy.utils.register_module(__name__). #  bpy.utils.register_module(__name__)  import os import bpy import bpy.utils.previews  class Panel(bpy.types.Panel):     """Creates a Panel in the 3D view Tools panel"""     bl_label = "Custom Icon Preview Panel"     bl_space_type = "VIEW_3D"     bl_region_type = "TOOLS"      def draw(self, context):         global custom_icons   # global variable to store icons in custom_icons = None  def register():     global custom_icons     custom_icons = bpy.utils.previews.new()     script_path = bpy.context.space_data.text.filepath     icons_dir = os.path.join(os.path.dirname(script_path), "icons")     custom_icons.load("custom_icon", os.path.join(icons_dir, "icon.png"), 'IMAGE')     bpy.utils.register_module(__name__)  def unregister():     global custom_icons     bpy.utils.previews.remove(custom_icons)     bpy.utils.unregister_module(__name__)  if __name__ == "__main__":     register()


Editing bounty messages, is it finally time for a little "Love"? (anti-Doh! feature request)

I start  and when I add a bounty remark I often get it right the first time. Once when a mistake in my message was problematic a moderator was kind enough to take the time to help me by cancelling/refunding it manually, followed by me starting a new one.  in 2012:  How about this:  a (say 5 minute?) short time frame to edit the text, much like comments perhaps during that period a small warning for viewers, explaining the bounty text may still be tweaked  That would allow honest folks to catch perhaps up to 95% of all minor (often formatting) mistakes, without a (big) risk of people investing wasted time to score a bounty while finding out later the bounty requirements changed a lot.  And in 2013, to the question , this  suggests (in part)  I suggest, given that  after it's started, it would be helpful:  If there would be a preview of your bounty text, before posting it; and/or If there would be a link to view the available markdown that's allowed, much like the help for comments.   Question: In 2019, with all the improvements to the site in the intervening years, is it possible to reconsider some way to edit bounty remark within 5 minutes as comments have, or to have some way to correctly preview them? I'm not sure if posting the draft message in an answer post window to preview will display everything correctly. There could potentially be typos or inadvertent formatting characters that display differently between the two, I don't know. I also don't know if there are any bounty-scamming schemes that could be implemented by changing a bounty remark within the first five minutes, the danger seems low but unlike me, some people are clever...  Example of a non-critical formatting problem ; an extra space at the end of the [title ] results in a failed hyperlink display. Everyone can copy/paste it, but a functioning hyperlink would have been better.


My sister just asked this question to me: "Is an irrational number odd or even?" I told her that decimals are not odd or even and that does imply that not recurring and non repeating decimals will also not be odd or even. But I want a rigorous math proof for this. Can someone help me with this proof? Also, can I do this proof by contradiction?


Is there any official ports of Ubuntu touch for nexus 6? I searched the whole internet and not seems to find anything juicy. I remember it used to support in my old galaxy nexus and nexus 7.


How do we know Dark Matter isn't simply Neutrinos?

What evidence is there that dark matter isn't one of the known types of neutrinos?  If it were, how would this be measurable?


How can you handle an IN sub-query with LINQ to SQL?

I'm a bit stuck on this. Basically I want to do something like the following SQL query in LINQ to SQL: SELECT f.*  FROM Foo f WHERE f.FooId IN (     SELECT fb.FooId     FROM FooBar fb     WHERE fb.BarId = 1000 )  Any help would be gratefully received.


Stacking is done with combining all the weak learners. What will happen if we do it with strong learners? A case of overfitting?


Is using the plural form (in place of the original singular) of these Latin/Greek loan words acceptable?

The following Latin/Greek singular vs. plural errors make me cringe every time:  bacterium - bacteria criterion - criteria millennium - millennia phenomenon - phenomena  It's extremely typical for an English speaker to always use the plural form, i.e. "the bacteria replicates by...", "the criteria for ... is ...", "a nice millennia". I would go as far as to say that the incorrect use trumps the correct use, but maybe there's a slight bias because I started looking for it. Well, it's mostly on YouTube, but the speakers do have degrees or at least represent science channels. A well known physics professor even used "these phenomenon" along with "this phenomena". Super-cringe. Yes I listened back several times, because it's sometimes hard to hear the exact endings. So much for the rant, the real question is: Have (some of them) become so common that they are considered acceptable? I can't really tell, because it's not my first language. Maybe I care more because of that.


Dual-boot Ubuntu and Windows 8 (only boots from "Windows Boot UEFI Recovery")

Yesterday I was finally able to install ubuntu 12.04.3 (64 bits) on my pre-installed Windows 8 (64 bits) Lenovo Ideapad Z500 (if that is of any help). I'll just explain the problem that I have now and if you need more info just ask me (such as the steps I followed to install Ubuntu, etc.) So I boot the computer (UEFI Bios, SecureBoot Disabled, Fast startup on Windows 8 disabled) and GRUB appears correctly (I already ran BootRepair to achieve this), then if I choose Ubuntu, it loads correctly. The problem is when I choose Windows 8 I receive this error:  unknow command `drivemap' invalid EFI file path   Furthermore, in GRUB I see 2 Ubuntu Boot options alongside many windows options and I just discovered that clicking one: "Windows Boot UEFI Recovery" actually boots my Windows 8 as usual. So, I actually have a working dual boot, but instead of choosing "Windows 8 (loader)" which doesn't boot Windows 8 (and just shows the drivemap error) I have to select the mentioned "Windows Boot UEFI Recovery" option to correctly boot windows 8. Is there any way to solve this issue?? Thanks in advance!!  Cheers, Alejandro.  P.S.: The BootInfo generated by BootRepair can be found here


How to use a tuple with string.format with out splitting beforehand

I've this working code:  ', '.join('%s=%r' % item for item in list)   where list is list of tuples ('key', 'value').  I want to refactore the code to use the new style string.format. I've tried it this way:  ', '.join(['{!s}={!r}'.format(item) for item in list])   This results in an IndexError: tuple index out of range. Are there any better solutions than:  arguments = [] for key, value in list:     arguments.append('{!s}={!r}'.format(key, value))  ', '.join(arguments)   Context:  def __repr__(self):     """     This method returns a string representation of the object such that eval() can recreate the object.     The class attributes will be ordered     e.g. Class(attribute1='String', attribute2=3)     """     list =[]     for item in vars(self).items():         list.append(item)     list.sort(key=lambda tup: tup[0])      arguments = []     for key, value in list:         arguments.append('{!s}={!r}'.format(key, value))      return '{!s}({!s})'.format(         type(self).__name__,         ', '.join(arguments)     )


How to create a launcher icon for anaconda navigator in ubuntu 16.04?

Generally, there is not an icon for anaconda navigator in Linux. that's why every time I used the terminal to open anaconda navigator. And then if I close the terminal somehow then the total project got closed.


What happens to the worlds that don't want to join the United Federation of Planets?

What happens to the worlds that are within Federation Space that decline to join the UFP? How are they treated?


I need to identify the roofs of buildings using a satellite image, something like what is available in OSM  (something like the image).  Is there anyway to do this in Qgis, R, Arcmap?


#!/bin/bash  SUBJECT="WARNING CPU USAGE HIGH" TO=gmail id MESSAGE=/tmp/messages echo "#######################" > $MESSAGE echo "CPU statistics as follows.." >> $MESSAGE mpstat >> $MESSAGE echo "#######################" >> $MESSAGE CPU_USAGE=$(top -b -n1 | awk '/^Cpu/ {print $2}' | cut -d. -f1) [ $CPU_USAGE -gt 85 ] && mail -s "$SUBJECT" "$TO" < $MESSAGE`   ./cpu.sh: line 11: [: -gt: unary operator expected What might be the reason


How do I count how many diamonds my player has collected in my 3d world What I need to do is to make a script which will update my text ui when the player collides with a diamond but I do not know how as I auto generate the diamonds How could I go about writing a script that will update the text score What I tried so far, but I'm not sure where to place it. (taken from comment) void OnTriggerEnter(Collider other) {     if (other.CompareTag("Diamind")) {       Debug.Log("Picking up...");        GetComponent<Counter>().ScoreAmount += 1;    }  }


I am trying to make a text to speech program, but I always get this:  Exception in thread "main" java.lang.NullPointerException at FreeTTS.main(FreeTTS.java:7)   Here is my code:  import com.sun.speech.freetts.Voice; import com.sun.speech.freetts.VoiceManager; public class FreeTTS {     public static void main(String args[]) {         VoiceManager vm = VoiceManager.getInstance();         Voice voice = vm.getVoice("kevin16");         voice.allocate();         voice.speak("Hello World!");         voice.deallocate();     } }   how can I fix it?


It's $\mathbb{Z}\subseteq \mathbb{Z}[X]/(X^5-1)$ an integral extension?  $\mathbb{Z}[X]/(X^5-1) \simeq \mathbb{Z}[x]$ where $x^5-1=0$.  So is an integral extension because $x$ is integral  over $\mathbb{Z}$. It's right?


Flag as off-topic + migrate also suggests I flagged as duplicate

I flagged  as being off-topic and requested it be migrated to . However, it's suggesting I flagged it as a duplicate and/or should be closed:    While closing as off-topic includes a listing for a possible duplicate    it seems incorrect.


I want to change my device name but I have not found any option in the settings to do it. I am using Ubuntu for first time. Is there any way to change the device name that appears when I lock the desktop?


Theorem of Lagrange multipliers - Extremas of $f$

I have to find the extremas of $f(x, y, z)=x+y+z$ subject to $x^2-y^2=1$, $2x+z=1$.   I have done the following:   We will use the theorem of Lagrange multipliers.   The constraints are $$g_1(x,y,z)=x^2-y^2-1=0 \ \ , \ \ g_2(x, y, z)=2x+z-1=0$$   We are looking for $x$, $y$, $z$, $\lambda_1$ and $\lambda_2$ such that $$\nabla f(x, y, z)=\lambda_1 \nabla g_1(x, y, z)+\lambda_2 \nabla g_2(x, y, z) \tag 1$$ and $$g_1 (x, y, z)=0 \tag 2$$ $$g_2(x, y, z)=0\tag 3$$   $$(1) \Rightarrow (1, 1, 1)=\lambda_1(2x, -2y, 0)+\lambda_2(2, 0, 1)$$   So, we have that $$1=2\lambda_1 x+2\lambda_2 \\ 1=-2\lambda_1 y \\ 1=\lambda_2$$   So, we get $x=y$, right??   When we apply this at the first constraint $g_1(x, y, z)=0$ we get $-1=0$, or not??   What have I done wrong??


Is it possible to reuse tcolorbox definitions in another tcolorbox definition?

TiKZ allows to define a .style which can be later be used in another one:  \tikzset{       first/.style={rectangle, draw},       second/.style={first, inner sep=2mm} }   any change in first is inherited by second. Is it possible to do something similar with tcolorbox?  As an example, take a look at next code, where a newtcolorbox and a newtcbox are defined with exactly same options. How can be same options applied to both definitions without having to type them again?  \documentclass{beamer} \usetheme{Madrid} \usepackage{tcolorbox} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage[french]{babel} \usepackage{lmodern} \tcbuselibrary{skins}  \makeatletter \newtcolorbox{myblock}[2][]{     enhanced,     frame hidden, interior hidden, segmentation hidden,     coltitle=black,     fonttitle=\bfseries\rmfamily,     fontupper=\tiny,     title={#2},     overlay unbroken={\draw[gray,line width=1pt] (frame.north west) rectangle (frame.south east);     \draw[gray,line width=1pt] ([xshift=\kvtcb@lefttitle+\kvtcb@boxsep]interior.north west)--([xshift=-(\kvtcb@righttitle+\kvtcb@boxsep)]interior.north east);     \shade (frame.south west)--++(0,-1mm)--(frame.south)--cycle;     \shade (frame.south east)--++(0,-1mm)--(frame.south)--cycle;},     #1     }  \newtcbox{mybox}[2][]{       enhanced,       frame hidden, interior hidden, segmentation hidden,     coltitle=black,     fonttitle=\bfseries\rmfamily,     fontupper=\tiny,     title={#2},     overlay unbroken={\draw[gray,line width=1pt] (frame.north west) rectangle (frame.south east);     \draw[gray,line width=1pt] ([xshift=\kvtcb@lefttitle+\kvtcb@boxsep]interior.north west)--([xshift=-(\kvtcb@righttitle+\kvtcb@boxsep)]interior.north east);     \shade (frame.south west)--++(0,-1mm)--(frame.south)--cycle;     \shade (frame.south east)--++(0,-1mm)--(frame.south)--cycle;},     #1     } \makeatother  \begin{document} \begin{frame}{A nice box for beamer}  \begin{myblock}{Oups, nous avons rencontré une erreur.} Note partagée non trouvée  L'URL fornie ne correspond pas à une note partagée valide. Cela a pu être causé par une erreur typographique dans le lien, ou le propiétaire l'a privaisée. \end{myblock}  \mybox{Oups, this is a long title}{Note partagée non trouvée} \mybox[left=0mm,right=1cm]{Oups}{Note partagée non trouvée} \end{frame} \end{document}   Another example. I would like to define some tcolorboxes like beamer's block, example block and alert block. I can do something similar with \mybox definition in previous code where an optional parameter can help to change some aspect like title color, margins, whatever.   \mybox{Oups, this is a long title}{Note partagée non trouvée} \mybox[left=0mm,right=1cm]{Oups}{Note partagée non trouvée}   But if I would like to use \myexample, \myalert, \myblock, the only way I know is retyping all parameters in all definitions. Do you know an easier way?


How can I make Google include special characters to search for programming terms?

This comes up from time to time when I want to search for a line of code, and it's perhaps something common to many languages or is a word/phrase outside of programming.  The special characters and formatting are what makes my query unique.  However, Google ignores almost all special characters.  I have put my string in quotes and also used verbatim mode.  No dice.  If I search "/echo/html/" (including the quotation marks), even in verbatim mode, Google finds results such as "You need to echo HTML" which do not include my forward slashes.  I've read  but it doesn't address my situation.  The same problem exists for <>, (), and many other common programming special characters.  If I want to read about <head> or print(), I need to include words like "HTML" or "Python" and even then I might get hits that aren't about the specific query I want.  . seems to be included, so searching for .Net is not a problem.  Is there a solution I'm missing?  Am I just not able to use the search how I would like?


What is this hexagonal board game with 10 marbles to a side?

I saw this game at a friend's place but nobody knew what it was called. Google search and reverse image search didn't help.    This is a hexagonal board with:   10 white marbles 10 dark marbles 37 notches to put them in


Whenever I try to add a window using archipack, I get an error. Before, it was a black screen but I did the render thumbs thing and now it is this.


Ubuntu 12.04 boots to blank screen without backlight after upgrade on ASUS A72J

I had a working version of Ubuntu 12.04 in dual boot with Windows 7 on my ASUS A72J. However, after installing the last ~350 upgrades (I had not used Ubuntu in a long time) using the normal updating program of Ubuntu, my laptop now boots to a blank screen without backlight. I think the issue might be with my video card (ATI 5470M 1GB) drivers, but I have no idea how to solve it. Do you have any idea what the problem might be?


Removing Guest Session at login in Ubuntu 14.04

I recently installed Ubuntu 14.04 LTS it works fine but I want to remove the guest account login.


python regex extract string between characters

I have a string:  x = "abc/xyz/foo/bar/foobar.mp3"   How to extract foobar out of it?  I have done it in this way:  import re re.search(r'\/[a-z]+.mp3', x)   Although, I do not know how to extract the matched string without '.' and without '.mp3'.   I do not want to do Python splits, rplist, partition etc. as it adds extra functions. I want it to be as simple and short as possible.   EDIT:   Yes, it is a path. I do not know the length of the path. As mentioned, I do not want to use splits.


I'm brand new to cycling and I have an entry level Cannondale catalyst 3. I was riding my bike on a trail and when I got home I noticed my right pedal was wobbling around. I tightened it but the pedal still wobbles around. I'm thinking the crank arm thread is stripped but I don't know. the crankset and the pedals are all default that came on the bike when I bought it. I'm on a low budget so is there any way I can fix this or do I have to get a new crank set? PLEASE HELP


Will the volt, ampere, ohm or other electrical units change on May 20th, 2019?

When  watching , a claim that the volt and unit of resistance (presumably the ohm) will change by about 1 part in 10 million caught my attention:     [...] I should point out that a volt will actually change by about 1 part in 10 million, and resistance will change by a little bit less than that. And that's because back in 1990, the electrical metrologists decided to stop updating their value of, effectively, plancks constant, and just keep the one they had in 1990. And there was a benefit to that: they didn't have to update their definitions or their instruments. [...] Well, now the electrical metrologists will have to change. But, that's a very tiny change for a very tiny number of people.   Apparently, the reason is that . The kilogram will be redefined using the Planck constant, which, presumably, means that any change in value from the previous definition () would affect derived units depending on it,  and .      Will the volt or ohm change, as Veritasium seemingly claims?   Are any other electrical units (listed above) affected? If so, exactly how much will they have changed after the redefinition?


Possible Duplicate:             \begin{tabular}{ l | c || r | }   A&B & 2 & 3 \\   4 & 5 & 6 \\   7 & 8 & 9 \\ \end{tabular}   How would I type & in LaTeX? Because I  want for example, A&B to be in one box, but I cant seem to figure out how.


Standard concise way to copy a file in Java?

It has always bothered me that the only way to copy a file in Java involves opening streams, declaring a buffer, reading in one file, looping through it, and writing it out to the other steam.  The web is littered with similar, yet still slightly different implementations of this type of solution.  Is there a better way that stays within the bounds of the Java language (meaning does not involve exec-ing OS specific commands)?  Perhaps in some reliable open source utility package, that would at least obscure this underlying implementation and provide a one line solution?


How can I make a footnote to a footnote? E.g.,  Playfair's axiom\footnote{so called in honor of mathematician John Playfair, etc, etc., but was actually discovered by Proclus\footnote{Greek mathematician, etc, etc.}}


If $a+b$ is even, then $24|ab(a^2-b^2)$. Since $a+b$ is even, then $a+b=2n$ for some integer $n$. This also implies that both $a$ and $b$ are either even or odd. So there are two cases to consider. Case $1$: Both $a$ and $b$ are even, then $a=2p$ and $b=2q$ for integers $p$ and $q$. Also $24=2^33$. So $$ab(a^2-b^2)=2^32q(p-1q)(p-0q)(p+1q).$$ If $(p-1q)(p-0q)(p+1q)$ is divisible by $3$, then case $1$ is done. I know that one of three consecutive integers is always divisible by $3$ and what I have found with this problem is the same thing, but where the consecutive aspect was replaced by shifting each $p$ term $q$ units. I'm trying to see how to incorporate this and know with certainty that I'm right and then do this for case $2$ where both $a$ and $b$ are odd. I'm also certain that there is an easier way to do this problem because what I'm doing is unlike anything in the textbook I'm using, where the problem came from. Any hints or solutions are greatly appreciated. I feel like I'm using a tank to kill a roach.


How does this function return the value 6?

I dont understand how this function returns 6. I was going to explain the part I don't understand and could not put it into words. I would really appreciate a simple explanation.  var add = function(a) {     return function(b){         return a + b;     } };  var addToFive = add(5); console.log(addToFive(1));


How to receive the product for these two disjoint cycles?

I am not sure when to stop the composition for an orbit when I come against a fixed point? Thank You ( 1 4 7 2 )(1 2 8 7 6 3)=?


created persisted computed columns when the user defined scalar function appears to be non-deterministic

I have a scalar UDF that I know to be deterministic, however SQL doesn't.  Is there a way to declare it as deterministic so that I can then use it in a persisted computed column definition?  further clarification: The purpose of this exercise is that I need to harvest out specific values from an XML column on the row.  I can't use the value method of the xml column in my computed column definition, but I can use it in a UDF.  I know the xpath query in the value method will produce the same output give the same input so while I certainly understand that not all calls to value will be deterministic I want to assert that mine is.


How to automatically archive a directory?

I want to do one way synchronization.  I am having Folder A on my computer which is constantly updated with content. Another Folder B is used for backup purpose which is on external HDD.  Now what I expect is that whatever extra which is present in folder A should go to folder B. However something which is present in B and NOT in A ""shall NOT be copied to A"".  In a nutshell, the backup folder may copy everything from the source folder, however nothing should be copied form backup folder to the source.


In a form like the following:        What should be the role of Enter when the email addresses input is focused?  Since the share message is optional, I am not sure if it should share the document straight away (if the email addresses are valid and the Share button is enabled) or if it should move focus to the textarea to allow entering a message.


If I need to ask someone about their birth order, what question is usually used? Let's say I do not ask how many children his family has first.  What is your birth order? or Which child are you in your family?


Unwanted indent in large subsection titles

It seems that no ones asked this before. I have an unwanted indent in the second line of the subsection title. I was wondering if anybody knows how to get rid of it. Near I provide a minimal example. Thanks in advance!      \documentclass[a4paper,14pt]{article}     \usepackage{cmap}                        \usepackage[T2A]{fontenc}                \usepackage[utf8]{inputenc}              \usepackage[english,portuguese, main=russian]{babel}          \usepackage{blindtext}     \usepackage{titlesec}     \usepackage[toc, page]{appendix}       \begin{document}     \section{Section One}     \subsection{The heading of this subsection is too long to fit in just one line. The indent after the first line is unwanted}     \end{document}


using find and cat command for merging text files orderly

I have a main directory and its sub-directories as;  main_directory == main_directory  0001 0102 0203 ... == first order sub_directories  001 002 003 ... == second order sub_directories  I use below command to merge all data.txt files in the second order sub_directories  find path_to_main_directory -name '*data.txt' -exec cat {} + > data_all    However, I see that data_all file doesn't seem orderly, such as (which I want); 0001/001+0001/002+.... it seems that the order is random.  Is there a way to merge all files orderly?


I'm just downloaded (current available) Blender 2.8 RC2, and little confused: I see NO restriction icons [commands] in Outliner:   Restrict Viewport Visibility  Restrict Viewport Selection  Restrict Rendering   I Have "hide in viewport" only. Is this OK? Or maybe I miss something? How to get back all 3 restrictions?


Having Overfull and underfull box warnings. Please help out as there are many matrices and equations

\documentclass[11pt]{article}  \begin{document}   The above equations on application of Laplace Transform become:  $$sL_1\hat{i}_{L1}(s) = D\cdot \hat{v}_{C1}(s) + D\cdot \hat{v}_{C2}(s) - D\prime \cdot \hat{v}_g(s) + (C_{C1} + V_{C2} - V_g + V_D)\cdot \hat{d}(s)$$ $$sL_2\hat{i}_{L2}(s) = -D\prime \cdot \hat{v}_{C1}(s) + D\cdot \hat{v}+{C2}(s) + D\prime \cdot \hat{v}_g(s) + (C_{C1} + V_{C2} - V_g + V_D)\cdot \hat{d}(s)$$ $$sC_1\hat{v}_{C1}(s) = -D\cdot \hat{i}_{L1}(s)+ D\prime \cdot \hat{i}_{L2}(s) + (-I_{L1} -I_{L2} - I_1)\cdot \hat{d}(s) -D\prime \cdot \hat{i}_l(s)$$ $$sC_1\hat{v}_{C1}(s) = D\prime \cdot \hat{i}_{L1}(s)- D\cdot \hat{i}_{L2}(s) + (-I_{L1} -I_{L2} - I_1)\cdot \hat{d}(s) -D\prime \cdot \hat{i}_l(s)$$ $$sL_l\hat{i}_l(s) = D\prime \cdot \hat{c}_{C1}(s) + D\prime \cot \hat{v}_{C2}(s) - D\prime \cdot \hat{v}_g(s) +(V_g - V_D - V_{C1} - V_{C2})\cdot \hat{d}(s) - R_l \cdot \hat{i}_l(s)$$  \end{document}   Error:   181 Underfull \hbox (badness 10000) in paragraph at lines 181--181 181 Overfull \hbox (22.63293pt too wide) detected at line 181


Why is my 32bit Win 7 installation limited to less than 1GB of ram (out of 16GB)?

I recently installed win 7 32bit as dual boot (to Win 10 64bit) on my Alienware 17 R3. I forgot what a pain manual driver installation used to be and probably got something wrong. 32bit is usually limited to 3.25 GB ram, right? But for me it's showing up as 16 GB (855mb usable) - I have no clue why. It's showing correctly in the BIOS (and the Win 10 system).  I might still be missing quite a few drivers, but I don't remember needing drivers for RAM in the past... Any ideas on how I might solve this?


I use Ubuntu, and I've used the katoolin script to install Kali Tools.  The only problem is that this makes my PC startup very slow.   # systemd-analyze  Startup finished in 3.208s (firmware) + 3.032s (loader) + 8.616s (kernel) + 2min 29.568s (userspace) = 2min 44.427s  # systemd-analyze blame     1min 29.982s nmbd.service          55.696s plymouth-quit-wait.service          44.647s apt-daily.service          40.144s postgresql@9.6-main.service          31.100s thin.service          23.626s openvas-manager.service          19.323s apache2.service          19.221s smbd.service          17.447s NetworkManager-wait-online.service          12.894s dev-sda11.device          11.278s squid.service   Is there a script to delete all the Kali Linux tools?


Is the spin of a particle always a 50/50 chance of being different after measuring it in Quantum Entanglement

This might be hard to understand but:  Let’s say you measure a partical and it has a spin of clockwise. If you stop measuring it then remeasure it, would it have a 50/50 random chance at changing its spin? Or would it continue to have the clockwise spin?


I want to turn off bluetooth. It seems to be turned off already, but every boot it appears at the panel again.  Here is how it looks at Settings.


How to tell if a socket has been disconnected (Java)

I've read   about this on stack overflow already, but none of them has provided me with an elegant solution.  I know that calling isConnected() and isClosed() on the Socket is useless because it returns the local connection state (if the server is connected - not if the client is connected, as I want).  I also can't simply call if(socket.getInputStream().read()==-1)* because that would only account for the end of the stream (EOS) being reached - i.e., the client didn't send a message recently. This doesn't at all indicate that the client has disconnected however.  I'm considering just having the client send a message to the server letting it know it's disconnecting just before it closes the socket, but I'm wondering if there's a simpler solution I'm missing - wanting to know the connection state of the remote socket is a fairly commonplace desire. Thanks.  *not to mention the fact that  is an abstract method, I'm using  for data read methods (i.e. readInt(), readByte(), etc.)


I'm new to QGIS and stuck.  I have a shapefile of 1 ft contours for an area.  I want to load it into mapbox so I can turn it into a layer for Gaia GPS, but the shapefile is too big for mapbox and it gives an error.  I was told I could use QGIS to cut out a smaller piece from the contour map but I can't figure out how to do that.  I can load the contour map and see all the contours, but can't figure out how to select a portion of it and save to a new shapefile.


How to fight request spam (DDOS i guess) on CentOS server

lately i'm trying to fight DDOS on my CentOS 6.4 server. I have installed CSF and I've set it quite strictly. Yet there is a URL that have like 1000 requests and max 2 per IP (smart ddos-er I guess).  How do you fight and prevent people to spam reqeusts, apache reports this request for all 1000+ requests...   POST /wp-login.php HTTP/1.0   If anyone have an idea or suggestion how to fight such thing, without disabling / removing the attacked website.  Thanks for all usefull info in advance.


What is the equivalent of gksudo in Kubuntu/KDE?

In regular Ubuntu (Unity/Gnome), I use gksudo to run GUI programs with root privileges. I'm trying out Kubuntu (or KDE) now -- what do I use?


Are there any download managers with web interface?

Im new to ubuntu server , im using a personal home server and i want to install a download manager through terminal. On windows i have been using jdownloader on which i was able to use my accounts on "downloading" sites like rapidshare , easybytes etc..  I read that jdownloader can be installed on ubuntu but only via desktop/gui. Is there any download manager like jdownloader but with webinterface? so it will be easy to use?   Thank you


Macbook Pro Battery Condition: Replace Now

My Macbook Pro ( Retina 13 inch early 2015), all of a sudden, started showing "Condition: Replace Now" on battery. Everything was working fine till last night; when I turned on the laptop in the morning, it asked me to restore the work (as if it was crashed when I turned it off at night).  The laptop was slow, and I noticed this "Condition: Replace Now" on battery status. I shut down the laptop, rebooted, did SMC reset, PRAM reset, but its still showing the same. The battery is showing 0% when I remove the charger the laptop turned off. And when its off when I connect the charger its starts the laptop.   My battery cycle is just 385. I am running macOS Sierra. Can anyone please advise what is the workaround to fix this.


Determinant of a finite-dimensional matrix in terms of trace

I have noticed that for the case of $1 \times 1$, $2 \times 2$ and $3 \times 3$ matrices $A$, $B$, I can write the determinant of their commutator $C=[A,B]$ in terms of traces:  $1 \times 1$  matrices $A$, $B$: $$\det(C)=\text{tr}(C)$$  $2 \times 2$ matrices $A$, $B$: $$\det(C)=-\frac{1}{2}\text{tr}(C^2)$$  $3 \times 3$  matrices $A$, $B$: $$\det(C)=\frac{1}{3}\text{tr}(C^3)$$  But I can't find a simple formula for $4 \times 4$  matrices--I have no idea how to generalize this general finite-dimensional matrices:  I can't quite understand the origin of this pattern for low-dimensional matrices.  So my question is can this be generalized to:   Larger $n\times n$ matrices, $n>3$? Anticommutators $C=\{A,B\} = AB+BA$?


GCD of two numbers divided by their greatest common divisor is 1

Im trying to prove that, given $a,b$ with at least one of $a,b \neq 0$, $$ \gcd\left(\frac{a}{\gcd(a,b)},\frac{b}{\gcd(a,b)}\right)=1 $$ I have tried to prove the identity  $$ \gcd(c\cdot a, c\cdot b) = c\cdot \gcd(a,b) $$ with $c =  \dfrac{1}{\gcd(a,b)}$  However I'm having trouble understanding the proof.  Thank you for your time.


Find primitive element and Galois group of extension

Find primitive element of $Q(\xi, \sqrt[6]{5})$, where $\xi^3 = -1 \neq - \xi$. Find Galois group of this extension and describe it`s subfields.   First of all, finding primitive element. The only idea I have is take $\gamma, \gamma^2, \gamma^3$, where $\gamma \in Q(\xi, \sqrt[6]{5})$ and try to derive $\xi$ and $\sqrt[6]{5}$ from this linear system.  I know what is Galois group, but not understand how I can build it in this case.


Using 'for' as a coordinating conjunction at the beginning of a sentence – is this acceptable?

As I understand it, 'for' is a coordinating conjunction. Learning German as a second language has taught me specifics about reforming sentences, but it is an awful lot less common in English. If I were to rearrange the sentence: "I ate lunch, for I was hungry," so that 'for' was the first word of the sentence, by my reckoning I should end up with "For that I was hungry, I ate lunch." Does this new sentence have any grammatical errors? I inserted the word 'that' after 'for', because without it the sentence didn't sound right. Should I have? Is there a rule for that? Thank you in advance, an aspiring author.  Additional Information:  I am not having problems with the sentence, this is a general question to increase my knowledge of the manipulations of coordinating conjuntions.


Lower chart in reputation graph is invisible

I first reported it 8 days ago on    and later flagged it to be moved to Meta Stack Overflow 3 days later   when I noticed it happening to me on Stack Overflow as well.   Is it happening to me alone? I am able to see charts for other users, but it is not shown for myself.  Screenshots to show the bug:      It should be something like (taken as a guest user):    This behaviour is not displayed only on Meta Stack Overflow but is experienced on all main sites I'm registered on. A few more points before someone else asks:   It is only noticed when I am logged in. Changing browsers doesn't make a difference. I do not use any JavaScript blockers or extensions in Chrome (where I normally keep logged in). The bars are somewhat visible when I zoom-out to around 90% as shown in images below:     At 90%  At 100%       I'd happy if I'm not a part of some experiment once again and this is most probably only my own screen and not a Stack Exchange error.    PS: All images in post are small sized thumbnails and can be clicked upon for larger images.


preg_match with multiline doesn't work correctly

I have the following code : $data = "numbers{One Two Three}";  preg_match("~(?<=numbers{)(.*?)(?=})~", $data, $result); echo $result[0];  The preg_match doesn't work i don't know why if the data is just one line then it works


The sequence $a_n=(1/2)^{(1/3)^{...^{(1/n)}}}$ doesn't converge, but instead has two limits, for $a_{2n}$ and one for $a_{2n+1}$ (calculated by computer - they fluctuate by about 0.3 at around 0.67). Why is this?


mysql client: change output columns separator

Thought of this to be a very basic issue which people would have definitely faced. But unfortunately, I couldn't find a solution for this after searching a lot.   I am using mysql command line client to run a query, and later on parse the output as per my requirement. By default, it returns output as tab separated. And some of the columns of the table have tabs in it.  Because of this, I am not able to parse it properly as the tabs in column data are not escaped. When I cut my output for tab, I get more columns then expected.  I will be using select * from table type queries. So replacing tab column wise in query is not an option.   Checked at mysql  for any available option but there doesn't seem to be any. Any way to solve this?


Why is the alternating group called "alternating"?

The title says it all: Why is the alternating group called alternating? What is being alternated that is not being alternated by any permutation?


Is it because Rey just saved BB-8 from a net, and then the droid just decides to follow her about - or is it for some other reason?  Does BB-8 have any idea who Rey is prior to being rescued by her?  Just wondering as she literally tells the droid to go elsewhere.


lower triangle inequality for complex numbers

prove $|z_1 + z_2| \geq ||z_1| - |z_2||$ I have proved the original triangle inequality.  Using the original I have ended up with $$|z_1+z_2| \geq |z_1| - |z_2|$$ and $$|z_1+z_2| \geq -(|z_1|-|z_2|)$$  but does this mean the result holds? I mean, if we had say $|x| \geq 10$, then that means that $x \geq 10$ or $x \leq -10$, so i don't see how to conmclude the result from here


I'm unable to play HEVC files in VLC 2.2.4. I use 14.04 LTS. I tried the following solution.  sudo apt-add-repository ppa:strukturag/libde265  sudo apt-get update  sudo apt-get install vlc-plugin-libde265   It doesn't work. This is the error I'm getting.  The following packages have unmet dependencies: vlc-plugin-libde265 : Depends: libvlccore7 (>= 2.1.0) but it is not going to be installed E: Unable to correct problems, you have held broken packages.   For apt-cache policy libvlccore7 the output is  libvlccore7:   Installed: (none)   Candidate: 2.1.6-0ubuntu14.04.2   Version table:      2.1.6-0ubuntu14.04.2 0         500 http://archive.ubuntu.com/ubuntu/ trusty-updates/universe amd64 Packages         500 http://archive.ubuntu.com/ubuntu/ trusty-security/universe amd64 Packages      2.1.2-2build2 0         500 http://archive.ubuntu.com/ubuntu/ trusty/universe amd64 Packages   For sudo apt-get install -f libvlccore7 the output is  The following packages have unmet dependencies:  libvlccore7 : Depends: vlc-data (= 2.1.6-0ubuntu14.04.2) but 2.2.4-3ubuntu2~ubuntu14.04.1york1 is to be installed   I don't really understand this as I do have VLC 2.2.4.


555 timer: how to set values to take an hour

I'm new (and novice) in electronics. I came to seek your knowledge to see if someone can help me with a very basic circuit.  It is a 555 chip, which should light a LED (for about 1/2 second) every hour. I managed to make the circuit diagram with a well known software.  My question is that I do not know what values to put the resistors and / or capacitors to achieve this frequency of light or flash. Actually, this triggers a parallel circuit (so I need the trigger every 1 hour). I guess there must be some calculations to obtain these values, but what I've seen online I find very difficult to understand. I am not a student of electronics, only an amateur trying to learn as well as realize a project. Now the circuit works, but not in the desired frequency flash lighting (every hour a little flash).  PS: Attached image of the schematic. Sorry for possible faults in the text, I used Google translator.  PS: I think this is an astable and oscillator circuit... but I'm not sure.


Can I enter a different schengen country before I enter the country of my student residence permit?

I have been accepted for a Masters degree in Finland. Because of this, I have already applied for the Finnish Residence Permit starting 1st August 2015. However, I wanted to visit Germany for a month before I start my master's study. I have been invited by a family friend for a month to travel and celebrate their grandparent's 50th anniversary.    When inquired about it at the Finnish embassy they mentioned that I cannot go to any other Schengen country before 1st August as I need to first enter Finland using my residence permit and then can go to any Schengen country. I also cannot apply for a separate German Schengen visa from 1st July 2015 to 31st July 2015 as one cannot hold two Schengen visas at the same time.   My doubt revolves around the last statement. Since the dates for my application to German Schengen visa doesn't overlap the Finland Residence permit dates, can I still apply for German tourist visa from 1st July to 31st July 2015? Also can I travel to Finland from Germany?


I want to make a list containing list of 4 elements and so on from a list of 100 elements without using numpy. For suppose x = [list containing numbers from 1 to 100] I want  to store these 100 elements in a manner that y = [[1,2,3,4],[5,6,7,8].......[97,98,99,100]]


I'm very new to the research domain and I'm extremely confused, let me explain further. For the literature review I've done assume that I have 1 topic, that comprises of three research papers say A,B,C. Now I put these papers in chronological order, I then take paper A and summarize it. What I mean here is that I discuss what the papers purpose was, how the authors met the papers purpose and mention the results. After this I then explain what is learned from each paper and what I can take forward in the proposed research and Introduce the next paper, in this case paper B. I do the same process for paper B etc. My question is that I've been told that this approach is wrong and that a literature review is like "telling a story" but frankly I can't see where I'm going wrong?? Can someone please help explain where exactly I am going wrong?