so i have this code for my voting system  public void Register() throws IOException{     String [] menuGender={"Male", "Female"};     String [] menuStatus={"Single", "Married", "Widow(er)", "Legally separated"};       do{     FileWriter writeFile=new FileWriter("voters.txt", true);     BufferedWriter outFile=new BufferedWriter(writeFile);      age=Integer.parseInt(JOptionPane.showInputDialog("Age: "));     while(age<18){         JOptionPane.showMessageDialog(null, "Voter should be 18 or above");         age=Integer.parseInt(JOptionPane.showInputDialog("Age: "));     }     name=JOptionPane.showInputDialog("Full Name: ");     gender=(String)JOptionPane.showInputDialog(null, "Gender:", "Election 2765", 1, null, menuGender, menuGender[0]);     if(gender=="Male"){         gender="Male";     }     else{         gender="Female";     }     dBirth=JOptionPane.showInputDialog("Date of Birth: ");     pBirth=JOptionPane.showInputDialog("Place of Birth: ");     address=JOptionPane.showInputDialog("Address\n(Province, City/Municipality, Barangay, House No./Street: ");     status=(String)JOptionPane.showInputDialog(null, "Civil Status:", "Election 2765", 1, null, menuStatus, menuStatus[0]);     if(status=="Single"){         status="Single";     }     else if(status=="Married"){         spouse=JOptionPane.showInputDialog("Spouse Name: ");         status="Married(Spouse: "+spouse+")";     }     else if(status=="Widow(er)"){         status="Widow(er)";     }     else{         status="Legally Separated";     }     citizenship=JOptionPane.showInputDialog("Citizenship:");     job=JOptionPane.showInputDialog("Profession/Occupation: ");     tin=JOptionPane.showInputDialog("Tin Number: ");     father=JOptionPane.showInputDialog("Father's Full Name: ");     mother=JOptionPane.showInputDialog("Mother's Full Name: ");     votersNumber++;       vNumber=Integer.toString(votersNumber);      outFile.append(vNumber+"/"+name+"/"+age+"/"+gender+"/"+dBirth+"/"+pBirth+"/"+address+"/"+status+"/"+citizenship+"/"+job+"/"+father+"/"+mother);     outFile.newLine();      outFile.close();      selectYN=JOptionPane.showInputDialog("Continue?\n[1]Yes [2]No");     }while(selectYN!="2"); }   my problem is my do while loop won't work. every time i type 2 it will still go back to the enter informations. my goal is when i type 2, it will go back to it's menu. this is the code of the menu  String choice, choice2;         String [] firstMenu = {"Register/Edit Information", "Voters List", "Voters Validation and Candidate Voting", "Exit"};      do{         choice=(String)JOptionPane.showInputDialog(null, "Welcome! Please choose:", "National Election 2765", 1, null, firstMenu, firstMenu[0]);     switch(choice){     case "Register/Edit Information":         String [] secondMenu = {"Register", "Edit", "Delete", "Back"};          do{             choice2=(String)JOptionPane.showInputDialog(null, "Please choose:", "Election 2765", 1, null, secondMenu, secondMenu[0]);             switch(choice2){             case "Register":                 Register();                 break;             case "Edit":                 break;             case "Delete":                 break;             }         }while(choice2!="Back");          break;     case "Voters List":          break;     case "Voters Validation and Candidate Voting":          break;     }     }while(choice!="Exit");   my do while loop here works, tho. only the Register method won't work.

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?


No matter what I do, I still have these errors. I don't know what to do to fix this. Please help!!

I am getting a Drill Size error and overlapping errors because I added a new via and a wire to my PCB. I'm not really sure why I am getting these errors. Is there a way to add a new wire and get it to connect to a wire that was already there without getting an overlap error? Also, do I need to make that via bigger in size? If so, how? I attached a picture that shows the area I need help with.


I want lightdm to enter power save after a specific period of time.  If I'm logged in then my screen will time out as per the user settings, however when no one is logged in the screen will stay on forever.  I've looked at some posts that make some suggestions on what to do, but none of them seem to work or it's down to my limited knowledge of Linux.  updated 6/2/2014: The settings shown by sudo -H -u lightdm dbus-launch --exit-with-session gsettings list-recursively org.gnome.settings-daemon.plugins.power are as follows:  org.gnome.settings-daemon.plugins.power active true org.gnome.settings-daemon.plugins.power button-hibernate 'hibernate' org.gnome.settings-daemon.plugins.power button-power 'interactive' org.gnome.settings-daemon.plugins.power button-sleep 'suspend' org.gnome.settings-daemon.plugins.power button-suspend 'suspend' org.gnome.settings-daemon.plugins.power critical-battery-action 'suspend' org.gnome.settings-daemon.plugins.power idle-brightness 30     org.gnome.settings-daemon.plugins.power idle-dim true     org.gnome.settings-daemon.plugins.power lid-close-ac-action 'suspend' org.gnome.settings-daemon.plugins.power lid-close-battery-action 'suspend'  org.gnome.settings-daemon.plugins.power lid-close-suspend-with-external-monitor false     org.gnome.settings-daemon.plugins.power notify-perhaps-recall true     org.gnome.settings-daemon.plugins.power percentage-action 2     org.gnome.settings-daemon.plugins.power percentage-critical 3     org.gnome.settings-daemon.plugins.power percentage-low 10     org.gnome.settings-daemon.plugins.power priority 0     org.gnome.settings-daemon.plugins.power sleep-inactive-ac-timeout 120     org.gnome.settings-daemon.plugins.power sleep-inactive-ac-type 'suspend'  org.gnome.settings-daemon.plugins.power sleep-inactive-battery-timeout 0     org.gnome.settings-daemon.plugins.power sleep-inactive-battery-type 'suspend'  org.gnome.settings-daemon.plugins.power time-action 120     org.gnome.settings-daemon.plugins.power time-critical 300     org.gnome.settings-daemon.plugins.power time-low 1200     org.gnome.settings-daemon.plugins.power use-time-for-policy true   I would have assumed the sleep-inactive-ac-timeout 120 would have been the correct entry, but it doesn't time-out unless I'm actually logged in as a user.

I have Ubuntu 13.10 set up on an older PC. If I am logged in as a user, then the screen timeout and power saving mode works as expected. However, if nobody is logged in, the screen never times out, and the monitor stays on all the time with the login screen.  How can I adjust Ubuntu 13.10 so that the login screen also times out after a minute or so? I don't want the monitor's power saving mode to be disabled just because nobody is currently logged in.


Here is jquery i got from stackoverflow as well.  $('ul.navigation').find('a').click(function(){     var $href = $(this).attr('href');     var $anchor = $('#'+$href).offset();     $('body').animate({ scrollTop: $anchor.top });     return false; });   Here is my nav

HOME

ABOUT ME

SERVICES

PORTFOLIO

SOMETHING TO READ

CONTACT ME

   It jumps on the correct id but it does animate. Animation part is what I'm missing. Thanks in advance!

I have done the following code in JavaScript to put focus on the particular element (branch1 is a  element),  document.location.href="#branch1";   But as I am also using jQuery in my web app, so I want to do the above code in jQuery. I have tried but don't know why its not working,  $("#branch1").focus();   The above jquery (focus()) code is not working for div, whereas If i am trying the same code with textbox, then its working,  Please tell me, how can I put focus on a div elemnt using jQuery?  Thanks!


I understand that if I have the Hamiltonian I solve it and I have the allowed energy values. The result of a measurement has to be one of them, true? Thus, where line broadening fits into the theory? Also, why the fundamental state is the only one without broadening? I ask for the 'theoretical' reason, not the usual simple explanations...

I have recently found one exercise in an exercise book:     During the transition from the first excited state of a hydrogen atom into the ground state, photons with a wavelength of 121.5 nm are emitted. The lifetime of the excited state is 10 ns. Calculate the natural line broadening of the excited state using the energy uncertainty.   Could someone please explain to me briefly what the 'natural line broadening of the excited state' is?


I want to put some line breaks in my tooltip but something goes wrong. I tried to use <br> with data-html="true" but there are just br as string(insted new line). I have also tried &#xA; and &#013; but it works only for first linebreak(second and others don't works - browser ignores this char). How is it possible to get a few new lines in tooltip as title?

I'm currently adding verbose tooltips to our site, and I'd like (without having to resort to a whizz-bang jQuery plugin, I know there are many!) to use carriage returns to format the tooltip.  To add the tip I'm using the title attribute. I've looked around the usual sites and using the basic template of:  link with tip   I've tried replacing the ? with:
 &013; / &#13; \r\n Environment.NewLine (I'm using C#)   None of the above works. Is it possible?


Prove: for $n$ is positive integer, it's impossible that: $$\exists k \in \mathbb Z, n(n+1)=k^{2}$$  I know that $(n,n+1)=1$, but the process seems odd using it.

I'd like to have my proof verified and if possible, to see other solutions that are interesting.  Proof: Suppose $n(n+1)$ is a square. Then we write $$n(n+1) = \prod_{p} p^{c(p)}$$ where $c(p) = a(p) + b(p)$ are such that \begin{align*} n &= \prod_p p^{a(p)} \\ n+1 &= \prod_p p^{b(p)} \end{align*} Now, by our hypothesis, $c(p)$ is even for all primes $p$. As $(n,n+1)=1$ for all $n$, it must be that $a(p)$ and $b(p)$ are even for all primes $p$ and moreover, $a(p) = 0$ whenever $b(p)>0$ and reversely.  This indicates that both $n$ and $n+1$ are squares. This is impossible as there are no consecutive squares in the natural numbers.


Here is the exercise: Create a class called SortingTest. In it, create a method that accepts an array of int values as a parameter, and prints out the elements sorted (smallest element first) to the terminal.  Part of this questions is also taking about using HashSets which are supposed to be used. How??   Here is what I have got so far  import java.util.Arrays; import java.util.HashSet;  public class SortingTest {    public void sortArrays(int numbers[]) {     Arrays.sort(numbers);     System.out.println(numbers);    } }   I think I am just not understanding the concept of what it is asking me to do.

