I have a MariaDB database, in which I have this table:  ID | Item Name | Item replaced | ----------------------------------------- 0  | Item 1     | Replaced 1  | Item 2     |  2  | Item 3     | Replaced 3  | Item 3     |  4  | Item 3     |  5  | Item 1     | Replaced 6  | Item 2     | Replaced 7  | Item 2     |  8  | Item 3     | Replaced   I want to count the number of same items and display so ITEM 3 in this case would be '4' as there are four of ITEM 3 in my database but I also want to show how many are replaced so in this case it would be '2' as only two of ITEM 3 is marked as replaced.  End result I want to get is something line  ITEM 1        2 - 2 (2 item 1's and both are are replaced) ITEM 2            3 - 1 (3 Item 2's and only 1 is replaced) ITEM 3            4 - 2 (4 Item 3's and 2 are replaced)  I have tried a UNION but that doesnt seem to work for me.   Also it would be helpful if I could count replaced as NULL or Empty.  I found  but it's not quite what I want, this case the user is listed more than once so this example wouldnt work for me.

Ref :   I got answer (thanks coytech ) but i need one more column in its :  as per :  id | mid | pid | owgh | nwgh | 1    3      12    1.5    0.6 2    3      12    1.5    0.3 3    3      14    0.6    0.4 4    3      15    1.2    1.1 5    4      16    1.5    1.0 6    4      17    2.4    1.2  7    3      19    3.0    1.4   i got answer      Select mid ,          COUNT(distinct pid) as cpid  ,          SUM(nwgh) as totalnwgh  from test  GROUP BY mid   sqlfiddle :   mid  cpid       totalnwgh 3      4          3.8 4      2          2.2    But above i need one more column that's as below : totowgh  mid cpid        totalnwgh  totowgh 3      4          3.8        6.3 (DISTINCT value as per pid column) 4      2          2.2        3.9   where totowgh = 6.3 come by DISTINCT value of owgh column  as per distinct pid column  mid = 3 has count 5 but distinct pid  = 4 for mid=3 same way "distinct" owgh = 6.3 for mid=3 and distinct pid.  As pid=12 , column owgh value 1.5 is twice ...hence its is count 1 time hence,  1.5 + 0.6 + 1.2 + 3 = 6.3 ( please not this is as per DISTINCT value of pid )  Please note : i need distinct owgh value as per distinct pid or group by pid .. because if i replace value of owgh 0.6 with 1.5 then it will be 5.7 instead of 7.2 but value of owgh 0.6 belong to pid = 14 and not pid = 12 hence totalcount of owgh change ...but i need is 7.2  SEE WHAT I MEANS   :


So right now I am working on small simulator, that simulates a store. This store has multiple check out lanes, or in this case queues. Now what I am trying to do is make it so I can move over a Customer from one queue, or line, to the another one if there is another open line, and they  are second in line. So essentially I am taking the front.next Node, and moving it over to become the front Node in the whatever queue I decide to move it to. This is the exact error code I am getting:  Exception in thread "Timer-0" java.lang.NullPointerException at unit8_Task1.Store.moveLanes(Store.java:220) at unit8_Task1.Store.access$9(Store.java:184) at unit8_Task1.Store$6.run(Store.java:96) at java.util.TimerThread.mainLoop(Timer.java:555) at java.util.TimerThread.run(Timer.java:505)   and here is the code that is involved with moving the customer:      private void moveLanes(LineQueue<Customer> l){ //modification     LineQueue<Customer> largestLine = null;     LineQueue<Customer> lineToAdd = null;      if(superExpress.size() == 0 && superExpress.getContFreeTime() >= 30){         lineToAdd = superExpress;          for(int i = 0; i < queues.length; i++){             if(largestLine == null){                 queues[i] = largestLine;             }else if(queues[i].size() > largestLine.size()){                 largestLine = queues[i];             }         }     }else if(expressOne.size() == 0 && expressOne.getContFreeTime() >= 30){         lineToAdd = expressOne;          for(int i = 0; i < queues.length; i++){             if(largestLine == null){                 queues[i] = largestLine;             }else if(queues[i].size() > largestLine.size()){                 largestLine = queues[i];             }         }     }else if(expressTwo.size() == 0 && expressTwo.getContFreeTime() >= 30){         lineToAdd = expressTwo;          for(int i = 0; i < queues.length; i++){             if(largestLine == null){                 queues[i] = largestLine;             }else if(queues[i].size() > largestLine.size()){                 largestLine = queues[i];             }         }     }      Customer c = largestLine.getNextInLine();     largestLine.remove(c);     lineToAdd.offer(c); //adds the customer to the smallest line     lineToAdd.setIPH(items); //this will be added after the customer is generated in the above method     if(lineToAdd.getMaxLength() < lineToAdd.size()){ //if the maximum length is now smaller than the current size         lineToAdd.setMaxLength(lineToAdd.size());     }     add(c); }   The add method at the end is what adds objects, or in this case Customers, to the front of a selected queue. That has been working when generating new customers, so there should not be a problem there. Lastly, there is the code I have for the LineQueue itself:  private Node<Customer> front; private Node<Customer> ref;  public Customer getNextInLine(){return front.next.data;};  @Override public boolean offer(Customer e){     if(size == 0){         front = new Node<Customer>(e);     }else if(size == 1){         front.next = new Node<Customer>(e);         ref = front.next;     }else{         ref.next = new Node<Customer>(e);         ref = ref.next;     }     size++;     CPH++;     return true; }   I am guessing this is occurring because the first.next.data is not actually storing the Customer object correctly. I also tried type casting to Customer (Customer)first.next; instead, but I got the same error.

What are Null Pointer Exceptions (java.lang.NullPointerException) and what causes them?  What methods/tools can be used to determine the cause so that you stop the exception from causing the program to terminate prematurely?


When I try to update I get this error. I am not sure why am I getting this error.   Fetched 424 kB in 46s (9,190 B/s)                                               W: GPG error: http://download.opensuse.org  Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 5A7D1D38BEB6D886 W: Failed to fetch http://ppa.launchpad.net/alexeftimie/ppa/ubuntu/dists/wily/main/source/Sources  404  Not Found  W: Failed to fetch http://ppa.launchpad.net/alexeftimie/ppa/ubuntu/dists/wily/main/binary-amd64/Packages  404  Not Found  W: Failed to fetch http://ppa.launchpad.net/alexeftimie/ppa/ubuntu/dists/wily/main/binary-i386/Packages  404  Not Found  E: Some index files failed to download. They have been ignored, or old ones used instead.

PPA seems to be constantly offline. Whenever I use sudo apt-get update, this error is shown:  W: Failed to fetch http://ppa.launchpad.net/ 404  Not Found   How do I fix these errors?


Has anyone done any research about the upwind vehicle ?  I think it is impossible but get a surprising number of disputes from some pretty educated people. It seems to me that if it were possible for a wind powered vehicle to go into the wind at greater than the speed of the wind X, then it would follow that on a windless day, a Ford F-150 towing the same vehicle at speed X (equaling the relative wind), would allow the vehicle to accelerate and pass the Ford, which is absurd, especially considering that the towed vehicle only needs to overcome the rolling coefficient of friction while the self starting vehicle must overcome the static coefficient of friction.    Am I overlooking something?

Recently a  set a record for sailing a wind-powered land vehicle directly down wind, and a speed faster than wind speed. Wikipedia has a  talking about it, but it doesn't explain exactly how it works.  I can imagine some configurations, but I don't get how a system could be set up to push forward with a tailwind (when the cart is moving slower than the wind) and push forward with a head wind (when the cart is moving faster than the wind).  Could someone help explain how this is possible?


Find the exact value of the limit of the sequence defined by $$a_1 = \sqrt 5, \;a_{n+1}= \sqrt {5 + a_n}$$  My only guess to this question is that the limit is e, however I don't know how to even begin to show this. Help please?

(Fitzpatrick Advanced Calculus 2e, Sec. 2.4 #12)  For $c \gt 0$, consider the quadratic equation $x^2 - x - c = 0, x > 0$.  Define the sequence $\{x_n\}$ recursively by fixing $|x_1| \lt c$ and then, if $n$ is an index for which $x_n$ has been defined, defining  $$x_{n+1} = \sqrt{c+x_n}$$  Prove that the sequence $\{x_n\}$ converges monotonically to the solution of the above equation.  Note: The answers below might assume $x_1 \gt 0$, but they still work, as we have $x_3 \gt 0$.    This is being repurposed in an effort to cut down on duplicates, see here: .  and here: .


I can pick a number in the interval from all real numbers from 0 to 1. Say this number is 0.42. Now the probability for drawing this number most be zero since we have infinity many numbers in the interval 0 to 1. Is this true and is it not a paradox ?

My understanding is that a random variable is actually a function $X: \Omega \to T$, where $\Omega$ is the sample space of some random experiment and $T$ is the set from which the possible values of the random variable are taken.  Regarding the set of values that the random variable can actually take, it is the image of the function $X$. If the image is finite, then $X$ must be a discrete random variable. However, if it is an infinite set, then $X$ may or may not be a continuous random variable. Whether it is depends on whether the image is countable or not. If it is countable, then $X$ is a discrete random variable; whereas if it is not, then $X$ is  continuous.  Assuming that my understanding is correct, why does the fact that the image is uncountable imply that $Pr(X = x) = 0$.  I would have thought that the fact that the image is infinite, regardless of whether it is countable or not, would already imply that $Pr(X = x) = 0$ since if it is infinite, then the domain $\Omega$ must also be infinite, and therefore  $$Pr(X = x) = \frac{\text{# favorable outcomes}}{\text{# possible outcomes}} = \frac{\text{# outcomes of the experiment where X = x}}{|\Omega|} = \frac{\text{# outcomes of the experiment where X = x}}{\infty} = 0$$  What is wrong with my argument?  Why does the probability that a continuous random variable takes on a specific value actually equal zero?


I have a book with footnotes which I want to display. I put the footnotes in their place inside curly brackets.  In order to retrieve the comments and display them in a different window, I wrote the following class in Angular 2:  export class BookreaderComponent implements OnInit {  async comments() {     var regexp = new RegExp('\{(\s*?.*?)*?\}');     var array= await regexp.exec(this.book);     console.log(array);   }    constructor(public appServices: AppServices, private http: Http, private route: ActivatedRoute) { }   book: string;   Name: string;   json: string;   ngOnInit() {     this.route.params.subscribe(params => {       this.Name = params['name'];       this.http.get("./assets/" + params['url'])         .map(ref => {           return ref;         }).subscribe(async ref => {           this.book = ref.text();           await this.comments();         });     });    }   The class calls the comments function, which calls a regex function on a large amount of text, that contains a lot of curly-bracketed text. The problem is that the regex function takes a very long time to load (I waited and waited, and it didn't load), and meanwhile the whole page is stuck.  Is there a way to speed this up, or maybe break this up into smaller chunks? Or maybe I should try a different way to display these footnotes?

Unfortunately, despite having tried to learn regex at least one time a year for as many years as I can remember, I always forget as I use them so infrequently. This year my new year's resolution is to not try and learn regex again - So this year to save me from tears I'll give it to Stack Overflow. (Last Christmas remix).  I want to pass in a string in this format {getThis}, and be returned the string getThis. Could anyone be of assistance in helping to stick to my new year's resolution?    Related questions on Stack Overflow:


Is there any way to kill a app completely JUST like Windows 7 where i can exit any application completely or prevent autostart by going into "msconfig".  How to kill/close an app so it does not bother my battery/cpu till i open it again JUST like windows.  I have root access. SUGGEST software to do such thing keeping in mind that what i am trying to achieve here something like install the app it will never bother you unless you open it just like windows 7/xp...  I used greenify in non root didnt helped.

When my phone starts up there are several application/services running in the background that I would rather not.  And when I press the Home button while using an app, that app usually goes into the background without exiting.  How can I stop these apps from running?


How to show $\langle x,y \mid x^3=y^3=(xy)^3=1 \rangle$ is presentation of an infinite group?   This is a result in textbook, but I do not understand the rationale.

I'm trying to prove that the following group has infinite order: $$H=\langle a,b\mid a^{3}=b^{3}=(ab)^{3}=1\rangle.$$  Currently I'm checking on some cases using the relations, but my problem is the reducibility for large products.  Naively I started to check that $ab$ is different than $1,a,b$ and then $ba$ than $1,a,b,ab$, just to understand $H$ in some extent.   Now I'm wondering about some more effective method to prove that $|H|=\infty$, I'm tempted to look for an injection from some group of infinite order into $H$, but I'm still stuck.  More than asking for a solution I'd rather appreciate some hints or thoughts about it. Thanks a lot.


I have a function in my .bashrc to automatically sudo to open files that aren't writable by me:  vim() {     if [ -w "$1" ]; then         \vim "$1"     else         sudo env HOME="$HOME" \vim -u ~/.vimrc "$1"     fi }   When the file needs sudo, it works fine. When it doesn't, it recursively calls this function and uses 100% of 1 CPU until I C-C.   I see there are a few options, all of which I've tried. One actually works:  'vim' "$1" #fails \vim "$1" #fails command vim "$1" #Works!   Why do the other options not work as I would expect them to?   (I know this is a duplicate, but it was very hard to find my answer on SO/SE with the current question titles, so I wanted to post a question with a title that I and others could've found by google searching)

Sometimes I define a function that shadows an executable and tweaks its arguments or output. So the function has the same name as the executable, and I need a way how to run the executable from the function without calling the function recursively. For example, to automatically run the output of fossil diff through colordiff and less -R I use:  function fossil () {     local EX=$(which fossil)     if [ -z "$EX" ] ; then         echo "Unable to find 'fossil' executable." >&2         return 1     fi     if [ -t 1 ] && [ "$1" == "diff" ] ; then         "$EX" "$@" | colordiff | less -R         return     fi     "$EX" "$@" }   If I'd be sure about the location of the executable, the I could simply type /usr/bin/fossil. Bash recognizes that / means the command it's an executable, not a function. But since I don't know the exact location, I have to resort to calling which and checking the result. Is there a simpler way?


Can't seem to get rid of the error, look at different methods of getting rid of it, but can't really understand.  static Holding[]holding = new Holding[15];  public static void main(String[] args){     sampleData();   //Sample Data from Assignment      int options;     do{          scanner = new Scanner(System.in);          System.out.println("1. Add Holding");         System.out.println("7. Print all Holdings");         System.out.println("13. Exit");          options = scanner.nextInt();         switch(options){          case 1:             addHolding();             break;         case 7:             printHolding();             break;          default:             System.out.println("Please");         }      }while(options != 13);     System.out.println("I'm out");  }  public static void sampleData(){     holding[0] = new Book("b000001", "Intro to Java");     holding[1] = new Book("b000002", "Learning UML");     holding[2] = new Book("b000003", "Design Patterns");     holding[3] = new Book("b000004", "Advanced Java");     holding[4] = new Video("v000001", "Java 1", 4);     holding[5] = new Video("v000002", "Java 2", 6);     holding[6] = new Video("v000003", "UML 1", 6);     holding[7] = new Video("v000004", "UML 2", 4);  }      public static void printHolding(){     int option;     do{         for(Holding h : holding){                h.print();             System.out.println();         }          System.out.println("To exit press '0'");         option = input.nextInt();     }while(option != 0);   }  Exception in thread "main" java.lang.NullPointerException     at s3599741_A2.LibraryMenu.printHolding(LibraryMenu.java:307)     at s3599741_A2.LibraryMenu.main(LibraryMenu.java:71)   The error is  h.print();   and  printHolding();   in the switch statement. As you can see, the array is made from another object, like  holding[i] = new Book("Insert ID", "Insert Title");   I wrote a question like this but got marked as duplicate, I looked at the link    But can't find the problem I have or that I don't have the knowledge yet to understand. Can someone explain what I should do?   The limit of the Holding must be 15, I cannot use ArrayList or List.  The Holding Class:  public abstract class Holding{  private String holdingId; private String title;  public Holding(String holdingId, String title){      this.holdingId = holdingId;     this.title = title;          }  public String getId() {      return holdingId; }  public String getTitle(){      return title; }  public boolean getStatus(){      return active;   }     public void print(){     System.out.println("ID: " + getId());     System.out.println("Title: " + getTitle());      }  }

What are Null Pointer Exceptions (java.lang.NullPointerException) and what causes them?  What methods/tools can be used to determine the cause so that you stop the exception from causing the program to terminate prematurely?


Let $S = [0,1] \times [0,1]$, and let $f: S \rightarrow \mathbb{R}$ be continuous. Assume for each $a \in S$, there exists a $b \in S$ such that $|f(b)| \leq \frac{1}{2}|f(a)|$. Show that there exists a point $c \in S$ such that $f(c) = 0$. My idea is to use the intermediate value theorem. So let $a \in S$. Then, there exists $b \in S$ such that $|f(b)| \leq \frac{1}{2}|f(a)|$. If $f(a) = 0$ or $f(b) = 0$, then we're done. So assume $f(a) \neq 0$ and $f(b) \neq 0$. Then, from $|f(b)| \leq \frac{1}{2}|f(a)|$, we have $-\frac{1}{2}|f(a)| \leq f(b) \leq \frac{1}{2}|f(a)|$. But I don't see how I can apply IVT from here since we are not guaranteed that $\pm \frac{1}{2}|f(a)|$ is in the range of $f$. Perhaps $f$ maps $S$ to only positive reals.

$$f\in C[a,b] $$If given that for every $x\in[a,b]\text{ there exists } y\in[a,b]$ such that: $$|f(y)| \le \frac{1}{2}|f(x)| $$ Prove that there exists $ c\in[a,b]$ such that :   $$f(c)=0$$  What I've done so far : We will build a sequence in this way: $$\text{take } x_1\in[a,b]$$ for this $x_1$ there exists $y_1$ such that $ |f(y_1)|\le\frac{1}{2}|f(x_1)|$ $$\text{now $y_1$ will be our $x_2$, } y_1=x_2 $$ we will go on by doing this: $$\text{take } x_n\in[a,b]$$ for this $x_n$ there exists $y_n$ such that $ |f(y_n)|\le\frac{1}{2}|f(x_n)|\le \frac{1}{2^{n}}|f(x_1)|$  I know that this is the only way to prove it but can't seem to get on from here.. any help?


I recently purchased Nikon D5600 with dual lens.   It has come with:   AF-P: 18-55 mm, and AF-P: 70-300 mm lens   I was just going through Nikon School videos and it was showing one 18-105 mm lens.  I am puzzled. How to decide which MM lens to use in which situation? I usually want to shoot landscapes and wildlife. Which lens is suitable for these specifically?

I have a beginner photographer and I have spent a lot of time learning the basics (exposures, lenses, focal lengths, crop factor etc). It's all good except I'm not so sure when I need to buy lenses of different focal lengths.   With a short focal length (a lens like ), I can still use it to take landscape. It doesn't mean I can't take photo of things that are far away from me. So unless I need magnification why would I need any other lens?   Also, I read that for portrait lens I really want focal length of 80-85mm but again wouldn't I be perfectly fine to take portraits with the lens above?


I have a problem that I can't seem to solve. Basically, I want my chapter headings to be at the same position relative to top of the page as the rest of the text. I've looked at numerous resources online, but the problem is still not solved... :(  I tried using the titlesec package, but no results:  \usepackage{titlesec} \titleformat{\chapter}[hang] {\normalfont\Large\bfseries}{\thechapter}{1em}{\Large} \titleformat{\section} {\normalfont\Large\bfseries}{\thesection}{1em}{} \titlespacing*{\chapter} {0pt}{\baselineskip}{0pt} \titlespacing*{\section} {0pt}{\baselineskip}{0pt}   Here is what I get in the output:  Chapter Heading:    Other text (sections):    Also, the headings of TOC LoF and LoT are a little off from normal Chapter heading spacing...  Please help!

I want to decrease the vertical space between the top of the page and the chapter heading. I have tried to follow the instructions for titlesec but I am not successful. I have tried the following two setups without any changes occuring.  First:  \documentclass[12pt]{report}   \usepackage[compact]{titlesec}   \begin{document}   \chapter{Characters}  The origin of the group determinant begins with Richard Dedekind in the late 1800's. He began to explore the idea after studying the discriminant in a normal field [A]. He made several observations about the group determinant, but was only able to prove some of them.   \end{document}   Second:  \documentclass[12pt]{report}   \usepackage{titlesec}   \titleformat{\chapter}[display]   {\normalfont\huge\bfseries}{\chaptertitlename\ \thechapter}{20pt}{\Huge}   \titlespacing{\chapter}{0pt}{0pt}{0pt}   \begin{document}   \chapter{Characters}    The origin of the group determinant begins with Richard Dedekind in the late 1800's. He began to explore the idea after studying the discriminant in a normal field [A]. He made several observations about the group determinant, but was only able to prove some of them.   \end{document}


White light is a mixture of different wavelengths.   If so what will be the structure of a beam of white light ? Is there a separation between different colours ? what does it actually mean ?  Does a beam of white light shows any spacing between different wavelengths ?

Different kinds of white light have a different spectrum.  Light from a white LED will have blue at the peak intensity while white light from a CFL or something else will have a different looking spectrum.  I don't understand how this works. Shouldn't pure white light have a unique spectrum no matter what?  For example, a certain white LED's spectrum looks like this:$\hspace{100px}$.


I use the Stack Exchange sites very often to find solutions to problems and help me with decision-making.  In some sites I have asked question and received answers, and I have more than 15 reputation. On Stack Overflow I have always found answers to my questions and never needed to post a question (avoiding duplicate questions). However, I would like to vote for the answers that helped me but I do not have the ability to do that, due to low reputation.  Posting a question or answering an answer on each site seems like the only way to get enough reputation.  Since I have no input to give in these areas unless they will be counted as duplications, many answers that I have already used are missing my vote.  I suggest to take into account all of the reputations from all Stack Exchange sites for voting, or thinking about a different way to allow votes.

On Stack Exchange, users may gain a certain level of reputation.  What does reputation do? How can a user gain or lose reputation?   See also   in the Help Center  - Maximum amount of votes a user can use in a day and reputation requirements to vote.  - How to get an exact overview of the actions that got you your reputation.  - A full list of all privileges granted at each reputation level on all sites.


I am trying  to write a program that reads a txt file and prints out its 2d numbers only array, but i got NullPointerEexception I have no idea why, please help  Here is my code:  import java.io.*; import java.util.*;  public class FileR {     public static void  main(String[] args) throws Exception {         int[][] desktop;         int rows = getTotalRow();         desktop = new int[rows][];         Scanner fin;         InputStream is;         is = new FileInputStream("hello.txt");         BufferedReader br = new BufferedReader(new InputStreamReader(is));         String line = "";         try {             int row = 0;             while ((line = br.readLine()) != null) {                 line = line.replaceAll("[^0-9]+", "");                 if (line.isEmpty())                     continue;                 String[] nums = line.split("\\s*(|,|\\s)\\s*");                 desktop[row] = new int[nums.length];                 for (int i = 0; i < nums.length; i++) {                     desktop[row][i] = Integer.parseInt(nums[i]);                 }                 row++;              }          } catch (NumberFormatException e) {             e.printStackTrace();         }         print(desktop);     }       public static int getTotalRow() throws IOException {         LineNumberReader reader = null;         try {             reader = new LineNumberReader(new FileReader("hello.txt"));             while ((reader.readLine()) != null) ;             return reader.getLineNumber();         } catch (Exception ex) {             return -1;         } finally {             if (reader != null)                 reader.close();         }     }       public static void print(int[][] value) {         for (int i = 0; i < value.length; i++) {             for (int j = 0; j < value[i].length; j++) {                  System.out.print(value[i][j] + " ");              }             System.out.println();         }     } }   HEre is my hello txt file:   There should be a specific text at the top of each page  2  2, 2, 2, 2, 2, 2, 2, 2, 2 2, 0, 0, 0, 0, 0, 0, 0, 0, 2 2, 0, 0, 0, 0, 0, 0, 0, 0, 2 2, 0, 0, 0, 0, 0, 0, 0, 0, 2 2, 0, 0, 1, 3, 4, 0, 0, 0, 2 2, 0, 0, 0, 3, 4, 0, 0, 0, 2 2, 0, 0, 0, 0, 0, 0, 0, 0, 2 2, 0, 0, 0, 0, 0, 0, 0, 0, 2 2, 0, 0, 0, 0, 0, 0, 0, 0, 2 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 lmlmlm   my ouput :  2 2 2 2 2 2 2 2 2 2  2 0 0 0 0 0 0 0 0 2  2 0 0 0 0 0 0 0 0 2  2 0 0 0 0 0 0 0 0 2  2 0 0 1 3 4 0 0 0 2  2 0 0 0 3 4 0 0 0 2  2 0 0 0 0 0 0 0 0 2  2 0 0 0 0 0 0 0 0 2  2 0 0 0 0 0 0 0 0 2  2 2 2 2 2 2 2 2 2 2  Exception in thread "main" java.lang.NullPointerException     at FileR.print(FileR.java:55)     at FileR.main(FileR.java:34)   I guess NullPointerException caught when it loops empty string or null object, i want to omit null object but how to realize it i don't know Any idea on how to solve it?


How do I set up my profile on Stack Exchange so that I log in just with username and password?  Right now I login using Facebook.  I have set up an alternative desktop only for coding, but I absolutely DO NOT want to have in that account my Facebook or email accounts to avoid distractions.  Yet I need to use Stack Exchange (this is for coding, after all and I have questions). How do I log in, without using all the Facebook or  or other services. Something as simple as: username, password.

I no longer use the service that I originally used to register, and would like to change the service I use to log in, or at least add a second account.  Is this possible? How do I change my login provider or associate a backup method to log in?     For more information, see "" in the .


I am looking to download ubuntu on my mac and make a bootable cd or flash drive for a PC with windows 7. how could I do this?

Not sure if the title is specific enough, so here we go:  I crashed my Windows pc, and now I want to install Ubuntu on that computer. I'm currently using my Mac, as it is the only operable computer I have left. I have downloaded the .iso. I guess my question is; How do I go about installing Ubuntu on my crashed computer from the external harddrive? I've used Ubuntu before, but I used to install it from a CD-rom. I tried reading the instructions, but couldn't really understand them. Please help  Edit: As Tom mentioned, I only want to install Ubuntu on the (formerly) Windows machine.  Anyways, thanks for the quick responses, I think I've got it from here. Cheers


I am new to Latex, but I am determined to learn it. I am writing my M.Sc thesis. I have found an introductory document on how to do so. My understanding is that:  1) The book class is more appropriate.  2) Apparently, it is good to break the thesis into chucks and "assemble it" with a "master file." I am a bit confused by this. I would greatly appreciate if someone could please refer me to additional info on how to write/assemble a thesis. So far, I have learned how to write small papers with math/text. Btw, my university no longer has a Latex format: they simply told me to follow the guidelines.  Thank you! :)

I'm in the process of thesis writing. I'm LaTeX newbie and have its limited knowledge and experience. I'm thinking to use LaTeX or LyX for my thesis. Which one is better for thesis write up? If I go with LaTeX then how can I use it more efficiently. In case of LaTeX I'd like to have separate .tex file for each chapter and each chapter will have its own bibliography. Then how can I combine all chapters and other issue would of cross references. I have to my Univ. template for thesis write up. I'd highly appreciate if someone provide me general guidelines to manage and write a long document like thesis in LaTeX.


Suppose that Γ is a set of sentences with arbitrarily large finite models (that is, for every natural number n, there is some interpretation whose domain has more than n members such that every member of Γ is true in that interpretation). Show that Γ has an infinite model.

I'm trying to prove the following: If $T$ is a first-order theory with the property that for every natural number $n$ there is a natural number $m>n$ such that $T$ has an $m$-element model then $T$ has an infinite model.  My thoughts: If $M$ is an $n$-element model then $\varphi_n = \exists v_1, \dots, v_n ((v_1 \neq v_2) \land \dots \land (v_{n-1} \neq v_n))$ is true in $M$. Can I use this to show that $T$ has an infinite model? How? Perhaps combine it with the compactness theorem somehow? Thanks for your help.


I have a situation like this:  I worked for an employer this year from January to May and contributed $14,500 to my 401K. There was no matching from this employer. In mid-May time frame, I changed jobs and my new employer matches $0.90 to every dollar, up to a maximum of 5% of base salary in 401K/Roth IRA. Since the 2013 401K individual contribution limit is $17,500, I would like to take advantage of my employer contributions to maximize my tax free gain. How can I do this? Please suggest my options.  Reading thru the web, I came to know that employer contributions do not count towards the $17,500 individual 401K limit. Is this correct? Can I contribute up to $17,500 before-tax in my 401K and still get employer matching, let's say $3000, on top of that? Which will take my 401K total contributions for this year to $20,500? Please advise.

Suppose I max out my 401(k) really early. This avoids the risk that if I lose the job I would have lost the chance to contribute to it fully. However there is another risk. My company doesn't match. Suppose I do lose my job in the middle of the year and go to another company that matches. Then I would lose out on the ability to get the matches from the new company in the rest of the year, because I (technically) cannot contribute more 401(k).  But... Since the new employer doesn't know how much I may have contributed, I may (should this scenario of changing jobs really occur) simply pretend I didn't know anything and contribute to the new company's 401(k) plan anyway (taking advantage of the matches), as if I didn't have 401(k) contributions already. Then, after the end of the year, I can ask the old 401(k) plan for excess contributions back from that plan, as  before April 15th.  To summarize, the strategy is, if I switch jobs, contribute fully to each job, and then at the end of the year, strategically withdraw excess contributions from the one that had the lowest match.  Would this strategy: (a) work? (b) make sense? (c) be legal? (d) be ethical?


I have an Acer Nitro-AN515-53 running Ubuntu. Is there a way I can control fan speed? Is there any type of software for this?

How can I control the computer's fan speed?  On Windows there is a wonderful program called .


Why not just use one or the other?  Is there a convention that applies to class vs struct?

In what scenarios is it better to use a struct vs a class in C++?


In a book (SAS Essentials: A Guide to Mastering SAS for Research 2009 page 143) it says:    However, when I look at this picture (not from the book, from the web):    Or also this picture, in case the first one is maybe wrong (also from the web):    So the leptokurtic (thin) green curve has a Kurtosis which is positive, it is more peaked. Ok, clear to me. But what about the tails? When I look at the right and the left tail, the red mesokurtic curve has heavier tails? I mean there is clearly more area under the curve under the red curve than under the green curve?

The kurtosis is to measure the peakedness and flatness of a distribution. The density function of the distribution, if it exists, can be viewed as a curve, and has geometric features (such as curvature, convexity, ...) related  to its shape.  So I wonder whether the kurtosis of a distribution is related to some geometric features of the density function, which can explain the geometric meaning of kurtosis?


I want to use Ubuntu 14.04.I do not wish to opt for lightweight versions so I need help in determining some reasonable hardware upgrades so I can use Ubuntu comfortably. Currently my system specs are as follows: 1)512mb of ram. Can be increased not more than 2 GB (would that be enough?) 2)No graphics card (would it be required?) 3)Processor is pentium 4 4)Speed is 2ghz.

I'm thinking about installing Ubuntu Desktop, but I don't know what flavor is the best for my system. What are the minimum and recommended hardware requirements? What kind of CPU? How much memory? Should I have Hardware Acceleration? What flavor should I use?  This is an attempt of a canonical answer. My answers have the "official  requirements", the recommended are a mix of official sources and opinion based (along with the answer it's told the source). You can comment or edit if you feel that the information is obsolete or incomplete. It is a good rule of thumb that any system capable of running Windows Vista, 7, 8, x86 (Intel) OS X will almost always be a lot faster with any Ubuntu flavor even if they are lower-spec than described below.


From some resources, I had come to know that under Java collection, ArrayList is faster than Vector. To check that, I was trying with a small program in which one method adds some data to an ArrayList and then retrieve those and the another method adds and retrieves same data to and from a Vector. Now the main() method calls two of them under two different time calculation process which calculates the execution time of those method separately. In the result, I am getting the execution time for ArrayList is 18385831 ns and for Vector is 2190242 ns. My project lead also said that the ArrayList is faster than Vector. But the result of my program is saying something different. Can anyone please explain me the correct thing with its reason? And also the reason of this result if ArrayList is really faster than the Vector.  This is my source code:  import java.util.*;  public class TestArraylist {      void Arraylistpart() {         ArrayList<Object> a1 = new ArrayList<Object>();         ArrayList<Object> a2 = new ArrayList<Object>();         a2 = a1;          a1.add(1);         a1.add('c');         a1.add("gh");         a1.add(2);         a1.set(2, "ab");         int count = 0;         System.out.println(a1);         try {             for (Object i : a1) {                 a2.set(count, i.toString());                 count = count + 1;             }             a2.sort(null);             System.out.println(a2);         } catch (ClassCastException e) {             System.err.println("Exception occurs");         }     }      void vectorpart() {         Vector<Object> v1 = new Vector<Object>();         Vector<Object> v2 = new Vector<Object>();         v2 = v1;         v1.add(1);         v1.add('c');         v1.add("ab");         v1.add(2);         int count1 = 0;         System.out.println(v1);         try {             for (Object i : v1) {                 v2.setElementAt(i.toString(), count1);                 count1 = count1 + 1;             }             v2.sort(null);             System.out.println(v2);         } catch (ClassCastException e) {             System.err.println("Exception occurs");         }     }      public static void main(String[] args) {         TestArraylist objct = new TestArraylist();         System.out.println("Arraylist program");         long startmili = System.currentTimeMillis();         long starttime = System.nanoTime();         objct.Arraylistpart();         long endtime = System.nanoTime();         long endmili = System.currentTimeMillis();         long totaltime = endtime - starttime;         long totaltimemili = endmili - startmili;         System.out.println(totaltime);         System.out.println("Time in mili is: " + totaltimemili);          System.out.println("\nVector program");         long startmili1 = System.currentTimeMillis();         long starttime1 = System.nanoTime();         objct.vectorpart();         long endtime1 = System.nanoTime();         long endmili1 = System.currentTimeMillis();         long totaltime1 = endtime1 - starttime1;         long totaltimemili1 = endmili1 - startmili1;         System.out.println(totaltime1);         System.out.println("Time in mili is: " + totaltimemili1);     } }

How do you write (and run) a correct micro-benchmark in Java?  I'm looking for some code samples and comments illustrating various things to think about.  Example: Should the benchmark measure time/iteration or iterations/time, and why?  Related:


I often see edited question/answer while surfing around the SE sites on the app on my phone. Sometimes I wish to see the original post but on the app this seems impossible.  To do this now I have to open the question/answer in my browser which takes time and data  How can I do this? Can this feature be added to the SE app?

Basically this suggestion for the Android app:   Many times I'll see that a post has been edited on the Android app. I'll want to see exactly what was edited, and the Android app doesn't show this. Can the revision history be added to the Android app?


I am executing Skyrim through Steam Big Picture with the controller but when I select Play on Big Picture, the launcher of the game appears and I have to use the mouse to start to play. This is very annoying and I would like to start to play avoiding this step.  I have seen that you can set parameters to the laucher on Big Picture mode.  This question seems to be duplicate, but this problem is slightly different because I need to open the game through the current executable to be able to get new achivements and to accumulate playing hours.  UPDATE: I am using a computer just to play games, so Steam opens at start with Big Picture Mode, so I Boot the computer and I can start to play only using my controller. The problem is that the launcher doesn't work with the controller and I have to use the  mouse just for it.

Can you Start Skyrim 'silent' without the launcher showing up?


Does there exist a positive integer $n$ such that $4^n - 1$ is not divisible by $3$? If so, what is it, and if not, prove it. This is just a recreational problem that seemed simple at first but I couldn't figure it out.

I did some mathematical induction problems on divisibility   $9^n$ $-$ $2^n$ is divisible by 7. $4^n$ $-$ $1$ is divisible by 3. $9^n$ $-$ $4^n$ is divisible by 5.   Can these be generalized as $a^n$ $-$ $b^n$$ = (a-b)N$, where N is an integer? But why is $a^n$ $-$ $b^n$$ = (a-b)N$ ?  I also see that $6^n$ $- 5n + 4$ is divisible by $5$ which is $6-5+4$ and $7^n$$+3n + 8$ is divisible by $9$ which is $7+3+8=18=9\cdot2$.  Are they just a coincidence or is there a theory behind?  Is it about modular arithmetic?


Dark energy is constantly pulling all objects away from each other with increasing speed. This in turn causes a red-shift of the light from the most distant object where this effect is most profound. This red-shift will gradually increase as the objects move away faster. Is there going to be a time where the objects travelling away will emit light of such long wavelength that they will ddisappear from sight?

So, this bit of information confused me lately. Before, I figured galaxies were no longer visible by us because their luminosity decreased in an inverse square manner. However, while watching a movie I stumbled upon the concept of how galaxies disappeared from our sight because the space which both galaxies occupy is moving away from each other faster than the speed of light.  I understand nothing can move faster than the speed of light, but the argument here, I guess, is that space itself can move, as a consequence of the Big Bang, faster than the speed of light. Is this correct? If not, how do galaxies disappear?


I've got an old Mac with 24 cores, and I'd like to run several hundred/thousands one-core jobs automatically.  I've made a bash script that runs the processes in the background, but if I set too many going at once the computer freezes (apparently 300 is okay, 400 too much...).    Ideally, what I'd like to do is run 24, then when one finishes, the 25th, then when the next finishes, the 26th, and so on. Unfortunately each job can take a different, and variable run time, so I can't do some kind of chron to set them going at staggered times.  I've seen some things with "wait", but I'm not sure if I sent 24 then, say, 976 with a wait command, would it give me the desired behaviour, or would it just run 976 in series after the first of the 24 finish?  EDIT: Thanks, this could very well be a duplicate, but as I see that question's answers only point towards parallel, can I please continue to explore here how to do it with xargs?  Reason for this, is that the Mac in question is currently on another continent and I absolutely need it to work for the next few days and run all these jobs - installing something always has the potential to mess up the machine, and so I don't want to install parallel at this point while I can't physically get to it. But it has xargs in bash, so I'm exploring using that.  Thus far, I've rewritten my bash script to meet what appears to be the situation expected by both xargs and parallel, that I can run it with a variety of input.  So now, what I have is a bash script that runs my jobs on each file in a folder. I've currently tried:  ls -d myfolder/* | xargs -P 2 -L 1 ~/bin/myscript.sh  But this still seems to run them all simultaneously, thus I'm not sure what I've done wrong. (here I'm using max 2 just so I can keep looking and testing! I put only 4 in the folder - didn't want to send hundreds by accident)  FINAL EDIT: Ahah!!! MUCH later I figured out what I'd done wrong. xargs was likely running my script in parallel, but not the program I'd written the script to run. I wrote a script because I hadn't been able to figure out how to insert the filename into the arguments list, which expected parameter=value pairs.  I eventually figured out how I could do this with the -I flag in xargs. This finally worked:  ls -d myfolder/* | xargs -I foo -P 2 -L 1 myprogram arg1 arg2 arg3=foo arg4  (I think -I and -L 1 are redundant, but as it works I'm not messing with it...)  Here, foo was replaced in the arguments list to myprogram with each filename.  I note that one reason it took me ages to figure out is most instructions with -I use {} as the element to replace, and for some reason on my Macs it couldn't handle that. So I thought -I wasn't working, but it worked fine with foo.

So, I have 10 CPU core and 20 data to process. I want to process the data in parallel but I am afraid if I just process 20 at once it will make some problem. So, I want to process 10 data 2 times. Is there any command to do this?  Add info:  The data are in file format. It is quite huge, per file can reach 10GB. In my expreience if I launch more than 10 process, the PC will become really slow and even lag. So I am limiting the process to be only 10 which is equal to the number of cores. As for my RAM, I believe the software which process the file will not load everything at once so the RAM usage is quite low. That is why I just need to parallel the process for every 10 data. For now, I generate 10 shell script which execute parallel and each shell script contains sequential command.


I was just reading chapters from The Feynman Lectures on Physics Vol 1 about antennas and radiation, and I'm confused about the so-called "radiation resistance" experienced when driving an antenna. If you push on a charge then you increase its momentum (which you can recover later) and you also create an electric field that can do work on other charges far away. My understanding is that the reason this isn't a source of free energy is that the Abraham–Lorentz force resists your effort to accelerate the charge. You have to put in extra work to account for all the energy being radiated away. The problem is that the radiated power is proportional to acceleration but the Abraham–Lorentz force is proportional to the next derivative (jerk). So what happens with constant acceleration? You could accelerate a charge in a straight line for 10 seconds, or you could maintain the same acceleration for 1000 years. You radiate power for much longer in the latter case, but the work done against the Abraham–Lorentz force is identical. Doesn't this violate conservation of energy?

The  gives the recoil force, $\mathbf{F_{rad}}$, back on a charged particle $q$ when it emits electromagnetic radiation. It is given by:  $$\mathbf{F_{rad}} = \frac{q^2}{6\pi \epsilon_0 c^3}\mathbf{\dot{a}},$$  where $\mathbf{\dot{a}}$ is the rate of change of acceleration.  If a particle has a constant acceleration, $\mathbf{\dot{a}}=0$, then there is no reaction force acting on it. Therefore the particle does not lose energy.   Does this mean that a constantly accelerating charged particle does not emit electromagnetic radiation?


I have a data model that is quite large with many members, and many of them are themselves large data models, with nesting like this for several levels deep. The top class represents the overall model that is serialized and sent off to a server for backup. As a debugging step, we would like to deserialize a recent backup and compare it to the in-memory data model at the time of backup, which should be equal. The most obvious way to do this is apply operator== on the current model and its serialized-then-deserialized version.  The problem is that the degree of nesting and quantity of custom data structures will require a tremendous amount of code to write all those operator== implementations. Not to mention that many of those individual implementations will alone be many lines long to compare every member's equality. We're easily talking >1k lines of code just spent on operator==. Even if we do all that, there is large room for programmer error on something like this.  Is there any alternative for a quick and dirty (though reliable) equality check, perhaps using much lower level techniques, or anything that would not require a couple of days of doing nothing but writing operator== functions?

I am a big fan of letting the compiler do as much work for you as possible.  When writing a simple class the compiler can give you the following for 'free':   A default (empty) constructor A copy constructor A destructor An assignment operator (operator=)   But it cannot seem to give you any comparison operators - such as operator== or operator!=.  For example:  class foo { public:     std::string str_;     int n_; };  foo f1;        // Works foo f2(f1);    // Works foo f3; f3 = f2;       // Works  if (f3 == f2)  // Fails { }  if (f3 != f2)  // Fails { }   Is there a good reason for this?  Why would performing a member-by-member comparison be a problem?  Obviously if the class allocates memory then you'd want to be careful, but for a simple class surely the compiler could do this for you?


Is it possible to create a table and include only the pure data from an external file (only ampersand delimited stuff). Is it also possible to scale a table because data is vast and I don't want to keep on messing with table width and heights??  \begin{table}[H!]    \centering   \begin{tabular}{llllllll} \input{stuff}; \end{tabular}    \caption{This is a caption}  \label{xxxx}     \end{table}   I want to import the data on the \input{stuff} part

I have a table which its width exceed the textwidth of the document, but I want reduce its size to fit the textwidth space.   I have tried the resizebox command but it doesn't work at all.  \begin{table}[h!]   \centering   \resizebox{\textwidth}{!}{     \begin{tabular}{|c|c|c|c|c|c|c|c|c|c|c|c|c|c|}   \hline   One & Two &Three & Four & Five & Six & Seven & Eight & Nine & Ten & Eleven &   Twelve & Thirteen & Fourteen\\    \hline   \hline   $1.111$ & $2.222$ & $3.333$ & $4.444$ & $5.555$ & $6.666$ & $7.777$ &   $8.888$ & $9.999$ & $0.000$ & $1.111$ & $2.222$ & $3.333$ & $4.444$\\   \hline   \end{tabular} }   \caption{Test Table}   \label{tab:label_test} \end{table}   The table keeps the same width and exceed the border of the page.  I want resize the table, scaling all the tabular object without touch the caption fontsize.   How can I do that?    If I copy the code of @HarishKumar:


I have seen this sentence somewhere.     she came undone   I take this in as putting together an intransitive verb and an adjective(or a participle) so as to describe state of a subject.  and likewise, I tried a few other variations,   so are followings weird in your sense?  If it sounds weird, can you explain the reason?     she arrives dry.      she walks wet.      she lived stealing.      she drinks unsatisfied.      she sits angry.      she stands hungry.

I came across these two sentences:  He was standing there proud." "He is growing up rich."  I think I can understand what each sentence means, but grammatically they don't make sense to me. My understanding about adjectives are that they can only be before the noun or with "be".  I see these kinds of sentences sometimes and have always wondered why. My first question is that in the first sentence, if I say, "He was standing there, being proud." is the meaning the same?  And in the second one, can I say, "He is growing up to be rich."? My second question is whether these ways of using adjectives are common or not.


I have a special field in my bibliography, called adsurl, and I would like to display this url in my file as a link.  However, when I try this, href throws a very weird error. It enters some sort of infinite loop where it keeps saying   ! Undefined control sequence.  \filename@simple ...#2\\}\fi \edef \filename@base                                                {#1}   MWE:  \documentclass[a4paper,12pt]{article} \usepackage[utf8]{inputenc} \usepackage{filecontents}  \begin{filecontents*}{\jobname.bib} @online{elk,  author       = {Anne Elk},  title        = {On the Theory of Brontosauruses},  adsurl       = {https://example.edu/~elk/bronto.html}, } \end{filecontents*}   \usepackage[hyperref,backend=biber]{biblatex} \usepackage{hyperref} \addbibresource{\jobname.bib}  \begin{filecontents*}{biblatex-dm.cfg}  \DeclareDatamodelFields[type=field, datatype=literal, skipout=false]{adsurl}  \DeclareDatamodelEntryfields{adsurl} \end{filecontents*}  \begin{document}  \cite{elk} %this works  \citefield{elk}{adsurl} %this also works  \href{\citefield{elk}{adsurl}}{ads} %this does not work \end{document}   How can I get href to accept the output of citefield as url?

Using biblatex, how can I get a URL from the bib file so that I can use it in the \href command?  I am guessing that the \usefield command is what I am looking for and that in order to use that I would need the \entrydata command. But both are undefined.  \documentclass{article} \usepackage[backend=biber]{biblatex} \usepackage{hyperref}  \usepackage{filecontents} \begin{filecontents*}{sources.bib} @online{biblatex,     url = {http://mirrors.ctan.org/macros/latex/contrib/biblatex/doc/biblatex.pdf},     urldate = {2018-02-02}, } \end{filecontents*}  \addbibresource{sources.bib}  \begin{document}      % This would work, but I don't want to duplicate the URL from the bib file:     \href{http://mirrors.ctan.org/macros/latex/contrib/biblatex/doc/biblatex.pdf}{biblatex documentation}      % Does not work because \citeurl{biblatex} is already a link, not the URL:     %The \href{\citeurl{biblatex}}{biblatex documentation}      % Does not work because \usefield and \entrydata are undefined:     %The \entrydata{biblatex}{\usefield\href{url}{biblatex documentation}}      \printbibliography \end{document}


I'm new to blender, and I'm trying some basic water sims.  I can't see Bake in the UI anywhere, and I've been looking for over an hour...   Any ideas?

(new to blender) i am trying to create a fluid sim in blender 2.83 but in my physics tab under domain there is no 'bake data' button in the options. It's there in all the tutorials i've watched but i dont seem to have it.


I am creating a simple program for a school assignment that creates a very basic user account and compares a user entered password to the account password.  No matter what value I pass to the checkPassword function, it always returns a value of false.  So far I have written the function as you see it here as well as breaking it down into an if else statement and returning a value based on that.  I have displayed the values being compared to the screen both from the main method and from the checkPassword method so that I know the values match.  package firstAssignment;  public class UserAccount {      // Fields     private String username;     private String password;     private boolean active;      // Constructors     public UserAccount() {         this.active = true;     }      public UserAccount(String username, String password) {         this.username = username;         this.password = password;         this.active = true;     }      // Getters and setters      public String getUsername() {         return username;     }      public void setUsername(String username) {         this.username = username;     }      public String getPassword() {         return password;     }      public void setPassword(String password) {         this.password = password;     }      public boolean isActive() {         return active;     }      public void setActive(boolean active) {         this.active = active;     }      // Methods      public boolean checkPassword(String password) {         return (this.password == password);     }      public void deactivateAccount() {         this.active = false;     }      @Override     public String toString() {         return this.username;     }      @Override     public int hashCode() {         final int prime = 31;         int result = 1;         result = prime * result + ((username == null) ? 0 : username.hashCode());         return result;     }      @Override     public boolean equals(Object obj) {         if (this == obj)             return true;         if (obj == null)             return false;         if (getClass() != obj.getClass())             return false;         UserAccount other = (UserAccount) obj;         if (username == null) {             if (other.username != null)                 return false;         } else if (!username.equals(other.username))             return false;         return true;     }    }   regardless of what values I feed it, it always returns a value of false.

I've been using the == operator in my program to compare all my strings so far. However, I ran into a bug, changed one of them into .equals() instead, and it fixed the bug.  Is == bad? When should it and should it not be used? What's the difference?


Using Lagrange's Theorem, it's easy to show that if $G$ is a finite group and $g\in G$, then $g^{|G|} = 1$.  But proving Lagrange's theorem requires defining cosets.  My question is, is there any elementary way to prove this result without using either Lagrange's theorem or cosets? There is an elementary proof of that kind in the abelian case, but I'm asking about the general case.

This is a very easy fact we use in Group Theory,  But somehow, I wondered that whether there may be another way (other than Lagrange's Theorem) to prove that the order of an element divides the order of Group.  I attempted to go on the term "exponent" of the Group (just assume that G is a Finite Group), which we may define the least common multiple of orders of elements in G. But this exponent divides $|G|$, since the order of each element divides $|G|$. So it became a little paradox.   Shall I think that; before teaching this fact in a Course, one should teach about Lagrange's first?


I have some data from NV charts. As it looks like the data is contained in .bsb and .eap files. Is there a possibility to implement these data in QGIS as raster as a background? Loading the .bsb data directly seems not possible. Loading the .eap data works but there is only black and white lines and nothings looks like a map.  This nautical chart data seems to be different from NOAA data as no .kap files exist.  Data can be read using the following software: nv charts App, Chart Navigator professional, or Chart Navigator Standard.

Is it possible to load a nautical chart from  into QGIS that has the .bsb format?  Didn't have much luck with mrSID format.   using QGIS(dev) on ubuntu 13.04


I'm trying to solve an exercise in Stein complex analysis book, and totally stuck up right now.  I can't find a pdf of this book..so I take the photo. The problem requires me to show the equality 'without' using the Cauchy Integral Formula. I at first thought it would be an easy task...but the calculation seems to be quite nontrivial. Some complicated exponential terms come out on the denominator..... Could anyone help me how to solve this problem?

I have this exercise:     Show that if $|a| < r <|b|$, then $\int_\gamma \! \frac{1}{(z-a)(z-b)} \, \mathrm{d}z=\frac{2\pi i}{a-b}$, where $\gamma$ denotes the circle centered at   the origin, of radius $r$, with positive orientation.   I will use the parameterisation $re^{it}$ and integrate from $0$ to $2\pi$. But I get stuck. One way I tried was partial fractions, I know that :  $$\frac{1}{(z-a)(z-b)}=\frac{-1/(b-a)}{z-a}+\frac{1/(b-a)}{z-b},$$ but when I try to integrate the first part I get:  $$\int_0^{2\pi} \! \frac{-1/(b-a)}{re^{it}-a}rie^{it} \, \mathrm{d}t,$$ but how do I evaluate this? My first instinct is to use substitution, but it is not clear if I can when we are dealing with complex numbers. Any tips?


Is it true that (k,n+k)=d if and only if (k,n)=d?  I solved "Prove that (k,n+k)=1 if and only if (k,n)=1"  but I cannot solve "Is it true that (k,n+k)=d if and only if (k,n)=d?"  I think it is False but I don't know why it is

Given: $a = qb + r$. Then it holds that $\gcd(a,b)=\gcd(b,r)$. That doesn't sound logical to me. Why is this so?    Addendum by LePressentiment on 11/29/2013: (in the interest of  and averting a duplicate)  What's the intuition behind this result? I only recognise the proof and examples solely due to algebraic properties and formal definitions; I'd like to apprehend the result naturally.


$$\lim_{x\to0}\frac{1-\cos x}{x^2}$$  I know there are many ways to calculate this. Like L'Hopital. But for learning purposes I am not supposed to do that. Instead, I decided to do it this way:  Consider that $\cos x = 1- \sin^2 \frac{x}{2}$ (from the doulbe-angle formulas ). Therefore:  $$\frac{1-(1- \sin^2 \frac{x}{2})}{x^2} = \frac{\sin^2 \frac{x}{2}}{x^2}$$  Let us split this:  $$\frac{\sin \frac{x}{2}}{x} \cdot \frac{\sin \frac{x}{2}}{x}$$  I will just work with the left one for now. At the end, I will just multiply it by itself.  $$\frac{\sin \frac{x}{2}}{x}$$  Hm. Remember that $\frac{\sin x}{x} = 1$ when $x\to0$. If only the denominator were an $\frac{x}{2}$ instead of $x$ I could do this... Well, I can! Let's just  $$\frac{\sin \frac{x}{2}}{x}\cdot\frac{\frac{1}{2}}{\frac{1}{2}}$$  Looks a bit dumb but it kind of makes sense. This will yield  $$\frac{\color{red}{\sin \frac{x}{2}}\cdot \frac{1}{2}}{\color{red}{\frac{x}{2}}}$$  Hurray, we can now apply the formula thingy and end up with  $$\frac{\color{red}1\cdot\frac{1}{2}}{\color{red}1} = \frac{1}{2}$$  Now I need to multiply this thing by itself.  $$\frac{1}{2} \cdot \frac{1}{2} = \frac{1}{4}$$  And that is the answer.  ... Which is wrong. The correct answer is  $$\frac{1}{2}$$  What did I do wrong in these steps? I know many of you are able to solve this with a variety of different methods, but I'm particularly interested in this specific procedure I just tried to use. What was my mistake?

$$\lim _{x \to 0}{1-\cos x\over x^2}={2\sin^2\left(\frac{x}{2}\right)\over x^2}={\frac{2}{x^2}\cdot {\sin^2\left(\frac{x}{2}\right)\over \left(\frac{x}{2}\right)^2}}\cdot\left(\frac{x}{2}\right)^2$$  now $$\lim_{x \to 0}{\sin^2\left(\frac{x}{2}\right)\over \left(\frac{x}{2}\right)^2}=\left({\sin\left(\frac{x}{2}\right)\over \left(\frac{x}{2}\right)}\right)^2=1^2$$  So we have $$\frac{2}{x^2}\cdot \left(\frac{x}{2}\right)^2=\frac{2}{x^2}\cdot \left(\frac{x^2}{4}\right)=\frac{1}{2}$$  Are the moves right?


I have a problem where I can see through a box in blender game, see picture. This effect changes so that the near side of the "chassis" of the truck is invisible when I rotate the model    What can I do to not make this happen?

I used sculpting on a plane, and things looks great. However, when I press P to play, the whole ground become a mess. I can see through it in various places, and there are also nasty looking black edges everywhere.  another problem, I made a UV Sphere to display the sky, but when I press , P to play it disappears!


I'm using Budgie Desktop currently, and I really enjoy it. It's got good battery life, customizability, stability and speed, but there's just one thing that bothers me; it doesn't have a real app switcher. Pressing Alt + Tab will switch apps, but no dialog appears, and it doesn't allow me to select an app I want to see; it just calls them all to front, on at a time.  Because of this, I've been looking for some third party app switcher that'll show a dialog and let me select the app to switch to instead of just pulling everything to the front. Right now, I'm using skippy-xd, which is an exposé-style switcher. It's OK, but I'd prefer the linear method that Unity and GNOME use.  Googling has turned up nothing. I think I'm just not doing it correctly.  Are there any standalone app/task switchers (besides skippy-xd) available for Ubuntu or Linux in general?

I have Ubuntu budgie 17.04 (budgie-desktop 10.2.9). While pressing Alt+Tab to switch between the windows, the windows are switched randomly and I am not able to select which window to shift.  This feature was available in Ubuntu 16.04 but not in Ubuntu-budgie-17.04.    How to resolve this?


On MSE (English):        On ruSO (Russian):        On jaSO (Japaneese):        On ptSO (Portuguese):        On esSO (Spanish):        Also note that progress indicator (white/green line) is not centered between values (current, needed) at least when no review completed yet, i.e. zero count.

Probably, the problem could be also on other localized sites.


its a windows xp for now so any how to tell how to do it in xp my old laptop:  Intel(R) Celeron(R) M processor 1.40 GHz and 224 MB of RAM

I'm thinking about installing Ubuntu Desktop, but I don't know what flavor is the best for my system. What are the minimum and recommended hardware requirements? What kind of CPU? How much memory? Should I have Hardware Acceleration? What flavor should I use?  This is an attempt of a canonical answer. My answers have the "official  requirements", the recommended are a mix of official sources and opinion based (along with the answer it's told the source). You can comment or edit if you feel that the information is obsolete or incomplete. It is a good rule of thumb that any system capable of running Windows Vista, 7, 8, x86 (Intel) OS X will almost always be a lot faster with any Ubuntu flavor even if they are lower-spec than described below.


I looked around for a bit and I haven't found the correct thread that fits my needs, I have an old mac Powerbook G4, I want to run Ubuntu Server on it, can I wipe out the entire harddrive and just run Ubuntu? (I don't need the Mac OS), or would I need to use a VM or dual boot. I tried a few things and it didn't work, I tried partitioning the hard drive and  burning the image, I tried using bootcamp but that did not work and tried both USB and Disk. I want to use the Ubuntu server just so I can get familiar with Linux servers and do my programming whenever I am on the road or not at my desktop. I don't know if I am doing something wrong, I maybe any help would be much appreciated.  Specs:  Mac OS X Version 10.5.8 Processor: 1.33 GHz PowerPC G4 Memory 2 GB DDR SDRAM Processor: PowerBook G4 1.1 L2 Cache: 512kb

Is the current version of Ubuntu usable on a PPC mac?  I've got a "lamp shade" mac from 2003 that I'd like to recycle into my first Linux computer.  I'm not a programmer.  So it appeals to me that Ubuntu is a download/upload kind of thing.  Apple iMac G4 1.25GHz  Any suggestions?


I want to cite using the \filecontents command for the books.  But it doesn't recognize the books. It only shows the keyword in bold. It says citation "elch" is undefined      \documentclass[12pt]{article}      \usepackage[ngerman]{babel}     \usepackage[a4paper, text={16.5cm, 25.2cm}, centering]{geometry}     \usepackage[sfdefault]{ClearSans}     \usepackage[utf8]{inputenc}     \setlength{\parskip}{1.2ex}     \setlength{\parindent}{0em}      \usepackage{filecontents}       \begin{filecontents}{ref.bib}     @BOOK{elch,     AUTHOR = "Karall, Benedikt and Schwarz, Markus",     TITLE = "{Eine Studie zur Elchplicht}",     PUBLISHER = "JG-Verlag",     YEAR = 2012}     \end{filecontents}       \usepackage[style=authoryear, backend=biber]{biblatex}     \addbibresource{ref.bib}      \begin{document}      Die exakte Herleitung kann in \parencite{elch} nachgelesen werden.     \end{document}

Running the minimal example  \documentclass{article} \usepackage{filecontents} \begin{filecontents*}{\jobname.bib} @ARTICLE{example,   author  = {Other, Anthony Norman},   title   = {Some things I did},   year    = {2014},   journal = {J.~Irrep. Res.},   volume  = {1},   number  = {1},   pages   = {1-10} } \end{filecontents*} \usepackage[backend=biber]{biblatex} \addbibresource{\jobname.bib} \begin{document} Hello\cite{example}. \printbibliography \end{document}   I get the warning There were undefined references.  I have read  and know that I need to run:   LaTeX Biber LaTeX   However, my editor is only set up to run BibTeX. How do I go about setting up my editor/IDE to be able to run Biber, and how do I run the LaTeX/Biber/LaTeX cycle?  Answers (sorted alphabetically by editor name)                    Answer guidelines   Each answer should be for one editor. If the editor is cross-platform, if possible give a single answer with notes covering the minor platform variations. Please edit the question to include new answers in the 'link list' Each answer should be 'stand alone', i.e. don't say 'It's almost the same as editor Y but ...' for the editor part Instructions for 'build tools' such as arara or latexmk are welcome but should explain how to set up the editor in question as not all editors allow simple addition of arbitrary tools


Please prove that $\sqrt 2 + \sqrt 3$ is irrational.  One of the proofs I've seen goes:     If $\sqrt 2 +\sqrt 3$ is rational, then consider $(\sqrt 3 +\sqrt 2)(\sqrt 3 -\sqrt 2)=1$, which implies that $\sqrt 3 − \sqrt 2$ is rational. Hence, $\sqrt 3$ would be rational. It is impossible. So $\sqrt 2 +\sqrt 3$ is irrational.   Now how do we know that if $\sqrt 3 -\sqrt 2$ is rational, then $\sqrt 3$ should be rational?  Thank you.

Can the expression $\sqrt{n} + \sqrt{m}$ be rational if neither $n,m \in \mathbb{N}$ are perfect squares? It doesn't seem likely, the only way that could happen is if for example $\sqrt{m} = a-\sqrt{n}, \ \ a \in \mathbb{Q}$, which I don't think is possible, but how to show it?


Since the  about two years ago, age is no longer displayed on user profiles.  However, it's still visible in the :        I can't see any  point leaving it there when it's removed from all site profiles. Can it please be removed from the network profile as well?

Ever since the profile redo, the age was shown in the network profile, but not in the per-site profiles. So if someone wanted to see the age, they had to go to the network profile. However.. It's vanished! The field is still there in the profile editing, however. It doesn't appear as if this was implemented:   So... Where is it?


How can I check if my server is using ssl 3?  When I run openssl version command I get this.  OpenSSL 1.0.1 14 Mar 2012  Thanks.

Google  a vulnerability in the SSLv3 protocol that     ... allows the plaintext of secure connections to be calculated by a network attacker.   This vulnerability has been given the designation  and the marketing name POODLE.  If I have a website at `, how can I tell if this vulnerability affects me?


Because of a low-graphics error I am not able to log into my system any more, or at least I am not seeing any graphical interface (solutions here  have been tried).  df -h revealed that my /dev/sda6 partition is full:    Filesystem Size Used Avail Use% Mounted on /dev/sda6 7.4G 6.6G 398M 95% / udev 1.9G 4.0K 1.9G 1% /dev tmpfs 762M 424K 762M 1% /run none 5.0M 0 5.0M 0% /run/lock none 1.9G 0 1.9G 0% /run/shm overflow 1.0M 4.0K 1020K 1% /tmp /dev/sda7 449G 266G 161G 63% /home /dev/sda1 447M 115M 308M 28% /boot   and  sudo du -kxa / | sort -nr | head leads to the output   sort: write failed: /tmp/sortXXXXXX (X = any number or letter):  No space left on device   Therefore my question, how do I clean this /tmp/sortXXXXXX folder or directory with terminal commands and how do I set permission flags for that folder or directory to the standard value? I assume I messed up this permissions and now every process is writing to tmp.

Note: This is an attempt to create a canonical question that covers all instances of "low-graphics mode" error that occurs to a user, including but not limited to installation of wrong drivers, incorrect or invalid lightdm greeters, low disk space, incorrect installation of graphics card like ATI and Nvidia, incorrect configuration of xorg.conf file while setting up multiple monitors among others. If you are experiencing the "low-graphics mode" error when trying to login but none of the following answers work for you, please do ask a new question and then update the answers of this canonical question as and when your new question gets answered.   When I try to boot into my computer, I am getting this error:  The system is running in low-graphics mode Your screen, graphics cards, and input device settings could not be detected correctly. You will need to configure these yourself.   How do I fix the failsafe X mode and login into my computer?  Answer index:


In chat, almost everything works as a reply to a specific message, including oneboxes. The only thing that doesn't seem to work as a reply is an uploaded image. Even if I hit the reply button before uploading the image, it will always be posted like an empty message.  Curiously, even if I post an image that has already been uploaded, as a link, such that it oneboxes, I can do so as a reply. Apart from the little reply-arrow, this even looks identical to a freshly uploaded image (and I suspect that behind the scenes, uploading actually does just generate a onebox to the uploaded image's link).  So I guess I can currently work around this, by uploading the image first (e.g. by inserting it into a post on main which I then never submit), and then posting the link as a reply, but that seems rather like a rather annoying workflow.  So would it be possible, to take replies into account when uploading images, too?

When I click the arrow icon to start a reply to a chat message, the text field is prepended with a colon followed by the message ID. This also works even if you've entered something in the text field, so  Replying to somebody   becomes  :1234567 Replying to somebody   But since an image upload will submit immediately, I have to start the reply before uploading.  But that doesn't work either. The message ID that's prepended ends up being erased and replaced with the image URL before the upload submits. I have to edit to include the message ID to turn it into a reply, and since editing a message with a onebox causes the onebox to reload, it can get distracting.  Can we please preserve the message ID so  :6059107   becomes  :6059107 http://i.stack.imgur.com/uzFM3.png   and not  http://i.stack.imgur.com/uzFM3.png   instead so I don't have to edit it or upload it separately?  EDIT [11/20]: just found out that the upload button is totally disabled when the field isn't empty now. I guess it's to stop any message being completely replaced with the upload URL, so perhaps seeing it from that perspective, it's a good thing. It doesn't exactly help matters here, though.


I have submitted a revised manuscript that has been "under review" again for the past 7 months. After a long wait, I have written a polite email to editor inquiring about a long delay in the revised review once I got positive reviews and minor corrections. It has been almost 3 weeks the Editor did not even replied to my email and still the status is the same. Any suggestions How long I should wait? or is it normal a practice by PHYSICA A journal of Elsevier?

What steps does a manuscript typically go through from submission to publication (or rejection) in a typical journal? How are these steps referred to, in particular by editorial systems, and how long do they each typically take?  Note that this question is about the typical situation and hence not about:   Journals with an atypical workflow, e.g. those that allow for an instantaneous reviewer–author interaction. Exceptional steps or rare occurrences such as withdrawal or .   This is a canonical question on this topic as per . Due to its nature, it is rather broad and not exemplary for a regular question on this site. Please feel free to improve this question.


The question is to prove that $$\frac{d}{dx}[xJ_n(x)J_{n+1}(x)]=x[J_n^{2}(x)-J_{n+1}^{2}(x)]$$  I have attempted using the product rule and the definition of Bessel but I just end up with a mess and no end in sight. Any help would be greatly appreciated.

Let $J_{\alpha}(x)$be the Bessel function. Show the equality:  $$\frac{d}{dx} \left( xJ_{\alpha}(x)J_{\alpha +1}(x)\right) = x \left( J_{\alpha}^2(x) -J_{\alpha +1}^2(x)\right)$$  How to start with it?


How to create people picker in sandbox solutions using jquery?  I need design part also. Any idea?

I have seen plenty of examples of how to use the Client Side People Picker in a SharePoint App, but can't find anything related to how to leverage it within a SharePoint Page on a SharePoint Site. I thought this AngularJS directive looked promising but it is asking for the App URL. Is it possible to leverage this with in a SharePoint Page (not App) or does anyone else have a recommendation?


I can't figure out what's the tense of call in the following phrase      I heard someone call my name   I mean,  I'm quite sure it's infinite but then shouldn't it be calling or to call?

I have been reading Men With Brooms for a few days. I read a sentence which did not make any sense to me, so I landed here to get some help on it. I have pasted the sentence from the novel. Please go through it and let me know your valuable feedback on it.  An excerpt from the novel (Men With Brooms: A Sweeping Epic, paperback 2002, a novelization by Diane Baker Mason):     Gordon was about to walk away from the Impala when he saw it stop and his son get out. So it was real the boy had come.   As per my opinion it should have been:     Gordon was about to walk away from the Impala when he saw it stopped and his son got out. So it was real the boy had come.   I have two questions here:   Why did the writer use stop and get instead of stopped and got? As she is telling us a story which happened in the past. Let's say the writer is telling us her mind's situation and she used the present tense for it but why did she use stop and get instead of stops and gets?


Do I need a transit visa from Narita to Haneda? I am holding a Philippines passport and a permanent resident visa in Canada. Does Japan provide transit visa in the airport? Unfortunately I only have 5 days for my flight so I cannot go to the embassy to get a transit visa.

I'm going to the Philippines this October and would like to layover in Japan. I found a reasonably priced ticket with a 15-hour layover to Haneda, however, I have to transfer to Narita. Do I need a visa since I'm going to have to stay at a hotel and ride a bus to travel to Narita airport? Thank you!


Whenever I start my PC, it shows up this message. It was not there until yesterday. It is giving me since today only. How can I solve it? Please help.

I have recently upgraded to Precise and had some errors. It seems to be quite random and with differences in the error reports. I have duly sent the reports hoping the system will have found the problem and sorted itself out. After the second error I am following the wizards (software...) advice and seeking help. The 1st time it happened I jotted down the following:  ExecutablePath /usr/lib/tracker/tracker-extract LaunchPad bug 950765 AMD64   The second time the following:  ExecutablePath /usr/share/appart/appart-gpu-error-intel.py "Possible GPU hang........" sandybridge-m-gt2 LaunchPad bug 981261   If there is anyone that can help it is much appreciated. I did not really want to upgrade at this stage, but was forced to due to the latest version of python-numpy in precise. You win some, you loose some....  Jacques   I am using a Pavilion dv6 notebook and 64bit ubuntu 12.04 LTS


Or: what is the minimum amount of time between dragonbreaths?  I've always been of the impression that, in D&D 3.5, a roll of "1" on a 1d4-round cooldown meant that the creature in question could use the ability in the next round. However, I've sometimes run into people who think it works differently, that a roll of "1" means that they can't use it in their next turn ("they must wait a whole round to use it again, after the turn they used it").  The relevant text of the true dragons' breath weapon is as follows:     Breath Weapon (Su): Using a breath weapon is a standard action. Once a dragon breathes, it can’t breathe again until 1d4 rounds later. If a dragon has more than one type of breath weapon, it still can breathe only once every 1d4 rounds.   There's similar text in other monsters, such as the ghost's telekinesis ability:     When a ghost uses this power, it must wait 1d4 rounds before using it again.   I am of the opinion that the definition of a round would imply that a "1" means the cooldown ends just before the creature's next turn, but some people I'm talking to don't think so.     A round can be a segment of game time starting with the first character to act and ending with the last, but it usually means a span of time from one round to the same initiative count in the next round. Effects that last a certain number of rounds end just before the same initiative count that they began on.   Is there any statement in the game's rules, including Dragon Magazine and the Rules Compendium, that specifies that these cooldowns work in a particular way? If there isn't, what about from supplemental, but not quite game rule resources, like Rules of the Game and Sage Advice articles, or the much-maligned WotC FAQ?  In the absence of that, is there a statement of the developers' RAI anywhere (i.e. a cited forum post, public chat log, or similar; not another rule that has been read as implying something about this one)?  And finally, if there is outright nothing stated about this issue, can anyone cite an English language grammar rule that would solve it?

Dragon breath weapons have a recharge time. For example, a  can use its breath weapon every 1d4 rounds.  Do you re-roll the recharge time each time you use the breath weapon? Or once per (...encounter? ...day? ...dragon?)


I want to bring my Photoshop swatch library into Illustrator.   I've tried saving swatches for exchange and then opening them in a New Swatch Library in Illustrator, but the colors become corrupted.

I use a mixture of InDesign, Photoshop and Illustrator to produce the vast amount of printed media I design at my current position and I find myself faced with copy/pasting color values from one program to another almost all the time, I have tried to find a quicker way but have been unsuccessful. I use a program called  to copy and store my most used colors, but still, it's not the same as being able to select it from the swatches palette in Adobe CS.  So the main meat of the question is:   Can I share my colors/swatches between InDesign, Photoshop and Illustrator and if so, how?


My  is edited for  tag, but I'm not notified for that edit, is this correct behaviour, AFAIK it will be intimated when the site without new top bar.

A question here on meta for instance may stick around for quite a while. A feature-request  maybe even for months. Then the status (tags) gets changed to  or  or whatever and the OP does not get notified.  On a normal post-edit we get a notification but retagging does not count for that. Please add retagging to the edit notifications.


I already read Stack Overflow has released . So I would like to ask a question.  Why did Stack Overflow choose the Portuguese language over Chinese or other languages?

I have noticed there is a Stack Overflow in language differs from English which is global and mostly used by programmers.  I think there is no need for a site in other languages. Otherwise we will end up with 127 StackOverflow sites. I am afraid that we will lose the amount of people sharing data.


(adverb) [NORTH AMERICAN] [informal] - certainly (used for emphasis). Example : "Texas sure was a great place to grow up."   I thought using sure as an emphatic adverb is grammatical, I saw it very often. But the dictionary says that it is informal, so using it like that in a test is not okay, right?  "Texas was sure a great place to grow up." Can "sure" be sued after the helping verb? Will it cause confusion?

Today I saw a sentence:  She surely can do it.  What does that mean? How does it differ from:  She certainly can do it. Surely she can do it.  This slight difference in meaning of those sentences I am not able to notice. Could you please help me? Thanks in advance!


I have Ubuntu OS. And I want to play flash games. How do I play flash games in Ubuntu?  NOTE: This post was translated using Google Translate from Turkish.  The original post can be found in the revision history.

Even though I have the latest Adobe Flash player 11.2 for Linux in Firefox -   - a particular online flash game still requests that I update to the latest flash player.  I've tried this online game on my laptop (Windows 8 with Flash Player 11.8) and it has no problems.  Is there a way to trick Ubuntu or this game into thinking Flash Player 11.8 is "installed"?


I const a variable in an if statement but I can't use the variable out of the statement    const a = 1  const b = 1  if (a == b) {   const c = 1   console.log(c) } console.log(c)     fist it gives me c ( in the if statement) then it gives me an error(out of the if statement)

What is the scope of variables in javascript? Do they have the same scope inside as opposed to outside a function? Or does it even matter? Also, where are the variables stored if they are defined globally?


As title, should I always use static_cast for C++ project; if I just want to handle the conversion from double to int and the conversion from a base-pointer to a derived-pointer. Is my thought correct?  Thanks all

I've heard that the static_cast function should be preferred to C-style or simple function-style casting.  Is this true?  Why?


I want to delete my parent directory but keep all of its content. Currently my directory structure   $ /usermanagement/usermanagement/file1   After deleting my parent directory I want to see like  bellow structure  $ /usermanagement/file1

My directory (in Linux) looks like com/com/{various,files} where com and com are folders of the same name and the second com holds the various files. I want the first com removed, but the second and files in the second kept.


I have a DisplayLink USB-to-VGA adapter (17e9:0198 Newnham Research) I would like to add to my system (eventually two). I am running Linux  3.5.0-19-generic #30~precise1-Ubuntu SMP Wed Nov 14 21:43:28 UTC 2012 i686 i686 i386 GNU/Linux and Ubuntu 12.04.1 LTS.   I have an Asus G74Sx with the main screen and a second monitor on the VGA port. The DisplayLink-connected monitor shows green unless I hit CTRL-ALT-F1 in which case the other two monitors go blank and a login screen appears on the monitor connected to the DisplayLink. I can login and have a text-mode display.  What I really would like is to extend the desktop to the third monitor. Can anyone help?

I have a DisplayLink-based external USB monitor, which has both power and data over USB, and seems to work perfectly under Windows 7, but only can display a text console under Ubuntu 10.10, and that I can only use when I am actually switched to it. So the only Use I can have so far is to have some text-based monitoring or console that I can watch while working on the graphic display.   I know there are some development done for DisplayLink, but I never could get it to actually run properly.   Yes, I tried the detailed setup described in other , but they did not work, and instead crashed my X that I had to restore.   Merci :-)


A universe number is a number which contain any finite length string of digits for a base.   Reference . These are usually called "disjunctive numbers" in English.  Then the question is, is the concatenation of all prime numbers, a disjunctive number?  By the  we can find that $$\forall n \ge 6,\text{ }\ln(n)+\ln\left(\ln(n)\right)-1<\frac{p_n}{n}<\ln(n)+\ln\left(\ln(n)\right)$$ where $p_n$ is the n-th number prime.  But I don't know what to do after. Any hint would be appreciated.

Does the string of prime numbers $$2357111317\ldots$$ contain every natural number as its sub-string?


Is it possible or even acceptable to use the present perfect with today (in those cases when today refers to the present age)? Even native speakers seem to disagree!! For instance; today, companies have thrived on foreign investment.   Thank you!

Today an excruciating accident has taken place in our vicinity. Today an excruciating accident took place in our vicinity.   Today indicates the present time. So I prefer has taken, which has been used in first sentence. But a native speaker of English said that he would prefer took place, though he didn't tell me why he would do this.  Now I ask to the members of this site what do they think about this?


We know that in every PID, for every two elements, there is one GCD (up to being associate). Now, since the set of real numbers is a field and consequently PID, this theorem holds for them. Then, what's the GCD of a rational (for instance $2$) and an irrational number (for instance $\sqrt2)$)?

Lets $A\subset \mathbb F$ where $\mathbb F$ is an arbitrary field. Is is correct, that there are two possibilities?   $A=\{0\}$, then $\gcd(A)=A$ $A\neq\{0\}$, then $\gcd(A)=A\backslash\{0\}$   My reasoning here would be: If $0$ is a common divisor of all elements in $A$, then $\gcd$ must be divisible by $0$ which is only the case for $0$ itself. If any nonzereo element is in $A$, then a common divisor can only be another nonzero element. This yields $A\backslash\{0\}$ because those are all associated.


To have specific number of digits in string formatting, I am aware that it can be done in this way:  In [18]: hours = 01  In [19]: "%.2d" %(hours) Out[19]: '01'  In [20]: "%.2f" %(hours) Out[20]: '1.00'   But my case is a bit different. I am using specific keys to denote the values, for example:  for filename in os.listdir('/home/user/zphot_01/')   Here I want to have different values for the '01', i.e.   for filename in os.listdir('/home/user/zphot_{value1}/'.format(value1=some_number):   When I use the above method with some_number = 01, it does not take into account the 0 and so my folder is not recognised.   EDIT:  Most of the answers are for only one value, however, I want to have more than one key value, i.e.:  for filename in os.listdir('/home/user/zphot_{value1}/zphot_{value2}'.format(value1=some_number1,value2=some_number2)).

What is a Pythonic way to pad a numeric string with zeroes to the left, i.e. so the numeric string has a specific length?


I am a Canadian travelling to Canada from India Via. Brussels. There is a layover time of ~ 3 hours and 45 minutes in Brussels on the same day. My travel is from Mumbai (India) - Brussels - Toronto (Canada)  Do I need to get a Transit Visa?  Please advise.

I found many related questions on this site but I am still not sure about the rules. How can I decide if I need a visa to transit? Schengen members as of May 2021 are as follows:  Austria Belgium Czech Republic Denmark (excluding Greenland and the Faroe Islands - but an open border with the Schengen Area is maintained) Estonia Finland France (excluding overseas departments and collectivities) Germany Greece Hungary Iceland Italy Latvia Liechtenstein Lithuania Luxembourg Malta Netherlands (excluding Aruba, Curaçao, Sint Maarten and the Caribbean Netherlands) Norway (excluding Svalbard) Poland Portugal Slovakia Slovenia Spain (except Ceuta and Melilla) Sweden Switzerland


I want to start IOS development as i prefer ios over android and other platforms due to personal liking only.  The problem is i tried Visual Studio with Xamarin but it needs an actual MAC for apps !!   I am thinking about using Xamarin Studio!  Does it require a MAC too ? Any other way around without using VM or MAC ?

Is there any way to tinker with the iPhone SDK on a Windows machine? Are there plans for an iPhone SDK version for Windows?  The only other way I can think of doing this is to run a Mac VM image on a VMWare server running on Windows, although I'm not too sure how legal this is.


I'm trying to use jQuery to add a click function to a list item. I had this method working using JS and onClick(), however I am trying to bring the code up to date with using jQuery. So my list has the following structure:

       Previous

        1

        Next

   The jQuery function is on the document.read function:  $(function () {     $('ul.pagination li.page-item').click(function () {         var $li = $(this);         $.ajax({             type: 'GET',             url: '/Projects/ProjectTable/CountProjects',             data: { searchString: $('#searchBox').val() },             success: function(result) {                 $('#table-container').load('/Projects/ProjectTable/TestPartialView',                     {                         searchString: $('#searchBox').val(),                         currentPage: page,                         projectCount: result                     }, function() {                         $li.addClass('active');                     });              }         });     });      getTable(); });   getTable() is being executed, however when I click on any
 the method is not called. I have tried removing ul.pagination from the .click call but again that has had no impact.  What do I need to change so that the
 have a .click method on each of them?  I have checked the console and there are no errors being reported at all.

I have a bit of code where I am looping through all the select boxes on a page and binding a .hover event to them to do a bit of twiddling with their width on mouse on/off.  This happens on page ready and works just fine.  The problem I have is that any select boxes I add via Ajax or DOM after the initial loop won't have the event bound.  I have found this plugin (), but before I add another 5k to my pages with a plugin, I want to see if anyone knows a way to do this, either with jQuery directly or by another option.


Using an Ubuntu VM on VMWare. The internet just stopped working out of the blue and even experts don't know why. Some stats: sudo lshw -C network   *-network DISABLED                description: Ethernet interface        product: 82545EM Gigabit Ethernet Controller (Copper)        vendor: Intel Corporation        physical id: 1        bus info: pci@0000:02:01.0        logical name: ens33        version: 01        serial: 00:0c:29:d7:ef:66        size: 1Gbit/s        capacity: 1Gbit/s        width: 64 bits        clock: 66MHz        capabilities: pm pcix bus_master cap_list rom ethernet physical logical tp 10bt 10bt-fd 100bt 100bt-fd 1000bt-fd autonegotiation        configuration: autonegotiation=on broadcast=yes driver=e1000 driverversion=7.3.21-k8-NAPI duplex=full latency=0 link=no mingnt=255 multicast=yes port=twisted pair speed=1Gbit/s        resources: irq:19 memory:fd5c0000-fd5dffff memory:fdff0000-fdffffff ioport:2000(size=64) memory:fd500000-fd50ffff   Tried  ,  and  (from this forum) Can't find ifup and ifdown commands installed  I also reset the network settings on my VMWare but that was of no help. It is very urgent and I would be grateful for any help!

I had internet connection, but when I upgraded my VGA and restarted my PC then everything for eth0 has gone.     When I used ifdown:     ifdown: interface eth0 not configured   Is there something I could do?    EDIT: Content of /etc/network/interfaces    auto lo iface lo inet loopback   When I ifconfig I don't have these lines:    inet addr:192.168.1.5  Bcast:192.168.1.255  Mask:255.255.255.0 inet6 addr: fe80::219:5bff:fe5e:a5e/64 Scope:Link   In the Terminal typed:  sudo gedit /etc/network/interfaces   and then added these lines in the bottom:  auto eth0 iface eth0 inet dhcp   then I typed:    sudo ifdown eth0 sudo ifup eth0   when I send the second command I received the below message:    No DHCPOFFERS received No working leases in persistent database - sleeping   Any help?


I see that in javascript, sometimes you can write  function thisIsMyFunction(options) {}  and u can write  var myFunction = function(input) {}  also you can write  function() {}  When are the different declaration used?

I've recently started maintaining someone else's JavaScript code. I'm fixing bugs, adding features and also trying to tidy up the code and make it more consistent.  The previous developer used two ways of declaring functions and I can't work out if there is a reason behind it or not.  The two ways are:  var functionOne = function() {     // Some code };     function functionTwo() {     // Some code }   What are the reasons for using these two different methods and what are the pros and cons of each? Is there anything that can be done with one method that can't be done with the other?


Does anyone know how to avoid background black color/ zero value in background pixels in processed images using erdas imagine? Particularly in model maker. It's confusing in statistical calculation.

I try to create an NDVI from Landsat and ASTER satellite images using Erdas Imagine. In Erdas, the satellite images have a nodata value of 0.   After creating an NDVI, the nodata value is still 0, but obviously there are also file pixels with the value 0 now (NDVI ranges from -1 to +1). So if I reset the NoData value to 0 (it is not done automatically), some pixels in my raster are missing since they are now classified as "nodata"   Any suggestions?


Is there a clean way to remove undefined fields from an object?  i.e.  > var obj = { a: 1, b: undefined, c: 3 } > removeUndefined(obj) { a: 1, c: 3 }   I came across two solutions:  _.each(query, function removeUndefined(value, key) {   if (_.isUndefined(value)) {     delete query[key];   } });   or:  _.omit(obj, _.filter(_.keys(obj), function(key) { return _.isUndefined(obj[key]) }))

How do I remove all attributes which are undefined or null in a JavaScript object?  (Question is similar to  for Arrays)


I just picked up Dark Souls and it looks like I can either stay in "hollow" form or become "human" by using a special item that I gained after defeating a boss. But from googling a bit and finding only ways to obtain it, I couldn't find any clear information on what it actually does. I also found that bonfires have an option to "kindle" them, but that requires humanity.  What effects does "humanity" have on me? And what about kindling bonfires with it?

In Dark Souls, what are the advantages and disadvantages of being in human form?  In Demon's Souls, being in human form gives you a clear HP advantage, but attacks have lower power and you can be invaded (if playing online).  In Dark Souls, however, the advantages and disadvantages are less clear. What are they?