what is this error supposed to mean : Exception in thread "main" java.lang.NullPointerException ?

the program is to count the frequency of each word in a sentence. This is the source code:  import java.io.*; import java.util.Scanner; class Dictionary {   String key;   int val;   public Dictionary()   {     key="";     val=0;   }  void insert(String k)   {     key=k;     val=1;      System.out.println("\nInserted key with value: "+k);   }  void update()   {     val++;   }  String retkey()  {    return key;  }  int retval()  {    return val;   }  public void display()   {     System.out.println("Word = "+key);     System.out.println("Number = "+val);   } } class stack {   Dictionary D[]=new Dictionary[50];   int n;   int top;   public stack(int N)   {     n=N;     top=-1;   // D=new Dictionary[n];   }   public void push(String p)   {     top++;     System.out.println("pushing "+p+"\n top=="+top);     D[top].insert(p);     System.out.println("\ntop="+top);   }   public void check(String p)   {     int i=0,flag=1;     String q="";     if(top==-1)     {       System.out.println("top=-1");       push(p);       flag=0;     }     else     {      for(i=0;i<=top;i++)      {        q=D[i].retkey();        if(q.equals(p))          {            D[i].update();           flag=0;          }         else         flag=1;      }     if(flag==1)      push(p);     }    }  public void print()  {    D[top].display();  } } public class Wrdcnt {   public static void main(String[] args)throws Exception   {   //  Dictionary D[]=new Dictionary() ;     String st="";     String p="";     System.out.println("Enter String: ");     Scanner in= new Scanner(System.in);     st=in.nextLine(); /*    no of words*/     int n=count(st);     int j=0;     System.out.println("No of words: "+n);     stack stck =new stack(n);     for(int i=0;i<=st.length();i++)      {       if(i==st.length())        {         p = st.substring(j,i);          System.out.println(""+p);          stck.check(p);          System.out.println("Checking done for word: "+p);                                     j=0;         break;        }                if(st.charAt(i)==' ')         {          p = st.substring(j,i);          System.out.println(""+p);          stck.check(p);          j=i+1;          System.out.println("Checking done for word: "+p);                   }      }   }   public static int count(String s)   {     int w=0;     for(int i=0;i<s.length();i++)      {            if(s.charAt(i)==' ')                {                    w++;                }      }    return (w+1);   } }   output:     Enter String:   Roses are red   No of words: 3   Roses   top=-1   pushing Roses   top==0   Exception in thread "main" java.lang.NullPointerException          at stack.push(Wrdcnt.java:51)            at stack.check(Wrdcnt.java:61)            at Wrdcnt.main(Wrdcnt.java:117)


I am confused as to when commas are supposed to be used before the conjunction and.    answers it but I am still a bit confused.   For instance the following two sentences:         I am going to buy apples, oranges, and bananas at the store.    I am going to buy apples, oranges and bananas at the store.       Which of the above sentences is the correct usage of a comma?


Is there a way to edit a Connected App from Apex code?

I'm looking for a way to edit some fields from a Connected App using Apex code. Is there a way to do it? For example, I want to add a Profile to the 'Connected App Allowed Profiles List'. Thank you in advance!


Difference Between Ubuntu and Ubuntu-Gnome

Hai all I just want to know is there any Difference Between  and . I love to use Ubuntu... But I hate the Unity desktop... So want an Ubuntu system with GNOME 3. So if I install Ubuntu GNOME is that same as that of a usual Ubuntu with the GNOME desktop installed?  I just want to know, does this mean if I install Ubuntu GNOME 14.04.2 then everything other than the desktop is same as in Ubuntu 14.04.2?


JavaScript Regular Expression to linkify text not in tags

I have been using the following linkify code for a while:  return str.replace(/(\s|^)(mailto\:|(news|(ht|f)tp(s?))\:\/\/\S+)/g,'$1$2') .replace(/(\s|^)@(\w+)/g, '$1@$2') .replace(/(\s|^)#(\w+)/g, '$1#$2');   I now have a scenario where a user can add images, youtube iframes, etc. So I need to wrap links around strings outside these tags.  Side note: I can limit what tags can be added and control the format of these tags.  Any suggestions?


How to get world clocks to show on the task bar in Ubuntu 18.04

I make extensive use of the multiple timezone clock feature in 16.04.  After upgrading to Ubuntu 18.04 I found various guides that installing GNOME Clocks and adding time zones I should see them in the dropdown when I click the clock on the taskbar.  However it isn't showing up in there, despite restarting a few times.  I also installed GNOME Weather and its section shows now in the clock dropdown.  Has anyone else had this problem? Ideas on how to fix this?


How to get `pwd` in the shell script that was started by another shell script

startScript.sh is in /root/script/startScript.sh  script1.shis in /root/script/test/script1.sh  script2.sh  is in /root/script/test/script2.sh  startScript.sh looks like below  #!/bin/bash #some code! sh `pwd`/test/script1.sh 2>&1 & sh `pwd`/test/script2.sh 2>&1 & #some code   script2.sh and script1.sh look like below  #!/bin/bash > `pwd`/process_ids.txt while true;do   echo "The Process: `ps`" >> `pwd`/process_ids.txt   #some code to parse the process, etc. and echo it done   Here is the thing is, the process_ids.txt file is creating in /root/script. But according to scriptx.sh the pwd is /root/scripts/test/. I displayed the pwd in scriptx.sh, it is showing /root/script/. How can I get the pwd of scriptx.sh?


Any simpler proof of Sylvester’s criterion for positive-semidefinite matrices?

I have seem one proof . However it involves concepts like exterior algebra. For positive definite matrix there is a proof for Sylvester's criterion by . I am wondering if there is any simpler proof for positive semi-definite matrix. Thanks!


Converting point layer to raster grid that shows frequency of points per cell uisng QGIS

I have a point layer that shows the distribution of a species.   Is it possible in QGIS to convert this point layer to a raster grid in which the value of each cell corresponds with the amount of points within that cell?   Until now, I only managed to attach attribute values to the grid cells. I have already added a column in my attribute table that has the value '1' for each point, hoping that there is a way to use a sum of attributes for each grid cell.


What's the recommended torque of the front caliper bolt for a carbon fork?  The Fork is from a Felt F1. I don't want to damage the fork from over thightening.


error: SELF_REFERENCE_FROM_TRIGGER while updating child records

I have written a trigger for before update and after insert function  trigger EstimateBudgetPerMonth on Opportunity__c(after insert, before update) {     Date startDate = Date.newInstance(2008, 1, 1);     Date endDate = Date.newInstance(2008, 1, 30);     Set < Id > oppId = new Set < Id > ();     Integer totalBudget;     for (Opportunity__c opp: Trigger.new) {         startDate = opp.Campaign_Start_Date1__c;         endDate = opp.Campaign_End_Date1__c;         totalBudget = Integer.valueOf(opp.Budget1__c);         oppId.add(opp.Id);     }      InsertBudgetOpp insertRec = new InsertBudgetOpp();     InsertBudgetOpp updateRec = new InsertBudgetOpp();        if (Trigger.isInsert) {         System.debug('--===Insert==--#--===Insert==--#--===Insert==--');          List < Budget_Allocation__c > baList = insertRec.insertChild(oppId, startDate, endDate, totalBudget);          insert baList;      } else if (Trigger.isUpdate) {         System.debug('--===Update==--#--===Update==--#--===Update==--');          Map < String, Budget_Allocation__c > baNewMap = updateRec.updateChild(oppId, startDate, endDate, totalBudget);          upsert baNewMap.values();     }    }    Its throwing the below error.     Error: Invalid Data.  Review all error messages below to correct your   data. Apex trigger EstimateBudgetPerMonth caused an unexpected   exception, contact your administrator: EstimateBudgetPerMonth:   execution of BeforeUpdate caused by: System.DmlException: Upsert   failed. First exception on row 0 with id a0Up00000000FHJEA2; first   error: SELF_REFERENCE_FROM_TRIGGER, Object (id = a06p0000000N3WU) is   currently in trigger EstimateBudgetPerMonth, therefore it cannot   recursively update itself: []: Trigger.EstimateBudgetPerMonth: line   38, column 1


I have a file /tmp/test.csv created by the mysql process (SELECT * INTO OUTFILE), thus having mysql:mysql ownership.  Problem: I'd like to rewrite the chmod from within the mysql console:  mysql --user=root --password=rootpw --database=$DB -e "system chown other:other /tmp/test.csv"   Result:  chown: changing ownership of '/tmp/test.csv': Operation not permitted   This is strange because the mysql proces actually owns the file, but why can't it be changed?


Electromagnetic wave properties of light vs radio waves

Both light and radio waves are electromagnetic waves.that means they have almost similar properties. Both are EM waves ,E and H fields are there in both waves.....but My question is "radio waves can pass through walls ,but why can't a light pass through walls or opaque medium???


I have a simple problem, but I am having a hard time getting the concept.  I have an array of doubles (doublesarray) and I want to slice the array so that I get the last "x" values.  x could be 2,5,7,12,etc  example:  doublesarray = {0,2,4,5,7,8,2,4,6}; doublesarray.slice(-4,-1);  output: [8,2,4,6]   doublesarray.slice(-2,-1); output: [4,6]   Attempt:  I found some code online that slices, but it does not handle 2 negative inputs.  public static class Extensions {     /// <summary>     /// Get the array slice between the two indexes.     /// ... Inclusive for start index, exclusive for end index.     /// </summary>     public static T[] Slice<T>(this T[] source, int start, int end)     {         // Handles negative ends.     if (end < 0)     {         end = source.Length + end;     }     int len = end - start;      // Return new array.     T[] res = new T[len];     for (int i = 0; i < len; i++)     {         res[i] = source[i + start];     }     return res;     } }


What is the fastest/most efficient way to find the highest set bit (msb) in an integer in C?

If I have some integer n, and I want to know the position of the most significant bit (that is, if the least significant bit is on the right, I want to know the position of the furthest left bit that is a 1), what is the quickest/most efficient method of finding out?  I know that POSIX supports a ffs() method in strings.h to find the first set bit, but there doesn't seem to be a corresponding fls() method.  Is there some really obvious way of doing this that I'm missing?  What about in cases where you can't use POSIX functions for portability?  Edit: What about a solution that works on both 32 and 64 bit architectures (many of the code listings seem like they'd only work on 32 bit ints).


Gparted has no option to shrink partition

I need to shrink a linux partition. All gparted options are greyed out. I see "greyed out" questions being asked for gparted in this forum since 2012, and no one fixed it, 8 years latter. No gui option should ever be greyed out. Use an error message instead. Now how can I shrink the partition, or even debug anything, if there is not even an error message?


The question I'm asking is pretty much:  How do you convert PSI to Velocity?  Everywhere I look it says You can't, but can you?  And what would you need to know to do so if there is no direct way to convert?  My homework is to convert 0.14 PSI into m/s.  EDIT Sorry guys my teacher does like being tricky, no clue why. Sorry for any inconvenience this may have caused.


SObject.addError() method does not prevent DML Operation

I want to prevent DML operations during certain processing-situations and provoke a Database.SaveResult with an Database.Error[]-List.  According to , the method addError() should "prevent any DML operation from occurring". As it turns out, this is not true. The following code commits the record to the database without any errors.  Account a = new Account(Name = 'Valid Corp Name Ltd.'); a.addError('Error one'); a.addError('Error two'); Database.SaveResult sr = Database.insert(a, false); System.debug(sr.isSuccess()); System.debug(sr.getErrors());   Debug log:  16:11:01:548 USER_DEBUG [5]|DEBUG|true 16:11:01:548 USER_DEBUG [6]|DEBUG|()   How can I prevent a record from beeing commited? I am aware of the similar question , which did not get answered. So I am trying again.


If everyone expects index funds to increase in value in the future, wouldn't future returns be zero?

Suppose everyone expects Apple to increase its earnings by 20% next year. Due to the general expectation, the current stock price will incorporate this information. For example, if subsequently Apple reports earnings that vindicates everyone's expectations, Apple's stock price will change by approximately $0, ceteris paribus. From my understanding, if everyone has the same expectations of an investment, the NPV of the investment is $0, because the expectations will be priced-in in such a way that makes the NPV = $0. I've been looking at index funds (e.g. S&P 500 ETFs). These funds seem to be commonly recommended for people with long investment horizons who want a passive diversified exposure to stocks. It appears that index funds are generally recommended on the basis that they "tend to increase in value over the long-run". From my observations, this "passive index fund investing" style has a very large following, especially in the US. For the moment, let us ignore the potential objections to the belief that index funds "tend to increase in value over the long-run", and let us assume that index funds are really going to increase in value in the future. Issues:  If the value of index funds is generally expected to increase, and people now continue to pump money into index funds in the belief that the values will materialize, wouldn't the future returns be approximately $0, as in the case of Apple illustrated above?  What prevents the future expectations of index fund performance from being priced-in at this very moment, thus ensuring that future returns will be mediocre?


What is the meaning of the function definition in the attached image?

I was reading a research paper, where I came to see the following the function definition and set definition. So what is 2^(R^n) here and what is the set X. Can somebody please provide examples also. Any thoughts will be very much helpful for me. Thank you in advance. Here are the images:  and


Today I was using the graph located in the  for my own profile in Stack Overflow:        As you can see it says select an area by dragging across the lower chart  But nothing happens if try to drag or click anywhere in the lower chart. I didn't know if this was something I was not understanding and so I tried the same in my profile at  as follows:        As you can see, there I can click and drag to select and area and it works just fine.  Is this a javascript bug maybe? Am I the only one for whom this happens?   EDIT:  Just tried with Firefox and it works fine. I use google chrome and it does not work even if I try with a new incognito window. I have Ubuntu 12.10 if it matters. Chrome version: Version 40.0.2214.93 (64-bit)


So I sometimes see messages flagged in chat and get the options "approve" "disagree" or something else.  Are there guidelines about how to deal with these flags? I couldn't find any (I didn't look very hard).  If there aren't any, let's have a CW answer here to make some.


Showing $\int_{0}^{\infty} \frac{\sin{x}}{x} \ dx = \frac{\pi}{2}$ using complex integration

Recently I had to use the fact that the Dirichlet integral evaluates as  $$\int_{0}^{\infty} \frac{\sin{x}}{x} \ dx = \frac{\pi}{2}$$ a couple of times.   There already is a question that specifically ask for methods to show this result $\textbf{not}$ using complex integration. In this question I am interested in seeing the derivation via contour integration. ( I am aware of the wikipedia entry, but am looking for more detail )


Is there anyway someone could get some sort of malware onto the Ubuntu Software Center? Or is it all checked thoroughly before being added to the official repositories?


How can I find such a $z$? (Injectivity of $T(z) = \lambda z + \mu\bar{z}$)

We consider $T:\mathbb{C}\to\mathbb{C}$ defined by $T(z)=\lambda z+\mu\overline{z}$, where $\lambda ,\mu\in\mathbb{C}$. I want to prove that if $T$ is injective, then $\lambda\cdot\overline{\lambda}\neq\mu\cdot\overline{\mu}$.  Clearly, if $\mu =0$, then $\lambda\neq 0$ because $T$ is injective.  Now, if $\lambda\cdot\overline{\lambda}=\mu\cdot\overline{\mu}$ and $\mu\neq 0$, then I wanted to find a $z\in\mathbb{C}\setminus\{0\}$ such that $z=-\dfrac{\overline{\lambda}}{\overline{\mu}}\overline{z}$, because we would have that:  $T(z)=-\lambda\dfrac{\overline{\lambda}}{\overline{\mu}}\overline{z}+\mu\overline{z}=\overline{z}(-\lambda\dfrac{\overline{\lambda}}{\overline{\mu}}+\mu)=0$  ('Cause this would prove that $\lambda\cdot\overline{\lambda}=\mu\cdot\overline{\mu}$ implies $T$ is not injective.)  So, the question is, can we always find such a $z\in\mathbb{C}\setminus\{0\}$?


Use keyboard shortcut automatically in nano?

I'd like the line numbers to show automatically whenever I use nano. I've seen the set const command in ~/.nanorc but I want to see the line numbers in the column to the left, activated by meta-# within nano. Is there a way to automatically use meta-# whenever I use nano without having to do it myself?  Thanks


Is apt-get update and upgrade necessary?

If I've already executed both apt update and apt upgrade, do I need to do the same with apt-get?


I'm looking to write some Groovy code to perform tasks inside of install anywhere but because of the platforms we support I'm restricted to java 1.5.  Any idea if this will be sufficient to run the latest groovy?


How to deal with hierarchical / nested data in machine learning

I'll explain my problem with an example.  Suppose you want to predict the income of an individual given some attributes: {Age, Gender, Country, Region, City}. You have a training dataset like so  train <- data.frame(CountryID=c(1,1,1,1, 2,2,2,2, 3,3,3,3),               RegionID=c(1,1,1,2, 3,3,4,4, 5,5,5,5),               CityID=c(1,1,2,3, 4,5,6,6, 7,7,7,8),               Age=c(23,48,62,63, 25,41,45,19, 37,41,31,50),               Gender=factor(c("M","F","M","F", "M","F","M","F", "F","F","F","M")),              Income=c(31,42,71,65, 50,51,101,38, 47,50,55,23)) train    CountryID RegionID CityID Age Gender Income 1          1        1      1  23      M     31 2          1        1      1  48      F     42 3          1        1      2  62      M     71 4          1        2      3  63      F     65 5          2        3      4  25      M     50 6          2        3      5  41      F     51 7          2        4      6  45      M    101 8          2        4      6  19      F     38 9          3        5      7  37      F     47 10         3        5      7  41      F     50 11         3        5      7  31      F     55 12         3        5      8  50      M     23   Now suppose I want to predict the income of a new person who lives in City 7.  My training set has a whopping 3 samples with people in City 7 (assume this is a lot) so I can probably use the average income in City 7 to predict the income of this new individual.  Now suppose I want to predict the income of a new person who lives in City 2. My training set only has 1 sample with City 2 so the average income in City 2 probably isn't a reliable predictor.  But I can probably use the average income in Region 1.  Extrapolating this idea a bit, I can transform my training dataset as      Age Gender CountrySamples CountryIncome RegionSamples RegionIncome CitySamples CityIncome  1:  23      M              4         52.25             3        48.00           2    36.5000  2:  48      F              4         52.25             3        48.00           2    36.5000  3:  62      M              4         52.25             3        48.00           1    71.0000  4:  63      F              4         52.25             1        65.00           1    65.0000  5:  25      M              4         60.00             2        50.50           1    50.0000  6:  41      F              4         60.00             2        50.50           1    51.0000  7:  45      M              4         60.00             2        69.50           2    69.5000  8:  19      F              4         60.00             2        69.50           2    69.5000  9:  37      F              4         43.75             4        43.75           3    50.6667 10:  41      F              4         43.75             4        43.75           3    50.6667 11:  31      F              4         43.75             4        43.75           3    50.6667 12:  50      M              4         43.75             4        43.75           1    23.0000   So, the goal is to somehow combine the average CityIncome, RegionIncome, and CountryIncome while using the number of training samples for each to give a weight/credibility to each value. (Ideally, still including information from Age and Gender.)  What are tips for solving this type of problem? I prefer to use tree based models like random forest or gradient boosting, but I'm having trouble getting these to perform well.  UPDATE  For anyone willing to take a stab at this problem, I've generated sample data to test your proposed solution .


Difference between "been to" and "been in"

In the following two examples, what is the difference between the usage of been to and been in? They seem like they have the same meaning but I’m not sure.     -Have you ever been to Florida?   -Yes, I’ve been to Florida many times.              -Have you ever been in Florida?   -Yes, I’ve been in Florida many times.


What's wrong with this command block code?

I am trying to check if I am in a spesific area and I use command blocks for that: This is the code I use:     testfor @p[r=4,name=<\miner11crafter>]   It should be right acording to this syntax I found on the :     testfor @p[r=5,name=<\owner>]    \ is neccesary for the formatting in SO otherwhise you can't see my name and stuff. What am I doing wrong ?


when i am trying to install required plug-ins to play music,the following notice is coming:  Failed to fetch http:/bd.archive.ubuntu.com/ubuntu/pool/universe/libd/libdvdread/libdvdread4_4.2.0+20121016-1ubuntu1.1_i386.deb 403  Forbidden Failed to fetch http:/bd.archive.ubuntu.com/ubuntu/pool/universe/libd/libdvdnav/libdvdnav4_4.2.0+20130225-1ubuntu0.1_i386.deb 403  Forbidden Failed to fetch http:/bd.archive.ubuntu.com/ubuntu/pool/universe/libm/libmad/libmad0_0.15.1b-7ubuntu2_i386.deb 403  Forbidden Failed to fetch http:/bd.archive.ubuntu.com/ubuntu/pool/universe/l/lame/libmp3lame0_3.99.5+repack1-3_i386.deb 403  Forbidden Failed to fetch http:/bd.archive.ubuntu.com/ubuntu/pool/universe/m/mpeg2dec/libmpeg2-4_0.5.1-5_i386.deb 403  Forbidden Failed to fetch http:/bd.archive.ubuntu.com/ubuntu/pool/universe/o/opencore-amr/libopencore-amrnb0_0.1.3-2_i386.deb 403  Forbidden Failed to fetch http:/bd.archive.ubuntu.com/ubuntu/pool/universe/o/opencore-amr/libopencore-amrwb0_0.1.3-2_i386.deb 403  Forbidden Failed to fetch http:/bd.archive.ubuntu.com/ubuntu/pool/universe/x/x264/libx264-123_0.123.2189+git35cf912-1_i386.deb 403  Forbidden Failed to fetch http:/bd.archive.ubuntu.com/ubuntu/pool/universe/a/a52dec/liba52-0.7.4_0.7.4-16build1_i386.deb 403  Forbidden Failed to fetch http:/bd.archive.ubuntu.com/ubuntu/pool/universe/libs/libsidplay/libsidplay1_1.36.59-5_i386.deb 403  Forbidden Failed to fetch http:/bd.archive.ubuntu.com/ubuntu/pool/universe/t/twolame/libtwolame0_0.3.13-1build1_i386.deb 403  Forbidden Failed to fetch http:/bd.archive.ubuntu.com/ubuntu/pool/universe/g/gst-plugins-ugly1.0/gstreamer1.0-plugins-ugly_1.0.6-1_i386.deb 403  Forbidden    what should I do now?....and is there any better Music Player than Rhythmbox? (i had to cut off one '/' after every http,cause i am not allowed to post more than 2 links.


How should I handle a paper with incorrect experimental results?

We found that a paper, published in an important CS conference, presents incorrect results in its experimental evaluation section.  Merely reading the paper is not sufficient to spot these mistakes, as the source of incorrectness lies within the the experimental evaluation and none of the algorithms/pseudo-code presented in the paper seems to be affected by it. That somehow explains how the error made it past the peer-review barrier.  We are currently in the process of circumscribing to what extent the results are incorrect. This is made difficult by the fact that the authors did not provide sufficient information to fully reproduce/verify their original experiment (not even upon gentle request), so we can only verify a limited portion of it (although it is substantial enough to draw our conclusions).  We tend to believe that the authors made a mistake in good faith and that they failed to spot it because they did not double-check the correctness of the results they obtained. We also don't have any reason to believe that the unreproducible portion of their results is incorrect as well.  We want to stress the fact that this problem only affects a subset of their results. The mistake they did somehow invalidates some of the conclusions of the experimental evaluation, although it does not seem to affect it as a whole nor to hinder the perceived worthiness of the algorithms presented in the paper.  We would like to ask what would be the best approach for disclosing this 'finding'.   It would seem the first, and most sensible step, is that to inform the authors about the issue. Then what? What should we expect them to do? Are there any other options?


Can we burn all forms of the  tag? Its too vague of a term.


How to remove, and not just hide, a question

Is there a way to definitively remove a question that I have, such that it no longer exists in any form on the site, and not just hide it from most users?


Removing string(s) within delimiter chars from another string C#

I think this should be a pretty simple solution but I am having trouble. I am trying to remove all strings within {} including the brackets from another string, and replace them with the string "^~". For example:   input: "{asdf} Hello Stack {over} flow you all are {very} helpful."  output: "^~ Hello Stack ^~ flow you all are ^~ helpful.  Currently I am using regular expressions but this only works to replace strings with only one delimited string. Heres my code and the output:       System.Diagnostics.Debug.WriteLine("s: " + s);      string regex = "(\\{.*\\})";     string output = Regex.Replace(s, regex, "^~");     System.Diagnostics.Debug.WriteLine("output after replace:" + output);      s: {Name}, {Time}, {Date}     output after replace: ^~      s: and {} inches long.     output after replace: and ^~ inches long.      s: {Person}'s {} lbs. {} oz.     output after replace: ^~ oz.   As you can see it works with strings with only one {} but I get an error when there is more than one. There must be something simple I'm doing wrong but I'm not too knowledgable of regular expressions and can't seem to find the answer anywhere.   Perhaps there is an easier way to do this without regular expressions also?


I was said that can exists simple algebras $A$ that are not semi-simples in the following sense:   $A$ is simple, i.e. doesn't have non trivial ideals; $A$ is not semi-simple, i.e. is not a semi-simple module over itself.   Does anybody has an example? Thanks in advance


Fantasy novel from the 90's. Maybe earlier. I can't remember the title

At the beginning the villain is lured to a meeting where an attempt is made on his life. Another character fired a projectile out of a cane which wounded him but he was able to magic up a shield or something to avoid death. There's also a bit later on where our protagonist (young male) has sex with a woman. There are elements of BDSM. She ties him up if I recall correctly. I think him and his companions are guests at her home.


Need help in proving that $4$ divides $n$.

I'm pretty sure this question has a duplicate, but since I can't seem to find it, I'm asking it again.  If $a_{1},a_{2}...a_{n}$ are $1$ or $-1$ and if,$$a_{1}a_{2}a_{3}a_{4}+a_{2}a_{3}a_{4}a_{5}+...+a_{n}a_{1}a_{2}a_{3}=0$$prove that $n$ is divisible by $4$.  What I've done so far is manage to prove that $n$ is even, which is pretty obvious. I haven't come up with any workable leads so far, so I'd be much obliged if you could give me some pointers.


Passive Voice with ''to be to be and past participle''

This Association’s standards are to be used globally for all ABC related Engineering issues. My question is that is ''are to be used'' passive structure? And if it is, what type is it. Because I can not see this kind of structure when I check the passive voice chart.


Can a multi-class Bard/Wizard write spells known from Bard, into Wizard spellbook?

Can a multi-class Bard/Wizard write spells known from their Bard class, into their wizard spellbook?  e.g. they know the Comprehend Languages as a Bard spell, and want to write it directly into their wizard's spellbook?  And what is the cost? ... i.e. 1 hour and 10 gp because they know it, or 2 hours and 50 gp because they  have to experiment with casting it as a wizard?


How can I install an older version of Firefox?

I have installed Ubuntu 14.04, which already has Firefox v31. I want to install an older version of Firefox. How can i do it?


My project shows in the viewer, but is black in the final render

So i can see the preview in the backdrop and the image editor, but if i render the picture or the animation, i'll just get black frames. I probably missed something simple, but haven't found the source of the issue yet.  I have rendered images and movies before with the node editor, but something's just wrong this time. I'm not a super experience blender user though.  On another note, blender seems to force windows aero off for me? Would a reinstall fix this or is there another way?


Wrong rendering - \sqrt interesting shape (\sqrt not slanted)

Unfortunately I'm not able to provide a MWE, because this error apparently is not reproduceable in another document  As you can see in the picture, the upper sqrt is somehow tilted...  There is nothing in the log related to this part.  Any idea, what this could be?  \documentclass[ titlepage, 12pt, a4paper, parskip=half, oneside, %   bibtotoc, %   listof=nochaptergap, final  % Status des Dokuments (final/draft) ]{scrbook}  \usepackage[T1]{fontenc} \usepackage{lmodern} \usepackage[ngerman]{babel} \usepackage{amsmath} %Mathe Umgebung  \begin{document}  \begin{align} I_{max}&=  \sqrt{\dfrac{P_{nom}-\frac{P_{nom}}{T_{max}-T_{nom}} \cdot(T_{max}-T_{amb})}{R}} \label{gl:resis-power1}\\ I_{max}&= \sqrt{\dfrac{P_{nom}-\frac{P_{nom}}{155^\circ C-70^\circ C}\cdot(155^\circ C-T_{amb})}{R}} \label{gl:resis-power2}  \end{align}  \end{document}


How do I speed up Mac boot to the ready desktop in El capitan

My computer has become slow to fully boot since updating to 10.11. This isn't helped by Applications (including their previous windows) reopening automatically post login. I am aware that this is part of the default Mac OS experience and I've seen answers that involve checking a box when restarting, although I would prefer a permanent fix to disable this particular function and any other advice to improve my iMacs startup efficiency.


Simple SELECT/WHERE query slow. Should I index a BIT field?

The following query takes 20-25 seconds to run  SELECT * from Books WHERE IsPaperback = 1   Where IsBundle is a BIT field. There's about 500k rows, and about 400k currently have this field set.   I also have a BIT field called IsBundle and only 900 records have this set. Again, execution time is about 20-25 seconds.  How can I speed up such a simple query?


Premium Economy Class Seat Availability on British Airways

Is there a way to see available seats before purchasing in Premium Economy Class on British Airways? I have already read the answers/tips in the linked duplicate "Can I see which seats are available on a British Airways flight before I book?" Those solutions work when booking Economy or Business Class, but none of those solutions work when trying to book Premium Economy. Any further suggestions are appreciated.


According to  documentation, we must use JavaScript (Perl 5) regular expressions : . What pattern do you use for email validation in Dart? Is there any different way than JavaScript to achieve this in Dart?


Installed Iso for amd instead of Intel iso

So recently I changed my computers OS from Windows XP to Ubuntu 16.4. I was installing it using a flash drive and all my programs (that I needed) are on my laptop, so I decided to also download the ISO image on my laptop. Now, my Laptop has AMD hardware but the pc has intel hardware and since i first installed it, Ive been having tons of program errors because of it. Also my antivirus (ClamAV) gives errors when i scan files and it would be great to have working antivirus right now.   It would be amazing if someone could help me get the Intel version of Ubuntu 16.4 so I could fix it.  The computer is a Dell OptiPlex 745 with an Intel Core 2 (1.80GHz) CPU.


Can you brew wine, or is the word "brew" specific to Beer, coffee, and tea?

I would like to know whether or not wine can be brewed, and secondly if the wine-making process is considered brewing. It seems that some definitions are specific to beer, coffee, and tea, where others are not.


Finite abelian group contains an element with order equal to the lcm of the orders of its elements

I will quote a question from my textbook, to prevent misinterpretation:     Let $G$ be a finite abelian group and let $m$ be the least common multiple of the orders of its elements. Prove that $G$ contains an element of order $m$.   I figured that, if $|G|=n$, then I should interpret the part with the least common multiple as $lcm(|x_1|,\dots,|x_n|)=m$, where $x_i\in G$ for $0\leq i\leq n$, thus, for all such $x_i$, $\exists a_i\in\mathbb{N}$ such that $m=|x_i|a_i$. I guess I should use the fact that $|x_i|$ divides $|G|$, so $\exists k\in \mathbb{N}$ such that $|G|=k|x_i|$ for all $x_i\in G$. I'm not really sure how to go from here, in particular how I should use the fact that $G$ is abelian.


Prove that $Z(S_n)$ is trivial for $n \geq 3$

Hi I am trying to solve this question I don't know where to begin but I have an idea so we have   $$Z(G) = \{x \in G \space  |\space  xy = yx \space\forall y \in G\}$$  We must show that for all $\sigma$ $\in S_n$ such that $\sigma \neq (1)$ Then there exists y $\in S_n$ such that $\sigma * y$ $\neq$ $y * \sigma$. However I don't know how to proceed further.   I was thinking I could use conjugation somehow but I don't know what would I do with them.


while sudo apt-get -f install i got following error how to fix it

Preconfiguring packages ... dpkg: error processing /var/cache/apt/archives/gcc-4.8-base_4.8.2-19ubuntu1_amd64.deb  (--unpack):  package architecture (amd64) does not match system (i386)  Errors were encountered while processing:  /var/cache/apt/archives/gcc-4.8-base_4.8.2-19ubuntu1_amd64.deb E: Sub-process /usr/bin/dpkg returned an error code (1)


Here's the traditional Winter Bash hats post. Same as last year there are two (and only two) answers: one for the secret hats, and one for the regular hats.     Remember there are no hats for guessing secret hat triggers, nor one for pinging SE employees.   Only edit the secret hat answer with definitive and correct triggers. This is not the place to post guesses. Please put secret hat triggers in a . If you'd like to discuss hats further and/or work towards identifying what their triggers are, please do so in the . Note comments are not meant for extended conversation, discussion etc of any hat, use the  for that.  If there are regular hats that are not listed yet, please edit and add them. If you know more specific info about one of the hats (example: time zones), edit that in, a source would be preferable.  Here are some of the hats of previous Winter Bashes:     Because It's important to know your history... in more ways than one


App version: 1.0.27  When I try edit a post on the app I get a notification saying: "Account is not allowed to suggest edits" . I can edit the same post if I try and do it on the browser.


Cipher vs Cypher - British English vs American English

As an English author but long time resident of America, I recently wrote a historical spy thriller that delved deeply into coded messages. I often caught myself writing cipher and cypher. Although I eventually used cipher exclusively the plot was mainly located in England and France.  Would cypher have been a better choice?


Why is the standard deviation defined as sqrt of the variance and not as the sqrt of sum of squares over N?

Today I taught an introductory class of statistics and a student came up to me with a question, which I rephrase here as: "Why is the standard deviation defined as sqrt of variance and not as the sqrt of sum of squares over N?"  We define population variance: $\sigma^2=\frac{1}{N}\sum{(x_i-\mu)^2}$   And standard deviation: $\sigma=\sqrt{\sigma^2}=\frac{1}{\sqrt{N}}\sqrt{\sum{(x_i-\mu)^2}}$.   The interpretation we may give to $\sigma$ is that it gives the average deviation of units in the population from the population mean of $X$.   However, in the definition of the s.d. we divide the sqrt of the sum of squares through $\sqrt{N}$. The question the student raises is why we do not divide the sqrt of the sume of squares by $N$ instead. Thus we come to competing formula: $$\sigma_{new}=\frac{1}{N}\sqrt{\sum{(x_i-\mu)^2}}.$$ The student argued that this formula looks more like an "average" deviation from the mean than when dividing through $\sqrt{N}$ as in $\sigma$.  I thought this question is not stupid. I would like to give an answer to the student that goes further than saying that the s.d. is defined as sqrt of the variance which is the average squared deviaton. Put differently, why should the student use the correct formula and not follow her idea?  This question relates to an older thread and answers provided . Answers there go in three directions:   $\sigma$ is the root-mean-squared (RMS) deviation, not the "typical" deviation from the mean (i.e., $\sigma_{new}$). Thus, it is defined differently. It has nice mathematical properties. Furthermore, the sqrt would bring back "units" to their original scale. However, this would also be the case for $\sigma_{new}$, which divides by $N$ instead.   Both of points 1 and 2 are arguments in favour of the s.d. as RMS, but I do not see an argument against the use of $\sigma_{new}$. What would be the good arguments to convince introductory level students of the use of the average RMS distance $\sigma$ from the mean?


Unable to switch on wi fi on acer aspire ES 15 with Ubuntu 16.04

I have a dual boot Acer Aspire ES 15 with ubuntu 16.04 and windows7. sometimes i am not able switch on wifi in ubuntu while wifi works perfectly in windows 7. I have to log into windows and then come back to ubuntu for wifi to be start getting connected.  The hardware key for wifi Fn+F3 is not working to in ubuntu.  $ lspci -knn | grep Net -A2 02:00.0 Network controller [0280]: Qualcomm Atheros QCA9565 / AR9565    Wireless Network Adapter [168c:0036] (rev 01)   Subsystem: Lite-On Communications Inc QCA9565 / AR9565 Wireless Network Adapter [11ad:0642]   Kernel driver in use: ath9k   Kernel modules: ath9k  $ rfkill list all 0: phy0: Wireless LAN    Soft blocked: no    Hard blocked: yes  1: acer-bluetooth: Bluetooth    Soft blocked: no    Hard blocked: no  2: hci0: Bluetooth    Soft blocked: no    Hard blocked: no


Why hasn't my Nexus 6 received Android M?

I've tried researching and I cannot find any explanation for this. About 2 weeks after Android 6 was released I did get a security update for lollipop but nothing since then. Everyone I know with a Nexus 5 has it, but I don't know anyone with a Nexus 6 besides myself. Why is my Nexus 6 not getting updated?  My phone is unlocked, but I do use T-Mobile.  Thanks


Explain why   $\sum_{i=0}^n {(-1)^i}{n \choose i} = 0$   I'm pretty sure know how to prove this using the Binomial Theorem:  $\sum_{i=0}^n {(-1)^i}{n \choose i}$  $ =(-1)^0{n \choose 0}+(-1)^1{n \choose 1}+(-1)^2{n \choose 2}+(-1)^3{n \choose 3}+ ... + (-1)^{n-1}{n \choose n-1}+(-1)^n{n \choose n}$  $={n \choose 0}-{n \choose 1}+{n \choose 2}-{n \choose 3}+...+(-1)^{n-1}{n \choose n-1}+(-1)^n{n \choose n} $  ${n \choose 0}={n \choose n}, {n \choose 1}={n \choose n-1}$, etc etc.  All of these are cancelled out and you're left with 0.  But how would you do this proof through finding a bijection? Is it something like:  Let M be the set of all even numbers. Let N be the set of all odd numbers.  For every $m \in M$ there exist an $n \in N $ such that $M \rightarrow N$  Or is it related to how ${n \choose 0}={n \choose n}, {n \choose 1}={n \choose n-1}$?   I'm totally new to this type of proof so I'm completely at a loss, any help would be appreciated.


Unable to locate package while installing software

Whenever I try to install (any) software using the terminal, the terminal is giving an output like:  E:Unable to locate package   Kindly help, as I am new to Ubuntu 12.04


$f,g$ continuous from $X$ to $Y$. if they are agree on a dense set $A$ of $X$ then they agree on $X$

Problem:      Suppose $f$ and $g$ are two continuous functions such that $f: X \to Y  $ and $g : X \to Y $. $Y$ is a a Hausdorff space. Suppose $f(x) = g(x)  $ for all $x \in A \subseteq X $ where $A$ is dense in $X$, then $f(x)  = g(x) $ for all $x \in  X $.   Attempt at a solution:  Put $h(x) = f - g $. Therefore, $h: X \to Y $ is continuous and $Y$ is Hausdorff by hypothesis. Also we know $h(x) = 0 $ for all $x \in A $ such that $A$ is dense in $X$. I want to show that $h(x)$ vanishes everywhere in $X$. We can show $h(x) = 0 $ for all $x \in X \setminus A $. Suppose $h(x) > 0 $ on $X \setminus A$. Pick points $y_1,y_2 \in Y $. Since $Y$ is Hausdorff, can find open set $O_1, O_2 \subseteq Y $ which are disjoint such that $y_1 \in O_1$ and $y_2 \in O_2$. By continuity, $f^{-1}(O_1), f^{-1}(O_2)$ are open in $X$.   I know that if I can show that one of the $f^{-1}(O_i)$ lies in $X \setminus A $, then we would have a contradiction since we have non-empty open set in $X \setminus A$ and this implies $A$ cannot be dense in $X$. But this is the part I am stuck. Any help would greatly be appreciated.  Also, Would be be possible to prove this without using the Hausdorff condition on $Y$?


Steam - Disable Two Factor Authentication

Is there a way to disable the Steam two factor authentication?  In other words, when I type my user and pwd, I want to be logged in.  I don't want to wait for Steam to email me some code if it "doesn't recognize me".  I have looked through the steam client settings and I can't find a setting for disabling the email.


I came across with the lemma below on Isaac's Algebra:  Lemma. Let $F \subseteq R$, where F is a field and R is a domain. If $|R:F|<\infty$ then R is a field.  As far as I know, $|E:F|$ denotes the degree of a field extension so here, $E$ is a field. In the book it is said that when "an integral domain $R$ contains a field $F$, this forces $R$ to be a unitary overring of $F$".  I would like to know how should I think $|R:F|$ as and what does it mean to be a unitary overring of some field?


Binomial coefficient formula: Why the dividend is a multiple of divisor

Looking at the formula for binomial co-effient,  $$ \binom{n}{r}= \frac {n(n-1)...(n-r+1)}{ 1(2)(3)...(r)} $$  I am wondering why $ n(n-1)...(n-r+1) $ is a multiple of $  1(2)(3)...(r) $ .  I understand from the applications of this formula that only integer values makes sense as in $ n C r $. But, why are these two products be related in such a way, purely thinking of them as product of numbers and from algebra, how can we prove that they will always be related that way.


Let $a$ be a p-cycle in $S_p$, and let $b$ be a transposition in $S_p$. Show $S_p$ is generated by $a$ and $b$.

I want to solve the following:     Let $p$ be a prime number and let $a$ be a p-cycle in $S_p$, and let $b$ be a transposition in $S_p$. Show $S_p$ is generated by $a$ and $b$.   My attempt  Write $a=(y_1 \space y_2 \space ...\space y_p)$ and $b=(z_1 \space z_2)$. WLOG, $y_1=z_1=1$. WLOG, we can also assume $a=(1 \space 2 \space ... \space p).$   Let $σ\in S_p$. It should be obvious that $σ$ is a product of transpositions, so to show $σ \in S_p$, it suffices to show every transposition can be written in terms of $(1 \space 2 \space ... \space p)$ and $(1 \space z_2)$. But how do I show this?  Duplicate? I think not.  Although another question (already answered on math.SE) is similar to mine, I do not believe that mine is a duplicate. The other question is equivalent to mine only for the special case when $z_2=2$, but not for general $z_2$.


I would like to add a menu link using the "Link"-Field with Autocomplete, but I would like to add a parameter afterwards.  Pretty much like this:    ...which is not working.  Is that possible? Thanks!


Do you need to claim the one ring for your own to be detected by Sauron?

Sam - Near Crith Ungol:  Sam puts on ring and " Sam hurled himself against the bolted brazen plates and fell senseless to the ground. He was out in the darkness"  He put the ring on before he goes unconscious. He woke up with the ring and The Dark Lord did not detect him.  Already the Ring tempted him, gnawing at his will and reason. Wild fantasies arose in his mind; and he saw Samwise the Strong, Hero of the Age, striding with a flaming sword across the darkened land, and armies flocking to his call as he marched to the overthrow of Barad-dûr. And then all the clouds rolled away, and the white sun shone, and at his command the vale of Gorgoroth became a garden of flowers and trees and brought forth fruit. He had only to put on the Ring and claim it for his own, and all this could be.  Frodo - At Mount Doom:  ‘I have come,’ he said. ‘But I do not choose now to do what I came to do. I will not do this deed. The Ring is mine!’ And suddenly, as he set it on his finger, he vanished from Sam’s sight. Sam gasped, but he had no chance to cry out, for at that moment many things happened.  Something struck Sam violently in the back, his legs were knocked from under him and he was flung aside, striking his head against the stony floor, as a dark shape sprang over him. He lay still and for a moment all went black.  And far away, as Frodo put on the Ring and claimed it for his own, even in Sammath Naur the very heart of his realm, the Power in Barad-dûr was shaken, and the Tower trembled from its foundations to its proud and bitter crown. The Dark Lord was suddenly aware of him...


Bash: How to get different color for the command line and its output?

Basically, I am trying to edit my .bashrc such that when I type ls or whatever I type on the console, it will be displayed in Green color. At the same time, all the results / output displayed by ls or other commands (output from a python / java script) will be displayed in a grey color.   Is this possible ? What would I need to add into the .bashrc file ? Thanks  UPDATE:  Well. Thank you very much for the answers and comments:  I saw from this  that I just have to add the following next to the definition of $PS1  trap '[[ -t 1 ]] && tput sgr0' DEBUG  Then it works. I am not sure there will be any issues. But it seems to work for now.


How do I upgrade to the development release (aka. Ubuntu+1)?

How do I upgrade to the unreleased version of Ubuntu for testing?


Will My Archer Tower Defend In Clan War During Their Upgradation?

Will my archer tower defend in clan war during their upgradation?


Applications losing focus for a few seconds in Windows 7

Recently all of my applications keep losing focus every minute (or so) for a few seconds (then the window gets the focus back). It is very annoying, since I'm typing most of the time and get interrupted by this behavior. Things worked fine until a week ago and I have no idea what is causing this error, but I noticed the mouse moves to a certain point on one of my screens when this happens.  I would appreciate any advice: it starts to drive me crazy...


Elegant way to construct a pipeline based on return value and not exit code?

When the status code is useless, is there anyway to construct a pipeline based on output from stdout? I'd prefer the answer not address the use-case but the question in the scope of shell scripting. What I'm trying to do is find the most-specific package available in the repository by guessing the name based on country and language codes. Take for instance this,  $PACKAGE1=hunspell-en-zz $PACKAGE2=hunspell-en  The first guess is more appropriate but it may not exist. In this case, I want to return hunspell-en ($PACKAGE2) because the first option hunspell-en-zz ($PACKAGE1) does not exist. pipelines of apt-cache The command apt-cache returns success (which is defined by shell as exit-code zero) whenever the command is able to run (from the docs of apt-cache)  apt-cache returns zero on normal operation, decimal 100 on error.  That makes using the command in a pipeline more difficult. Normally, I expect the package-search equivalent of a 404 to result in an error (as would happen with curl or wget). I want to search to see if a package exists, and if not fall back to another package if it exists. This returns nothing, as the first command returns success (so the rhs in the || never runs) apt-cache search hunspell-en-zz || apt-cache search hunspell-en  apt-cache search with two arguments This returns nothing, as apt-cache ANDs its arguments, apt-cache search hunspell-en-zz hunspell-en  From the docs of apt-cache  Separate arguments can be used to specify multiple search patterns that are and'ed together.  So as one of those arguments clearly doesn't exist, this returns nothing. The question What is the shell idiom to handle conventions like those found in apt-cache where the return code is useless for the task? And success is determined only by the presence of output on STDOUT? Similar to    they both stemming from the same problem. The chosen answer there mentions find -z which sadly isn't applicable solution here and is use-case specific. There is no mention of an idiom or constructing a pipeline without using null-termination (not an option on apt-cache)


I'm having this really weird issue that I thought I might ask about. On one of my computers the zero key will not work.  The zero key on the number pad works just fine, the right parenthesis works just fine, When I RDP in and try using the remote keyboard I'm still unable to use the zero key, when I use the alt code (ALT+48) it works and when I use On Screen Keboard I'm still unable to use the zero key.   If I open Microsoft Keyboard Layout Creator and try to test out the keyboard, it won't recognize the zero key either. However, If I click the start button, click on the search box, and press zero the text will disappear (telling me it is recognizing me pressing the key).  I'm pretty sure it's not the keyboard drivers, since it's not working over RDP or with OSK. But it still could be windows drivers, I'm just not sure which ones.  I'm just curious if anyone has had similar issues and might like to shed some light on the issue.


Implementation of "Title Case" in Bibtex

How is "title case" defined in bibtex? Which is the list of words not to  capitalize, and in which file is it defined? Is it possible to change it? I checked the .bst file, but apparently it's delegated to a function change.case whose definition I cannot find.


Navigation between components in lightning

I am trying to build navigation from one component to another in a Lightning application. Following this answer  got me working with one exception, the new page doesn't seem to be in the Salesforce1 navigation context, there is no back arrow when the second component is loaded.   Am I missing something simple? Sure feels like I am.


Is there a Stack Exchange website to discuss software/app licenses?

Is there a Stack Exchange website where you can discuss software,app licenses. What is possible what not. What is legal what not.  For example for software that is dual licensed with GNU v2 and CC3.0, is it possible to create a distro application or something like that?  Or like can you use the student version of Adobe Photoshop for commercial use? Can you use Visual Studio Express for commercial use etc etc.


If the sum of two irreducible fractions is an integer, then the denominators are equal

I have to show the following:"If the sum of two irreducible fractions with positive denominators is an integer, then the denominators are equal." $$\frac{a}{b}+\frac{c}{d}=k, \text{ where k an integer }$$ Since the fractions are irreducible, $(a,b)=1$ and $(c,d)=1$. Right? But how can I continue??


Table of Contents: Customize space between dots before page number?

I am writing a small KOMA-Script scrartcl document with multiple sections. In the table of contents, LaTeX fills the current line with dots between the end of the section name and the page number. Is there any way to customize this behavior? I would like to reduce the space between the single dots (i.e. use more dots in the same space).


I recently bought a green, and a brown coconut (different stages of maturation). I drunk the liquid from the green, young one, which is apparently what you are supposed to do, and it tasted terrible. It was sourish not sweet at all, and had almost like a carbonated feel to it. However, water from the brown coconut (mature) tasted delicious and sweet, and left me much more satisfied. Is there a reason for this, because this is contrary to what I read online.


How to make index entries refer to section numbers and/or figure/table numbers, and replace comma with leaders?

One could use the package makeidx together with the program makeindex to generate index table in his/her LaTeX document, automatically. They are great tools, however, I'm not satisfied with the default outputting style. The default style uses a comma as separative sign of index entry name and the page number(s), and what I need is something like the default table of contents --- using leaders as separator  and referring to the section numbers (but not page number). I've searched and read lots of posts on Internet, and  seems to be the answer to the question. However, I don't know how to migrate them into my document. For these reasons, could I ask for a step by step answer?


Javascript Detect click event outside of div

I have a div with id="content-area", when a user clicks outside of this div, I would like to alert them to the fact that they clicked outside of it. How would I use JavaScript to solve this issue?

       Display Conents


I'd like to write a formula where there is a $\smile$ underneath the exponent.  Like in this example which works fine:   $2^{\overset{\text{blabla}}{\smile}}$   But when I want to replace the blabla by a mathematical symbol like $\omega$ it does not work.  Any suggestions?


Very simple (and potentially stupid question)  What is 'List Slicing' in python and can someone please give an example of list slicing.  Thanks !


Roots of complex polynomial have modulus less than 1

Let $0<a_0<a_1<...<a_n$, $a_i\in \mathbb R$. I need to show that if $$a_0+a_1z+...+a_nz^n=0$$ then $|z|<1$. Any hints? I don’t know how to begin.  I can’t use Rouche’s theorem as it wasn’t introduced in the classes yet, and the answer to the duplicated question shown only that $|z|\leq1$, but I don’t know how to rule out the $|z|=1$ case.


Some real number $x \in\mathbb R$ is computable if there is a computable function $f :\mathbb N \to\mathbb Q$ such that, for all $r \in\mathbb N,$ $$|f(r) − x| ≤ 2^{−r}$$ If $x, y \in R$  and $x$ and $y$ are computable, then prove $x+y$ is computable. I understand we are supposed to prove $|f(r) − (x+y)| ≤ 2^{−r}$ by defining a function $f$ and then use the fact that $x$ and $y$ are computable to prove it, but I don't get how to start the problem.


I'm doing some automation in my work using Python, I basically created a fairly simple GUI with several options, whenever to user click in one of these options the app creates a new thread with the deamon flag set to true.  Happens that most of the time everything works flawlessly, except when something that was not planned happens, then I have to manually kill the application while it keeps pressing buttons and clicking everywhere, I'm already using the safe flag from the PyAutoGui from putting the mouse on the top left corner of the screen, but this isn't quite user-friendly for users that are not so familiar with technologies, I wish I could set a key in the keyboard to act a safety switch, whenever the user press this key all the threads except the main one should be killed.  I know that there is a lot of content available about that, but I'm just a simple guy that knows some stuff about coding and I didn't quite understand how this is supposed to work, could you clarify how can I stop all threads? Or point me to some good reading material?


Trying to install Ubuntu 14.04, monitor says mode unsupported/out of range

Monitor says mode unsupported/out of range during installation of ubuntu 14.04 and never boots to the ubuntu desktop.


What dyes are now available in Minecraft?

Notch just updated the game and reintroduced dyed blocks - in the form of wool + a specific dye.  Apparently there's 15 new dyes, obtainable through various means - but I can't seem to find information on all 15.  What dyes are now available and how can I obtain them?


Access content within cross domain iframe

Is there are ANY way to access IFRAME content across different domains ?  I am a trying to load external pages into an iframe and scrape their info. But get security errors in Chrome.


Find limit of sequence $e^{-n}\sum_{k=0}^n n^k/k!$

I can't deal with finding: $$\lim_{n\to\infty}e^{-n}\sum_{k=0}^n n^k/k!$$ Have you any idea ?


I'm thinking of getting a new car ... why shouldn't I LEASE one?


I encounter the following problem in Evan's PDE:    I feel I should use the property:   but don't know how to proceed.


Simplifying this expression$$1\cdot\binom{n}{0}+ 2\cdot\binom{n}{1}+3\cdot\binom{n}{2}+ \cdots+(n+1)\cdot\binom{n}{n}= ?$$ $$\text{Hint: } \binom{n}{k}= \frac{n}{k}\cdot\binom{n-1}{k-1} $$


How can we discipline a strong-willed, misbehaving 5 year-old?

My 5 year old son receives and fears punishment but repeatedly exhibits the same unacceptable behaviors.  He's always been strong-willed, and is usually the kind to view a statement like "Don't do that" as an open invitation to do it.  We've tried redirection or distraction tactics, but he is still so narrowly focused on doing the original behavior.  Even worse, he will typically do the prohibited behavior and flagrantly tell us or show us that he's done it.  Repeatedly, even after punishment.  (He's in time out right now for this very thing).  He's consistently punished, yet he continues down the same self-destructive path each time.  When he is punished, we explain what he did wrong, why he's being punished, and why he shouldn't do what he was told not to do.  Sometimes he'll even tell us first why he's in trouble, so it makes me wonder if he's acting out for the inevitable negative attention he gets.  I think he gets plenty of love and positive attention- he's an only child and stays with a relative during the day.  We're trying to give him a good, fun childhood, but we need to figure out how to effectively discipline him.    His repeated misbehavior includes:   Yelling at the top of his lungs in public (stores, friends' houses, etc) Running away from us (at parks, stores, parking lots, etc) Talking back and disrespecting authority figures Hurting animals even after we explain why it's wrong Repetitive nuisance behaviors (repeating himself, banging his fists, kicking walls, intentionally crumbling food on floors, etc) Repeatedly asking us why he can't do something even after it's been explained to him Basically, most bad behaviors that young children may do, but repeated over and over again, even after discipline   He gets a warning to stop the behavior, then depending on the severity of what he's done (and where we are), he'll either go to time out or lose a privilege (such as taking away a favorite movie or missing out on an activity).  Going to time outs and losing privileges really upset him, but still do not ultimately deter him from the bad behavior.  It's like he can't help himself.  My spouse and I are getting worn down.  We try to model good behavior and encourage him to be well-mannered and respectful.  This behavior mortifies us.  It seems we can't even enjoy life as a family because our son is so disruptive and unresponsive.  Most public outings have to be cut short or eliminated because he consistently misbehaves and doesn't respond to our discipline.  After he's misbehaved, when we try to have heart-to-heart talks with him about his behavior and why we expect him to mind us, he usually has a little trouble expressing himself, and a lot of times we get the same nonsensical responses from him (Us: Why did you do [bad behavior]?  Him: Because I didn't want to).  He also doesn't like to make eye contact.  We don't usually feel like we've gotten through to him.  Is there another discipline tactic we could try?  Or does it sound like we need to see a professional at this point?  We're at a loss, and don't want things to spiral further out of control as he gets older (and even begins school).  We just want him to understand that his behavior isn't always acceptable.  Thanks for reading.  Update (from comments below): My spouse and I disagree on spanking, as we had different experiences with it. He feels it's necessary sometimes. Since our son failed to improve after time outs and taking away items/privileges, I grew to agree with him and we used it for select bad behaviors. It didn't work any better. However, when he was spanked, he was always told why. I didn't mention that we have used it because I was afraid it would distract from the original question, but since it has already come up [in comments], yes, it has been explored, but with no better results than our other tactics.


I've seen a couple other questions such as  one talk about focusing screens. What is a focusing screen? Where is it located?


New topbar notification for badge earning should link to badge

In the new topbar's Achievements dropdown (the graph icon), badges that you earn are listed.  However, when you click the badge notification, it doesn't take you to the badge you earned.  For example:    Here are 2 recent Achievements for me.  The top is a badge, the bottom is earned reputation from an upvote.  Both links go to the post.  The badge earning notification says 'See your profile', but nothing in that notification links to my profile.  In the old topbar, there was a section for recently-earned badges.  When you clicked the badges there, it would take you to a page that showed you the badge, its description, and a link to the post that earned you the badge.  Can we get that behavior back?  It's more useful to understand what the badge is and how you earned it.  The link to the post doesn't tell you anything about what's special about that post that makes it badge-worthy.


In the Linux FHS, it says all third party packages should use /opt. However, I didn't see anybody is using /opt. Also, /opt is not in $PATH in anyway, so I think the OS is not intended to let us use /opt. So why bother to create /opt there since nobody is going to use it anyway.  You guys might think this is a duplicate, but clearly it's not. I know about the difference and the thread, but I just don't know why nobody is using it.


Why are $L_4$ and $L_5$ lagrangian points stable?

This diagram from  shows the gravitational potential energy of the sun-earth two body system, and demonstrates clearly the semi-stability of the $L_1$, $L_2$, and $L_3$ lagrangian points. The blue arrows indicate lower potential energy, red higher - so any movement in the plane perpendicular to the masses would require energy and without it, an object there would settle.    However, the $L_4$ and $L_5$ are claimed to be stable, even though the direction arrows indicate it's at the top of a gravity well, and would fall into lower potential energy in any direction. What is it that makes these points stable if not gravity? What am I missing?


python list comprehension for loop in for loop

What the beat way to convert:  [(1, 2), (3, 4)] => [1, 2, 3, 4]   I tried   [i for i in row for row in [(1, 2), (3, 4)]]   but it's not work.


What is this heart in the crimson biome?

I found this heart while exploring the crimson biome - what is it?


I would like to disable right click on my UI, for example, I don't want the user to use right click on my Button UI.   How can I disable Right Click ?  Thanks


I am sorry if my question is too simple, but I am a bit of a beginner on tension. So this is the problem:  A system of two objects suspended over a pulley by a flexible cable is sometimes referred to as an Atwood’s machine. Here, let the mass of the counterweight be 1000 kg. Assume the mass of the empty elevator is 850 kg, and its mass when carrying four passengers is 1150 kg. For the latter case calculate (a) the acceleration of the elevator and (b) the tension in the cable.  So they call: $$m_E = 1150kg$$ $$m_C = 1000kg$$  Now what I don't understand from the explanation I was given is that the tension force and acceleration for both objects is the same in this example.     We leave the motor out of the system for this calculation, and assume the cable’s mass is negligible and the pulley is frictionless and massless, which assures that the “tension” in the cord has the same magnitude on both sides of the pulley.   How can tension force be the same if tension force is the weight plus the net force, and if the weight is different for both objects, then how is the tension and acceleration the same magnitude on both objects?


How to Change Mirrors in sources.list Automatically?

This is what  my sources.list looks like currently:  deb http://ftp.us.debian.org/debian/ jessie main deb-src http://ftp.us.debian.org/debian/ jessie main  deb http://security.debian.org/ jessie/updates main contrib deb-src http://security.debian.org/ jessie/updates main contrib  # jessie-updates, previously known as 'volatile' deb http://ftp.us.debian.org/debian/ jessie-updates main contrib deb-src http://ftp.us.debian.org/debian/ jessie-updates main contrib   As you can see, the repositories are mirrors from the US region. How do I change it to another repository region automatically, without having to change the sources.list manually?   I only know how to delete the old repo and change it manually to the other region repo, like AU repositories or other repositories.  I know that we can change the repo region Debian uses by following this format:   http://ftp.[Region].debian.org/debian/   But how about repositories which do not follow the default format such as: kartolo.sby.datautama.net.id, which is a repo from Indonesia? How can I change this to one from ?


How are Contacts in Marketing Cloud counted?

Salesforce bills Marketing Cloud on total number of Contacts within the system. I'd like to know what exactly is used to count these? Is this the Email Studio > All Subscribers list or the Contact Builder > All Contacts list?  When we have Marketing Cloud connector and synchronise the Contacts object, is this counted towards that number? (or only when they have been inserted into the All Subscribers / All Contacts list, as they are not done so automatically)


EM Fields Transmitted from an antenna and photons

What is the relationship between The EM waves (light) and photons in some context i studied light as photons and others as EM fields but how they are related....another questions : what's the name of the field of study that allows me to study antenna and wave propagation on the particle level (photons) and the relationship between different kind of particles in the matter


Interaction with the site on the app should count towards Enthusiast/Fanatic

If I do any of the below, which would normally constitute "activity" on any Stack Exchange site (including mobile):   View my profile Vote on any question or comment Visit one or more questions   ...then Stack Exchange considers me to have "visited" the site.  If I do any of the below on the mobile app:   Vote on any question or comment Visit one or more questions   ...then Stack Exchange does not consider me to have visited the site.  If one wants the app to have feature parity with the mobile site, then shouldn't my participation within the app also count towards the Enthusiast/Fanatic badge?


Is there a way to toggle startup sounds on a 2017 MacBook Pro?

I've been a Mac user for a while, and I was really upset about the removal of the startup sounds in the new MacBooks post-2016. I was wondering if there was a way to turn the startup sound back on, or even edit the startup procedure to play a sound file. I currently am using a 2017 MacBook Pro 15-inch running macOS 10.12.6.


ASP.NET MVC -  passing parameters to the controller

I have a controller with an action method as follows:  public class InventoryController : Controller {     public ActionResult ViewStockNext(int firstItem)     {         // Do some stuff     } }   And when I run it I get an error stating:     The parameters dictionary does not contain a valid value of type 'System.Int32' for parameter 'firstItem'. To make a parameter optional its type should either be a reference type or a Nullable type.   I had it working at one point and I decided to try the function without parameters.  Finding out that the controller was not persistant I put the parameter back in, now it refuses to recognise the parameter when I call the method.  I'm using this url syntax to call the action:  http://localhost:2316/Inventory/ViewStockNext/11   Any ideas why I would get this error and what I need to do to fix it?   I've tried adding another method that takes an integer to the class it it also fails with the same reason.  I've tried adding one that takes a string, and the string is set to null.  I've tried adding one without parameters and that works fine, but of course it won't suit my needs.


how to user super() in python class inheritance

I'm trying to implement super() per  SO answer.  I have the following class:  class Collection():     """returns a collection curser from mongodb"""       def __init__(self, db, collection_name):         self.db = db         self.collection_name = collection_name          if not hasattr(self.__class__, 'client'):             self.__class__.client = MongoClient()          self.data_base = getattr(self.client, self.db)         self.collection = getattr(self.data_base, self.collection_name)   and the following subclass:  class User(Collection):     def __init__(self, db, collection_name):         super(User, self).__init__(db, collection_name)   Calling the Collection class works fine:  agents = Collection('hkpr_restore','agents')   Calling the subclass:  user = User('hkpr_restore','agents')   I get an error:  Traceback (most recent call last):   File "main.py", line 37, in <module>     user = User('hkpr_restore','agents')   File "filepath/user.py", line 35, in __init__     super(User, self).__init__(db, collection_name) TypeError: must be type, not classobj   What am I doing wrong?


Showing that $S_1 \cup S_2$ is countable

Let's say that $S_1$ and $S_2$ are two countable infinite sets that are disjoint (i.e. $S_1 \cap S_2 = \emptyset$). How would you show that $S_1 \cup S_2$ is also countable?


Can the right to delete one's account be denied?

I am writing for a friend who cannot ask a question here on Meta.  He has been suspended last week, asked to delete his account[s] and a message said that accounts cannot be removed before the end of the suspension.  Since he has been suspended for ten years, that seems tantamount to right being denied.  Is that fair and acceptable? How can that be overcome? Why didn't they just remove the account permanently?  If somebody doesn't believe it, they can check , no reason is given. Not just because he's my friend but I am sure that a suspension of ten years makes no sense.


I am trying to do svm model training and it gives this error:   ValueError: Found input variables with inconsistent numbers of samples: [91, 212]   Code:  target = data.target target.head()  ##splitiing data into training and test data X_train, X_test, y_train, y_test = train_test_split(train, target, test_size=0.3, random_state=101) print("X_train size ===>", X_train.shape) print("y_train size ===>", y_train.shape) print("X_test size ===>", X_test.shape) print("y_test size ===>", y_test.shape)  #Create a svm Classifier  clf = svm.SVC(kernel='linear')  #training the model using the training sets  clf.fit(X_train, y_train)  #predict the response for test dataset  y_pred = clf.predict(X_train)


Adding parentheses to object declaration causes constructor not to run

Say I have an extremely simple Foo class like so:  #include <iostream>  class Foo {     public:         Foo() {std::cout << "bar" << std::endl;} };   I have always thought that both Foo foo and Foo foo() would output bar, as they both call the constructor. But when I try:  int main() {     Foo foo();     return 0; }   Nothing gets outputted. Is there a reason for this? How can I make sure that the constructor gets called in both instances?


What hotkeys to use to preview material node result?

What hotkey should I use to quickly add "Viewer" node marked on the screenshot and preview result of my currently selected node?


Why aren't we sure that photons and gravitons are massless?

In particle data group's (PDG) The Review of Particle Physics (2016) page number 29, the mass of the photon is given to be $<1\times10^{-18}eV$ and that of graviton as $<6\times10^{-32}eV$.   In case those limits are experimental upper bounds, what makes them give theoretical value for gluons and experimental limits for photon and graviton? Why aren't we sure that photon's mass is zero, even though we are sure that gluons mass is zero (as given in it)?  In case they have mass, why do we think graviton may have lesser mass that of the photon even though they both are carriers of forces of similar range?


Is there any function in Apex which could emulate functionality of the  formula function? I'm trying to get 18-char Id variant from the standard one.


Interpreting incidence rate ratios in poisson without exposure variable

I have a dataset made up of observations of procedural cases, with a count outcome (variable X carries the number of times a specific finding was detected in one procedure/case). My denominator is the total number of procedures. My count outcome starts with 1 (no zeros), therefore I am using a Poisson model.  I am not sure what the exposure variable should be as the data is a retrospective cross-sectional sample of procedures with procedural findings, from each of 4 calendar years aggregated together. What would be the offset (exposure) variable, if appropriate, in this case?  Hence the question comes to interpreting the incidence rate ratios of the independent variables.  For example, specialist vs trainee (reference level) IRR =1.50 . If no exposure (offset) variable is used, does that mean that the specialist is 50% more likely compared to the trainee to detect one addtional finding count per procedure? Or : the specialist will detect on average 50% more copies of that finding per procedure?  I have seen and watched various people phrasing the interpretations of IRRs in various ways.  With or without exposure variable (if needed) , what would be the correct interpretation of IRR in this case?


Running the ls / command some files are coming out;  What are those files?  They are not even directories.  Output of ls /:  bin dev boot etc cdrom media mnt home lib lib64 proc root


Can an external drive be sabotaged by the manufacturer so can't be used internally?

I might have made a $150 mistake. I saw a WD MyBook 8TB External Drive for $150, and thought that it was quite a bargain and wanted to use it as an internal drive on my  2010 Mac Pro tower.  Before cracking it open, I partitioned/formatted to a Mac OS format. Now, when put inside a Mac, it’s not seen at all. The usual “Can’t recognize drive” message doesn’t appear, nor can I access it via disk utility.  I wrote to Western Digital, and got a canned reply. My question was whether the WD80EZAZ drive was built in a way that it would not function without the PC board that converts from SATA to USB? I am looking for confirmation that this type of sabotage is possible, and if there is any work-around.   FWIW, I saw this other question “” but in that case, the drive functioned fine, and I’ve done this before with other drives, which is why this caught me by surprise.


I am re-opening  question as i have the following question. I was going through the  which was mentioned in an answer in that post. Initially i beleived that the follwoing problem is NP-Complete.  Suppose there is a graph $G=(V,E)$. I want to test if V can be partitioned into two disjoint sets $V_1$ and $V_2$ such that the subgraphs induced by $V_1$ and $V_2$ are unit interval graphs.  But in the paper,there is a theorem which says      Let $A$ and $B$ be additive induced-hereditary properties. Then there   is a polynomial-time transformation from the $A$-recognition problem   to the $(A◦B)$-recognition problem.   So, my question is that :- is it possible that because of the above theorem the problem might be solvable in polynomial time ??


A Way to Create Blender Materials in Text or Script? (Included: Script to Retexture SFM Models in Blender!)

I have a model from Source Filmmaker that has a bunch of different textures. It's all imported and ready to be textured using Blender nodes, but since there are so many objects (over 40) in this particular model, I figure it would be a waste of time to manually reshade/texture every single material which could take several hours. Instead, I could just write a simple script that could read the texture VMT files (from SFM) which define what each texture file is for (diffuse, bumpmap, etc.) in batch and create all the Blender shaders nodes automagically once the .blend file is there. The snag is .blend is a binary file, and I can't read it or edit it in a text editor. Is there any way at all to create Blender nodes programmatically (i.e. not inside the Blender GUI but perhaps importing other things or using addons?)


What is the significance of Black Widow saying "You could at least recognize me" to Bucky?

In Captain America: Civil War, Black Widow says "You could at least recognise me" while fighting a 'hypnotised' Bucky. Most people suggest that it's simply a reference to her past encounters with him from The Winter Soldier and prior to that film, and possibly there relationship from the comics.  Natasha Romanoff: I know who killed Fury. Most of the intelligence community doesn't believe he exists. The ones that do call him the Winter Soldier. He's credited over two dozen assassinations in the last 50 years. Steve Rogers: So he's a ghost story. Natasha Romanoff: Five years ago I was escorting a nuclear engineer out of Iran, somebody shot at my tires near Odessa. We lost control, went straight over a cliff, I pulled us out, but the Winter Soldier was there. I was covering my engineer, so he shot him straight through me. -  Black Widow was a former KGB operative before joining SHIELD.  "At a young age[5], Romanoff was recruited by the KGB." -  Bucky Barnes was part of the Winter Soldier Program which was a Soviet/Hydra program. And apparently was given his name because of his work with the KGB.  "The Winter Soldier Program was a top secret Soviet project started by Arnim Zola that involved brainwashing American hero James Buchanan Barnes and turning him into a deadly assassin for HYDRA using a serum similar to the Super Soldier Serum." - "Receiving vast training from HYDRA, Barnes became a formidable fighter and an even more ruthless killer. His experiences with the KGB would earn him the name of the "Winter Soldier." -  My question(s), is it possible that Black Widow saying "You could at least recognise me" had much more significance than just referencing Captain America: The Winter Soldier and her experience in Iran? I understand that it may be a stretch and she hasn't really given any other indication that this may be the case. Being that she is apparently one of the worlds top spies, like Fury, she holds her cards close to her chest. Could they have crossed paths before while she was still with the KGB, but she is yet to explain/admit this? I also understand that similar questions have been asked on here before. However these questions and the answers provided do not take into consideration that the comment was referring to something that is yet to be properly explained. The answers dismiss the comment as simply being sarcastic and/or referencing Captain America: The Winter Soldier. Whereas I'd like input on whether or not the comment was or could be much more significant than this.


How to evaluate $$\lim_{n \to \infty}\sum_{m=1}^{\infty}\int_{0}^{\infty} \left(\frac{ m+x}{(m^n+x^n)^n} \right )dx$$ I made the substitution $$x = mt$$and factored out  $$m^{-(n^2-2)}$$. I got this: $$\lim_{n \to \infty} \left(\sum_{m=1}^{\infty}m^{-(n^{2}-2)}\right)\int_{0}^{\infty} (1+t)(1+t^n)^{-n} dt $$ After that I tried the substitution: $$t^{n}=tan^{2}\theta$$ but after substitution I got two beta integrals after which I couldn't proceed further. I got the following: $$\frac{2}{n}\lim_{n \to \infty} \left(\sum_{m=1}^{\infty}m^{-(n^{2}-2)}\right)\int_{0}^{\frac{π}{2}} (\sin^{(\frac{2}{n}-1)}{\theta}\cos^{(2n-\frac{2}{n}-1)}\theta + \sin^{(\frac{4}{n}-1)}{\theta}\cos^{(2n-\frac{4}{n}-1)}\theta)  d\theta $$ I couldn't proceed further.The answer is 3/2. Could someone clarify ? Thank you.


Is it possible for a foreigner to drive through (mainland) China in a foreign-registered car?

Is it possible to drive through mainland China, for example for transit from Kazakhstan to Vietnam, as a non-Chinese citizen, in an own car/van/truck?  This is about an European Union citizen, trying to make a tourist trip overland by car from the EU to Vietnam. This is about a special (equipped with sleeping, cooking and other facilities) vehicle, that the owner intends to keep and use in Vietnam, so buying/renting a vehicle inside China and selling it before leaving is not an option - the question is about driving a specific vehicle the owner already has in the EU to Vietnam. getting new licence plates is OK, as long as it is allowed to put back the old ones when the vehicle gets back to the EU.  What legal issues are there with getting in an own car over China, and how to overcome them?  Is it possible to drive a car with EU licence plates through China, or would one have to get something like temporary Chinese plates? Is an EU driving licence valid? Are there any customs issues one has to know about, and how long one can keep a foreign motor vehicle in China without having to pay import taxes on it?


Does an uncountable discrete subspace of the reals exist?

Does an uncountable and discrete subspace of the reals exist?


I have a favorite jambalya recipe. I usually saute the trinity (celery, onions, green peppers) for a short while before adding garlic and then a longer while later I will add my Cajun seasoning. For some reason the other day I did it differently and added my Cajon seasoning to the oil before adding the trinity and garlic (like I do when making Thai curry - adding the curry paste to the oil to start the cooking). I was surprised to find my final dish at the end was far less spicy (less hot) and there was less of the flavor from the Cajon seasoning. That surprised me. Slightly less spicy would make sense but this was WAY less spicy. I used the normal quantity of all ingredients so that wasn't the cause of the difference. EDIT: DIshes made 3 days apart with spices that have been stored the same length of time (months+). What is going on?


A thought passed by me and I wondered if projecting black light was possible.  We can make lights with many other colors, but I'm not so sure about black.  So, is it possible? Has it been done?


Misconceptions about the Klein-Gordon and Dirac equations and their problems

In my course on particle physics the KG and Dirac equations were explained in an historical way. However, it was more confusing than clarifying. The problems with the KG equation were   The probability density can take negative values. Energy doesn't have a lower bound.   To solve this the Dirac equation was introduced. However, it only solves the first problem but not the second. Then the antiparticle interpretation is presented to solve the negative energies problem and everybody is happy. Also, the probability density problem of the KG equation is then solved saying that it is actually a charge current so it can take negative values...  So, if density is actually charge density and negative energies are antiparticles, what was the problem with the KG equation in the first place? How can we interpret the probability density of the Dirac equation as charge density if its always positive? Does QFT solve the negative energy problem without the need of postulating weird stuff like particles going backwards in time?


Quick directory navigation in the bash shell

I would like to frequently switch between directories that are in totally unrelated paths, for example /Project/Warnest/docs/ and ~/Dropbox/Projects/ds/test/.  But I don't want to type cd /[full-path]/ all the time. Are there any shortcut commands to switch to previously worked directories?  One solution I could think of is to add environment variables to my bash .profile for the frequently used directories and cd to them using those variables.  But is there any other solution to this?


Function to generate pseudo ramdom sequence

Lets assume an ordered finite sequence of integers A = {0,1,2, ... k}. Im looking for a (seeded) function f: A -> A where the image of f seems to be ramdom, but every element is hit exactly once (bijective).  It's importatant that someone who has access to some results of f should neither be able to estimate if he's looking at direkt neighbours f(n), f(n+1) nor should he be able to guess the next result.  One idea would be to map a range(1, k) on a shuffle(range(1, k)). But this seems very low in performance (for large k) and does miss the basic idea of a generator. The first element in the sequece should be as expensive to calculate as the n-th element.  Difference to 'normal' randomgenerators  Read carefully before marking as dublicated. I'm not looking for randomly picking from a range where collisions are possible. Also I want to calculate the n-th element without calculating all n-1elements before, like I would have to using the MT or Xorshift.


How to properly establish a PostgreSQL connection using QgsCredentials

I'm trying to establish a Postgres connection using QgsCredentials as described here:    The only problem is that I cannot establish a working connection unless I "physically" add the layer to the map canvas (which I don't want because I only want a connection to the DB and a reference to the layer which will be edited later on in the code)  When clicking a button the run function reads:  uri = QgsDataSourceURI() connInfo = uri.connectionInfo()  (success, user, passwd) = QgsCredentials.instance().get(connInfo, None, None)  if success:     # Isn't this enough to establish the connection and get a valid reference to the layer?     uri.setConnection("HOST", "PORT", "DB_NAME", user, passwd)     uri.setDataSource("SCHEMA", "TABLE_NAME", "the_geom")     LYR = QgsVectorLayer(uri.uri(), "LYR", "postgres")      # Unless I add the following line, I am not able to use properly the object     # (which asks the user the credentials until he/she inserts the right ones and gets     # a working connection with a valid reference to the layer)     QgsMapLayerRegistry.instance().addMapLayer(LYR)   What am I doing wrong?  Thanks in advance,  m.


I follow two specific tags: [*worklight*], [*mobilefirst*] (everything under worklight-* and everything under mobilefile-*.  These tags are not too high volume; something like 10 questions a day. It would be great, for me, if the app would get a notification whenever a new question is submitted. It could function as an option you can enable in your account either in the website or the app...


Are the two following equivalent under ZF :   Axiom of Choice/Zorn's Lemma Given any two sets A, B, there exists an injection from A to B or there exists an injection from B to A   I could prove that (1) implies (2) and I wonder if they are actually equivalent  but I couldn't prove it. I read somewhere that (2) cannot be proven with only ZF, that's why the equivalence seems plausible to me.   Thank you :)


I found the following exposition of darapti on wikipedia:    All squares are rectangles. (MaP)    All squares are rhombuses. (MaS) ∴ Some rhombuses are rectangles. (SiP)   As far as I can see, this is of the form:   all A's are B's  all A's are C's  ∴some C's are B's  I was watching a talk by the logician Graham Priest, where he stated that darapti is now invalid but he didn't offer an explanation.  I was wondering if anyone could show why it is invalid, by way of an example?  Thanks.


Narrow-phase collision detection algorithms

There are three phases of collision detection.    Broadphase: It loops between all objecs that can interact, false positives are allowed, if it would speed up the loop. Narrowphase: Determines whether they collide, and sometimes, how, no false positives Resolution: Resolves the collision.   The question I'm asking is about the narrowphase. There are multiple algorithms, differing in complexity and accuracy.   Hitbox intersection: This is an a-posteriori algorithm, that has the lowest complexity, but also isn't too accurate, Color intersection: Hitbox intersection for each pixel, a-posteriori, pixel-perfect, not accuratee in regards to time, higher complexity Separating axis theorem: This is used more often, accurate for triangles, however, a-posteriori, as it can't find the edge, when taking last frame in account, it's more stable Linear raycasting: A-priori algorithm, useful for semi-realistic-looking physics, finds the intersection point, even more accurate than SAT, but with more complexity Spline interpolation: A-priori, even more accurate than linear rays, even more coplexity.    There are probably many more that I've forgot about. The question is, in when is it better to use SAT, when rays, when splines, and whether there is anything better.


Startup error Uncleared pch fifo underrun on pch transcoder

Does any one know how to fix this error? I have a Dell note and it is the second time this error shows up.  [   1.761113]   [drm:intel_set_pch_fifo_underrun_reportintel_set_pch_fifo_underrun_reporting   [i915]  *ERROR* uncleared pch fifo underrun on pch transcoder A /dev/sda1 contains a file system with errors, check forced.  Inodes that were part of a corrupted orphan linked list found.   /dev/sda1: UNEXPECTED INCONSISTENCY; RUN fsck MANUALLY.       (i.e., without -a or options)  Fsck exited with status code 4  The root filesystem on /dev/sda1 requires a manual fsck   BusyBox vc. 22.1   (Ubuntu 1:1.22.0-15ubuntu) built-in shell (ash) Enter 'help' for a list of built -in commands.   (Initramfs) help ((i wrote ))  Built-in commands: ------------------------------- . : [alias break cd chdir command continue echo eval exec exit export false getopts hash help history let local printf pwd read readonly return set shift test times trap true type ulimit umask unalias unset wait  [  [[ acpid ash awk basename blockdev cat chmod chroot chvt clear cmp cp cut deallocvt devmem df dnsdomainname du dumpkmap echo egrep env expr false fbset fdflush fgrep find fstrim grep gunzip gzip hostname hwclock ifconfing ip kill ln loadfront loadkmap ls lzop lzopcat mkdir mkfifo mknod mkswap mktemp modinfo more mount mv openvt pidof printf ps pwd readlink reset rm rmdir sed seq setkeycodes sh sleep sort stat static-sh stty switch-root sync tail tee test touch tr true tty umount uname uniq unlzop wc wget which yes zcat


Markov chain on an $n$-dimensional hypercube?

I am looking at the following Cambridge Tripos question, which has left me rather stumped for quite a while.  A particle moves on the $2^n$ vertices of the hypercube $\{0,1\}^n$. At each step the particle is equally likely to move to each of the $n$ adjacent vertices, independently of its past motion. The initial vertex occupied by the particle is $(0,0,...,0)$. Calculate the expected number of steps until the particle i) first returns to $0,0,...,0)$; ii) first visits $(0,0,...,1)$; iii) first visits $(0,0,...,1,1)$.  I have seen multiple answers on here regarding the 3D case, as well as a general $D$-dimensional case presented , but I am quite stuck on generalising to other vertices, including the three presented here. Would be lovely to see some guidance here, thanks!


If this has already been discussed or this is not the right place to ask let me know and I will delete this question.  That being said, the first two months of me using SO, the push notification system(reputation changes, comments, live tracking of votes and answer acceptance) was flawless.   However, in the past month, I notice up and again that it is clearly off. For example, I will be in a question tab and post an answer and monitor that question only to realize there have been alot of changes on this page such as votes and new answers and comments. However, to get those updates I have to keep refreshing the page. What is more peculiar is I can glimpse reputation changes for that question in another tab being updated correctly, but not for the post itself.  What gives?


Is there any mathematical or physical situations that $1+2+3+\ldots\infty=-\frac{1}{12}$ shows itself?

I just saw the proof that  $$1+2+3+\cdots=-\frac{1}{12}$$ and my brain still hurts.   I completely understood the proof and my question is NOT actually about the proof itself. At the end of the proof, they said that this answer shows itself in quantum physics (e.g. it has a role in why there are 26 dimensions in string theory).  Sadly though, I am no expert in quantum physics and I'm wondering are there any other  physical and/or mathematical situations that this counter intuitive result shows itself?  P.S. Needless to say, it would be great if your answer doesn't need a very deep background in physics or math.


A phonon is a quantized unit of sound; they are encountered when quantizing lattice vibrations in solids. Now, even an ideal gas supports sound waves, but in this case, interactions between atoms are weak. That makes it hard to imagine what a quantized vibration would look like, since at small scales, the particles are free!   Is there a phonon picture for sound in an ideal gas? Is it ever useful?


Difference between List strings = new LinkedList(); and LinkedList strings = new LinkedList();

I am learning about interfaces in Java and one example they give is being able to create a linked list using the List interface List<String> strings = new LinkedList<>(); but they don't go into any detail. Why would I want to do this as oppose to LinkedList<String> strings = new LinkedList<>();?


Can I use hawaii state in my game commercially?

I want to make game more realistic, for that I need a state . So, I decided to take hawaii state, as it can be seen through google maps with street view, 3d view and much more and will help me a lot for making realistic game. So, my simple question is that can I use the whole hawaii state [whole means everthing like clone/duplicate] in my game commercially.


How to find how many times I'd have to run a scraper to collect entire set by random subsets

So I have sets of data with several hundred entries, but can only go through 100 randomly at a time. What I'm trying to figure out is how many times I'd have to run a scraper to get almost all entries. I can't quite find what I need through searching, though I know it's a probability problem ..  Any help?


Add additional question to faq about avoiding duplicates?

I am a new user to the Stack Exchange network.   I am making a proposal to add to the FAQ a Question:   This will be especially useful to the new users (FAQ is supposed to help new users, I guess).   Please explain the following:    How to effectively search for an answer/question? (Please add the discussion )  Will asking a specific question about a system whose answer is in another question which deals with the general aspect of the system be considered a duplicate and closed? (Meaning question is not exactly a duplicate, but answer can be found by extensive reading of answers from other related questions) Please add the question to the FAQ:  and    This is not a duplicate of the question 'how to avoid asking duplicate questions' because this deals with adding that question to faq.


I've a USB 2.0 drive. Today while I coping some media files in the pendrive, I found that It stucked in middle. I'd wait for half an hour, it remains unchanged! I thought that this is may be problem with my pendrive. I tried with another pendrive and got the same result!! What can I do?


Proving intersection of empty set is the set of all sets

In an exercise, it asks to prove $\bigcap \varnothing$ is equal to the set of all sets.  I understand that there are many proofs online but I have a specific question (mostly regarding mathematical logic) regarding my proof.  From my understanding, given a set $S$ (where all of its elements are also sets), $x \in \bigcap S \iff \forall \, Y\in S, x \in Y$.   Now I will try and show the set of all sets is contained in $\bigcap \varnothing$.  Let $x$ be an arbitrary set - now $x \in \bigcap \varnothing \iff \forall \, Y\in \varnothing, x \in Y$.  My question is why the statement $\forall \, Y\in \varnothing, x \in Y$ vacuously true?  From my understanding, a statement is vacuously true in the case of an implication (ie. $p \implies q$ where $p$ is false) but I fail to see how $\forall \, Y\in \varnothing, x \in Y$ can be written in an implication (I tried writing it in the form $\forall Y: Y \in \varnothing \implies x \in Y$ but this is not the same statement)