In Java, arrays don't override toString(), so if you try to print one directly, you get the className + '@' + the hex of the  of the array, as defined by Object.toString():  int[] intArray = new int[] {1, 2, 3, 4, 5}; System.out.println(intArray);     // prints something like '[I@3343c8b3'   But usually, we'd actually want something more like [1, 2, 3, 4, 5]. What's the simplest way of doing that? Here are some example inputs and outputs:  // Array of primitives: int[] intArray = new int[] {1, 2, 3, 4, 5}; //output: [1, 2, 3, 4, 5]  // Array of object references: String[] strArray = new String[] {"John", "Mary", "Bob"}; //output: [John, Mary, Bob]


I'm getting a NullPointerException for the code below, and I don't quite understand why (or how to fix it). I know that my first node (next) is null, and that I can't call any methods on it without causing a null pointer exception, but I can't make it 'not null' without calling any methods on it :(. The null pointer exception is thrown in the first for loop in the insert function.   Here's my node class:  public class Node {  public Node next; public String word;  public Node(String word){     this.word = word; }  public void display(){     System.out.println (word); }  public String toString(){     return word; }   And here's my linked list class  public class WordLinkedList {  private int size; //integer to store the size of the linked list (# of words) private Node firstnode; // reference to first node  public WordLinkedList(){     size = 0;     firstnode = new Node(null); // setting first node to null - dummy node ... I think ???!!! }     public WordLinkedList(String[] arrayOfWords){     for (int i = 0; i < arrayOfWords.length; i++){         this.insert(arrayOfWords[i]);     } }   public void insert(String newword){     Node newNode = new Node(newword);     for (Node iterator = firstnode.next; iterator != null; iterator =        newNode.next){         if (iterator.word.compareTo(newword) < 0){             if (iterator.next.word.compareTo(newword)>0){                 newNode.next = iterator.next;                 iterator.next = newNode;             }         }         if (iterator.word.compareTo(newword) > 0){             iterator.next = iterator;             firstnode.next = newNode;         }     } }  public void display(){     Node theNode = firstnode;      while (theNode != null){         theNode.display();         System.out.println("Next node: " + theNode.next);         theNode = theNode.next;         System.out.println();     } }   }

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 me preface this by saying that I'm a high school student so my knowledge of GR might be seriously flawed.  As far as I'm concerned, Einstein's theory of GR states that matter curves the fabric of space-time so instead of there being an imaginary "tug," objects are simply falling in.  My question is, how do the objects "fall" in because in real-life simulations of the curvature of space-time, the force that's causing objects to "fall" in is Earth's gravity. In other parts of space, what causes objects to "fall" in. Does the Newtonian "tug" of gravity still exist within Einstein's theory because, without it, I can't seem to understand why curving space-time would cause stuff to "fall" in?

They say that gravity is technically not a real force and that it's caused by objects traveling a straight path through curved space, and that space becomes curved by mass, giving the illusion of a force of gravity.  That makes perfect sense for planetary orbits, but a lot less sense for the expression of gravity that we are the most familiar with in our day-to-day lives: "what goes up must come down."  Imagine that I hold a ball in my hand, several feet off the ground, with my fingers curled around it, and my hand is above the ball.  Then I open my fingers, releasing my grip on it, being very careful to not impart any momentum to the ball from my hand as I do so.  An object at rest remains at rest unless acted upon by an outside force.  If the ball is not moving (relative to my inertial reference frame), it has no path to travel that's any different from the Earth's path through space.  It should remain at rest, hanging there in the air.  And yet it falls, demonstrating that an outside force (gravity) did indeed act upon it.  How does curved space explain this?


Have been in Malta for over 90 days (since 28th Sept 2014) - though received a residence permit which expires 5th February.    Does this mean I cannot visit any other Schengen areas after this date?    My return flight leaves from Rome on February 20th and I was planning on visiting Spain, Hungary and The Netherlands before then.

I have a 1-year residence permit from one Schengen country that is now expiring. Upon its expiration, I would like to get my 90/180 days validity as a tourist to stay, or return here as soon as possible.  I understand that the tourist short-stay scheme is based on the 90/180 days "counter". But what happens if my previous stay was not tourism but residence (as searching year). Wouldn't that mean that I can quickly exit and re-enter the Schengen area to activate my tourist stay?   Also, is there a way to change this purpose of stay without exiting the Schengen area?


The goal for these negotiations is to reach a mutually-agreed long-term comprehensive solution that would ensure Iranˈs nuclear program will be exclusively peaceful.  I am wondering the reason why there has been used the different tenses like the following:  Would  Will

The goal for these negotiations is to reach a mutually-agreed long-term comprehensive solution that would ensure Iranˈs nuclear program will be exclusively peaceful.    what does would imply here? If it implies future, why will has not been used?  A good link teaching would thoroughly would be really appreciated. Specially, distinguishing between the senses of would is not always easy.


I was wondering which type would have better performance and which you think should be used.   For example I have a List of strings not knowing how many items I will need so having the .Add(String) function is really convenient. I can Add new strings to the list at any time easily.  What are the advantages/disadvantages of using each?  Are lists the new arrays?

MyClass[] array; List<MyClass> list;   What are the scenarios when one is preferable over the other? And why?


I have a question about equivalence relations:  If I have a relation "$\sim$" which is symmetric and transitive, can I say that if:  $$a,b\in A : a\sim b$$  As "$\sim$" is symmetric:  $$a\sim b \Rightarrow b\sim a$$  And as "$\sim$" is transitive:  $$a\sim b\land b\sim a \Rightarrow a\sim a$$  So, is "$\sim$" reflexive? This prove that if any relation symmetric and transitive is reflexive?

Can you give an example of a relation that is symmetric and transitive, but not reflexive?   By definition,   $R$, a relation in a set $X$, is reflexive if and only if $\forall x\in X$, $x\,R\,x$.  $R$ is symmetric if and only if $\forall x, y\in X$,  $x\,R\,y\implies y\,R\,x$. $R$ is transitive if and only if $\forall x, y, z\in X$, $x\,R\,y\land y\,R\,z\implies x\,R\,z$.    I can give a relation $\leqslant$, in a set of real numbers, as an example of reflexive and transitive, but not symmetric. But I can't think of a relation that is symmetric and transitive, but not reflexive.


Prove: $$33|mn(m^{10}-n^{10})\forall m,n\in\mathbb Z$$   Apart from the trivial cases: $$3|m\;\lor\;3|n\;\;\&\;\;11|m\;\lor\;11|n$$ If $3\nmid m\;\land 3\nmid n$  Let $x\in\mathbb Z$ s.t.  $$x\equiv 1\pmod{3}\implies x^{10}\equiv 1\pmod{3}$$ $$x\equiv 2\equiv-1\pmod{3}\implies x^{10}\equiv 1\pmod{3}$$ $$\implies m^{10}\equiv n^{10}\pmod{3}\;\forall m,n\in\mathbb Z\implies m^{10}-n^{10}\equiv 0\pmod{3}$$ $$\implies 3|mn(m^{10}-n^{10})$$  $11\nmid m\;\land\;11\nmid n$  Let $x,y\in\mathbb Z$ s.t.  For each of the cases: $$x\equiv y\pmod{11},\;y\in\{1,\ldots, 10\}$$ by the Fermat's little theorem: $$x^{10}\equiv y^{10}\equiv 1\pmod{11}$$ $$\implies m^{10}\equiv n^{10}\pmod{11}\implies m^{10}-n^{10}\equiv 0\pmod{11}$$ Finally, $$\implies 33|mn(m^{10}-n^{10}),\;\forall\;m,n\in\mathbb Z $$ $$Q.E.D.$$  Is this correct?

I'm asked to show that $a^{61} \equiv a\pmod{1001}$ for every $a \in \mathbb{N}$. I've tried to tackle this using Fermat's Little Theorem and Euler's Theorem, but I can't even get started. My main problem seems to be the "for every $a \in \mathbb{N}$" part, because if it restricted $\gcd(a, 1001) = 1$ I would be able to factor out 1001 and try to show that it's factors divide $a^{61} - a$. I'm kinda lost here. Any help is appreciated.


I am new to node JavaScript and do not understand the syntax too much. My code   console.log(index+ "\t" + output[index]);   Outputs empty strings in my array.  So I have created a new method  var array = removingEmptyString(output[index]); function removingEmptyString(array) {     var newArray = [];      for(var i in array)         {             if(i != "" || i != null || i != " ")                 {                     newArray[i] = i;                 }         }      }   What I do not understand is if I declared my arrays correct? Also if I passed int he array into the removingEmptyString correctly, also if declaring the new array and inserting the non empty string into that array are correct?

How do I remove empty elements from an array in JavaScript?   Is there a straightforward way, or do I need to loop through it and remove them manually?


I want to show these other applications' Battery Usage percentage values from my own application. Can I do that?

How do I get the battery status on an iPhone?


It is weird only happen on chrome at home.  At company, it does share the login session/cookies.  After I login stackoverflow,  only stackexchange.com can recognize the cookies. But askubuntu , superuser, serverfault don't let me auto login.  What's wrong?

While on other Stack Exchange sites like Game Development and Code Review they recognize if I am logged in to Stack Overflow or Stack Exchange and after refresh request from page I am logged in there too. This autologin feature does not happen on Super User.  Even if I go to the login page, it does not offer me automaticaly to login with my connected SE account.  I know I am registered on Super User as I even asked a question there.


A program I was writing had a weird output, which I boiled down to the behavior of the following code:  class Program {     public static void Main()     {         double test1 = 0.1;         double test2 = Math.Pow(10, -4);         double test3 = 0.1+Math.Pow(10, -4);     }  }   When I check the values of test1, test2, and test3 in debug mode, the values of the first two variables are  test1 = 0.1  test2 = 0.0001  which is what I assigned them to be, but their sum becomes  test3 = 0.10010000000000001.  There appears to be an error of 10^{-17}. My questions are:   Why does this happen? Can I do anything to prevent it?   Thanks.

Consider the following code:   0.1 + 0.2 == 0.3  ->  false   0.1 + 0.2         ->  0.30000000000000004   Why do these inaccuracies happen?


When electron moves, its electric field contracts, and becomes asymmetric. If spin means that electron rotates around itself, does the electric field rotates too?  Does spin influence on electric field at all?

I learned in my undergraduate physics class that atoms have magnetic fields produced by the orbit of electrons and the spin of electrons. I understand how an orbit can induce a magnetic field because a charge moving in a circle is the same as a loop of current.   What I do not understand is how a spinning ball of charge can produce a magnetic field. Can someone explain how spin works, preferably in a way I can understand?


I am trying to learn how to use the 'model builder' in QGIS 2.2. I have used model builder in ArcGIS, but I don't understand how to do it in QGIS 2.2?  What I want to do is to make buffers, clip vector layers and, if it's possible, add columns and data to attribute tables?  I want to do the same process for quite a few different layers, so it would be nice to get help from a model.  Is there any instructive tutorials to be found online that can show me how to make a model? I tried to google it, but didn't find what I needed.

Like the ModelBuilder of ArcGIS Desktop to run simultaneous geoprocessing tools, is there any model builder available in QGIS?


I'm reading  independent notes on the , by Dr. Frederic P. Schuller. The first chapter is a brief summary of axiomatic systems and set theory. In page 6 the following definition is presented:  An axiomatic system $a_1, a_2, . . . , a_n$ is said to be consistent if there exists a proposition $q$ which cannot be proven from the axioms.  The motivation for such definition is that since within an axiomatic system which contains a contradiction every proposition is provable, a sufficient condition for a consistent system is that there exist propositions which cannot be deduced from the axioms. Then the following theorem is announced:  Any axiomatic system powerful enough to encode elementary arithmetic is either inconsistent or contains an undecidable proposition, i.e. a proposition that can be neither proven nor disproven within the system.  The Continuum hypothesis is then given as an example of an undecidable proposition within ZF. Why isn't the undecidability of CH proof that ZF is consistent, if, after all, it should be provable if ZF was inconsistent?

Gödel's incompleteness theorem states that: "if a system is consistent, it is not complete." And it's well known that there are unprovable statements in ZF, e.g. GCH, AC, etc.  However, why does this mean that ZF is consistent? What does "relatively consistent" actually mean?


Well, first of all, I am not a physics major, just a high school student. Watching a bit of cosmos and some physics at school got me thinking about this.  Well, the earth exerts acceleration due to gravity of magnitude $9.8\;\mathrm{m/s^2}$ which causes deceleration in everything that we throw up, correct?  And if we assume light to be made of particles (photons), it should theoretically exert some acceleration on them as well, but I presume it would be very minimal so as to not cause any significant change.  But if we imagine an imaginary celestial body (and every celestial body has a finite gravity field, correct? beyond which gravity cannot act and henceforth exerting no acceleration towards it on any body) that has the gravitational force strong enough, so that it exerts a very strong acceleration on everything. If it's also luminous, a ray of light will escape from its surface at $3\times 10^8 \;\mathrm{m/s}$.  Now this time, imagine the acceleration due to gravity being so strong that by the time the light has reached the end of the gravitational field of that celestial body, the speed of light (or the photons, which should theoretically get slowed down) is now, let's say $20\;\mathrm{m/s}$.  The light, after escaping the gravitational field, considering there's no neighboring celestial body to exert a gravitational force on it, will maintain its speed of $20\;\mathrm{m/s}$. We can then send a satellite into space that can easily hit that speed, therefore traveling faster than what is still technically light.  Also, when we say it's impossible to travel faster than the speed of light, do we refer to a numerical value of $3 \times 10^8\;\mathrm{m/s}$ or the speed of photons? Because we can theoretically travel faster than photons? And if it's the numerical value, what are the basis to which we arrived at the cosmic speed limit?

Gravity causes anything with energy to accelerate toward the source. Black holes, for example, have such strong gravity that they pull in light and don't let any escape. But can acceleration still apply to light? The speed of light is constant, of course, but why are photons affected by gravity yet aren't accelerated by it?  Edit: My main question is why photons aren't affected in the same way as most other particles. I'm perfectly aware that it cannot surpass lightspeed, but I want to know what makes it unaffected by acceleration while other particles are affected.


I'd like to know if the use of were is correct in the sentence below or if it should be replaced with was:     As if X weren't hard enough already, companies now face the   challenge to deliver Y.   For your response, assume that X is hard enough already.  Edit:   I'm aware that several questions related to the subjunctive "were" have been asked on this site. But they don't help me.   To clarify, I'm asking if the subjunctive mood is appropriate here. If so, I'd like to use the subjunctive. I'm not asking if it is OK to not use the subjunctive. (I know that in current English language it is more or less acceptable to not use the subjunctive even when it is called for.)  If it helps, I think my difficulty has roots in the negative phrase "weren't". I haven't found this negative subjunctive construction addressed anywhere.

It is to me a curious fact that the  of verbs in English has so nearly disappeared in modern times. In fact, even the correct form and usage of the subjunctive in Modern English barely distinguishes itself from the indicative! In many regions and dialects, the subjunctive would appear to be entirely obsolete, replaced by the indicative in all cases. (Educated speakers, certainly in Britain at least, do however still make good use of it.)  The present subjunctive form in  is (in almost all cases) virtually identical to the third-person plural present indicative (e.g. 'He were', 'She own'). This is markedly different from , where the subjunctive form a form was . Even by the advent of Early Modern English in the 16th century, the subjunctive was already converging with the indicative.  Other Modern European languages, not only Romance ones such as French and Spanish, but Germanic languages related to English (e.g. Dutch/German) have a much more pronounced subjunctive form. From what I remember of my Classical Latin, word suffixes for a variety of tenses are hugely obvious in the subjunctive.  My question is: why is this convergence of the subjunctive and indicative so strongly the case in Modern English? Is it a general trend in other Germanic/Romance (or more generally Indo-European) languages? Why is its disappearance so much more apparent in English than other related languages?


In Java, it's allowed to have assignment in a if condition, meaning we can have code like this: List<T> result; if ((result = getResultFromA())) == null) {   result = getResultFromB(); } return result;  Which I think is equivalent to: List<T> result = getResultFromA() if (result == null) {   result = getResultFromB(); } return;  I know the second one is more readable, but I'm wondering if there is any difference in terms of efficiency or performance? Is the first style a bad practice? I would appreciate any ideas. Update: Thanks for all these great ideas. Actually the question should be: which of these two syntaxex should be followed? Apart from readability, is there any other reason why we prefer the second style?

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 use following commands very often, and they're too long.  sudo /etc/init.d/kerio-kvc start sudo /etc/init.d/kerio-kvc stop   how can I create a shortcut command for them? something like sudo kerio start or sudo kerio stop

It's taken me almost 10 years of Linux usage to ask this question. It was all trial and error and random late-night internet surfing.  But people shouldn't need 10 years for this. If I were just starting out with Linux, I'd want to know: When to alias, when to script, and when to write a function?  Where aliases are concerned, I use aliases for very simple operations that don't take arguments.   alias houston='cd /home/username/.scripts/'   That seems obvious. But some people do this:  alias command="bash bashscriptname"   (and add it to the .bashrc file)   Is there a good reason to do that? I'm trying really hard, but I genuinely can't think of any circumstances in which I'd want to do that. So, if there is an edge case where that would make a difference, please answer below.  Because that's where I would just put something in my PATH and chmod +x it, which is another thing that came after years of Linux trial-and-error.  Which brings me to the next topic. For instance, I added a hidden folder (.scripts/) in the home directory to my PATH by just adding a line to my .bashrc (PATH=$PATH:/home/username/.scripts/), so anything executable in there automagically autocompletes.  If I needed to.  I don't really need that, though, do I? I would only use that for languages that are not the shell, like Python.  If it's the shell, I can just write a function inside the very same .bashrc:  funcname () {   somecommand -someARGS "$@" }   As I stated, I found a lot of this out through trial and error. And I only truly saw the beauty of functions when my computer died and I was forced to use the computers of the people around me when they weren't using them.   Instead of moving a whole directory of scripts from computer to computer, I ended up just replacing everyone else's .bashrc with my own, since they had never even made a single modification.  But did I miss anything?   So, what would you tell a beginning Linux user about when to alias, when to script, and when to write a function?   If it's not obvious, I'm assuming the people who answer this will make use of all three options. If you only use aliases, or only use scripts, or only use functions—or if you only use aliases and scripts or aliases and functions or scripts and functions—this question isn't really aimed at you.


If I look at my reputation graph with a large range, the bars don't appear on the chart:    However, if I select a smaller range, things seem to work fine:    It looks like anything under a year works, but any timespan over a year doesn't. I'm on Chrome 31.0.1650.57 m. No errors appear in the console.

As you can see, if you go to the reputation graph on your profile on Stack Overflow, the bars in the bottom overview will be white. This makes them invisible unless they are selected.  Eeek!  This does not happen on meta or any other site. Also, I cannot seem to reproduce it on others' profile. Possibly a bug only on your own profile? EDIT: I think I've existed for too long. If I change the CSS on one of the bars to stroke: none, then it becomes green. I think the outline is covering the fill because the bars are too skinny. EDIT2: Confirmed hypothesis by reproducing on Jon Skeet's graph. Proposed solution: enforce minimum bar width and add horizontal scrollbar. EDIT3: Can only repro on Chrome 29.0.1547.57 (Official Build 217859) m (the latest version). Norepro on older versions of Chrome, IE9 (winces), all versions of FF, and all versions of Safari. EDIT4: Can be fixed simply by running the JavaScript $('rect').css('stroke-width', '0') or a userstyle rect { stroke: none }. I may make a user[style|script] to fix this.


Why are Singleton Classes used in Android/Java, when the same functionality looks to be provided by using a class with static fields and methods?  e.g.  public class StaticClass {     private static int foo = 0;      public static void setFoo(int f) {         foo = f;     }      public static int getFoo() {         return foo;     } }   vs  public class SingletonClass implements Serializable {      private static volatile SingletonClass sSoleInstance;     private int foo;      //private constructor.     private SingletonClass(){          //Prevent form the reflection api.         if (sSoleInstance != null){             throw new RuntimeException("Use getInstance() method to get the single instance of this class.");         }          foo = 0;     }      public static SingletonClass getInstance() {         if (sSoleInstance == null) { //if there is no instance available... create new one             synchronized (SingletonClass.class) {                 if (sSoleInstance == null) sSoleInstance = new SingletonClass();             }         }          return sSoleInstance;     }      //Make singleton from serialize and deserialize operation.     protected SingletonClass readResolve() {         return getInstance();     }      public void setFoo(int foo) {         this.foo = foo;     }      public int getFoo() {         return foo;     } }

What real (i.e. practical) difference exists between a static class and a singleton pattern?  Both can be invoked without instantiation, both provide only one "Instance" and neither of them is thread-safe. Is there any other difference?


Suppose I have 3 dice. Each has some mechanism that can prevent other dice being in 2 if itself is 2 when they are rolled together. Now I roll the 3 dice at the same time. Then what is the probability of having a 2 appearing?  Is the answer 1/6 + 1/6 + 1/6 = 1/2 since the event are mutually exclusive and each has a probability of 1/6?  But without the mechanism the probability of at least one 2 appearing is 1 - (5/6)^3 = 91/216 < 1/2?  Why should the probability decrease?

Suppose I have 3 dice. Each has some mechanism that can prevent other dice being in the same number as itself when they are rolled together. Now I roll the 3 dice at the same time. Then what is the probability of having a 2 appear?  Is the answer 1/6 + 1/6 + 1/6 = 1/2 since the event are mutually exclusive and each has a probability of 1/6? But 1/2 seems to be too high?


An internal error occurred during: "Launching app". java.lang.StackOverflowError. Got red exclamation marks on both my main android project and my test project. in my logcat it says:   Error invoking for backup on @pm@ stackoverflow   Anyone have any idea what parts of the project I should check?

What is a StackOverflowError, what causes it, and how should I deal with them?


The charging port on my Acer laptop is dead, I thought it was the charger but I bought a new universal charger only to discover that the problem was the port on my laptop. The new charger has USB ports on it as well as different size heads, can I charge my laptop using the USB port since my charging port will not work?

Can I charge computers by inducing 5-volt into their USB connectors? Is this possible? I noticed that when my EeePC 900 is off but plugged in charger, there is power coming out of the USB port. Can this be a sustainable way of charging a PC, or a flaw in design?


What actually is energy? Is it a property associated with matter or just a number? By doing work are we changing the energy of the body or converting one form of energy into other which is already present.

The simplistic undergrad explanation aside, I've never really understood what energy really is. I've been told that it's something when converted from one kind of something to another kind, or does some "work", as defined by us, but what is that something?  Moreover, if the total amount of energy in the universe is finite and we cannot create energy. Then, where did it come from? I've learned from thermodynamics where it goes, but where does it come from?  I know this sounds like something trivially simple, but there is so much going on in the physical universe and I just can't grasp what it is. Maybe it is because I lack the mathematical understanding that I can't grasp the subtle things the universe is doing. Still, I want to understand what it is doing.  How do I get to the point of understanding what it's doing?  (Note: What prompted me to ask this was . I'm afraid that it just puzzled me further and I sat there staring at the screen for a good 10 minutes.)


Is there a way to make a conditional where the test is the definition of a counter with a specific name, i.e. "if there exists a counter named foo, then do [bar], otherwise do [baz]"? If so, how do I do that?

I've written a package that introduces a new environment:  \newfloat{foo}{htb}{bar}[chapter]   The package however can be used for articles, books, ... Since not all of these environments have the concept of chapter, on gets a No counter 'chapter' defined. exception.  How can I check if the chapter counter is defined?


So I am trying to find a way to increment a datetime object by one month. However, it seems this is not so simple, according to .   I was hoping for something like:   import datetime as dt  now = dt.datetime.now() later = now + dt.timedelta(months=1)   But that doesn't work. I was also hoping to be able to go to the same day (or the closest alternative) in the next month if possible. For example, a datetime object set at January 1st would increment to Feb 1st whereas a datetime object set at February 28th would increment to March 31st as opposed to March 28th or something.    To be clear, February 28th would (typically) map to March 31st because it is the last day of the month, and thus it should go to the last day of the month for the next month. Otherwise it would be a direct link: the increment should go to the day in the next month with the same numbered day.    Is there a simple way to do this in the current release of Python?

I am using the datetime Python module.  I am looking to calculate the date 6 months from the current date. Could someone give me a little help doing this?  The reason I want to generate a date 6 months from the current date is to produce a review date.  If the user enters data into the system it will have a review date of 6 months from the date they entered the data.


I have switched for a moment from calculating integrals and solving differential equations to learning how to prove statements about infinite sets. I have made a list of exercises for training and found myself absolutely helpless even in the face of the simplest problems in that list. The thought process that is required, currently, is alien to my brain, so I want to start with a little help from the community.     The problem is:     Given an uncountable set A of positive numbers, prove that we can choose a countable subset B from set A, so that the sum of the elements of B is infinite.     I guess, we should somehow provide the construction of the set $B \subset A$ with the required property, but I don't event know how to start.  I'd like to see the thinking process with as much detail as possible, so that I could internalize this type of thinking.    No, my question is not duplicate. Why do you mark it a duplicate so fast? 1. I need to extract countable set B, not any set. 2. I am more concerned with the specific type of thinking that is needed to solve these kinds of problems, than particular one-line formula that does it. In order to make my question concrete, I have provided a specific problem. By explaning how we are coming up with the solution to that problem it is easy to show how one thinks in the process.    A lot of interesting and useful information has been generated in the comments :) Now I am going into analysing mode and start putting this information together inside of my brain (and mold it with additional thinking). It is interesting, what time will it take before I get a general feeling for what is happening :)

If $\Gamma$ is a set of uncountably many different positive real numbers, can we choose a sequence of pairwise different positive numbers from $\Gamma$, say $\{a_n\}$, such that $\sum a_n = \infty$ ?   I am considering such problem and I think the answer should be yes. But what's the rigorous way to prove it? Please give me some hints and I will appreciate any help :-)


I have followed up the below process in cmd:  DISKPART> attributes disk clear readonly  Disk attributes cleared successfully.   Even if I do that it displays Read-only:yes:  DISKPART> attributes disk Current Read-only State : Yes Read-only :yes Boot Disk : No Pagefile Disk : No Hibernation File Disk : No Crashdump Disk : No Clustered Disk : No  DISKPART>   How can I remove the write protection from this USB flash drive? I have tried several things I found on the Internet.  I guess it happened because of a virus infection.

When I plug in my USB flash drive, it shows up on my computer as write-protected or read-only. I am unable to transfer data to it, nor can I modify or delete any files already stored on it. I also cannot repartition or reformat the drive using Windows Disk Management, DiskPart, GParted, or other tools. The drive does not have a write-protect switch.  Why did this happen and what can I do about it? Is there a way to remove the write protection?  (Note that this can happen with some memory cards, too, as they often use controllers similar to those used in flash drives. In some cases, the system may report that the drive or card was formatted successfully even though it was never actually formatted; the original data reappears when the device is reinserted.)     This question comes up often and the answers are usually the same. This post is meant to provide a definitive, canonical answer for this problem. Feel free to edit the answer to add additional details.


I have two datatables as shown in screenshot (table 1 and table 2). I want to merge these tables based on the Name column and create the result table as you see ...   Can you please explain to me how to achieve this?   Note: my table is simple datatable in c# not SQL table Thanks

If I have 2 DataTables (dtOne and dtTwo) and I want to merge them and put them in another DataTable (dtAll).  How can I do this in C#?  I tried the Merge statement on the datatable, but this returns void.  Does Merge preserve the data?  For example, if I do:   dtOne.Merge(dtTwo);   Does dtOne change or does dtTwo change and if either one changes, do the changes preserve?  I know I can't do this because Merge returns void, but I want to be able to store the Merger of both dtOne and dtTwo in dtAll:  //Will Not work, How do I do this dtAll = dtOne.Merge(dtTwo);


Can I make power (electricity ) using buoyancy see diagram. if this diagram is possible then how much power i get . I just need formula for upwards speed.

I realize this isn't possible, but I can't see why not, especially if you change the model a little bit so that the balls simply travel through a tube of water on the way up, rather than exactly this model.  Please be clear and detailed.  I've heard explanations like "the balls wouldn't move" but that doesn't do it for me - I really do not see why the balls on the right would not be pulled/pushed up, and the rest of the chain wouldn't continue on.


I read a novel from the 1970s about a crew on a ship who are in hibernation.  The story mostly deals with one crew member.  He has very disturbing dreams during his sleep periods.  Such things as being a fish, and being eaten alive by a bigger fish.  He can feel, in the dream, all the pain of being chewed.  He has waking periods to think about the dreams, and having to face the inevitability of going back into hibernation.  I cannot remember the title or author, and that is what I am seeking.

I read this story/novella at least 15 years ago, probably 20 or more. It is about a ship, travelling through the universe, looking for habitable planets. Why, I can't remember. People are held in Cryo Stasis and I think they are wearing nothing in the chamber but some kind of mesh. Every time the ship gets close to a planet it wakes one or two of the people (one woman, one man?) to check it out but they never find anything good. I think in the end they wake up and discover, that they have arrived back at Earth. Other details are very vague but I seem to recall there was lots of stuff about a (blue?) light, dreaming/dreams and something about the cold, or cold blue lights or similar. Does that ring a bell for anyone?


I have a PLC which sends me a 32 bit REAL value, but i am only able to receive a 64 bit float value. The value is not 100% correct, e.g. I send 9.4 and receive 9.3999984026 Why is that so and even if I would use 64 bit on both sides would  it change the result? The norm is IEEE 754. Thanks in advance, Daniel

Consider the following code:   0.1 + 0.2 == 0.3  ->  false   0.1 + 0.2         ->  0.30000000000000004   Why do these inaccuracies happen?


I'm looking for a word that describes an idea that is often held out as true or used as a rationale though in fact the opposite is true. Something like "common misconception" or "antipattern" come close, but I feel as though there's a better word I'm missing.  Examples:  "Refusing to use popular security algorithms because everyone knows how they work is a [word], since it is because everyone knows how they work that they are so safe."  Not necessarily saying I 100% agree with the following, but someone who advocates for Keto might say this:  "Trying to lose weight by cutting out fat is a [word], because replacing carbohydrates and proteins with fat allows the body to enter ketosis, which is one of the best states for losing weight."  Thanks in advance.

It isn't any of the words on this  and I believe it started with the letter 'e' (though please offer your word even if it doesn't).  Example sentence: Because he researched what he had heard from his friends, he was able to refute many of their _________________.  Factoid seems to be the closest one, but the word I am looking for only refers to a belief that is false.


