public class MainActivity extends Activity {      Button button = (Button)findViewById(R.id.btn);     ProgressBar bar = (ProgressBar)findViewById(R.id.pbar);      @Override     protected void onCreate(Bundle savedInstanceState) {         super.onCreate(savedInstanceState);         setContentView(R.layout.activity_main);           button.setOnClickListener(new OnClickListener() {              @Override             public void onClick(View v) {                 // TODO Auto-generated method stub                 updateHandler.post(updateThread);             }         });      }      @Override     public boolean onCreateOptionsMenu(Menu menu) {         // Inflate the menu; this adds items to the action bar if it is present.         getMenuInflater().inflate(R.menu.main, menu);         return true;     }      @Override     public boolean onOptionsItemSelected(MenuItem item) {         // Handle action bar item clicks here. The action bar will         // automatically handle clicks on the Home/Up button, so long         // as you specify a parent activity in AndroidManifest.xml.         int id = item.getItemId();         if (id == R.id.action_settings) {             return true;         }         return super.onOptionsItemSelected(item);     }        Handler updateHandler = new Handler(){          public void handleMessage(Message msg) {             bar.setProgress(msg.arg1);             updateHandler.post(updateThread);         };     };      Runnable updateThread  = new Runnable() {          int i = 0;         @Override         public void run() {             // TODO Auto-generated method stub             System.out.println("------------");             i = i+10;             Message msg = updateHandler.obtainMessage();             msg.arg1 = i;              try {                 Thread.sleep(1000);             } catch (InterruptedException e) {                 // TODO Auto-generated catch block                 e.printStackTrace();             }              updateHandler.sendMessage(msg);             if (i==100) {                 updateHandler.removeCallbacks(updateThread);             }         }     };   }   Logcat:     java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.zxy.handlerpbtest/com.zxy.handlerpbtest.MainActivity}: java.lang.NullPointerException


I am a Nigerian citizen with a student stay permit in Italy and I am flying to the US through Manchester. I will arrive Manchester on the 9th by 14pm and the continued flight is on the 10th by 11 am.  Do I need a transit visa? Will I go through boarder control? Can I go outside and return seeing that I have a long wait before the continued flight?

Is there a website or some other way to find out if I need a transit visa for a short stop in the UK on my way somewhere else? Ideally this should give me the answer for all nationalities, and take into account any other visas I may have.


What is the most effective way of increasing reputation and badges and how do users reach 29k or 40k in rep when rep is limited to 200 a day?

From "6 Simple Tips to Get Stackoverflow Reputation Fast" at codexon.com:   Be the First to Answer. Even at the cost of quality. Use Downvotes and Comments Strategically Use obnoxious in-your-face formatting and lists. Be Aware of the 200 rep/day Limit Edit, But Don’t Edit Too Much Associate your other accounts   Courtesy of . Agree? Disagree? Walnuts? Cantaloupe?


I've not seen this port before, it looks kind of like a HDMI port and has this symbol next to it... what is it?    It's on the back panel of a desktop computer.

How would I go about identifying a port, card or connector on my system which I am unfamiliar with?  Where would I find information on what these parts are? What would be the steps I would take in identifying a unknown port or cable?   This question comes up frequently, and the suggested solutions are usually the same. This community wiki is an attempt to serve as the definitive, most comprehensive answer possible. Feel free to add your contributions via edits.


Can't quite finish this proof:     Prove that if $x$ and $y$ are not both $0$ then $ x^2 +xy +y^2> 0$   $ x^2 +xy +y^2 +xy -xy> 0$  $ (x +y)^2 -xy> 0$ Without loss of generality define $x\geq y$  Firstly the case where $y<0$ and $x>0$ is trivial as both $ (x +y)^2$ and $-(xy) >0$.   I want to say by transitivity  as each are >0 that there sum must be ${}> 0$ can I do that?  The second trivial case is $y=0$ as we simply have $ x^2 >0 $ where $x>0$.  Lastly we have define $c= x+y$  since both $x$ and $y$ must have the same sign we know $|c|>x$ since $x\geq y$ we know that $ x^2 \geq xy$ finally since  $ |c|^2 = c^2$ $ \forall c \in \mathbb{R} $  We have $ c^2 >x^2 \geq xy$ hence $c^2 -xy >0$  I feel like I have all the pieces but it doesn't feel finished how do I fix it?  Edit: I am really glad i asked this question love the variety of different good answers no idea what a discriminant is but im going to go look that up. I wanted to give the accepted answer to Edward as he actually answered my question but Anurag s proof was just so much better then my attempt. ^^

How can I prove that $xy\leq x^2+y^2$ for all $x,y\in\mathbb{R}$ ?


I'm really sick of getting all of my items destroyed when I die.  Is there any way, even by cheating, to re-acquire the items or to disable the ?

I once played a vanilla Minecraft adventure map (called "Herobrine's Mansion") that prevented the player from losing their items on death. Which commands can be used to prevent the player from losing their items on death (in vanilla Minecraft)?


I am trying to show that the following holds: $$x+y =\sup\left\{ r+s: r,s \in \mathbb{Q}, r\leq x, s\leq y\right\}.$$  I have been able to show that   $$x=\sup\{q\in \mathbb{Q}: r\leq x\}$$ and similarly that $$y=\sup\{q\in \mathbb{Q}: r\leq y\}.$$  Thus, I am essentially trying to show that  $$\sup\left\{ r+s: r,s \in \mathbb{Q}, r\leq x, s\leq y\right\}=\sup\{q\in \mathbb{Q}: r\leq x\}+\sup\{s\in \mathbb{Q}: s\leq y\}.$$  One direct is trivial, namely that $$\sup\left\{ r+s: r,s \in \mathbb{Q}, r\leq x, s\leq y\right\}\leq\sup\{q\in \mathbb{Q}: r\leq x\}+\sup\{s\in \mathbb{Q}: s\leq y\}=x+y.$$  The other direction is tricker, though. I was trying to approach this by contradiction: Let $A=\{ r+s: r,s \in \mathbb{Q}, r\leq x, s\leq y\}$ and suppose that $\sup A < x+y$. I was trying to use the fact that $\mathbb{Q}$ is dense in $\mathbb{R}$, but I'm still not seeing how to get the proof to work out. Suggestions?? Thank you!!

If $A,B$ non empty, upper bounded sets and $A+B=\{a+b\mid a\in A, b\in B\}$, how can I prove that $\sup(A+B)=\sup A+\sup B$?


if dim(S2) = 3, S1 ⊂ S2, then what are the possible dimensions of S2?   Answer: 1, 2, 3  (this is from our quiz)   is R^2 a subspace of R^3?   Answer: R^2 is not a subspace of R^3 because its elements (2-component vectors) do not even come from R^3 (the set of 3-component vectors)  (this is from )  My question is, S2 is a plane through origin right? Since it is the possible dimension, how R2 is not a subspace of R3?   We been debated about this for days, if you would kindly provide any hint to us, we will be greatly appreciated.  EDIT: I am greatly appreciated for everyone's reply. Sorry this is my first time posting and a few typo is already fixed.

I cannot understand why $\mathbb{R}^2$ is not a subspace of $\mathbb{R}^3$.   My reasoning is as follows: Choose any elements $v_1$ and $v_2$ from $\mathbb{R}^2$, add them together you get an element of $\mathbb{R}^2$ and same for scalar multiplication and $0$ vector is an element of $\mathbb{R}^2$. So where did I go wrong?


I am supposed to tell which one of $(101!)^{100}$ and $(100!)^{101}$ is larger. I am trying to use the behavior of the function $f(x)=x^{1/x}$ as is a standard technique to dealing with questions of this sort. Here is what I have so far. $$\begin{aligned}(101!)^{100!}&\lt (100!)^{101!}\\ (101!)^{100} &\lt (100!)^{101\times 100}\end{aligned}$$ Any ideas on how to proceed. Thanks.

This is from the book How to think like a Mathematician,  How can I prove the inequality $$\sqrt[\large 7]{7!} < \sqrt[\large 8]{8!}$$  without complicated calculus? I tried and finally obtained just $$\frac 17 \cdot \ln(7!) < \frac 18 \cdot \ln(8!)$$


I want to prove that field are domain. Let $K$ a field. Suppose it's not a domain. Then there are $a,b\in K\setminus\{0\}$ s.t.  $ab=0$. Let $a'$ and $b'$ s.t. $a'a=aa'=1$ and $b'b=bb'=1$.  Then $$1=(a'a)(bb')=a'(ab)b'=0,$$ which is impossible. Does it work ?

Prove that any subring of a field which contains the identity is an integral domain.  Do i need to show that $ab = 0$ where $a = 0$ or $b = 0$. Or in general What do you need to show in order something is an integral domain


I am trying to understand what mathematics is really built up of. I thought mathematical logic was the foundation of everything. But from reading a book in mathematical logic, they use "="(equals-sign), functions and relations.  Now is the "=" taken as undefined? I have seen it been defined in terms of the identity relation.  But in order to talk about functions and relations you need set theory.  However,  seems to be a part of mathematical logic.  Does this mean that (naive) set theory comes before sentential and predicate logic? Is (naive)set-theory at the absolute bottom, where we can define relations and functions and the eqality relation. And then comes sentential logic, and then predicate logic?  I am a little confused because when I took an introductory course, we had a little logic before set-theory. But now I see in another book on introduction to proofs that set-theory is in a chapter before logic. So what is at the bottom/start of mathematics, logic or set theory?, or is it circular at the bottom?  Can this be how it is at the bottom?  naive set-theory $\rightarrow$ sentential logic $\rightarrow $ predicate logic $\rightarrow$ axiomatic set-theory(ZFC) $\rightarrow$ mathematics  (But the problem with this explanation is that it seems that some naive-set theory proofs use logic...)  (The arrows are of course not "logical" arrows.)  simple explanation of the problem:  a book on logic uses at the start: functions, relations, sets, ordered pairs, "="  a book on set theory uses at the start: logical deductions like this: "$B \subseteq A$", means every element in B is in A, so if $C \subseteq B, B \subseteq A$, a proof can be "since every element in C is in B, and every element in B is in A, every element of C is in A: $C \subseteq A$". But this is first order logic? ($(c \rightarrow b \wedge b \rightarrow a)\rightarrow (c\rightarrow a)$).  Hence, both started from each other?

I wonder about the foundations of set theory and my question can be stated in some related forms:   If we base Zermelo–Fraenkel set theory on first order logic, does that mean first order logic is not allowed to contain the notion of sets? The axioms of Zermelo–Fraenkel set theory seem to already expect the notion of a set to be defined. Is there are pre-definition of what we are dealing with? And where? In set theory, if a function is defined as a set using tuples, why or how does first order logic and the axioms of Zermelo–Fraenkel set theory contain parameter dependend properties $\psi(u_1,u_2,q,...)$, which basically are functions?


Knowing $$\lim_{n\to\infty}x_ny_n = 0$$try to prove $$\lim_{n\to\infty}x_n = 0$$or$$\lim_{n\to\infty}y_n = 0$$

Assume   $$\lim_{n\to \infty}{x_ny_n}=0$$  then  $$\lim_{n\to \infty}{x_n}=0$$ or $$\lim_{n\to \infty}{y_n}=0$$  I couldnt find two series who disprove that.. just hint please thanks


In a situation when I talk with someone about setting up a schedule, can we use "totally" with a phrase like the title? I know that the meaning of totally itself is basically used for emphasizing the expression. And I also know that completely sounds more polite and also a little old.　But what I just want to know is whether native speakers use "totally" in this kind of situation or not. Does it sound normal? Or do you have some other better suggestions?

There was the following sentence in an article titled, “Like, Degrading the Language? No Way” in New York Times (April 5), in which the author says Americans are moving backward on language:     “(Like the use of ‘like’) the use of “totally” mines the same vein.   “He’s totally going to call you” does not mean “He is going to call   you in a total fashion.” It has a more specific meaning, although only   handled subconsciously by speakers, as so much of language is. “He’s   totally going to call you” contains an implication: that someone has   said otherwise or that the chances of it may seem slim at first glance   but in fact aren’t. As with “like,” “totally” tracks and nods to the   opinions of others. It’s totally civilized.”      Although the author explains “totally going to call you” contains an implication of someone having said otherwise, I’m not still clear with the meaning of “He’s totally going to call you.”   What does it mean? He’s totally going to call you “what”?   How does “He’s totally going to call you.” differ from “He’s going to call you.”? Is this expression (use of totally) ubiquitous today as the author asserts?


I have a table:  | id(int) | isActive(bit) |   and then I delete some records from the table.  delete from table  where id in (1, 5, 8, 3)   Now I'd like to have a trigger or some other functionality which checks if you try to delete some ids which are active and skip those.  Sure I could create a stored procedure, but what if someone deletes something from the table not using that stored procedure?  And I could do a rollback in the trigger if any record was active.  But I'd like the user to be able to delete those that was not active and just "cancel" the delete on the records that was active.  Or is this even possible?

I want to create a trigger to check what is being deleted against business rules and then cancel the deletion if needed. Any ideas?  The solution used the Instead of Delete trigger. The Rollback tran stopped the delete. I was afraid that I would have a cascade issue when I did the delete but that didn't seem to happen. Maybe a trigger cannot trigger itself.


When i click on add new column i don't see option to add  External data type

I want to create External column  but I can't see the option to select the type.


Constructors of non static member classes take an extra hidden parameter which is a reference to an instance of the immediately enclosing class. There is also a syntactic extension of 'new'.   In the below code,  class K{     static class Ka{         static class Kb{             class Kc{                 class Kd{                  }             }         }     } }  class Test{     K.Ka.Kb.Kc.Kd k = new K.Ka.Kb().new Kc().new Kd(); }   Can you please help me understand the meaning of Kb() in K.Ka.Kb().new Kc().new Kd()? I understand that new Kc() is required as told in first paragraph.

What is the main difference between an inner class and a static nested class in Java? Does design / implementation play a role in choosing one of these?


I don't get this to work. This is OOP. I am supposed to get the (x,y) coordinates in a grid when moving it up, down, left or right. I need the toString to always update for every move I take. I would prefer using arrow keys in the keyboard, but I don't know how. If someone know that it would be nice for the program. I must be able to - for example - press up, then down, then up without it stopping.     package stateandbehavior;     import java.util.*;     public class Location {          int x;         int y;              public void up() {         boolean run = true;         while (run) {            Scanner tast = new Scanner(System.in);         String tas = tast.nextLine();         if (tas == "W" || tas == "w") {             y-=1;         }else {             run = false;         }         }     }          public void down() {         boolean run = true;         while (run) {         Scanner tast = new Scanner(System.in);         String tas = tast.nextLine();         if(tas == "S" || tas == "s") {             y+=1;         } else {             run = false;         }         }              }          public void right() {         boolean run = true;         while (run) {         Scanner tast = new Scanner(System.in);         String tas = tast.nextLine();         if (tas == "D" || tas == "d") {             x+=1;         }else {             run = false;         }         }     }          public void left() {         boolean run = true;         while(run)         Scanner tast = new Scanner(System.in);         String tas = tast.nextLine();         if(tas == "A" || tas == "a") {             x-=1;         }else {             run = false;         }     }          public int getX() {         return x;     }          public int getY() {         return y;        }          public String toString() {         return "(" + x + ","+ y + ")";     }          public static void main(String[] args) {         Location Loc = new Location();         Loc.up();         Loc.down();         Loc.right();         Loc.left();         Loc.getX();         Loc.getY();         System.out.println(Loc);         } }

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?


I was studying block matrices and suddenly this question came to my mind. Let $A, B \in \Bbb R^{n \times n}$. From this , $$\det \begin{pmatrix} A & B\\ B & A\end{pmatrix} = \det(A-B)\det(A+B)$$ even if $A$ and $B$ do not commute. Does a similar condition hold for the following block matrix? $$\begin{pmatrix} A & -B\\  B & A \end{pmatrix}$$

The complex general linear group is a subgroup of the group of real matrices of twice the dimension and with positive determinant.  Let us decompose complex matrices $M$ as $M=A+iB$, where $A,B$ are real matrices. Now consider the correspondence $$f(A+iB)=\begin{pmatrix} A & -B \\ B & A\end{pmatrix}.$$  If $\det f(M)=|\det M|^2$ for square matrices, then we would have $GL(n,\mathbb C)\subseteq GL_+(2n,\mathbb R)$ with the identification $M\to f(M)$, which is an injective homomorphism. In other words, the complex general linear group would be a subgroup of the group of real matrices of twice the dimension and with positive determinant.  How is $\det f(M)=|\det M|^2$?


I'm using ArcGIS 10.1 and am fairly new to it. I have the latitude and longitude of sub-districts, and wish to create Thiessen polygons of these sub-districts. I also have shapefiles for districts (there are about 10 sub-districts within each district), and want the Thiessen polygon of each sub-district to lie completely within it's district, and not spillover to a neighboring district. Thanks!

I am trying to create Thiessen (Voronoi) polygons, based on points within a defined shapefile extent. The output should be inclusive to the feature.  The output I receive now is the rectangular area around the selected points.    Steps I am using: 1. select points of interest (inside and outside spatial extent) 2. set primary display field to FID (aka:ObjectID) 3. Environment… > Set 'Analysis Mask' to shapefile with feature (in this case, a watershed)  Now here is where the problem starts. I have a set of instructions for arc 9.3, but I am now operating on ArcGIS 10 (Spatial Analyst installed & activated). Also, just to clarify, I did scour the inter-webs for some number of hours- Esri support, gis.SE, Professor Google...  ########  9.3.1 version: Spatial Analyst >> Distance >> Allocation - set 'Assign To' as point shapefile of selected data - set cell size  10.0 methods tried: Analysis >> Create Thiessen Polygons -- Many variations of selected features -- File locations, both inside and out of file geodatabase  I am open to any solution, using Arc 10.0 and/or python would be ideal.  The first image is an example.  The output does not need to be exact.  wiki:


So I have a few list comprehensions that look like the following.  li = [some_computation(x) for x in y if some_computation(x)]   Where I only want the values that are truthy with respect to some_computation.   Does this compute some_computation(x) twice as the list comprehension makes it seem? If some_computation is expensive, I really don't want this. (I feel like this is probably the case :() Is there a better way to do this? Perhaps to break it into a regular for loop and append if only if some_computation(x), but I like comprehensions.

The Python list comprehension syntax makes it easy to filter values within a comprehension.  For example:  result = [x**2 for x in mylist if type(x) is int]   Will return a list of the squares of integers in mylist.  However, what if the test involves some (costly) computation and you want to filter on the result?  One option is:  result = [expensive(x) for x in mylist if expensive(x)]   This will result in a list of non-"false" expensive(x) values, however expensive() is called twice for each x.  Is there a comprehension syntax that allows you to do this test while only calling expensive once per x?


I'm new in LaTeX and I'm currently faced with a problem of placing an object at the end of the line. E.g.     {equation} (1.1)   I wish to place (1.1) at the end of the line, and I've searched around trying to find a method to do so but to no avail. Can someone help me with this?

I'm writing a math paper in LaTeX and for math formulas I'm just using $$math formula$$. Is is possible to numerate formulas? Or do I have to you use some specific commands such as align?


Essentially, I am trying to store a char (1 byte) into memory using sb.   I am writing MIPS assembly to reproduce the functionality of some C code. I put the function str_make_lower in a separate file and compiled the C code with it.   #include <stdio.h> /* uses tolower() to convert upper case to lower case*/ void str_make_lower(char *s); //  while(*s != '\0'){ //      *s = tolower(*s); //      s++; //  } // }   int main(int argc, char const *argv[]) {     char *s = "AB\000";     str_make_lower(s);     printf("%s\n", s);     return 0; }   My assembly is as follows, which should mimic the C code that is commented out:  .text .global str_make_lower str_make_lower:     # arg passed in:     # a0: char *s     addi    $sp, $sp, -40     sw      $ra, 32($sp)     sw      $s0, 36($sp)      # save char *s      move    $s0, $a0  while_str_make_lower:     # initialize registers     add     $t0, $zero, $zero     add     $a0, $zero, $zero      lb      $t0, 0($s0)     # get a char from pointer     beq     $t0, $zero, str_make_lower_return     nop      move    $a0, $t0        # load arg for tolower      jal     tolower         # yeah     nop      add     $t0, $zero, $zero     move    $t0, $v0        # collect lower letter     sb      $t0, 0($s0)     # store it back      addiu   $s0, $s0, 1     # increment pointer     j       while_str_make_lower     nop  str_make_lower_return:     # restore and return     lw      $s0, 36($sp)     lw      $ra, 32($sp)     addi    $sp, $sp, 40     jr      $ra     nop   Ultimately, by using gdb, I found that it was the store byte (sb) that was giving seg fault. I inspected the content of $t0 and $s0 but the values of the two seem to be what they should be. I wonder whether it is me using the sb wrong, or something else.  (gdb) p $t0 $5 = 97 Program received signal SIGSEGV, Segmentation fault. while_str_make_lower () at tl.s:35 35      sb      $t0, 0($s0)     # store it back (gdb) bt #0  while_str_make_lower () at tl.s:35 #1  0x00400700 in while_str_make_lower () at tl.s:30 Backtrace stopped: previous frame identical to this frame (corrupt stack?)  (gdb) p (char*)$s0 $9 = 0x4008c0 "AB"   Thanks!

The following code receives seg fault on line 2:  char *str = "string"; str[0] = 'z';  // could be also written as *str = 'z' printf("%s\n", str);   While this works perfectly well:  char str[] = "string"; str[0] = 'z'; printf("%s\n", str);   Tested with MSVC and GCC.


How to refer variable defined in sub shell in parent shell. command grouping is difficult in my case. What would be the alternative.

I've written a quick-and-dirty script to time some reports from a web service:  BASE_URL='http://example.com/json/webservice/' FIRST=1 FINAL=10000  for report_code in $(seq 1 $FINAL); do   (time -p response=$(curl --write-out %{http_code} --silent -O ${BASE_URL}/${report_code}) ) 2> ${report_code}.time    echo $response  # <------- this is out of scope!  How do I fix that?   if [[ $response = '404' ]]; then     echo "Deleting report # ${report_code}!"     rm ${report_code}   else     echo "${report_code} seems to be good!"   fi done   I need to wrap the time command in a subshell so I can redirect its output, but that makes the value of $response unavailable to the parent shell.  How do I get around this problem?


The Catalan number $C_n$ counts the number of ways $n$ pairs of parentheses can be written without having a close-parenthesis too early, and it also counts the number of ways $n+1$ factors can be grouped along with an non-associative binary operator.  For example, $C_3 = 5$ and the permissible binary strings are (copied from Wikipedia):  ((()))     ()(())     ()()()     (())()     (()())  The ways to group four factors $a, b, c, d$ are:  ((a*b)*c)*d     (a*(b*c))*d     (a*b)*(c*d)     a*((b*c)*d)     a*(b*(c*d))  What is the bijection between these two sets? I know that both of them can be shown directly to be counted by the Catalan numbers, but I want to know what the correct map is from one set to the other.

The  lists various combinatorial objects that are described by them. I posit that there might be bijections between these various combinatorial objects. For some of them (like Dyck paths, correctly matched parentheses and paths from the bottom left to top right of a $2n \times 2n$ grid) they are quite obvious.   I was then trying to find a bijection between the number of Dyck words and the number of ways of associating $n$ applications of a binary operator to $n+1$ items (third one on the list). I attempted to do this for a simple case ($n=3$ which is the example provided in the Wikipedia article). However, couldn't find one after multiple hours. Is it reasonable to expect such a bijection will exist? If so, how do we go about finding it?    EDIT: In addition to the very nice answer by @Marc, the following page also helped me see the bijection:   "Let $P$ be the Dyck path and $f(P)$ be the binary tree. If you go up in the Dyck path, create a left child. Otherwise, go up one vertex until creating a new right child is possible and create one."    Here is one of my attempts:   Number of Dyck words with length $2 \times 3$ is $\frac{6 \choose 3}{4} = 5$. They are:  hhhttt; hhthtt; hhttht; hthhtt; hththt  And the number of applications of a binary operator among $3+1=4$ factors is:  ((ab)c)d;     (a(bc))d;     (ab)(cd);     a((bc)d);     a(b(cd))  Both combinatorial objects have been arranged in a way that there is some kind of ordering between them. For the Dyck words for example, if h equals +1 and t equals -1, then the order is lexicographical from the left to the right of the cumulative score along the sequence.   Now, the first and last characters of the Dyck words are always h and t respectively. So, we can ignore them. We are left with:  hhtt; htht; htth; thht; thth  I tried to start from the left of the sequence abcd and if I see 'h', merge the character with the one to its right. This approach didn't produce a valid mapping from the third Dyck word to the third binary operator precedence order.


In the project I have created 3 classes. First class is Browser_Initialize in src/main/java, second class is PhoneWall_Page in src/main/java, third class is PhoneWall_TestClass in src/main/java. In Browser_Initialize I have defined browser initiation. In PhoneWall_Page initialized all webelemnts using Page Factory & also created few methods. In PhoneWall_TestClass calling methods present in Phonewall_Page class. Once code reaches @Test anbnotation, I am getting Null pointer Exception.   package com.base;  import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; import java.util.Properties; import java.util.concurrent.TimeUnit;  import org.openqa.selenium.WebDriver; import org.openqa.selenium.chrome.ChromeDriver;  public class BaseClass {     public static Properties prop;     public static WebDriver driver;          public BaseClass()  {              try {     prop=new Properties();     FileInputStream fip=new FileInputStream(System.getProperty("user.dir")+"//src/main//resources//PropertyFile//PropertyData.properties");     prop.load(fip);     }     catch(FileNotFoundException e){         e.printStackTrace();     }     catch(IOException e) {         e.printStackTrace();     }    }              public void initialize() {         System.setProperty("webdriver.chrome.driver", "C:\\chromeDriver\\chromedriver_win32 (2)\\chromedriver.exe");         driver=new ChromeDriver();         driver.get(prop.getProperty("url"));         driver.manage().window().maximize();         driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);         System.out.println(driver);      } }      package com.pages;  import org.openqa.selenium.JavascriptExecutor; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.support.FindBy; import org.openqa.selenium.support.PageFactory;  import com.base.BaseClass;  public class PhonePage extends BaseClass{     WebDriver driver;          public PhonePage(WebDriver driver) {         //super(driver);         this.driver=driver;         PageFactory.initElements(driver, this);     }      @FindBy(xpath="//div[@aria-label='View device Apple iPhone 12 Pro Max ']")      WebElement Device;               public void ScrollMethod() {         JavascriptExecutor js = (JavascriptExecutor) driver;         js.executeScript("window.scrollBy(0,1000)");     }          public void DeviceSelection() {         System.out.println("Device selection");         System.out.println(driver);         Device.click();                       } }      package com.test;  import org.openqa.selenium.WebDriver; import org.testng.annotations.AfterTest; import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; import com.base.BaseClass; import com.pages.PhonePage;  public class PhoneTest extends BaseClass {          WebDriver driver;     PhonePage phonepage=new PhonePage(driver);;      // //  public PhoneTest(WebDriver driver) { //////      super(driver); //      this.driver=driver;      //  }      @BeforeMethod     public void browser() {         System.out.println("Before method driver obj is:"+  driver);         initialize();         System.out.println("Before method driver obj is:"+  driver);     }              @Test     public void SelectDevice() {                  System.out.println("Test mthod driveris:"+driver);         phonepage.DeviceSelection();             }          @AfterTest     public void closeBrowser() {         driver.close();     }  }    Error displayed in console: java.lang.NullPointerException     at org.openqa.selenium.support.pagefactory.DefaultElementLocator.findElement(DefaultElementLocator.java:69)     at org.openqa.selenium.support.pagefactory.internal.LocatingElementHandler.invoke(LocatingElementHandler.java:38)     at com.sun.proxy.$Proxy11.click(Unknown Source)     at com.sprint.qa.pages.PhoneWall_Page.DeviceSelection(PhoneWall_Page.java:31)     at com.sprint.qa.testcases.PhoneWall_TestClass.SelectDevice(PhoneWall_TestClass.java:31)

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?


Show that $(x,y,z)$ is a primitive Pythagorean triple then either $x$ or $y$ is divisible by $3$. The solution is given by 13.1.2:  But how do you become the 2 congruences?

Prove that for any primitive Pythagorean triple (a, b, c), exactly one of a and b must be a multiple of 3, and c cannot be a multiple of 3.  My attempt:  Let a and b be relatively prime positive integers.  If $a\equiv \pm1 \pmod{3}$ and $b\equiv \pm1 \pmod{3}$,   $c^2=a^2+b^2\equiv 1+1\equiv 2 \pmod{3}$  This is impossible as the only quadratic residues modulo 3 are 0 and 1.  So far, so good.  If one of a, b is $\equiv 0 \pmod{3}$ and the other is $\equiv \pm1 \pmod{3}$,  $c^2=a^2+b^2\equiv 0+1\equiv 1 \pmod{3}$  This is the part I don't understand. Just because $c^2\equiv 1\pmod{3}$ doesn't mean that $c^2$ must be a perfect square. For example, $a=12$ and $b=13$ satisfy the above conditions but $c^2=a^2+b^2=313$, which isn't a perfect square.


I have tried the installation with basic running the file,  then with the instructions given by the post   But after all of this, on running the following command  utserver -settingspath /opt/utorrent-server-alpha-v3_3/   I found that the terminal is not even responding.  It's been 5 minutes waiting in that screen before taking the screen shot    By my search, there are no guides for installing utorrent in the Ubuntu 18.04.   Please help me in the comments to clarify the question.

I am trying to install utorrent instead of using the torrent apps and I just came off windows seven can someone help me?


Describe the kernel of the ring homomorphism $\phi\colon \mathbb{C}[x, y, z]\to \mathbb{C}[t]$ defined by $\phi(x) = t$, $\phi(y) = t^2$, $\phi(z) = t^3$.   Some hints?   I know $\ker\phi = \{ a \in\mathbb{C}[x, y, z] \mid \phi(a) = 0\}$ is closed under addition and multiplication. Also, it is an ideal of $\mathbb{C}[x, y, z]$.  Using egreg hint, I came up with   $\ker \phi$ ={$ (x^2 -y)r_1 + (xy-z)r_2 + (x^3-z)r_3 | r_1,r_2, r_3 \in\mathbb{C}[x, y, z] $} ? I am not sure if this is right.

Suppose $R=k[x,y,z]$ and $S=k[t]$. Consider the map $f:R\to S$ s.t. $f(x)=t$, $f(y)=t^2$ and $f(z)=t^3$. I suspect the kernel of this map is the ideal $(y-x^2,z-x^3)R$.    It's clearly contained in the kernel, but I am not sure how to prove the reverse inclusion.


I have a entry level full-frame DSLR with a 50mm f/1.8 lens, the end goal is that I want to generate some cash for buying my next lens/equipment.  I have the following problems:   Portfolio: I am a self-taught photographer, I don't have connections in this industry. That means I don't have access to models to create my portfolio. Time: Since I have a full-time job, my time is limited to weekends and evenings. What can I do with only so much time?   Quick background: I already know how to use Lightroom but not much about Photoshop. I used Photoshop a lot for other purposes (web assets processing) but not for creative photo editing.   If there are ways that would work, I can probably spend a maximum of $500 on equipment. I feel that I don't know how to make my next move here.

I have photos in Getty Images, in Shutterstock, Imagekind and I recently added some to RedBubble, but I'm not having the expected results.  Does anyone have some history of success selling photographs or working as a photographer?  Examples of my work are available in .    Also asked by   I am an amateur who sometimes takes pictures of nature or random things. I've been told by several people that my pictures are worth money.  How can I monetize my best shots?  I don't really want to do a lot of work, editing, SEO or whatever. I'm looking for an easy way where I would just upload my pictures somewhere and let it go.  Maybe stock photos? People buying prints? I have no idea how that works...  EDIT: maybe a link to see which type of photography I do can help


The setting is simple, I wanted to retrieve all rows from table A that were not present in table B. Because a unique row can be identified using 4 columns, I needed to have a way to write the WHERE statement that it works correctly.   My solution is to concatenate the 4 columns and use that as "one" column/key to do the outer join:  select      *  from        table_A where       filter_condition = 0 and         (column1 || column2 || column3 || column4) not in (             select          A.column1 || A.column2 || A.column3 || A.column4             from            table_A A -- 1618727             inner join      table_B B             on              A.column1 = B.column1              and             A.column2 = B.column2              and             A.column3 = B.column3              and             A.column4 = B.column4             and             filter_condition = 0             )   My question is, is this a good way of doing this or am I doing something fundamentally wrong?   To be clear, the desired result is simply to get back only the rows of table_A that I "lose" due to the INNER JOIN with table_A and table_B.


Let $A$ be uncountable, $A\subseteq B.$ Prove that $B$ is uncountable.

Let B be a countable set, and let A be an uncountable set. Prove that A-B is uncountable


Hi guys I'm having an unresolvable problem with my LaTeX document (at least for me).  Here are my first two entries from the references file:  % Encoding: UTF-8  @Article{FelixWortmann2015,   author       = {Felix Wortmann, Kristina Fluechter},   title        = {Internet of Things - Technology and Value Added},   journal      = {Springer},   journaltitle = {Business \& Information Systems Engineering},   year         = {2015},   date         = {2015-03-27},   url          = {https://link.springer.com/content/pdf/10.1007/s12599-015-0383-3.pdf}, }  @Online{Lueth2016,   author = {Knud Lasse Lueth},   title  = {OVERVIEW OF 640+ ENTERPRISE IOT USE CASES},   year   = {2016},   date   = {2016-08-11},   url    = {https://iot-analytics.com/global-overview-640-enterprise-iot-use-cases/}, }   Here are my headers for the document:  \RequirePackage[utf8]{inputenc}  \graphicspath{{images/}} \logofile{logo} \bibliography{references}    in my project folder there is an "references.bib" and a "references.bib.bak" file (containing all the sources)  Now when creating my pdf-file i get all [0] instead of the correct number. My texnic center gives me this output:     pdflatex> LaTeX Warning: Citation 'Repschlaeger2014' on page1 undefined on input line 75   pdflatex> There were undefined references.   pdflatex> Package biblatex Warning: Please (re)run Biber on the file   I get the same warning for a number of citations. Please tell me if you require any more information.

I've browsed the forums and found a number of posts that have addressed this issue, but none of the solutions seem to work for me. I have the following script that I just copied from the bibtex home page to get familiar with it. Instead of the citation number I get a question mark. I compile using Latex+Bibtex+Latex+Latex+PDFLatex+ViewPDF just as has been previously suggested and the problem persists.   \documentclass[11pt]{article} \usepackage{cite}  \begin{document}  \title{My Article} \author{Nobody Jr.} \date{Today} \maketitle  Blablabla said Nobody ~\cite{Nobody06}.  \bibliography{mybib} \bibliographystyle{plain} \end{document}   My bibliography (Bib.bbl)  @misc{ Nobody06, author = "Nobody Jr", title = "My Article", year = "2006" }    Looking at previous posts one thing that is concerning is that my .bbl looks empty as shown below. Further, I don't have a .blg  \begin{thebibliography}{}  \end{thebibliography}


On your turn, you misty step 30 feet straight up. Can you make an attack before you start falling, or will you immediately begin to fall?  For example, a player wants to reach a flying enemy to knock him prone, then feather fall safely to the ground. Is he in reach long enough for all his attacks to go through? Will he fall before he can cast feather fall? (He used his bonus action on to cast a spell, so only cantrips during his turn.)

Situation:  Alice the Aarakokra sees Bob the Battlemaster coming. She ascends to 605', just out of the 600' range of Bob's longbow.  Bob (Str 14) performs a running high jump 5' into the air and successfully hits Alice with his longbow, despite firing at disadvantage for long range. He spends one of his maneuver dice to perform the Trip Attack maneuver, and succeeds on the contested roll to knock Alice prone.  Alice is now flying and prone, so she falls. Falling does 1d6 bludgeoning damage per 10' fallen, to a maximum of 20d6.  Questions:   When does Alice start falling? It is on Bob's turn as soon as she's knocked prone, or some time else such as the beginning of her own next turn? When does Alice hit the ground? On Bob's turn as soon as she's knocked prone, or some time else?   These answers determine whether anyone can save Alice from her 20d6 of certain doom.   Is a reaction (e.g. casting Feather Fall) on Bob's turn the only hope? Can Alice's ally Charlie swoop in on his subsequent turn within the same round to catch her? Can Alice spend half her movement on her next turn to "stand from prone" and pull out of her involuntary dive? If Alice had expected to be shot down, could she have spent an action to be Ready to "stand from prone" while moving through Bob's airspace?


Explain in detail why the following “proof” is incorrect.   Theorem $1$. All positive integers are equal.   Proof. We show that any two positive integers are equal, from which the result follows. We do this by induction on the maximum of the two numbers. Let $P (n)$ be the statement “if $r$ and $s$ are positive integers and max{$r, s$} = $n$ then $r = s$”.   Clearly $P (1)$ is true. Suppose that $P (n)$ is true and let $r, s$ be positive integers whose maximum is $n + 1$. Then max{$r−1,s−1$} = $n$. By the inductive hypothesis, $r−1=s−1$ and hence $r=s$. Thus $P(n+1)$is true.   The result is now proved by mathematical induction.

Suppose that we are trying to prove that for every positive integer n, if x and y are positive integers with max(x, y) = n, then x = y. For the base case, we suppose n = 1. If max(x, y) = 1 and x and y are positive integers, we have x = y = 1. Now we let k be a positive integer, and assume that whenever max(x, y) = k and x and y are positive integers, then x = y. Let max(x, y) = k + 1, where x and y are positive integers. Then max(x - 1, y - 1) = k, so by the inductive hypothesis, x - 1 = y - 1, so x = y. What is wrong with this ``proof''?


If you are about to answer "because k-fold incorporates future information", I'm going to challenge you on that answer :)  If my time series exhibits some pattern (e.g. annual seasonality), that pattern must obviously occur every year, in the past and in the future.  For example, if some summer seasonality appears in the 2017 data, it should also appear in 2010, or in 2007, etc. Otherwise it's not really a pattern!  But if seasonality appears every year, then training the Model on chunks of future data and validating the Model on chunks of past data, should be fine as well.  So cross-validation rocks on time series too, right?

What is an appropriate cross-validation technique for time series data?   I have a daily 4 years time series data and fitting a SVM model by MATLAB R2015b:  SVMModel = fitcsvm(Input, binary_output,'KernelFunction','RBF','BoxConstraint',1); CVSVMModel = crossval(SVMModel); z = kfoldLoss(CVSVMModel)   This a binary classification problem. As default I used 10-fold cross validation, but because of the random nature of this method I think this is not suitable for time series data.   Questions:   Is it better to use other techniques like sliding window validation as discussed ?  How we can implement these techniques in MATLAB?  Are there any predefined functions for other proposed techniques?


If X and Y are two sets of vectors in a vector space V, and if X $\subset$ Y, then is span X $\subset$ span Y? If so, why is or isn't the span of X a subset of the span of Y?  EDIT:  Thank you for the hints! Here is the proof I came up with; please let me know if it is correct.    The spanning set of X can be written as: Span(X) = {$a_1 x_1 + a_2 x_2 + ... + a_n x_n$} where all $x_i$ are vectors and all $a_i$ are scalars. Since X$\subset$Y then all $x_i$ are also in Y. Thus, Span(x) is a linear combination of vectors from Y So Span(x) $\subset$ Span(Y).

Let $S$ and $W$ be subsets of a vector space $V$. Show that if $S$ is a subset of $W$, then $\mathrm{span}(S)$ is a subspace of $\mathrm{span}(W)$.  Ok I'm finally understanding what each of these things mean.. but I'm running out of ideas on how to actually show it without using arbitrary vector space examples like Rn. Since sets and subspaces are kind of new its hard to figure out how to write correct proofs with them.   I can see how if $V = \mathbb{R}^3$ and $S = \{(1,1,1)\}$ and $W = \{(1,1,1), (1,1,2)\}$ then $\mathrm{span}(S) = R1(line), span(W) = R2(plane)$ and that R1 is a subspace of R2... im just having trouble showing this officially when all vector spaces and sets are completely in general....  I could get as far as writing out $S=(u_1,u_2,\dots,u_n)$, $u_i \in V$ and same with $W$, but I can't really figure out what else to do in this sort of proof.


A problem from Griffiths asks us to find the electric potential inside and outside a spherical shell. The potential on the shell is specified to be $V(R, \theta) = k \cos(3\theta)$. There is no charge anywhere else. The solution (I think) is $$V_{in}(r,\theta) = \frac{k}{5} \left(-3\left(\frac{r}{R}\right)P_1(\cos\ \theta) + 8\left(\frac{r}{R}\right)^3P_3\cos\ \theta\right)$$ The field is not zero inside this shell. But if I apply Gauss's law over any surface fully inside this shell, $$\oint \mathbf{E}\ \cdot d\mathbf{a}\ = \frac{Q_{enc}}{\epsilon_0}$$ $Q_{enc}$ is zero because there are no charges anywhere. And since the above equation holds for every closed surface inside the shell, $\mathbf{E} = 0$ everywhere inside the shell. Which is not true according to the potential I computed. What am I missing?

This is a question from David J Griffith's Introduction to Electrodynamics.      A specified charge density $\sigma(\theta)=k\cos(\theta) $ is glued over the surface of a spherical shell of radius $R$. Find the resulting potential inside and outside the sphere.   The question was solved using legendre polynomials and the final answer for potential inside the sphere was : $V(r,\theta) = \frac{kr}{3\epsilon_0}cos\theta$  This final answer is confusing because The Electric field inside the sphere is coming out to be dependent on $r$ and $\theta$ whereas electric field inside a shell, no matter what the charge distribution is outside, is $zero$ from gauss's law.      my doubts:         why is the electric field inside non zero?    Can gauss's law explain this, or does it fail here?      Since solving using ordinary surface integral gave me the same result and since the. divergence inside the shell is $zero$, I concluded that legendre polynomials and gauss's law in differential form are correct. So the problem should be with the integral form of gauss's law : $\int_s{\vec E}.d\vec{s} = \frac{q}{\epsilon_0}$  The answer I got for this doubt is that  "since the charges are glued to the surface, and not evenly distributed, electric field inside need not be zero. "     This is not convincing because proof of gauss's law does not expect the charges to be free to move. presence of an exrernal force that would hold the charges in place does not change the theorem. That is    Say only a single charge $q_i$ is present outside      then $\int_s{\vec E_i}.d\vec{s} = \frac{q_{inside}}{\epsilon_0}=0$      Now if there are more charges, following any distribution, net electric field $\vec E = \vec E_1 + \vec E_2+\vec E_3+...$       So the net flux,       $\int_s{\vec E}.d\vec{s} = \int_s{\vec E_1}.d\vec{s}+\int_s{\vec E_2}.d\vec{s}+\int_s{\vec E_3}.d\vec{s}+. . .=0$   Or is it possible that $\int_s{\vec E}.d\vec{s}=0$ does not imply $\vec E = 0$?


every Lebesgue measurable set with non-zero measure contains a non-measurable set.what is the proof?

I was thinking if there is a solution to this problem without trying to explicitly create Vitali sets in $A$. Does anyone have any ideas?


I deleted my whole partition by mistake. To make things worse I created a new partition over it (I didn't leave it like unallocated space). However I didn't copy anything to that partition or used it in any way. I tried some data recovery software tools (only to preview what would they recover). I could restore my video files, pictures, audio, html, etc... However I couldn't find any javascript files. Is it at all possible to recover javascript files. If it is do you have any software to recommend (Windows 10 User). Thanks for your time in advance.

What steps can I take to try to recover lost or inaccessible data from any storage device?  Answers:   This applies to any computer storage device, e.g. internal/external hard drives, USB sticks, flash memory. The most important thing is to STOP using it, any type of I/O can ruin your chances of a recovery.     We have separate questions covering common problems with USB flash drives in greater detail:


I want retrieve Global picklist Value Set and assigned them into a drop down box using apex.   How could I resolve this?

Is it possible to retrieve the values of a Global Picklist/GlobalValueSet using Schema class without a SOQL ?


My publisher has a list of ~50 words that need to be lowercase in titles of books and articles, the remaining words need to be capitalized. We are using BiBTeX, not biber, for performance reasons. Here is the invocation: \usepackage[backend=bibtex,language=american,style=authoryear]{biblatex}``` % Patch biblatex: \urlstyle{sf} \DeclareFieldFormat{url}{\url{#1}}  Right now, the only way I can think to honor the publisher's list is to have a python program that does post-processing on the .bbl file. Which I can certainly do, but it would be nice if there were a better way. If I do need to do post-processing on the .bbl file, is there a way to get latexmk to run my python program after running bibtex? From the docs, it seems that I might be able to set $bibtex = 'python bibwrap.py' where bibwrap.py would run bibtex and then run my post-processing script. Would that be the way to do it?

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


I am using java.sql.Connection and java.sql.Date to access the date here is my code:  private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {                                               if(jTextArea1.getText().equals(""))     JOptionPane.showMessageDialog(null, "Please Enter the Expence Description. ");  else if(jComboBox4.getSelectedIndex()<1)     JOptionPane.showMessageDialog(null, "Please Select the Type.");  else if(jDateChooser1.getDate().equals(""))     JOptionPane.showMessageDialog(null, "Please Enter the Date. ");  else if(jTextField3.getText().equals(""))     JOptionPane.showMessageDialog(null, "Please Enter the Amount.");  else{   try{     con= DriverManager.getConnection("jdbc:mysql://localhost:3306/project","root","1234");     ps=con.prepareStatement("insert into work values(?,?,?,?)");     ps.setString(1, jTextArea1.getText());     ps.setString(2, jCom.getDate());boBox4.getSelectedItem().toString());     ps.setDate(3, (Date) jDateChooser1.getDate());   But it gives error as   java.lang.ClassCastException: java.util.Date cannot be cast to java.sql.Date   Can anyone give the solution for aforesaid?

I am trying to use a  as input and then creating a query with it - so I need a .    I was surprised to find that it couldn't do the conversion implicitly or explicitly - but I don't even know how I would do this, as the Java API is still fairly new to me.


Prove that the number of units of $\mathbb Z[\sqrt{3}]$ is infinite, i.e. $a^2 -3b^2=1$ has infinitely many integer solutions.  Can you help me?

I'm asked to show that there are infinitely many units in the ring $\mathbb Z[\sqrt 3]$.   But I don't really see a good approach to this one, so far.   Some thoughts: The inverse of $a+\sqrt3 b$ should be given by $\pm(2 - \sqrt 3 b)$, since the norm   $$N: \mathbb Z[\sqrt{3}] \to \mathbb Z, \qquad N(x+\sqrt{3} y) = x^2 - 3y^2$$  is multiplicative. So if $(a+\sqrt{3}b)^{-1}=x+\sqrt 3 y$, then   $$1 = N(1) = N((a+\sqrt{3}b)(x + \sqrt{3}y)) = (a^2 - 3b^2)(x^2 - 3y^2)$$  Hence we must have $\pm 1 = (a^2 - 3b^2) = (a+\sqrt{3}b)(a-\sqrt{3}b)$.  Therefore I need to show that there are infinitely many $a,b$ such that $a^2 - 3b^2 = \pm 1$.   Here I don't know how to proceed.   Maybe rewriting as $a = \sqrt{3b^2 \pm 1}$, and now trying to prove that there are infinitely many $b$ for which $3b^2 \pm 1$ is a square?  A hint would be appreciated! =) Thanks.


I have used several .SE's which were very helpful. However to stay on topic for some questions I went to other .SE's which did not have the same number of active members due to which questions stay unanswered very long. If a question is suitable for several .SE's and at the most appropriate one it stays unanswered because of low population on that .SE, is that a good reason to migrate it to another (although less) suitable .SE?  Basically a .SE does not work as well as another if theres less people on it. Even though its more on topic on the less functioning .SE, its much more helpful to post it on the good functioning .SE. So you could say the less functioning .SE should not have been created, on the other hand you could say that all active people more engaged with subtopics on the busy .SE that better fit on the less functioning .SE should really spend more time there.

I posted . I think it was probably a better fit for the , but for the reasons I cited in my question, I posted it on SO.     I deliberated whether to post this on code review or here. I came to   the conclusion that it is a straightforward question about PHP and   with the number of supporters here, it would likely get an answer, as   code review is slow and the question has a greater chance of not being   answered.   The answers and feedback have been amazing and, I believe, will add another good resource for visitors to the site.  I have attempted to be active on the Code Review SE, but there is not a great deal of interaction.   Can anyone suggest a way to support our Beta sites and yet still get good answers?


So I've been working on a wireless remote relay switch using several components and have struck a break wall. The issue I'm having is that the D0 siginal output triggers the relay but only at short range. When using 2 different power sources the relay behaves as it should with pretty good distance.  Basically the issue I think I'm having is related to a power one which is beyond me and hopefully someone can guide me in the right direction.  Below is the some details of each main component:   315mhz SC2272-M4 Receiver (5v) 315mhz 4-CH SC2262 Transmitter (12v) High & Low Level SRD-05VDC-SL-C Relay circuit for Uno 3 (5v)   Here's what I've tried.         – Schematic created using   Basically what I'm finding is that D0 is dropping mA and not driving the high level trigger, but it works fine with its own power source, something I hoped to correct by using a 1AMP+ Mains USB supply. Is there a better way to resolve this issue. Oh, I've also messaged the seller of the high low level trigger relays to find out the exact mA at which the low and high triggers trigger on.  Updated:  As recommended I have tested the circuit with a multimeter and here's what I've discovered.  When activating relay:   Data 0 (DCA - 20m) drops from 8.70 to 7.75 (very unstable sometimes can drop as low as 1.0) Data 0 (DCV 5v) drops from 5v to 4.3v (very unstable when range is increased, as low as 0.33v)

I'm currently encountering a problem when using a relay switch with a 5v receiver. When using the same receiver with a row of LEDS it works flawlessly. I've noticed that the relay keeps making the switching noise over and over like I'm pressing the transmitter really fast apart from the fact I'm not. Also, when the transmitter is moved closer to the receiver from 20" to around 1" the problem stops. Below is some circuits to help show you my setup.  Any help appreciated thanks.  Setup Specs   USB 5v DC (2AMPS) Receiver (XY-DJM-5V - SC2272-M4) Relay (SRD-05VDC-SL-C 5V DC) Transmitter (XY-04) Diode (1N4001) Transistor (2N2222A) Resistor (1.8K Ohms)          – Schematic created using   Antenna Signal Workaround or Booster  I believe this issue is related to wireless signal on D0. Basically above 20" inches the output to the relay drops from 5.05v to 0.5v and is obviously causing the problem. I think I need to boost the signal or replace the transistor with something that triggers at low and high current but have no clue. Any help appreciated, I'm new at this.  Board Setup


I am trying to make a multi-language website with fully translated content. And the thing is I am not sure about the URL for the homepage.   So the structure I am planning to prepare right now is using just the URL (like example.com/) for the English version and /de, /jp or /tr subfolders for the other language versions.   Would that be useful or should I use /en subfolder for the English version? If so, what kind of the homepage would you suggest (for example.com/), just a page with language selector or IP-based redirecting?

I have a website running in English and Japanese and the default language is Japanese.  What are the advantages of one over the other solution:   Solution 1. When accessing example.com, you will see only Japanese. When accessing example.com/en, you will see only English. Solution 2. When you access example.com, it will redirect you to example.com/ja, where you will see only Japanese. English site is still example.com/en.


Let $F = \mathbb{Q(i)}$. Prove that $p(x) = x^3 - 3$ is irreducible over $F$.  attempt: Suppose  $F = \mathbb{Q(i)}$. Then let $p(x) = x^3 -3$ ,then $p(x) = x^3 -3$  is irreducible over $\mathbb{Q}$ since it is Eisenstein and since it is a cubic root which has no rational root.  Hence $[\mathbb{Q}(\alpha): \mathbb{Q}] = 3$ for any root $\alpha$ of $p(x)$.  i.e., the degree of $\alpha$ over $\mathbb{Q }$ is the degree of the extension it generates over $\mathbb{Q }$.  We also know that in $\mathbb{Z(i)}$ , $p(x) = x^3 -3$ is irreducible, where $\mathbb{Z[i]}$ is a UFD.   And suppose $F = \mathbb{Q(i)}$ is an extension field of $\mathbb{Z(i)}$ containing the root $\alpha$ of $p(x)$ . Then $Z[\alpha] \cong Z[x]/(x^3 - 3)$.  Can someone please help me? I am stuck. I was hoping that because $p(x)$ is irreducible in $Z[i]$ , then that might help with showing $p(x)$ is irreducible in $ F.$ Thank you for any help!

Let $F=\Bbb{Q}(i)$. Prove that $x^3-2$ and $x^3-3$ are irreducible over $F$.   How do I go about this? Should I just say that the roots of $x^3-2$ are $2^{1/3},2^{1/3}e^{i2\pi/3},2^{1/3}e^{i4\pi/3}$, which do not belong to $\Bbb{Q}(i)$?


I made a mess with areas trying to merge them into 2. Is there a way to remove areas without aiming at the corner and then dragging them with LMB?

I would like to close some view windows that I opened accidentally.  See the image below:    Edit: another note: I tried searching for the solution, but only found things like "Join Area", which don't seem to work in this situation.


I have a custom object called Employee and another object called Device  Device is a lookup relationship to Employee object  I'm trying to pull the Device RecordType.Name something like this:  SELECT id, Name, device__r.RecordType.Name from Employee__c   in the Developer Console I see its pulling the data but the column is displaying like this [Object Object] What do I need to show the actual data?

I'm trying to perform the following multilevel relationship query.   SELECT ID, SystemModstamp, Product__r.Catalog__r.Active__c  FROM Journal__c      WHERE SystemModstamp > 2013-10-02T00:00:00.000+0000  AND SystemModstamp < 2013-10-05T00:00:00.000+0000    In the Product__r.Catalog__r.Active__c column I'm getting a value of [object Object] for every single record. I can substitute any field name from the Catalog__c object and get the same response. Does anyone know why this is happening or how to get the field's actual value?


When I type in the omnibar at the top  goo   it autocompetes to  google.com.au   rather than  google.com   This is driving me crazy. How do I blacklist a site so autocomplete doesn't show it? Or, how do I get it to autocomplete again to google.com

I've got a URL in Chrome "local.mysite.com" that autopopulates when I start typing "local.my" into the URL bar.  Note that this URL DOES NOT EXIST in my browser history (at chrome://history/#e=1&p=0) because it isn't a real site and therefore couldn't ever be successfully visited and therefore never shows up in my history.   The URL I want is "local.mysite.com/subdir/". That URL is 3 down in the suggested results because I keep accidentally hitting "enter" when it auto-suggests the unwanted first URL thus reinforcing its assumption that that is the one I want.   How do I get rid of the "local.mysite.com" entry in Chrome's memory?


I want to resize the terminal which comes up when you press CtrlAltF1 (or F2,F3,...). 25x80 is small for a 24" screen.  Tried using stty, but the commands stty columns 200 and stty rows 50 does not work directly. Am I missing something OR is this a wrong approach.  Ideally looking for a generalized solution, but would be content with something that works in RHEL5 and Ubuntu. It would be better if its possible using some commands which I can put in a script file rather than changing some boot-level stuff.

I'm running a Linux server without X11 or any kind of GUI, with a modern 22" LCD monitor.  Given the huge size of my monitor, I would like to increase the number of rows and columns in my console, how can I go about achieving it?


I've been noticing all through my SO "career" that my questions aren't always well received. They are either too vague or general or I seriously confuse terminology because well, frankly I don't know what I'm talking about. Being "self trained" or "internet trained" I find my education of anything programming to be very incomplete. Namely my terminology gets snarled up. It makes researching difficult which in turn leads to posting bad or vague and confusing questions. Probably a good example is in this post I made yesterday and edited today  where I gained a little more experience and was able to research for slightly better keywords and get what appears to be the exact answer to my question but better  So being new to everything programming, how can I learn to ask better questions?

I am what I would call an "advanced hobby programmer". So I have limited in-depth technical training. I'm also the "virtual CTO" for my SaaS application. Which means I have ultimate technical  responsibility for the entire scope of a complex multi-technology application. For budgetary reasons, my development team does not include senior people with broad and in-depth technical knowledge. As a result of these constraints, I occasionally need to do problem solving on issues that I barely know the key words for in order start researching. In the process, I sometimes ask questions on Stack Exchange for which I get negative feedback in one form or another. Question:  Is there a site in the Stack Exchange network where I can answer "less informed" questions (possibly considered "dumb") in order, for example, to just get started on what to specifically research? Or if not in this network, what would you recommend?


I wana compare a String with the Key of a Hashmap.  So every time i run this code it uotputs : Not found  I'm new at Java and its surely a little thing but i need help.  Here my code  btnNewButton.addActionListener(new ActionListener()      {         public void actionPerformed(ActionEvent e)          {             if(!txtSearchHere.getText().isEmpty() && txtSearchHere.getText().length() > 1)             {                 String value = txtSearchHere.getText();                 txtSearchHere.setText("");                  for(Integer key : plzHashMap.keySet())                 {                     if(key.toString() == value)                     {                         System.out.println("Matched key = " + value);                     }                     else                     {                         System.out.println("Not found");                     }                 }             }         }     });

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?


Is Knowhere, the severed skull of an unknown Celestial floating in space, actually in fact the physical remains that once housed the brain of the Celestial Ego?

It was mentioned in the movie  as well as in  and confirmed , that:     Knowhere — the mining colony located on the edge of the universe in the decapitated head of a long-dead [Links added by me]   Which Celestial Being did the head belong to? (if known).  I have also checked the , but the closest thing to its origins was this line from the creators (Dan Abbnett and Andy Lanning):     Honestly, they just came to us. The severed Celestial head was, I think, something that popped out of Andy's mind one day. Similarly, one morning, I said "what about a talking Russian dog?" We run with these things and develop them together. It's hard to pin down where exactly they originate.


The relevant PR was merged into code-prettify:   As per , I'm asking to deploy it to the network and assign to kotlin tag.

I motion to reopen  as there's a lot of evidence It says  If Kotlin becomes more popular in the future, we will reconsider.  Evidence of maturity There's a  from 2 years back, but since then a lot of things have happened, especially to Kotlin:  Kotlin is coming up on its 5th major update widespread adoption in Android (and some backend) Gradle kts build scripts official support from Google.  See also the comments on the rejecting answer.  I think this is a quite compelling evidence that Kotlin is now trending:  Kotlin is in quite notable positions in  especially when compared to , when it wasn't even on the list. 24.8M views according to   Trigger I just asked a  and noticed that even basic highlighting is missing (fun/val are the most common keywords and they're not highlighted).


When loading the page I bind the click event of a list of element. then I append new items to the same list with same element but event not binds with the newly added elements.  This problem with me from a long time and I usually reload that location after I appended element, but it is not giving me the benefit of using ajax.  Common answer with sample code will appreciated.

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.


Objects are passed around by reference. They are never copied. I have code segment as following:  var person={firstname:'John', lastname:'Smith'} var anotherPerson=person anotherPerson.nickname='Curly' console.log(person.nickname) "Curly" var fname=person.firstname console.log(fname) "John" person.firstname = 'Tom' console.log(anotherPerson) Object {firstname: "Tom", lastname: "Smith", nickname: "Curly"} console.log(fname) "John" <-- fname is not updated   My question is after I updated the object person's firstname to 'Tom', why local varialbe fname is not updated?

The primitive types (number, string, etc.) are passed by value, but objects are unknown, because they can be both passed-by-value (in case we consider that a variable holding an object is in fact a reference to the object) and passed-by-reference (when we consider that the variable to the object holds the object itself).  Although it doesn't really matter at the end, I want to know what is the correct way to present the arguments passing conventions. Is there an excerpt from JavaScript specification, which defines what should be the semantics regarding this?


I am struggling to solve the following exercise:  Let $E \subset \mathbb R^d$ be finite measurable and $(f_k)_{k \geq 1}:E \to \mathbb R$ be a sequence of measurable functions such that for all $x \in E$, there is $M_x \in \mathbb R_{>0}$:$$ |f_k(x)|\leq M_x, \space \forall k \in \mathbb N$$ Show that for each $\epsilon>0$, there exists $F\subset E$ closed and $M>0$:$$ |E \setminus F| <\epsilon, \space \text{and}\space |f_k(x)|\leq M, \space \forall k \in \mathbb N, \space \forall x \in F$$  I got stuck at some point but this is what I thought of: Let $(E,\mathcal M_{E},m_{E})$, then it is easy to see that $E=\bigcup_{n\geq 1} (\bigcap_{k \geq n} \{x \in E: |f_k(x)|\leq n\})$, note that $E_n= \bigcap_{k \geq n} \{x \in E: |f_k(x)|\leq n\}$ forms an increasing sequence of measurable sets. Then $\emptyset=\bigcap_{n\geq 1} (\bigcup_{k \geq n} \{x \in E: |f_k(x)|>n\})$. Since $m(E)<\infty$, $$0=\lim_{n \to \infty} m((E_n)^c)$$ Given $\epsilon>0$, there is $N: m((E_N)^c)<\dfrac{\epsilon}{2}$. Since $E_N$ is measurable, there exists a closed set $F \subset E_N$ with $\mu(E_N \setminus F)<\dfrac{\epsilon}{2}$. But then $m(E\setminus F)<\epsilon$ and $$|f_k(x)|\leq N, \space \forall x \in F, \space \forall k\geq N$$ I need this to work for all $k \geq 1$, I don't know what to do with the remaining $1,...,N-1$. Any help would be greatly appreciated.

Let $m$ be Lebesgue measure on $\mathbb R$ and $\mathcal{F}$ a countable set of Lebesgue measurable functions defined on Lebesgue measurable set $E\subset\mathbb R$ with $m(E)<\infty$. Assume that for each $x\in E$, the set $\{|f(x)|:f\in\mathcal F\}$ is a bounded subset of $\mathbb R$. Show that for all $\epsilon>0$, there is a closed set $F\subset E$ and a number $M<\infty$ such that $m(E\setminus F)<\epsilon$ and $|f(x)|\le M$ for all $x\in F$ and all $f\in\mathcal F$.     My attempt:  By , for each $f_n\in\mathcal F$, there exists a closed subset of $F_n$ such that $f_n$ is continuous on $F_n$ with $m(E\setminus {F_n})<\epsilon/2^n$. Then for every $f\in\mathcal F$, $f$ is continuous on the closed set $F=\bigcap_{n=1}^\infty F_n$ with $m(E\setminus F )<\epsilon$.   Now how to prove that it is uniformly bounded on $F$?


I have below codes,  First code:      {         public virtual void Test()         {             Console.WriteLine("Parent Test");         }      }      class Child : Parent     {         public override void Test()         {             Console.WriteLine("Child Test");         }          static void Main()         {             Child c = new Child();             c.Test();          }     }   Output: Child Test  Second code:      {         public void Test()         {             Console.WriteLine("Parent Test");         }      }      class Child : Parent     {         public void Test()         {             Console.WriteLine("Child Test");         }          static void Main()         {             Child c = new Child();             c.Test();          }     }   Output: Child Test  I can able re-implement a function in child class without using virtual and override. Second code also gives same output then why I should virtual and override?

Why would you declare a method as "virtual".   What is the benefit in using virtual?


I want to check whether my userid is having any special character apart from alphanumeric characters (a-z,A-Z,0-9). The below regex is failing...what would be the correct way?   var testStr = '3278|3278.3000.2506.60200000.1100.000.0000.0||703"68*[70"8'; var splitTeststr = testStr.split('|'); alert(splitTeststr[0]); /* alert('Length of splitStr is : ' +splitTeststr.length); */ if (splitTeststr.length == 4) {     var userId = splitTeststr[3].trim();     alert('userId before removing junk : ' +userId);     var letterNumber = /^[0-9a-zA-Z]+$/;          if((userId.match(letterNumber))){         alert('UserId contains junk : ' +userId);              }else{         alert('Userid is fine');     } }

I need to find a reg ex that only allows alphanumeric. So far, everyone I try only works if the string is alphanumeric, meaning contains both a letter and a number. I just want one what would allow either and not require both.


When we install a program using apt-get, after installed it's available in terminal, normally, when we just call "your name" independent of context directory we are.  On Windows, when we add a path to envoriment variables in variable PATH all programs or files in this path are available in terminal (prompt command) to be called.  In Ubuntu, how does it when we want to make a program callable but it is a standalone file installed without apt-get or aptitude?

I'd like to know if there is a way to run  program/shell script without typing full path:  /opt/idea/bin/idea.sh


Let $a,b,c>0$ be real numbers such that $a+b+c=3$,how to prove that? :   $$\frac{1}{2ab^2+1}+\frac{1}{2bc^2+1}+\frac{1}{2ca^2+1}\ge1$$


I'm searching for applications where the distribution of the eigenvalues of a unitary matrix are important. Example properties of the eigenvalues could be that the eigenvalues are clustered, that they live in some half plane, that, in the case that the matrix has real eigenvalues, that a certain fraction are 1, etc. Are there any well known areas where this is important?

I'm searching for applications where the distribution of the eigenvalues of a unitary matrix are important. Example properties of the eigenvalues could be that the eigenvalues are clustered, that they live in some half plane, that, in the case that the matrix is orthogonal, that a certain fraction are 1, etc.


I'am using Ubuntu 13.04 on Lenovo G500 -E  when i turn my laptop computer on the brightness of screen is 0 and i need to increase the brightness to see the screen  is this problem related to Ubuntu 13.04?  please help me to solve this problem  thanks in advance,

Ubuntu 11.10 doesn't save my brightness settings between sessions. Everytime I boot up, the brightness is always at zero, and I always have to set it back to my preferred setting (at maximum). How can I ensure that my brightness preference will persist after reboot?


Over the last month, on some of the sites I visit regularly there seems to be a marked decrease in new questions and answers.    I personally have not noticed as much on work related sites, like dba.se but on personal hobby and development sites, there seems to be a sharp decline.  Is it possible to define what the level of post activity has been in the last month compared to other related times (i.e. same month last year, last year overall)?

Ever since Everything That Happened with Stack Exchange, it's understandable that many users are hesitant to get re-involved on SE.  It's understandable that  are deleting their own accounts, out of protest, or out of frustration, or for many other reasons.  But I have noticed that, at the very least on , where I spend most of my time, questions are getting fewer views and fewer answers, fewer votes are being cast, and fewer questions themselves are being asked.  I've also noticed that flags are taking a long time to be processed, probably because of the fact that Writing.SE .    Are other sites also experiencing inactivity?  Is this in direct correlation with Everything That Happened?  Is it just this site, or are other sites experiencing the same patterns as well?


So the equation is: $$𝑧^2−(4+𝑖)𝑧−10−10𝑖=0$$  I've tried to use the quadratic formula, but still can't get the solution.  I need an algebraic number form.  Thank you for help!

I've tried two ways, but get stuck.  I've tried to simplify, but didn't know what to do next, and I've tried to solve it like a Quadratic equation but got stuck too.   One way got me this:  $$\frac{z}{2} \times (-1+3i+z)-1-i=0$$ - don't know what next.  option b, got me mess, while trying to make the equation into a Quadratic.


I hope it's not inappropriate asking this here.  I stumbled upon this site recently while researching a Project Euler problem, now I figure I'd use it to ask about a recurring theme in these problems: quadratic Diophantine equations.  I've recently boiled down another Project Euler problem (I won't say which, it should be unrecognizable from the original problem and should probably be kept that way) to the following Diophantine equation:  $$5n^2+2n+1=y^2$$  I've been trying to use  as a reference, but I seem to get lost in a sea of constants.  And the steps that program on the bottom of that page takes don't seem to match what he says to do.  I'd rather be able to understand the steps I'm taking anyway rather than just copying a method.  I'm interested in all positive integer values of n and I'm more or less given a solution exists with n=2.  How would I go about finding the rest of the solutions?  And how would I solve these kinds of equations in general?  If that last part is too complex a question to be handled here, is there any other resource that might help?  As far as my current level of math, I have a degree in engineering (and helped a math major with some courses I never took myself) and I've already worked on Project Euler problems involving Pell's equations and continued fraction expansions of square roots.

My number theory is terrible so I don't know what "class" of problem this secretly is.  I'm looking for all positive integer solutions to the equation:     $M^2=5N^2+2N+1$   That is, I want positive integer $M$ and $N$ to make the above true.  I've got the obvious solution ($N=0$, $M=1$) but I don't know how to go about getting more solutions.  It has been suggested to me that there should be infinitely many solutions, and I would like to find them all.  I could transform it to look like Pell's equation by completing the square on the right, but it won't have integer coefficients (or you could multiply it through by the denominators, but then it wouldn't look like Pell's equation), so I don't think that helps much.  I don't know enough number theory to guess at other things, but I'm happy to read something on this topic.


I have a table that has an NVARCHAR column that contains data that cannot be converted to BIGINT.  I'm well aware of that and have filtered it out using ISNUMERIC(BB.NVARCHARCOL) = 1.  Despite this, I still get an error when trying to query the data stating that Error converting data type nvarchar to bigint.  The following works fine (no errors reported by SQL):  SELECT * FROM myNormalTable AA INNER JOIN myBadTable BB ON BB.NVARCHARCOL = AA.MYBIGINTCOL WHERE ISNUMERIC(BB.NVARCHARCOL) = 1   The following throws the error:  SELECT * FROM (     SELECT *     FROM myNormalTable AA INNER JOIN myBadTable BB ON BB.NVARCHARCOL = AA.MYBIGINTCOL     WHERE ISNUMERIC(BB.NVARCHARCOL) = 1     ) ZZ  WHERE ZZ.MYBIGINTCOL = 1234   This variation also throws the error:  SELECT * FROM (     SELECT *     FROM myNormalTable AA INNER JOIN         (SELECT CAST(NVARCHARCOL AS BIGINT) NVARCHARCOL FROM myBadTable WHERE ISNUMERIC(NVARCHARCOL) = 1) BB       ON BB.NVARCHARCOL = AA.MYBIGINTCOL     ) ZZ  WHERE ZZ.MYBIGINTCOL = 1234   Keep in mind that this does not error and returns all the records successfully...  SELECT CAST(NVARCHARCOL AS BIGINT) NVARCHARCOL FROM myBadTable WHERE ISNUMERIC(NVARCHARCOL) = 1   I was able to find a solution, which was to convert my BIGINT to NVARCHAR in the subquery:  SELECT * FROM (     SELECT *     FROM myNormalTable AA INNER JOIN myBadTable BB ON BB.NVARCHARCOL = CAST(AA.MYBIGINTCOL AS NVARCHAR)     WHERE ISNUMERIC(BB.NVARCHARCOL) = 1     ) ZZ  WHERE ZZ.MYBIGINTCOL = 1234   If I insert the records into a temporary table:  SELECT CAST(NVARCHARCOL AS BIGINT) NVARCHARCOL INTO #TEMP FROM myBadTable WHERE ISNUMERIC(NVARCHARCOL) = 1   I can use that temporary table in a subquery successfully:  SELECT * FROM (     SELECT *     FROM myNormalTable AA INNER JOIN #TEMP BB ON BB.NVARCHARCOL = AA.MYBIGINTCOL     WHERE ISNUMERIC(BB.NVARCHARCOL) = 1     ) ZZ  WHERE ZZ.MYBIGINTCOL = 1234   What in the world is going on?  It seems like SQL refuses to use the subquery to get a smaller result set before running the outer query, it wants to use the whole table regardless of what I do.  SQL Server 2012 Developer Edition

I have some data tables that where imported in from a flat file source so everything is varchar(max) except FileRecordID which is a int that hold the row number the data came from in the flat file source (and is the primary key of the imported table.)  The following query works perfectly  SELECT *   FROM [CLIENT]   left outer join   (     select cast(ENTRY_CODE as int) as ENTRY_CODE, ENTRY_DESCRIPTION     from [ENTRY]     inner join [TABLE] on [ENTRY].ENTRY_TABLE = [Table].FileRecordID     where ENTRY_RECD = 'A' and TABLE_RECD = 'A' and TABLE_CODE = 'CLTDISC' and ISNUMERIC(ENTRY_CODE) = 1   ) as discounts on CLIENT_CLASS = ENTRY_CODE   where Client_recd = 'A'   --and client.[FileRecordID] = 10607   I get the exact number of rows I was expecting and everything is fine. However if I uncomment that last line so I only show the record from the client data table who has  client.[FileRecordID] = 10607 it reports to me      Msg 245, Level 16, State 1, Line 1   Conversion failed when converting the varchar value 'BK/TN' to data type int.   The problem is from cast(ENTRY_CODE as int) as ENTRY_CODE in the first outer join. ENTRY can contain text in the ENTRY_CODE column, however all records that have ENTRY_TABLE set to the line number from TABLE where TABLE_CODE = 'CLTDISC' will always be numbers only. I perform the cast as ENTRY_CODE may or may not have leading 0's and spaces so I am trying to get them to be well formed.  What appears to me to be happening is adding client.[FileRecordID] = 10607 to the outer query causes the where clause not to be evaluated before the cast to int in the inner query.  I have tried things like adding and ISNUMERIC(ENTRY_CODE) = 1 to both the inner and outer queries but it has no affect.   How do I fix this? Can anyone explain what is happening so I can understand how to avoid this in the future?   Non filtered query planed execution   Filtered (non working) query planned execution  Notice the reversed order of the Compute Scalar and the Filter    Other things I have tried that do not work:   Move TABLE_CODE = 'CLTDISC' in to the on clause in the inner join. Added OPTION (FORCE ORDER) query hint to the query.     Update:  but it is very "hackish" IMHO, I really would still like a explanation of how to avoid things like this in the future and how to do this correctly.  SELECT *   FROM [CLIENT]   left outer join   (     select ENTRY_CODE, ENTRY_DESCRIPTION     from [ENTRY]     inner join [TABLE] on [ENTRY].ENTRY_TABLE = [Table].FileRecordID     where ENTRY_RECD = 'A' and TABLE_RECD = 'A' and TABLE_CODE = 'CLTDISC' and ISNUMERIC(ENTRY_CODE) = 1   ) as discounts on CLIENT_CLASS = REPLACE(LTRIM(REPLACE(ENTRY_CODE, '0', ' ')), ' ', '0')   where Client_recd = 'A'   and client.[FileRecordID] = 10607


My code is relatively simple. I have to create a program that takes the input of a string, and tracks the frequency of each string. As well as the user should be able to type in a line, click enter and be able to enter the next line, etc. until the user clicks enter twice in a row. Here is my code so far:   package javaapplication8;  import java.util.Scanner;  public class JavaApplication8 {  static Scanner sc = new Scanner (System.in);  public static void main(String[] args) {     System.out.print("Enter a sentence: ");     String input = sc.nextLine() ;     while (input!=null) {         if (input.isEmpty()){             System.out.println("Read Enter Key.");             break;         } else if (sc.hasNextLine()){             input = sc.nextLine();         } else {             input = null;         }     }     String sentence = input.replaceAll("\\W", "");     sentence = sentence.toUpperCase();     int [] frequencies = new int [26];     int value = 65;     double valuecount = 0;      for (int i = 0; i < 26 ; i++) {         for (int i2 = 0; i2 < sentence.length(); i2++){             if (sentence.charAt(i2) == value){                 valuecount += 1 ;             }         }         double percent = (valuecount / sentence.length() ) * 100;         char val = (char) value;         System.out.format (val + " occured %.2f percent of the time. \n", + percent);         value += 1;         valuecount =0 ;     } } }   Netbeans isn't giving me any syntax errors meaning there isn't any exception stack trace. I'm guessing the issue is between the replaceAll line and the null statements in my while loop (that allows the user to click the enter key twice before the program runs.  I'm very new to Java, so sorry for any 'rookie mistakes'  Thanks!  Edit: My apologies, I thought the exception stack trace was the red text you get when you run your program with syntax errors (missing a semicolon, etc.)  I mean that my program runs, but it gives me NaN instead of the percentage amount, but when I remove the whole while loop, the program works perfectly without the next line feature.

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 need to thicken ("fatten") some parts of my mesh. I tried to scale X but it deforms and make a mess. How do I solve this?

This hand looks too skinny. What is the simplest way to make it fatter, especially the fingers?


I have 4 DC motors, and I do not need to individually control each of them. Can I connect all the motors parallely to one pair of motor pins on the L293D? Does this pose any issues?  I'm using BO geared motors with the following specs:     RPM - 100;     Output Torque - 0.8--5kgcm;     Operating Voltage - 3v-12v;     No-load Current - 57 mA;

This question is about the following three integrated H-bridge drivers: -    or L293D (D = protection diodes added)  (protection diodes included)  (no protection diodes)   Time after time the same question keeps coming up - someone is using one of these devices (on a low voltage, usually around 6V or less) and they are just not performing adequately. The reasons are listed further below but my question is this: -  What H-bridge drivers are preferred when controlling a low-voltage motor?   Information  The L293 and the SN754410 are nearly identical and crucially, if you try and control a 1 amp load, you are faced with dismal performance: -    The tables tell you (typical conditions) that the upper transistor drops (loses) about 1.4 volts when driving a 1A load and, the lower transistor drops (loses) about 1.2 volts when driving a 1A load. The upshot is that if you have a 6V, 1A motor and 6V battery, don't expect to see more than 3.4 volts across the motor: -  \$V_{OUT} = 6V - (1.4V + 1.2V) = 3.4V\$  Worst case scenario is you might only see 2.4 volts across it.  What about the L298? It's got a nice big heat-sink whereas the L293 and SN754410 are regular-looking chips. Here's what the volt drop (losses) look like: -    It's the same story - for a 1A load, you can expect to lose up to 3.2 volts and, what you thought might be 6V across your motor, is at best 4.2 volts and at worst only 2.8 volts.  Clearly none of the devices listed are suitable for low voltage applications where the motor might be expected to draw in excess of 0.5 amps.


When Dumbledore told Voldemort that he was a wizard, Voldemort used to live in an orphanage. Voldemort's mother had died during his own birth and his father had left his mother even earlier.  Later, in his teen, he killed his father using the wand of his mother's father (Dumbledore discovered this using memories of various people).  But, Voldemort was an orphan with no link to his history. How did he come to know about his parents?

The only information Tom Marvolo Riddle has about his parents are in his name.  In HP 6 Dumbledore shows Harry how Voldemort found the house of the Gaunts before learning about his father, who might have been easier to find, given that he knew his whole name.  So how did he find out about the Gaunts and how did he find their house?


Can someone kindly explain how this works?  if ((Control.MouseButtons & MouseButtons.Left) != 0)   MSDN only says that Control.MouseButtons Property gets a value indicating which of the mouse buttons is in a pressed state but I can't understand how that '&' works and why should it be different than 0.

For the life of me, I can't remember how to set, delete, toggle or test a bit in a bitfield. Either I'm unsure or I mix them up because I rarely need these. So a "bit-cheat-sheet" would be nice to have.  For example:   flags = flags | FlagsEnum.Bit4;  // Set bit 4.   or  if ((flags & FlagsEnum.Bit4)) == FlagsEnum.Bit4) // Is there a less verbose way?   Can you give examples of all the other common operations, preferably in C# syntax using a [Flags] enum?


$A, B$ are $n\times{n}$ matrices over the field F. Do $AB$ and $BA$ have the same characteristic polynomial? I have been able to prove that they have the same set of characteristic values. Also if any one the matrices $A$, $B$ are invertible, then $AB$, $BA$ are similar and they have the same characteristic polynomial. What if they are both non invertible? Do they have the same characteristic polynomial then?

Let $ A, B $ be two square matrices of order $n$. Do $ AB $ and $ BA $ have same minimal and characteristic polynomials?   I have a proof only if $ A$ or $ B $ is invertible. Is it true for all cases?


A friend of mine has a Notebook with two hard disks, one SSD and one HDD. The SSD held a Windows 7 installation, the HDD contained most of his data. After a bluescreen, the computer won't boot anymore. I've already re-written the MBR (BIOS-based system) using bootrec \fixboot on Windows 7 installation DVD, but to no avail.  Furthermore, when trying cd /D C:\ (the SSD) from the command line on the installation DVD, the execution failed stating an I/O error. cd /D D:\ (the HDD) works fine. Since the system is only a few months old, I hope that only the file system crashed on the SSD, and not the SSD itself. I want to try data recovery on the SSD that doesn't boot anymore, what's the best way to accomplish this? Are there any open source- / freeware-tools you can recommend?

What steps can I take to try to recover lost or inaccessible data from any storage device?  Answers:   This applies to any computer storage device, e.g. internal/external hard drives, USB sticks, flash memory. The most important thing is to STOP using it, any type of I/O can ruin your chances of a recovery.     We have separate questions covering common problems with USB flash drives in greater detail:


A user has suggested many edits adding tags to questions like    to a question involving an if statement  to a question titled "c#: Add element to second nesting in xml"  to a question titled "How to get exact cursor position in RichTextbox to display Popup "   these seem worthless to me. However, he claims otherwise (we are having a polite discussion about it, everybody be nice to him even if you agree with me!):     Hmm I see what your after and from your POV I do agree. But there are people like myself searching for these tag belive it or not. I use them to mostly to illustrate common problems programmers run into. Otherwise they wouldn't be tags created by the SO community. I read the article you supplied to me good read.. but I think you focus to much on the value adding from YOUR pov. I always read the question and study the problem, and if theres a problem with a nested or and if-statement why not tag it. I mean when are those questions ever going to be tagged otherwise with those tags??   And indeed,   for some reason. Still, I'd make the argument that none of these tags add any value to the question or its searchability.  Does a general guideline exist how to deal with this? How do we account for the fact that we may not be able to see the value in a borderline esoteric tag, but others do? How do we still have clear rules for this kind of situation?  Bonus question: what do we call tagging that simply describes what happens to be the question's subject matter, without really adding any relevance? It's not Meta tags, but it's something like them.

It's an additional unnecessary burden to the honest stacker during suggested edit duty. A question presents some code then the minor editor adds a tag like 'for-loop' or 'forms'.  These tags are so general that they only have a handful of followers. They serve no useful purpose and are the cause of many too minor edits. Why not permit culling of generic tags?


How to remove HTML tags from string, So string is as follows:  myString = @"Lewis Hamilton's social media posts have long been a talking point in Formula One but the absence of any from the four times world champion so far this year is also attracting attention.";   After modification my string should be as follows:  newString = @"Lewis Hamilton's social media posts have long been a talking point in Formula One but the absence of any from the four times world champion so far this year is also attracting attention.";   What should I use to get above newString from myString?

There are a couple of different ways to remove HTML tags from an NSString in Cocoa.   is to render the string into an NSAttributedString and then grab the rendered text.   is to use NSXMLDocument's -objectByApplyingXSLTString method to apply an XSLT transform that does it.  Unfortunately, the iPhone doesn't support NSAttributedString or NSXMLDocument. There are too many edge cases and malformed HTML documents for me to feel comfortable using regex or NSScanner. Does anyone have a solution to this?  One suggestion has been to simply look for opening and closing tag characters, this method won't work except for very trivial cases.   For example these cases (from the Perl Cookbook chapter on the same subject) would break this method:  <IMG SRC = "foo.gif" ALT = "A > B">  <!-- <A comment> -->  <script>if (a<b && a>c)</script>  <![INCLUDE CDATA [ >>>>>>>>>>>> ]]>


While learning C programming only the memory is mentioned, but in practice it seems that there is more; the buffer and stack words are also used.  What is the difference between these terms? Why are they relevant?  Please, I need a detailed answer. Short answers can't serve. Also some resources may be helpful.

Programming language books explain that value types are created on the stack, and reference types are created on the heap, without explaining what these two things are. I haven't read a clear explanation of this.  I understand what a stack is. But,    Where and what are they (physically in a real computer's memory)? To what extent are they controlled by the OS or language run-time? What is their scope? What determines the size of each of them? What makes one faster?


If we have $f=x^3-2 \in \mathbb{Q}[x]$ and it has splitting field $L=\mathbb{Q}(\alpha , \omega )$ where $\alpha =\sqrt[3]{2} \ ,\ \omega =\exp{(2\pi i/3)}$. I know that since $f$ is irreducible and it's roots are $\alpha , \alpha \omega, \alpha \omega^2 $, there is an element $\sigma \in \text{Aut}(L/\mathbb{Q})$ such that $\sigma (\alpha )=\alpha \omega .$ How do I determine the action of $\sigma $ on the other roots?

I know the Galois group is $S_3$. And obviously we can swap the imaginary cube roots. I just can't figure out a convincing, "constructive" argument to show that I can swap the "real" cube root with one of the imaginary cube roots.   I know that if you have a 3-cycle and a 2-cycle operating on three elements, you get $S_3$. I have a general idea that based on the order of the group there's supposed to be at least a 3-cycle. But this doesn't feel very "constructive" to me.   I wonder if I've made myself understood in terms of what kind of argument I'd like to see?


I'm having trouble running a cron job at particular times during the day.  Will this crontab setting run the command at 3am, 6am, noon, 6pm, and 9pm?  0 3,6,12,18,21 * * * command

This is a  about using cron & crontab.   You have been directed here because the community is fairly sure that the answer to your question can be found below. If your question is not answered below then the answers will help you gather information that will help the community help you. This information should be edited into your original question.  The answer for 'Why is my crontab not working, and how can I troubleshoot it?' can be seen below.  This addresses the cron system with the crontab highlighted.


I'm working on smartphone cameras. I want calculate Field Of View of different smartphone cameras  using the formula : FOV = 2 arctan(SensorSize/2f) where:    f is the focal length  sensor size is the Height or Width or Diagonal of the sensor (in mm)   In doing some research, I've found that there is another parameter to take in consideration, which is the crop factor. When using the formula for FOV, should I apply the given f (focal length), or should I apply the effective focal length which is (focal length x crop factor)?

I'm reading that a 50mm lens is recommended as a first prime lens for DSLR owners as it's supposed to give a 'natural' perspective, but when used on (most) DSLRs, the view is cropped, as if you were zoomed in by 1.5-1.6x, so it's more of a telephoto lens when used on a DSLR. I've also read however that the 50mm lens gives the same perspective on a DSLR and a 35mm, and shouldn't really be considered to be 'equivalent' to an 80mm lens as the crop factor isn't really a magic focal length changer.  Can someone explain how the image is different from (for example) a 50mm lens on a DSLR and an 80mm lens (assuming 1.6x crop factor) on a 35mm camera?


I've marked many questions as favourite but I'm unable to find those questions now. Then what's the point of marking them as favourite? I'm not able to find them in my profile as well.

What does bookmarking a question mean? How do you bookmark a question? Do users get updates on their bookmarked questions? Are my bookmarks publicly visible? How do you see your own bookmarks? How do you see other users' bookmarks? How do you see which users have bookmarked a particular question? What impact does the bookmark system have on the voting system? Can I "un-bookmark" a question? Can I search within my bookmarks?


How can I calculate date difference between two dates in years?  For example: (Datetime.Now.Today() - 11/03/2007) in years.

Given a DateTime representing a person's birthday, how do I calculate their age in years?