Problem  Prove that if $f \in C^1([0, \pi])$ with $f(0)=f(\pi) = 0$, then  $$ \int_0^\pi |f|^2 dx \le \int_0^\pi |f'|^2 dx.$$  I want to prove it using Fourier sine series of $f$. Let $f \sim \sum_{n=1}^\infty A_n \sin nx$ be Fourier sine series of $f$. (obtained over $(-\pi, \pi).$) By Parseval's theorem, $ \int_0^\pi |f|^2 dx = \frac{1}{\pi} \sum_{n=1}^\infty |A_n|^2$. If $\sum_{n=1}^\infty |A_n| < \infty$, series converges uniformly so  $$f' = \sum_{n=1}^\infty n A_n \cos nx.$$ Thus, $\int_0^\pi |f'|^2 dx = \frac{1}{\pi}\sum_{n=1}^\infty |A_n|^2 n^2$ so the inequality holds. However, there is no assumption that $\sum_{n=1}^\infty |A_n| < \infty$. My question is that whether the series of $f$ converges uniformly. Is the equation $f' = \sum_{n=1}^\infty n A_n \cos nx$ valid? At least, I want to know that whether applying Parseval's theorem to conclude $\int_0^\pi |f'|^2 dx = \frac{1}{\pi} \sum_{n=1}^\infty n^2|A_n|^2$ is possible.

I am looking for proofs of the (Poincare-) Wirtinger inequality which states that if $f:[0,\pi]\to \mathbb{C}$ is $C^1$ and $f(0)=f(\pi)=0$ then \begin{equation} \int_0^\pi |f(t)|^2 dt \leq \int_0^\pi |f'(t)|^2 dt. \end{equation} See .  The proof that I know starts by proving that if $$ \int_0^{2\pi} F(t) dt =0 $$ then $$ \int_0^{2\pi} |F(t)|^2 dt \leq \int_0^{2\pi} |F'(t)|^2 dt. $$ using Parseval's identity. From this, one proves the desired inequality for $f$ on $[0,\pi]$ by "extending" $f$ to an odd $C^1$ function on $[-\pi,\pi]$.  Are there other proofs? (Straightforward or otherwise...)


I have a script that works but it does not do what I want it to do. My script makes an object rotate on when another is clicked. However, I want the object to continuously rotate until I click on the other object again. Right now when I click it rotates just a bit and stops.  Here is my script   using UnityEngine;  using System.Collections;   public class Rotate : MonoBehaviour {  public float speed =50f; public GameObject target;   public void OnMouseDown(){      target.transform.Rotate (new Vector3(0, Time.deltaTime, 0) * speed);   }    }   Any assistance? I created what I have now using what I found on the internet but cant find another solution.

I have a script that works but it does not do what I want it to do. My script makes an object rotate on when another is clicked. However, I want the object to continuously rotate until I click on the other object again. Right now when I click it rotates just a bit and stops.  Here is my script:   public class Rotate : MonoBehaviour {     public float speed =50f;     public GameObject target;      public void OnMouseDown(){        target.transform.Rotate (new Vector3(0, Time.deltaTime, 0) * speed);     }  }   How can I make the object rotate continuously until I click it again?


In 1.12, the command:  clear @p paper 0 1 {display:{Name:"[Winning Ticket] Musical Minecarts",Lore:[" Take this ticket to the reward "," collections at the entrance of the ", " Games area to claim your prize! "]}}   would remove a piece of paper with that specific name and lore from the player's inventory. I assumed the 1.13 conversion would be:   execute at @p as @p run clear @s paper{display:{Name:"[Winning Ticket] Musical Minecarts",Lore:[" Take this ticket to the reward "," collections at the entrance of the ", " Games area to claim your prize! "]}} 1   but this doesn't work. As well as this, the command:  give @p minecraft:paper{display:{Name:"[Winning Ticket] Musical Minecarts",Lore:[" Take this ticket to the reward "," collections at the entrance of the ", " Games area to claim your prize! "]}} 1   only gives the item, without the custom display name, despite the lore being correct. What is the correct syntax for these two commands?

I am in 1.13 Pre-Release 7 trying to make a one command creation and I need an item with a specific name. The command I use is /give @p diamond_sword{display:{Name:"Sword of Power"}} and it gives my a diamond sword, but it doesn't have the name.   This is me running the command.   This is the command not working.


Using the 'app_label' in the 'Class Meta' will solve this problem. But it won't create tables while issuing 'syncdb' command.  Because the app name won't match with INSTALLED_APPS entry. Is there any way to achieve both (custom app name and creating tables with syncdb)

In the same way that you can give fields and models verbose names that appear in the Django admin, can you give an app a custom name?


Does answering all questions about a product that I'm working on is considered self-promotion? I'm asking because of this part in FAQ:     If a large percentage of your posts include a mention of your product or website, you're probably here for the wrong reasons.   And is it necessary for me to disclose my affiliation? Note that the questions are directly about how to use the product and I'm not suggesting my product as a solution

As a web search will tell you, I'm a committer on the  project. This means that I'm affiliated with the project, and according to , implies that I need to state that affiliation in every Tycho-related answer:     Post good, relevant answers, and if some (but not all) happen to be about your product or website, that’s okay. However, you must disclose your affiliation in your answers.   But this really feels wrong: If for example I'd write "I'm a committer" in my answer to a Tycho question with multiple answers, this feels like saying "I'm a committer, so that's why I am right and all others are wrong". IMHO, the affiliation statement would be undermining the community's mechanism for choosing the best answer based on the content of the answers, and not based on ranks and titles. I don't want to get votes because I'm a committer, but only if people like the information I'm providing.  So, for a purely technical answer on a project that I am affiliated with, do I really need to state my affiliation? I'm not promoting my project by answering a question of someone who happened to choose my product, am I?


How can you add a custom marker/point on the vertices of a line feature?   There are only options to add them to the start/end of the line and equally spaced along the line.   However, a marker on the exact postition of each vertices seems not to be possible.

In ArcGIS, is it possible to change the polyline symbology to show vertices? Or do I need to extract the points via ? This becomes a pain if I want to edit the source polygon/polyline features.  Here is what I'd like to see (this is from GMS), as I can clearly see start/end nodes and interior vertices.    I  that pressing the V key while editing will show vertices. But it is only useful while editing and pressing V.


I have the following classes  class Parsing  class Parsing {   private ClassWithTable c = new ClassWithTable();    public void doAction(){     parseRowData();     c.initComponents();   }    private void parseRowData(){     Object[][] rowData = new Object[3][2];     for(int i = 0; i < 3; i++){         rowData[i][0] = "A string";         rowData[i][1] = null;     }     c.setRowData(rowData);   } }   class ClassWithTable  class ClassWithTable {   private JTable table;   private Object[][]rowData;   private final String[] colNames = new String[]{null,null};    public void initComponents() {     table = new JTable(getRowData(),colNames); //in this line I get the exception     System.out.println(table.getValueAt(1, 1));   }    public void setRowData(Object[][]rowData){this.rowData = rowData;}   private Object[][] getRowData(){return this.rowData;}     public JTable getTable(){return table;} }   class JTableInstantiation  public class JTableInstantiation {   public static void main (String[] af){     ClassWithTable c = new ClassWithTable();     Parsing p = new Parsing();     p.doAction();    } }   When I run it, I get a java.lang.NullPointerException. I figured out that the table inside ClassWithTable cannot be instantiated, despite the fact that rowData take all right values. Could you please explain to me why is this happening? What am I doing wrong? Thank you in advance.  Exception table:  Exception in thread "main" java.lang.NullPointerException at javax.swing.JTable$1.getColumnName(JTable.java:685) at javax.swing.JTable.addColumn(JTable.java:2801) at javax.swing.JTable.createDefaultColumnsFromModel(JTable.java:1287) at javax.swing.JTable.tableChanged(JTable.java:4386) at javax.swing.JTable.setModel(JTable.java:3688) at javax.swing.JTable.<init>(JTable.java:632) at javax.swing.JTable.<init>(JTable.java:573) at javax.swing.JTable.<init>(JTable.java:684) at drafts.ClassWithTable.initComponents(JTableInstantiation.java:28) at drafts.Parsing.doAction(JTableInstantiation.java:10) at drafts.JTableInstantiation.main(JTableInstantiation.java:41)

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?


I could not retrieve information from mysql database. I got an error saying     Array\n(\n [0] => 42000\n [1] => 1064\n [2] => on the client side   However, when I replace the variable $city with regular string like "san francisco" it works fine. I even tested that whether $city is a string and it is a string   $sth just failed to execute even though the query was successful    <?php      if (isset($_GET)) {          $servername = "localhost";         $username = "XXXXX";         $password = "XXXXX";         $dbname = "CALIFORNIA";         $city = $_GET['userinput'] . "";           // Create connection         $conn = new PDO("mysql:host=$servername;dbname=$dbname", $username, $password);         $conn->setAttribute(PDO::MYSQL_ATTR_USE_BUFFERED_QUERY, PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING);         $sql = "SELECT State FROM  CITY WHERE City_name = $city";   // When I replace the $city with string like "San Francisco", it works but not with variable $city          if (($sth = $conn->prepare($sql))) {             if ($sth->execute()) {            // $sth failed even though the query was successful                  $result = $sth->fetchAll();                 $json = json_encode($result);                 echo $json;             }             else                 echo print_r($sth->errorInfo()); // Error print out on client side          }         else             echo  $conn->errorCode();          }

If user input is inserted without modification into an SQL query, then the application becomes vulnerable to , like in the following example:  $unsafe_variable = $_POST['user_input'];   mysql_query("INSERT INTO `table` (`column`) VALUES ('$unsafe_variable')");   That's because the user can input something like value'); DROP TABLE table;--, and the query becomes:  INSERT INTO `table` (`column`) VALUES('value'); DROP TABLE table;--')   What can be done to prevent this from happening?


I'm trying to make a command that summons a sign that you can buy a certain item from, however I keep on getting a error with inserting the lore and the custom name, the command that I have used is,  /give @p sign 1 0 {BlockEntityTag:{Text1:"[{\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/tellraw @p[score_Grains=0] {\\\"text\\\":\\\"You do not have enough Grains to buy that\\\",\\\"color\\\":\\\"dark_red\\\"}\"},\"text\":\"[Buy]\",\"bold\":\"true\"}]",Text2:"[{\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/tellraw @p[score_Grains_min=1] {\\\"text\\\\\\\":\\\"You just bought 1 Test for $1\\\",\\\"color\\\":\\\"dark_green\\\"}\"},\"text\":\"Test\",\"underlined\":\"true\"}]",Text3:"[{\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/give @p[score_Grains_min=1] minecraft:paper 1 0 {display:{Name:"Test",Lore:["Test"]},ench:[{id:0,lvl:10}]}\"},\"text\":\"$1\",\"color\":\"green\"}]",Text4:"[{\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/scoreboard players remove @p[score_Grains_min=1] Grains 1\"},\"text\":\"1\"}]"},display:{Name:"Buy Test"}}   However, there is a error message which is,   [13:21:48] Data tag parsing failed: Unexpected token 'T' at: Test",Lore:["Test"]},ench:[{id:0,lvl:10}]}\"},\"text\":\"$1\",\"color\":\"green\"}]",Text4:"[{\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/scoreboard players remove @p[score_Grains_min=1] Grains 1\"},\"text\":\"1\"}]"   What is wrong? And how do I fix this?

I need help with a specific command that I am using in a new game that I am creating inside of Minecraft. The command is:  /give @p sign 1 0 {BlockEntityTag:{Text1:"{"text":" [MF2]","color":"gold","clickEvent": {"action":"run_command","value":"tellraw @a [""{"text":"[MF2]  ","color":"gold"},{"selector":"@p","color":"dark_aqua"},{"text":" is now an admin of the server!","color":"white"}]"}}",Text3:"{"text":"Click to join Admin","color":"dark_aqua","clickEvent": {"action":"run_command","value":"scoreboard teams join admin @p"}}"},display: {Name:"Custom Sign"}}   If I take out the /tellraw command then the command works fine, but I need the command in there to announce to the game that a new admin has joined.  With the tellraw command, the error message is the following:  Data tag parsing failed: Unexpected token 't' at: text":" [MF2]","color":"gold","clickEvent":{"action":"run_command","value":"tellraw @a [""{"text":"[MF2] ","color":"gold"}, {"selector":"@p","color":"dark_aqua"},{"text":" is now an admin  of the server!","color":"white"}]"}}",Text3:"{"text":"Click to join Admin","color":"dark_aqua","clickEvent": {"action":"run_command","value":"scoreboard teams join admin @p"}}"   If anyone knows how to fix this, please let me know.


I'm kinda new in this thing of Latex's Graphics, recently I'm trying to make lecture notes of multivarible calculus, but I'd like to iunclude the geometrical perpective and you better know ain't the best drawer, so I would like to complement it with some beamer-type of presentation.   Okay, too much information..., my real problem is: I still don't know how to "recreate" this kind of graphics to include them in the notes, I had had many problems with Ticks in the past, I'd like to have other options.   Graphics such as:     or     Sure any help is welcome, thanks.

I feel intimidated in learning TikZ. I was wondering if there are some nice materials (or just your replies) at different level:   for providing big picture, which is important to beginners to not lose direction during learning. for comprehensive reference.   Examples are important, but only examples are not always clear for understanding the big picture and organization.


I have a web service that returns an array of bytes and my intention is to convert said array to a .wav in the client (a handheld such as Blackberry). However I really have no idea of how to do that, I tried just making an FileOutputStream but of course that wouldn't play. So I am once again without knowing what to do. Any ideas?

Given an InputStream called in which contains audio data in a compressed format (such as MP3 or OGG), I wish to create a byte array containing a WAV conversion of the input data. Unfortunately, if you try to do this, JavaSound hands you the following error:  java.io.IOException: stream length not specified   I managed to get it to work by writing the wav to a temporary file, then reading it back in, as shown below:  AudioInputStream source = AudioSystem.getAudioInputStream(new BufferedInputStream(in, 1024)); AudioInputStream pcm = AudioSystem.getAudioInputStream(AudioFormat.Encoding.PCM_SIGNED, source); AudioInputStream ulaw = AudioSystem.getAudioInputStream(AudioFormat.Encoding.ULAW, pcm); File tempFile = File.createTempFile("wav", "tmp"); AudioSystem.write(ulaw, AudioFileFormat.Type.WAVE, tempFile); // The fileToByteArray() method reads the file // into a byte array; omitted for brevity byte[] bytes = fileToByteArray(tempFile); tempFile.delete(); return bytes;   This is obviously less desirable. Is there a better way?


How can I make a subscript for sum in latex like the following picture:    I tried \sum_{q_i} but that doesn't make the result I want. It makes the following result:

I'm very familiar with how symbols display differently in inline mode (with $ ... $) vs. how display math shows them (with \[ ... \] or $$ ... $$).  Two examples would be with limits  $\lim_{n\rightarrow \infty}f(x)$   vs.  \[ \lim_{n\rightarrow \infty}f(x) \]   and with sums  $\sum_{n=1}^{x} n^2$   vs.  \[ \sum_{n=1}^{x} n^2 \]   My Question is:     How do you display these things in inline mode (with all the nice inline formatting) as if they were in display mode ?   The inverse -- how to display things in display mode as if they were in inline mode -- is also of interest.


I recently upgraded from Ubuntu 16 to Ubuntu 18.04. The Alt + Tab behavior has changed. I already installed a gnome extension to remove the delay as recommended in this answer: , but this still does require an extra press on Tab to actually switch the window. I find it very annoying.

Currently if I hold ALT + TAB and then while still holding down ALT I press TAB I am able to go between applications in a little view and then when I release all the keys that application and all its windows come to the front.  And this is very useful, but I would like to know if there is a way of switching between individual windows with this keyboard shortcut in the same way rather than grouping windows with an application to switch to?  I am running Ubuntu GNOME 15.10 with GNOME 3.18.


For the sake of learning I'm writing some codes in C# to create an FTP client without GUI. For the connection I'm using the "FluentFTP" module from below link:  I'm wondering how to detect idle user and disconnect them from the server. Should I use Async or Parallel programming? I'm knew to both of them, please refer me to some simple tutorial if that is the solution.  I can provide codes, but won't for now to keep it clean. My app tries to read IP, username, and password of the FTP server and connects to it, then does some regular stuff like upload and download files. Timeout can happen during data entry or at the page user decides what task wants to do, but shouldn't happen when files are being transmitted!

I have a console app in which I want to give the user x seconds to respond to the prompt.  If no input is made after a certain period of time, program logic should continue.  We assume a timeout means empty response.  What is the most straightforward way of approaching this?


The c function with param such as :   void test(int fp, int &pos){ //do something... }   But i don't understand what does "int &pos" meant . Thank you very much for your help

I know references are syntactic sugar, so code is easier to read and write. But what is the difference between a pointer variable and a reference variable?


I read a fantasy (?) series 25+ years ago, and it has strangely been on my mind. It took place on a desert-like world not unlike the Middle East.  Language was similar too.   Main character was a young man that mind-melded with a very large cat (reminds me of Avatar's character with the flying creature). He rode on his back. This image was on the cover.

Some time around 1998 I read a book (which is surely older) suggested by one of my friends. Since this is the first time posting for me I'll do my best to give all the details I can recall.  The main protagonist is a white male (who I believe has cancer and/or is very old) on a boat that gets hit by a comet or meteor or some kind of astronomical event. He wakes up in the body of a young dying male in a desert and meets a telepathic cat that was bonded with the dying male.   The beginning of the book is about the protagonist learning to navigate his body, the bonds with the people his body knew and the telepathic cat. The two have to learn to trust one another. The "bond" is a two-way lifelink, if one dies so does the other.  We learn later that others on that boat suffered much the same fate shifting into new bodies in this parallel dimension including a female he had fancied or met back on the boat. Her body is also bonded to a telepathic "riding" cat. While I can't remember if anyone else on the boat also switched over, I feel like at least one other person did who was an antagonist but I can't verify it in my brain.  The protagonist is trying to find "something", but I can't remember what. I seem to recall jewels or gems and an important sword. Like, a hilt that's important and has an invisible blade? I remember certain scenes but without enough information for them to feel useful.  Such scenes as:   They end up in a huge palace with a verdant garden that they later escape from, for some reason. The protagonist gets super injured at one point and the cat struggles with him so they both survive. He keeps having flash backs to the incident on the boat. For a long while the cat hates this guy who basically has supplanted his master/friend, but it's okay since that guy dying would have killed the cat.   The only thing I can recall about the title is "The [blank] cycle(s)" and all my searching has come to naught. It was a series of books, I know that.  The cover showed the main protagonist, the female "love interest" and their cats in the sun bleached desert. I recall that the female has very short cut dark hair. The protagonist is wearing a white "turban" of some sort.


If we ask someone what the speed of light is, they will say that it is constant and its value is $3\times 10^{8}\ \mathrm{m/s}$.  But if we recall refraction of light, we say that when the light travels from a rarer medium to a denser medium then it slows down.     But we still say that its speed is constant. Why?

So light travels slower in glass (for example) than in a vacuum. What causes light to slow down? Or: How does it slow down? If light passes through the medium, is it not essentially traveling in the "vacuum" between the atoms?


I made this using more then one object, then joined them together. used some fill faces as well. Then when I put the subdivision mod on it I get this three color pattern on the now Whole oject. Is that normal? I think not. so if I am right how to I get it to show all of it in the same color?

While rendering a mesh with smooth shading on, I get a dark region/shadow on certain faces. The effect is more evident when smooth shading is applied to a mesh containing ngons, with the ngons turning black when rendered.   The blackening effect is visible in the viewport too.  How can I solve this problem?


How do I get the current date and time in the local timezone? System.DateTime.Now returns the current date and time for what the local time zone was when the program was started, which does the wrong thing.  Duplicate of sum of:

This problem occurred during daylight saving time change. After the change occurred, we've noticed that our server application started writing into the log incorrect time - one hour ahead which means that .NET caches time zone offset. We had to restart our application to resolve this problem. I wrote a simple application to reproduce this problem. When I change the time zone while application is running, DateTime.Now property keeps producing the time in the old time zone. Does anybody know if there is a workaround for this problem apart from restarting the application?


I updated from v16 of ubuntu to v8.  When I did that all went well. A lot of things were funky (e.g., there is no pip and it won't let me add one).  The best advice so far is to re-install v18 again. 'Software Updater" app runs, but ends up saying "the software on this computer is up-to-date". How do I get it to reinstall the latest version of Ubuntu over the (somewhat messed up) current OS? Addendum: Someone asked for a screenshot.  Here is one from another user who had the exact same problem, but none of the suggested fixes fixed it for me:  BTW, the updater does give me a settings button and pages, but none of them are about the install I want to do.  They control, for example, what the upgrade and patch methodology (daily, automatic, etc.) do.

I am trying to install a fresh version of Ubuntu in my computer without touching the windows 10 dual boot! In the Installation Type, the first option seems exactly what i wanted to do.  My question is, is this feature is safe to use? because i don't want to lose any windows files and other NTFS partitions on the hard-disk. Please eliminate my confusion. Note as that i dont need any files or media which are in the ubuntu partition, Thanks.


I have been revising basic compound angles and I am struggling to understand the following question from the examples I have previously studied on such topic.  A first step, or point of direction/suggestion would be brilliant. Thank You.  The instantaneous current ($i$) and the instantaneous voltage ($v$) in a pure resistance AC circuit is given by; \begin{equation} i=i_{max} \sin(\omega t) \end{equation}  and \begin{equation}  v=v_{max} \sin(\omega t). \end{equation} Since power is computed \begin{equation} P=iv=i^2 R \end{equation} Show that an equation for instantaneous power is \begin{equation} P=i_{max}^2 R \left(\frac{1−\cos(2\omega t)}{2}\right). \end{equation}

I have been revising basic compound angles and I am struggling to understand the following question from the examples I have previously studied on such topic.     I cannot envisage the compound angle formulae associating with this (if I am correct in saying it associates with this topic).     A first step, or point of direction/suggestion would be brilliant. Thank You.  The instantaneous current $i$ and the instantaneous voltage $v$ in a pure resistance a.c. circuit is given by;  $i=i_{\text{max}} \sin \omega t$     and     $v= v_{\text{max}} \sin \omega t$  Since power;  $P = iv =i^2 R$  Show that an equation for instantaneous power is;  $P=i_{\text{max}}^2 R[1-\cos 2(\omega t)]/2$


Hopefully no one gets offended by the title but I had a discussion with a coworker whether or not there is a good word for people who fight for men's rights. If feminists are woman activists, what is the correct term for male activists (really just looking for the word, not for a discussion about activism) Andronists?  Enlighten us :)

I am looking for a word or phrase that are to men's rights as the words feminist/feminism are to women rights.  And will the word or phrase be called a synonym or antonym?


How to prove the following sequence converges to $0.5$ ? $$a_n=\int_0^1{nx^{n-1}\over 1+x}dx$$ What I have tried: I calculated the integral $$a_n=1-n\left(-1\right)^n\left[\ln2-\sum_{i=1}^n {\left(-1\right)^{i+1}\over i}\right]$$ I also noticed ${1\over2}<a_n<1$ $\forall n \in \mathbb{N}$.  Then I wrote a C program and verified that $a_n\to 0.5$ (I didn't know the answer before) by calculating $a_n$ upto $n=9990002$ (starting from $n=2$ and each time increasing $n$ by $10^4$). I can't think of how to prove $\{a_n\}$ is monotone decreasing, which is clear from direct calculation.

Let $s_n$ be a sequence defined as given below for $n \geq 1$. Then find out $\lim\limits_{n \to \infty} s_n$.   \begin{align}   s_n = \int\limits_0^1 \frac{nx^{n-1}}{1+x} dx  \end{align}  I have written a solution of my own, but I would like to know it is completely correct, and also I would like if people post more alternative solutions.


Shortcut for quickly toggling between cameras (in a similar way the Alt+Tab works for OS tabs) ?    Assuming the function exists...  If it doesn't, it should lol.

Let's say I have 4 cameras on a scene:    I would like to render with the first camera, see what it looks like, then switch to the "next" camera quickly and see what that render looks like.  Currently, to switch cameras I have to click on a camera and set it as active and finally I can render (I don't have a number pad so I have to go to the menu and set it each time; else I'd use Ctrl+0). What I would like to know is whether there is a way to switch cameras and set it as active all in one step?  EDIT: I'm not asking how to set a camera as active, that's doable via menu, what I'm asking for is a guide for a "quick toggle" between cameras; a quick way to switch active cameras without an animation.


I have a log file, name out.log. I need to search a list of string (filelist.txt) from this log file.  I need each matching line from "out.log" for every file in filelist.txt. it can appear multiple times.  cat out.log | grep -i I466030.CXR910E >> search_result.txt   this works, it will search for I466030.CXR910E and output to search_result.txt  for i in `cat filelist.txt`; do  grep -i "$i" out.log >> result.txt; done    for i in `cat filelist.txt`;     do        echo $i      cat out.log | grep -i $i >> result2.txt      grep $i out.log >> result3.txt    done    Above code the echo will output the search string but none of the grep not writing output to any result*.txt    What am I missing here ? Thanks for your advice.     In response to comments:  xxxxxm@cxxxrtrls01[DEV][rerun] $ grep -i -f filelist.txt out.log > result.txt xxxxxm@cxxxrtrls01[DEV][rerun] $ ll total 564 -rw-r----- 1 cnrlsadm cnrlsadm   4600 Aug 19 09:36 filelist.txt -rw-r----- 1 cnrlsadm cnrlsadm    216 Aug 19 10:14 file.sh -rw-r--r-- 1 cnrlsadm cnrlsadm 557403 Aug 19 10:10 out.log -rw-r--r-- 1 cnrlsadm cnrlsadm      0 Aug 19 12:14 result.txt -rw-r----- 1 cnrlsadm cnrlsadm    213 Aug 19 12:10 srch.sh xxxxxm@cxxxrtrls01[DEV][rerun] $   size of result.txt is zero , it doesnt have anything.

I have a text file with 4 sentences and I want to grep the ones ending in "me", however when I do grep "me$" it doesn't work.  Am I missing something?  (I wanted the result to be the 1st, 2nd and 4th line).  Edit: Replaced image with text.  $ cat sm.txt somebody once told me  somebodyoncetoldme  the world was  gonna roll me $ grep "me$" sm.txt $


This is just trivia really, but it's just got me wondering what's going on. I accidentally hit / instead of . today and got this:  [andrew.morris@server ~]$ cd // [andrew.morris@server //]$ pwd /   I would have thought // was an invalid path. What happened?

I was working in the bash terminal on my system (OSX 10.8.3 / bash version 3.2.48(1)-release (x86_64-apple-darwin12)) and I accidentally typed "cd //" instead of "cd /" to get back to the root directory.    Strange thing was that it took me to "//" which when I listed looked exactly like "/".    So my questions are:  Is there any semantic difference betweens these two paths?  What if anything is the purpose of these two paths?   and/or is it a bug?


How can I check to see if anyone has tried to file my tax return? I have reason to suspect that someone has stolen my social security number.

I don't know if I've filed my taxes or not!  I am due a refund according to TaxACT Deluxe, but I have no idea how to check if I have already filed for my taxes?  What happens if I e-file again and I have filed for taxes?  How do I check if I need to file again?  Thanks!


How can I transfer my files from Ubuntu desktop to my Android phone using Wi-Fi network?

I am using Ubuntu 14.04. How to install and configure the latest version of  on Ubuntu.  I would like to know how to install it from PPA and from source.


I changed the permission of the /usr to 400 and now I am not able to use sudo. How do I revert this and fix it?

I accidently ran  sudo chmod 755 -R /   instead of  sudo chmod 755 -R ./   I stopped it after few seconds, but now there is some problems such as  sudo: must be setuid root   How can I revert permissions back?


My 28-month-old girl absolutely refuses to poop. We started potty training a week ago and she does perfect with pee. But she went to poop and freaked out. Crying and gagging is all I got... That was on a Monday, it's now Saturday morning and not more poop. She even told me I don't want to poop ever never...   Please help! I figured by now it would have to come out... Apparently not... We've tried everything big potty little potty rewards... I hate to give her something to go and her have diarrhea.

My son is almost 3 (33 months) and for the past few months, he has been holding his poop in, to the point that he won't go for many days a time. When this started, the doctor advised us to give him Miralax to make his stool softer so it comes out more easily. Even with the Miralax, he still managed to hold it for two days at a time sometimes, but at least it was coming out at all, so we continued with it.  Anyway, we've been giving him the Miralax for months now, and now he's (supposed to be) going to preschool in September, which of course requires that he be potty trained. We don't want to hold him back since he's developmentally ready otherwise, so we started potty training a few weeks ago.  He picked up the potty training really quickly – for peeing – but he still holds his poop in no matter what. If he's sitting on the potty, as soon as he's about to do it, he stands up and just keeps holding it in (and once he starts to stand, if we even so much as ask him to sit back down, he screams and cries).  We have tried everything to convince him (or distract him enough) to sit and poop: reading books, singing songs, playing games, playing with toys, offering him snacks/treats (graham crackers), giving him stickers, etc. Nothing works.  As of today, it has been a week since the last time he pooped, with the exception of a little bit today and a little bit yesterday (both of which ended up all over the bathroom floor since he won't sit down). The doctor says now we should give him an enema to force it all to come out, but even so, that won't solve anything going forward since he still won't go in his diaper or on the potty in the first place (what are we going to do, give him an enema every week, indefinitely?).  The issue isn't that he's scared of the potty itself, since (a) he was holding it before we started potty training, and (b) he knows exactly what he's supposed to do, since he has no problem with peeing (he sits down himself, points it out afterward, knows that it gets emptied into the big potty, etc.).  It's that he just won't poop, ever – not in his diaper, not on the potty – and the only reason why anything comes out at all is because we've been giving him the Miralax every day (and even then, these aren't "full" poops, just whatever happens to come out because it's soft enough that he's unable to hold it all in).  I'm at a complete loss as to why this even started, and what if anything we can do that would actually help. Is it a behavioral problem? Medical? Both?? Help!    UPDATE: I just wanted to update this question since a lot has changed since I originally posted it. We discovered there was a specific situation where he would go in his diaper voluntarily: in our bedroom closet with the door closed. So we knew then that the withholding was intentional, since it was now established that he could go if he wanted to.  So we let him continue going in the closet and, over time, found that he usually went around the same time each day. Based on that, we then had him sit on the potty when we knew it was most likely he would need to go. We also managed to find two things that distracted him enough to sit (blowing bubbles and playing with his toy laptop).  By doing this, we were able to get him to go on the potty without really realizing it (so he didn't try to fight it), and then made a big deal out of it every time he did. Over time, that helped establish that that's what he was supposed to do, and now he does so voluntarily. He hasn't pooped in his diaper in probably 3 weeks by now.  I wouldn't say he's "fully" potty trained, in that an adult still needs to go with him and distract him (and occasionally remind him when he needs to go in general), but finally we made progress.


I have a Raspbian system which I need to list all the packages that have been installed since the machine was setup.   Obviously I can show what now is installed, but I'd like just a list of the packages that did not come with the distribution... ie the ones that have been installed since the machine had been setup.   Is there a way of doing this?

I have tried searching for this but there seems to be no command that can output a list of packages (ideally in Ubuntu) that I have installed, not including any dependencies.


in window I know make this withe the cmd but in ubuntu it's not good  I have a  question about the Terminal. I want to ask how to call a program in the terminal  $ /home/yvanmoses/Dropbox/apprendre_a_programmer/"boucles en python"/mot_le_plus_frequent.py   the answer is permission not given. How to put this right? or   python: can't open file 'mot_le_plus_frequent.py': [Errno 2] No such file or directory`enter code here`   A second question: Is that a short way to open a script?  My wish: to program and verify without the "execute" button in geany (the little cogwhell in the right top)  I want to work with python and ruby  good experts saying to me to add #!/path/to/python in the first line of my script.  This work for files that are in/home/myname/ But for the files that are deep into directory into directory etc, in my Dropbox it is not good.   A priori it sames very trivial. I read many questions that someones considered as very similar to mine and find no uniform explanation. SO I REPETE THE QUESTION WHAT is the best way for a developer (python or ruby) when he work in a script to run and run again the script easy and nicely.  I was convicted that they use the terminal. If it is not right. I'ii accept! WHAT TO DO???

I need help running python in ubuntu  I can run python without a problem in my terminal but when I create a .py file I can't get it to run.


I just found this sentence in an article in :     Lovelace died in great pain at 36, from uterine cancer.   And I'm confused about the use of "from". I know "from" is used to express physical origin (e.g., He moved from Paris), but in this case the preposition is used to state the cause of something (the death of somebody). Is this use valid?

Why can't I say “She died from drinking 18 cans of Coca-Cola”? Instead, the correct sentence would be “She died of drinking 18 cans of Coca-Cola”. Why does that happen?


A delta-like 3-phase power source is as below:         – Schematic created using   This diagram is equivalent to "Fundamental of Electric Circuits, 5 Edition" Figure 12.6 (b)  Will it be short circuit?

Consider 3 windings, a, b and c. L1 is connected to A, L2 to B and L3 to C. The 3 windings are then connected in delta.  If we could freeze frame the voltage waveform where L1 and L2 are positive maximum and L3 is negative, what will the current direction through the windings look like? Particularly through the bridge which connects a1 to b2...   Will we at any point have the current from 2 different phases going towards each other?


I have a templated function declared in my .h and implemented in my .cpp:  //file.h class FileReader{ template <class T> void Read( T *aValue ); };  //file.cpp template<class T> void FileReader::Read( T *aValue ) {     //implementation }   To allow the implementation in my .cpp, I had   template void FileReader::Read<uint8_t>( uint8_t * ); template void FileReader::Read<uint16_t>( uint16_t * );   But trying to fix a doxygen issue, someone pointed me  that I should use  template<> void FileReader::Read<uint8_t>( uint8_t * ); template<> void FileReader::Read<uint16_t>( uint16_t * );   This indeed, fixes the doxygen issue, but it breaks my compilation at linking.  =>What is the correct syntax to specialize my function template in my .cpp and allow the function to be linked?   other question seems to indicate that I should use my second version. But  article uses my first version.

Quote from :     The only portable way of using templates at the moment is to implement them in header files by using inline functions.   Why is this?  (Clarification: header files are not the only portable solution. But they are the most convenient portable solution.)


I'm simply curious as to why there isn't chat integrated within the mobile apps (mainly iOS).  It's fairly annoying to have the app redirect me to Google Chrome (iOS version) every single time I try to open chat on the iPhone (which is often), and I usually have around ~20 to 30 tabs open after I'm done with chatting.  Also, to be honest, there is no support for iOS in the mobile version of the chat.  Some proposals (if possible):   Add some form of chat integration into the app (for both Android and iOS)   It should be integrated by now, instead of a redirect link.  At least integrate the chat properly for iOS users (it's basically just the webpage, I have to zoom out every time for my message to be rendered properly, and the keyboard blocks out the text)

Currently, the app notifies users when they're mentioned in chat. However, when we tap on the notification, we got redirected out of the app to Safari.   Is there a chance we can get some chat capabilities in the app, so that we don't have to login again in Safari to quickly reply to the messages?    App version: 0.1.19 09/19/2014


Sir Reginald Wingate, a British general, is said to have described the Bedouin as “.”  ?  Google search for "most of who have" returns about 2,70,00,000 results. While a similar search for "most of whom have" returns about About 70,20,000 results. I understand though, from , that a more reliable approach would be to either consult the  or .  The problem with the sentence fragment is that it does not sound right substituting "who"/"whom" with "he"/"him".

Here's the full sentence: "These men, all of who were well-known, well-respected statesmen, were viewed by their peers and common people alike as great thinkers in their day.  I just can't really see where it would fall into: subject? predicate? object? What would it be?


Do I need a visa on a South-African passport if in transit in Munich en route to St. Petersburg

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


jQuery onclick not working for added element from ajax call, i am using onclick handler for my appication and using php for loading data dynamically php html on click event not working when json

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.


I am pretty new to development and this is why I am stuck at such a "beginners" problem.  I want to have a directory under /var/www/mysite with a index.html and access it via web browser on my PC (Win10 64 Bit) by typing mysite.example into it.  I don't want to publish anything into the internet with that. I only want to test and develop a site which later might be hosted.  I have created a VirtualMachine using Oracle VirtualBox and installed Ubuntu16.04 (64-Bit, also enabled Virtualization at my i5 2500 in Bios so I get these 64-Bit displayed).  Then I installed apache2, mysql and php.  ip addr show gave me an address: 192.168.178.31.   So if I type into my browser http://192.168.178.31/ I get to the apache2 default page - It works!  I created the directory /var/www/mysite and put a simple index.html for testing purpouse into it. I said sudo chown -R 775 to /var/www/.  Now I need to create a vhost so I can access to this index.html in this specific directory by typing in a specific string into my browser. But it just won't work!  I went to /etc/apache2/sites-available/ and created mysite.conf.  This is the content:  <VirtualHost *80> ServerAdmin webmaster@localhost DocumentRoot /var/www/mysite ServerAlias mysite.example </VirtualHost>   I did a2ensite mysite.conf, sudo service apache2 reload and restart  So there I am. If I type mysite.example into my browser I only get errors.  Site not reached. DNS-Server for mysite.example not found and so on (ERR_NAME_NOT_RESOLVED).

I installed Apache on an Ubuntu VM. When I go into the guest and load up Firefox I can see that Apache is working fine when I browse to localhost.  I would like to access this same page through the host. I've tried using the IP address of the guest but nothing comes up. Ideally I would love to set up my Windows 7 (host) to request http://guestserver.com of the Apache server on the guest. How can I do this?


What is the advantage of using a struct in C++ when you have class? I cannot find any literature on the subject. I have been told to just use class and is the correct

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


I want to know why my HDD main partition (the biggest part of the disk) appears as it was a double partition:    Can I change it? How?  Also, LibreOffice 5 doesn't recognize that partition. It only let me read and write files from the System partition. Why? How could I fix it? ???  Greetings & Blessings from Chile!!!!!!!  Juan

In the image below, what does Extended 103 GB mean?


In an aid to reduce the amount of rubbish that gets posted from brand new users (or long time listeners, first time posters), it could be useful to make them sit a short test (or an "interactive tutorial" might sound better).  This "interactive tutorial" might consist of an initial page presenting a cut-down version of the FAQ, highlighting what makes a good question, and what kind of things they should avoid asking.  The user would then proceed to a number of bad question examples, the user would then be required to select from a list of choices, what is wrong with the example question.  Of course, we wouldn't want to deny membership should anybody "not pass", so instead, whenever a user selects a wrong answer, they are presented with an explanation as to why their selection is wrong, and why the correct answer is a more suitable reason. The user should be forced to read this by using a short 30 second timer (or however long), before they can move on to the next question.  This could be extended to work on a per-action basis. For example, before a user can have privileges for an action (e.g. post question, answer, comment, vote up/down, etc.) they have to sit the "interactive tutorial" related to that action.  This could also be enforce on existing users. I would have no problem sitting a few short tutorials in order to earn my privileges back if it means we improve the content from new users.

We often see new users make offtopic, low quality posts, with broken English and cries for help. These questions look significantly different from most on SO.  When I worked in publishing, we would frequently receive documents that were incorrectly formatted. This was a major problem and we wasted a lot of time sending emails back and forth.  I made a small JavaScript quiz asking our authors about the formatting directions and the number of emails drastically dropped. I felt this was much nicer than simply rejecting them, additionally providing us a chance to make the directions more clear.  It is slightly unconventional but, would showing new users a quiz where they have to identify good and bad posts help to improve the quality of SO questions?  Edit (3/8/2017)  Recently a Norwegian website got some media attention for .


So recently I stopped playing on my vita... ( What a mistake buying that thing). I still have a PlayStation All Stars code for the online features. Is there  a way to find out if the code still works without redeeming it?

I have a code for additional content on a Playstation game, and I want to know whether it is still valid, but I don't want to redeem it for myself.  If I enter it in the Playstation Store (on PS3, PS4 or the website), does it get redeemed to my account automatically, or can I enter it without redeeming? If it gets redeemed automatically, is there another way to check if it is valid?


I would like to track my corrections in the pdf format simply. Actually after every running I wanna avoid scroll to specified pages of changes.  is there anyway to manage that?

I stumbled upon these SyncTeX files in my directories and wanted to know what they are for. I searched this site and the internet and I think I have some vague understanding of what it is but I'm still not very satisfied with my actual knowledge. I've found many questions about configuring SyncTeX but none about what it is and what it does.  So, could someone explain what is SyncTeX and what does it do exactly and/or point to some general purpose documentation?


To make beef stew, I start by simmering a chopped onion, add cut up top round beef, add water, and bring to a boil. In about 15 minutes, millions of bits of horrible looking gunk appear in the water.  Picture below.  What am I doing wrong?

I've found the terms "aspic" and of course "drippings" and "gravy", but I don't think any of those quite describe what I'm asking about — for example, we just baked some meatballs and between each one there was a mix of both liquid fat and a grey-ish/pink-ish sludge. With chicken meat it tends to be whiter. It has a texture somewhere between cooked liver and jello.  Is there a proper name for this "sludge"? Are there any particularly traditional uses for it?  UPDATE: another question calls this same thing "scum", and the answers deal with what it is:   I'm wondering here what it's called, i.e. if there's a more generous term for it than "sludge" or "scum".


Given the function $f(x,y)=\frac{x^3−y^3}{x^2−y^2}$. Defined by $x^2\neq y^2$ and $(x,y) \in \Bbb R$. Proof that $\lim\limits_{(x,y) \rightarrow (0,0)} f(x,y)$ exists.  I found that the limit went to $0$. And I was trieing to prove this with an $\epsilon$ $ \delta$ prove, but I'm stuck.  I got:   Let $\epsilon > 0$ be given, take $\delta= ....$. Than $|(f(x,y)-L|$=$|\frac{x^3-y^3}{x^2-y^2}|$= $|\frac{x(x+y)+y^2}{x+y}|$=$|x+\frac{y^2}{x+y}|$  I don't know how to go on.

In class, we were simply given that this limit is undefined since along the paths $y=\pm x$, the function is undefined.  Am I right to think that this should be the case for any function, where the denominator is $x^2-y^2$, regardless of what the numerator is?  Just wanted to see if this is a quick way to identify limits of this form.  Thanks for the discussion and help!