Helper Methods within static method are overidding multiple variables?

public class SeamCarving {   public static Seam carve_seam(int[][] disruption_matrix) {     int[][] original = disruption_matrix;     int[][] weighted_matrix = disruption_matrix;     SeamCarving s1 = new SeamCarving();      weighted_matrix = s1.buildMatrix(disruption_matrix);     ....   }   In the above code I have a static method carve_seam. The method takes a matrix. That input is saved in a matrix variable called original. A calculation is performed on the matrix and that is also saved as a variable called weighted_matrix. Both are needed.   Since its in a static method, a new object of the class is made and it is called from that "s1.buildMatrix"  However, that line is doing something that is over my head. This is because afterwards, not only is weight_matrix changed (correctly from the buildMatrix method) but original is also changed to the same exact thing! How does this happen???


How to add users to vboxusers to enable USB usage

I want to use my flashdrive in Windows XP, which I am currently running in Virtualbox, but when I open up the settings to enable usb usage, I get an error: Failed to access the USB subsystem. VirtualBox is not currently allowed to access USB devices.  You can change this by adding your user to the 'vboxusers' group.  Please see the user manual for a more detailed explanation   Result Code:  NS_ERROR_FAILURE (0x00004005) Component:  Host Interface:  IHost {30678943-32df-4830-b413-931b25ac86a0} Callee:  IMachine {22781af3-1c96-4126-9edf-67a020e0e858}  Does anyone know how to fix this!?


How to restore the Path environment variable I deleted?

I accidentally deleted the Path environment variable by creating a new one with Path name. How can I restore my old Path environment variable?


How do we know that a wave of light has electric field? Maxwell proved that light is an electromagnetic wave. Can you give me a reference of an experiment which proves light as an EM wave?


What preposition should be used with "cache"?

Which is most grammatical?        It's still cached to your phone.   It's still cached in your phone.   It's still cached on your phone.      I find myself gravitating towards "to" but I'm not sure - I feel like "cached" implies some kind of attachment.


I have already sent the visa application off the the hub in NYC for a visa to the UK and didn't realize I had to put a rush on it when I originally applied. I leave for Australia shortly and want to know is there anyway to contact anyone to speed up the process, I am happy to go in person to NYC but it seems that is not doable, and I can not find any phone number to call either?  I am a US citizen and applied that way, but also an Australian citizen..


A right triangle has a hypotenuse equal to 10 and an altitude to the hypotenuse equal to 6. Find the area of the triangle.


The error is :- Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.support.v7.app.ActionBar.setTitle(java.lang.CharSequence)' on a null object reference at com.example.pratikrathi.registerapp.MainActivity.onCreate(MainActivity.java:49)  how to solve this? why i am getting this error? help me   public class MainActivity extends AppCompatActivity {  public Button register_button; private FirebaseAuth mAuth;     @Override protected void onCreate(Bundle savedInstanceState) {     super.onCreate(savedInstanceState);     setContentView(R.layout.activity_main);      mAuth = FirebaseAuth.getInstance();      Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);     setSupportActionBar(toolbar);     // Create the adapter that will return a fragment for each of the three     // primary sections of the activity.     getSupportActionBar().setTitle("RegisterApp");   }  @Override protected void onStart() {     super.onStart();     FirebaseUser currentUser = FirebaseAuth.getInstance().getCurrentUser();     if (currentUser == null) {          sendToLogin();       } } @Override public boolean onCreateOptionsMenu(Menu menu) {     // Inflate the menu; this adds items to the action bar if it is present.     getMenuInflater().inflate(R.menu.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.     switch (item.getItemId()){          case R.id.action_logout_btn:             logOut();             return true;         case R.id.action_settings_btn:             Intent settingsIntent = new Intent(MainActivity.this,SetupActivity.class);             startActivity(settingsIntent);              return true;     }     return super.onOptionsItemSelected(item); } private void sendToLogin() {     Intent loginIntent = new Intent(MainActivity.this,LoginActivity.class);     startActivity(loginIntent);     finish(); }  private void logOut() {      mAuth.signOut();     sendToLogin();  } }   The Xml layout file is included below.       <?xml version="1.0" encoding="utf-8"?>      <android.support.design.widget.CoordinatorLayout       xmlns:android="http://schemas.android.com/apk/res/android"      xmlns:app="http://schemas.android.com/apk/res-auto"      xmlns:tools="http://schemas.android.com/tools"     android:id="@+id/main_content"     android:layout_width="match_parent"     android:layout_height="match_parent"     android:fitsSystemWindows="true"     tools:context="com.example.pratikrathi.registerapp.MainActivity">     <android.support.v7.widget.Toolbar      android:layout_width="match_parent"     android:layout_height="wrap_content"     android:background="@color/colorPrimary"     app:title="RegisterApp">  </android.support.v7.widget.Toolbar>   </android.support.design.widget.CoordinatorLayout>


I have a byte array (an IEnumerable actually), and I need to save it to a new file containing this data.  How do I do that?  I found some answers telling how to create a MemoryStream from that, but still can't save it to a brand new file.


How to create a local mirror that replicate only the security patches from archive.ubuntu.com

Can anyone help me here. I need a local mirror with all the security patches in the Ubuntu mirror. I don't need any other updates due to security constraint. Tried with apt-get but it has only subset of patches. Rsync/wget download the entire mirror which is of 600GB which is not possible. Any other way to do this?


Finding the Jacobian matrix of $x^T A x$

I am trying to find the Jacobian matrix of $x^T A x$. Where $A \in \mathbb R^{n \times n}$ (and $A$ is symmetric) and $x\in \mathbb R^n$.  I have tried to write it in summation notation:  $$x^T A x=\sum_{i=1}^n \sum_{j=1}^n x_ia_{ij}x_j:=y$$  Since $x^TAx=y$ is a polynomial, the corresponding Jacobian matrix will look something like this:  $$J_y=\begin{pmatrix} \frac{\partial f_1}{\partial x_1} & \frac{\partial f_1}{\partial x_2} & ........ & \frac{\partial f_1}{\partial x_n} \end{pmatrix}$$  So the $k$-th component of my Jacobian matrix is:  $$ \frac{\partial y}{\partial x_k}=\frac{\partial }{\partial x_k} \left(\sum_{i=1}^n \sum_{j=1}^n x_ia_{ij}x_j \right) $$  I am stuck here. I have tried separating this into cases where $k=i \not=j$ but I am not really getting anywhere. Is there a way to simplify this further? ( I am not necessarily looking for a complete solution but rather a few hints that will enable me to figure it out by myself. Thanks.)


How to use "range" in python to include not just numbers 1-1000, but have each number appear with 3 digits?

I want to go through each number in the range 1-1000, but I need my program to be 3 digits. So 001, 002, 003,...,999. How can I do this?


double test = 1029 / 9.8; // = 104.99999...     int inttest1 = (int) test; // 104     int inttest2 = (int)Math.floor(test); // 104     double testtt = 9.8 * 105; // 1029.0   1029 / 9.8 equals 105  but Java returns 104.9999...  More serious problem is integer casing result is 104, not 105  Why this happens and how can I avoid this result?


if $A\times B = A$, is $B ={} $Identity matrix?

Let $A, B ∈ M_{n×n}$ If   $A\cdot B = A  $, then $B$ is the identity matrix. I can't find a theorem that proves this statement. Could it be false? Edit: A is NOT the zero matrix.


Finding the radius of convergence for $\sum_{n=0}^{\infty} \frac{(n!)^kx^n}{(kn)!}$

I'm reviewing some calculus concepts right now, and this series stumped me. I'm trying to figure out what its radius of convergence is, but it's not falling for any of my old tricks. Using the root-test, I want to compute: $$ L_1=\lim_{n\rightarrow\infty} \left|\sqrt[n]{\frac{(n!)^k}{(kn)!}}\right| $$  where $k$ is some positive integer. Passing the limit through the absolute-value bars and $n$th root symbol, I now want to compute the simpler (?) $$ L_2 = \lim_{n\rightarrow\infty} \sqrt[n]{\frac{(n!)^k}{(kn)!}}$$  Which I can't seem to pin down. Numerical tests indicate it goes to 0, and that jives with an intuitive notion I have that there are always $k$ terms on the numerator, but $kn$ terms in the denominator. But since all of these terms themselves depend on $n$, proving that $L_2 = 0$ escapes me. Once we get this result (if it's correct), then clearly $L_1$ is also 0, and the radius of convergence of the series is $\mathbb{R}$. Thanks for any ideas you may have.


How can I best take portraits in strong sunlight, without a flash or reflector?

When on the road as a tourist, I often do not carry a reflector of flash. Now I am at a location with very strong sunlight and I want to take a photo of a companion in front of a nice scenery or building, the classic "we have been here" photo.  With very strong sunlight however, specially at a slight angle, I either get it into the person's eyes and they squint like crazy, or they are in the shade and their whole face is black.  Please note that I do not have aspirations to take a professional photo in such circumstances, but at least something acceptable.  Is there an easy trick to deal with that?


How do I set up No-IP as a proper service?

There is an example service shell script in the download, but it seems limited and relies on killproc which doesn't exist by default on Ubuntu 16 LTS.


How do i add a standard account to sudoers file, or give that standard account root privileges?

I am new and i wonder how am i supposed to run some commands in my standard account (since i don't want to harm system files) that needs root privileges.  i have used sudo and it prompted me to enter the current user's password which is not root, guide me to a way to to it safe.


I have this table:   ID     Value           -----------------       3       A1                       4       A2                       8       A20                    10      A10     I have to create only two rows with the name of the columns at the beginning, I think using the pivot, but I don't know how to do it:   ID        3    4    8    10    -----------------------------------      Value     A1   A2  A20   A10


Let define $f:\mathbb{R}\rightarrow\mathbb{R}$ as $f(x)=3^x+4^x-5^x$.  Prove that there exists only one $x_0$ such as $f(x_0)=0$.  My approach:  We can see that $\lim_{x\rightarrow-\infty}f(x)=0$ and $f(2)=0$. I don't know how to use the derivatives of $f$ to prove that it is firstly increasing and then decreasing for $x\in(-\infty,2)$ and for $x\in(2,\infty)$ it is only decreasing.


A coworker replied to an earlier email from me with some very good news. I wanted to thank him for his help. I was hoping to start with     Thank you, Jim. That is wonderful news...      OR is it     Thank you Jim. That is wonderful news...   Do I place the comma after the "Thank you"?


The determinant of matrix product follows the following property unlike it's sum. $$     \det (AB) = \det A\det B $$ Why is this true? What's the easiest proof?


Installation not giving option to install along side Windows 8?

I'm trying to install (from DVD) Ubuntu 14.04 LTS on my desktop computer along side Windows 8.1.  I am never given the option to do so.  I never get this screen:


Effect of elementary row operations on determinant?

1) Switching two rows or columns causes the determinant to switch sign  2) Adding a multiple of one row to another causes the determinant to remain the same  3) Multiplying a row as a constant results in the determinant scaling by that constant.  Using the geometric definition of the determinant as the area spanned by the columns of the matrix, could someone give me a geometric interpretation of the above theorems? Thanks.


Godzilla is always referred to as male and referenced with "he" or "him."  Do we know, for sure, if Godzilla is a male? Has beast gender ever been a factor within any kaiju movies?


Why is sed failing when using two variables?

sed fails with the following error:  sed: -e expression #1, char 72: unterminated `s' command   Here is my script:  #!/bin/bash OLD="$(cat /etc/fstab | grep /tmp)" NEW="$(cat /etc/fstab | grep /tmp | sed 's/,noexec//')" sed "s|$OLD|$NEW|" /etc/fstab   I don't see how it is unterminated, I have 3 | symbols as delimiters and am using double quotes since I have variables in the statement.  I have read many other questions on stack overflow and other blogs that are similar, but none that were using two variables like this.  Edit to show fstab:  LABEL=/boot    /boot    xfs    defaults,nodev,nosuid,noexec    1    2 /dev/mapper/LV_tmp    /tmp    xfs    nodev,noexec    1    2 proc    /proc    proc    defaults    0    0


I'm fairly new to Java and am trying to create a text game, involving escaping. Here is my code:  import java.util.Scanner; import java.util.concurrent.TimeUnit; public class Adventure {     public static void main (String args[]) throws InterruptedException{         System.out.println("YOU WAKE ON YOUR COUCH. YOU NEED TO GET OUT OF YOUR HOUSE.");         int x = 1;         while (x == 1){              Scanner ACTION = new Scanner(System.in);             System.out.println("WHAT DO YOU DO NEXT?");             String action;             action = ACTION.next();              if (action == "a"){                 System.out.println("if");             }else{                 System.out.println("else");             }         }     } }   Try running and see that the if does not work, if you enter 'a', it prints 'else'. Please explain each new line of code (if any) in your answer. Thank you.


Suppose $f$ is analytic on $\mathbb{D}_r$, where $\mathbb{D}_r$ is a disk with radius $r$. Also $\operatorname{Im}f(z)\geq 0$ for $\operatorname{Im} z\geq 0$, and $\operatorname{Im}f(z)\leq 0$ for $\operatorname{Im}z\leq 0$  Then f'(x)>0 for $x\in (-r, r)$. ---> I proved $f'(x)\geq 0$ for $x\in (-r, r)$, so it remains to show $f'(x)\neq 0$. Edit: here we assume $f$ is non-constant.  Now suppose $g:\mathbb{D}_r\setminus\{0\}\rightarrow\mathbb{C}$ is analytic. Also Also $\operatorname{Im}g(z)\geq 0$ for $\operatorname{Im} z\geq 0$, and $\operatorname{Im}g(z)\leq 0$ for $\operatorname{Im}z\leq 0$.  Then $g$ is meromorphic at $0$.---> Thus we need to show $0$ has a neighborhood such that either $g$ or $1/g$ is holomorphic in it. From part $1$ we know that $g'(x)>0$ for $(-r, 0)\cup (0,r)$. But the domain of $g$ is $\mathbb{D}_r\setminus\{0\}$, can we somehow extend it to $(-r, r)$? If $g$ has a pole at $0$, then the pole is simple (order $1$), and $\operatorname{Res}(g,0)<0$. ---> For this I don't have much idea.


If $A$ is a symmetric positive-definite matrix then $U = V$ in the SVD

What I have: $A \in \mathbb{R}^{n \times n}$ is a symmetric positive-definite matrix and has Singular Value Decomposition $A = U\Sigma V^T$.  What I want: prove that $U = V$.  Also... does $A$ has to be positive-definite for this to be true?  Edit: There is the exactly same question , but none of the answers there satisfy my doubts. I'm talking in comments with people here and there. If I come up with a detailed enough answer I might write it there. But I suggest also reading the comments on my question here, they are helpful.


How to installed ubuntu 12.04 lts alongside windows 7?

. I am using windows 7 64 bit and want to install Ubuntu 12.04 LTS alongside windows 7   Please tell me how I can do that.


conditional regex case match for email in python 3

I have a list of email addresses:  emails = ['email@google.com', 'email@happytown.aau.edu', 'fox.trot@nickle.com.uk']   I was using:  re.findall(r'\w+@\w+\.\w+', emails)   But I'm not sure how to account for the extended TLD's. How would I make this a conditional match so that we match all email addresses regardless of the ending?


Access Variables from public static void main(String[] args)

i started learning Java some days ago. I have some experience with C++ and this is why I'm used to pointers, which would make this much easier.  so now my question.   Let's say I have the following Code:  public class Main {      public static void main(String[] args) {          int variable1=2, variable2=2;          input(variable1, variable2);          System.out.println(variable1 + " " + variable2);              // this should output "1 3" on the console       }      private static void input(int variable1, int variable2) {          System.out.println(variable1 + " " + variable2);              // this will output "2 2" on the console          variable1 = 1;         variable2 = 3;     }    }   So the function input() takes the Variables from main and outputs them (correctly). But how can I transfer the changed Variables back to the main function?


Intalled Ubuntu alongside Win 8.1 and it goes only to Ubuntu

I installed Ubuntu 12.04LTS without turning off Fast Startup in Windows 8.1 as I was unaware that this needed to be done. I've installed Ubuntu many times before, but this was my first time with windows 8.1, and unfortunately I didn't look up anything before I did it. I resized the partition and installed Ubuntu successfully and upon reboot, it went directly to Ubuntu without grub showing up. Is there anything I can do as the windows partition is my primary one and there is software that I need access to on it.


404 Not Found for do-release-upgrade in Ubuntu

I'm using Ubuntu 15, and I'm trying to get Ubuntu 16. I was getting some 404 errors with sudo apt-get update, so I already looked into threads such as these     I resolved the errors by editing the /etc/apt/sources.list file so it looks like  ###### Ubuntu Main Repos deb-src http://old-releases.ubuntu.com/ubuntu/ wily main restricted universe multiverse   ###### Ubuntu Update Repos deb http://old-releases.ubuntu.com/ubuntu/ wily-security main restricted universe multiverse  deb http://old-releases.ubuntu.com/ubuntu/ wily-updates main restricted universe multiverse  deb-src http://old-releases.ubuntu.com/ubuntu/ wily-security main restricted universe multiverse  deb-src http://old-releases.ubuntu.com/ubuntu/ wily-updates main restricted universe multiverse   ###### Ubuntu Partner Repo deb http://archive.canonical.com/ubuntu wily partner deb-src http://archive.canonical.com/ubuntu wily partner  ###### Ubuntu Extras Repo #deb http://extras.ubuntu.com/ubuntu wily main #deb-src http://extras.ubuntu.com/ubuntu wily main   However, when I try sudo do-release-upgrade, I get 404 errors such as   ... Err http://old-releases.ubuntu.com wily-updates/restricted i386 Packages          404  Not Found                                                                Err http://old-releases.ubuntu.com wily-updates/universe i386     Packages            404  Not Found                                                                Err http://old-releases.ubuntu.com wily-updates/multiverse i386 Packages          404  Not Found   ...  Error authenticating some packages   It was not possible to authenticate some packages. This may be a transient network problem. You may want to try again later. See below  for a list of unauthenticated packages.   apt-xapian-index  libboost-graph-parallel1.58.0  libboost-mpi-python1.58.0  libboost-mpi1.58.0  virtualbox  virtualbox-qt   how do I fix this?


Choosing FQDN for Internal Use (avoiding split DNS)

I've been looking everywhere for a definative answer to this. We are recreating our interal Windows domain and trying to come up with a FQDN for our TLD.  Currently we are using "company.co.uk" internally. We own this domain and also use it for our public website. This causes all sorts of DNS issues internally and by creating a new domain we were hoping to avoid all that micromanagment.  We want something like "company.local", however this would conflict with Bonjour.  Would using something like "local.company.co.uk" or "ad.company.co.uk" still present us with DNS issues? We want to avoid split DNS.  Thanks


Can collinearity of variables impact Principal Components

I am trying to understand how to quantify the relationship between variables and their principal components, e.g. PC1, and that lead me to consider the information contained in the loadings of each variable for PC1.  If the variables are normalized prior to running the PCA, it seems fair to me (am I wrong?) to assume that the loading of a variable is at least somewhat representative of the strength of the relationship between said variable and PC1.  But my next question is, how does collinearity of variables impact their loadings? If I recall correctly, in a linear model, if two variables are collinear, then any linear combination of the two in the model would result in pretty much the same thing, as long as the coefficients are only "shifted" between the two variables. Can the same happen for the principal components?  EDIT: It seems this  is pretty similar, but more details are always welcome


How can I overlay a rainbow gradient over a photographic image in Photoshop?

How can I make this color effect in Photoshop? Is it a gradient?


When should I use GC.SuppressFinalize()?

In .NET, under which circumstances should I use GC.SuppressFinalize()?  What advantage(s) does using this method give me?


prove that a connected graph with $n$ vertices has at least $n-1$ edges

Show that every connected graph with $n$ vertices has at least $n − 1$ edges.  How can I prove this?  Conceptually, I understand that the following graph has 3 vertices, and two edges:  a-----b-----c  with $a$, $b$ and $c$ being vertices, and $\{a,b\}$, $\{b,c\}$ being edges.  Is there some way to prove this logically?  --UPDATE--  Does this look correct?  Any advice on how to improve this proof would be appreciated.  Thank you.


CentOS: List the installed RPMs by date of installation/update?

I'm on a CentOS machine. I updated and installed some packages a few weeks back, but I don't remember the name of every package or the names of every dependency. I used yum.  Can I list the packages on my system by the date they were last installed or updated?


How do I apply partial borders around symbols?

I'm working on a project that requires me to write partial borders around individual symbols, like this:  I haven't been able to find any conclusive answers to how to do it, so I figured I'd ask.


ConcurrentModificationException on iterating over ArrayList( see the results while iterating)

(I believe this is not a duplicate question!!).  I am trying to iterate over a arrayList, do some manipulation and add elements to the same arrayList inside the for each loop.  I want to see the results while iterating.  I am ending up with ConcurrentModification Exception.           for(String ex55 : firstListOfOptions)     {         Criteria crteria4 = session.createCriteria(Delays.class)                 .add(Restrictions.eq("programName", ex55));          List<Delays> delaysList = crteria4.list();          for(Delays dlys : delaysList)         {             if(!dlys.getProgramCalls().contentEquals(" "))             {             System.out.println(dlys.getProgramCalls());             String[] resultSet = dlys.getProgramCalls().split(",");             for(String rs : resultSet)             {                 firstListOfOptions.add(rs);             }             }         }       }   How do I avoid this issue. Many thanks!


How does blackholes become supermassive?

I am not an expert in this field. I have seen documentaries on the Universe and have a basic idea of how black holes come to existence. When black holes form from supernovae they have a initial mass which is a factor of the progenitor's mass. My question is how do they evolve to the million/billion solar mass monsters lurking in galaxies?   In the same vein how do we explain the supermassive black holes in very old galaxies formed immediately after the big bang? Did they form immediately after the big-bang?


How to update an EOL Ubuntu distribution

I know that Ubuntu 11.10 has reached EOL status.  But is there a way to have it updated up until the EOL date of 5/9/2013?  I have looked at this , and it talks about how to get it done, but when I go to old releases, 11.10 is not listed.    So is the fact that it just got EOL status it needs a little time to move there or is there another way to have that update done?  The system is too old to have anything above 11.10.


Converse of Schur's Lemma in finite dimensional vector spaces

I am trying to prove (or disprove) the converse of Schur's Lemma in finite dimensional vector spaces. I am not sure if it holds in this case, but I have tried to apply the idea that proves it in representation theory (see for example Theorem 4.3  that uses Maschke's theorem or in questions  and ).  The converse of Schur's Lemma in finite dimensional vector spaces is:     Let $V$ be a finite dimensional vector space over the complex numbers. Let $S$ be a set of endomorphisms of $V$ and assume that every endomorphism $A$ of $V$ such that $$AB=BA\text{ for all }B\in S$$ is of the form $\lambda I, \ \lambda\in\mathbb{C}$. Then $V$ is a simple $S$-space.   (*an endomorphism of $V$ is a linear operator from $V$ to $V$  *$V$ is a simple $S$-space if the only $S$-invariant subspaces of $V$ are $V$ itself and the zero subspace)  What I've tried so far:  Assume to the contrary that $V$ is not a simple $S-$space. Then, there exists a subspace $W$ of $V$ such that $W\not =\{0\}$, $W\not= V$ and $W$ is $S$-invariant. Let $W'=V\setminus W$. Then, since $V$ is finite, we can easily prove that $V=W\oplus W'$ (this is my attempt to translate Maschke's theorem in vector spaces). Consequently, for every $v\in V$, there exists unique $w\in W$ and $w'\in W'$, such that $v=w+w'$. Define the projection $P:V\rightarrow V$ by $Pv=w$ for every $v\in V$.   What is left to prove is that $PB=BP$ for all $B\in S$. Then $P$ is clearly not a scalar and thus we have the contradiction we are looking for.  There is a difficulty in showing that $PB=BP$ for all $B\in S$, because $W'$ might be $S$-invariant or not. More precisely:   Let $v\in V=W\oplus W'$ and $v\not =0_V$.  If $v\in W$ then $Bv\in W$ because $W$ is $S$-invariant, therefore: $PBv=Bv$ and $BPv=Bv$.  If $v\in W'$ then $Pv=0$, hence $BPv=B\cdot 0=0$, and  (i) if $Bv\in W'$ then $PBv=0$.  (ii) if $Bv\in W$ then $PBv=Bv$ and this is where the problem occurs.  Any hints, ideas or counterexamples would be very helpful.


$(3x-1)^7=a_7x^7+a_6x^6+a_5x^5+...+a_1x+a_0$  Now it is required to find the value of $a_7+a_6+a_5+...+a_1+a_0$  Please give me some hints to solve this problem.Thanks a lot in advance.


Add class to an element and then use it as Trigger

This is my first question on stackoverflow and I hope my problem description is enough precise. I would like to add a class to some elements and then use those elements to trigger. But the following code (just an example) doesn't work. In the inspector I can see the class, but there is no reaction on click. Is there an easy solution?       $(".T").click(function(){     $(this).addClass("current"); });  $(".current").click(function(){     $("#Deko").hide(); });


I want to insert a record into the data-base, I don't know where's the probolem  this is my code !    <?php  if ($_SERVER['REQUEST_METHOD'] === 'POST') {     $status = "";     $name = $_POST['name'];     $username = $_POST['username'];     $email = $_POST['email'];     $password = $_POST[$password];      $query = "INSERT INTO admins (name, email, username, password) ";      $query .= "VALUES ('{$name}','{$email}','{$username}','{$password}')";      $result = mysqli_query($connect , $query);      if (isset($result)){         $status = "Admin has been added";     }else {         $status = "Admin hasn't been added ";     } } ?>  <form action="add_user.php" method="post">
Name
     <input name="name" placeholder="Name">
Username
     <input name="username" placeholder="Username">
E-mail
     <input name="email" placeholder="E-mail">
Password
     <input name="password" placeholder="Password" id="password" type="password">
Confirm Password
     <input name="confirm_pass" placeholder="Confirm Password" id="confirm_password" type="password" onkeydown="ValidatePass()">

         <input type="submit" value="Create User dis" disabled>

<?php ?>
 </form>     I know that there night be sqlInjections !  don't worry about that that's only for local development and learning purposes:D    please Help !


Can anyone help me identifying this font?

I have been looking for a long time over the internet (and yes I have stumbled here many times) the font or typeface used for example, on the book Physics for Scientists and Engineers, Serway and Jewett,  among many others. I guess this book might have been written in LaTeX, XeTeX, etc. or not. I normally use LaTeX to write my own documents and I have never used any other, so I don't really know if that kind of document may have been typed on another language or software that I am not aware of. I post here an image as an example of the use of the font. I have been looking and I think the font itself resembles to Baskerville but I specially like the math typing and greek letters.    I hope you could help me identify the font and how to get it, and if it's not possible to do in LaTeX how could I create something like this I don't really know if there are other possibilites to type math and do stuff like LaTeX or variants do.   Thank you in advance!


Confusion about deleting parts of an graphic with pathfinder

I'm trying to create a rubber stamp effect on a logo and am following  that has me use a combination of Live Trace and Pathfinder to accomplish the effect.  Here's my interpretation of what the author is suggesting:   Live Trace on a complicated texture (e.g. zoom in picture of stone or concrete);  delete the white space from result;  copy my logo behind this layer;  make sure my logo is selected; Pathfinder -> Subtract.   The result is various objects (e.g. the letter "T") gets deleted, and those deletes do not align with the Live Traced texture.  My logo has a layer that has several different objects within it (e.g. text object, some lines, etc.).   I suspect (based on my very limited understanding of Illustrator) that I need to combine all the objects/layers of my logo into one object. I could be completely wrong though, and can't figure out how to do this combining in the first place.   Regarding this subgoal, perhaps it's worth noting that if I resize this group of objects I call my logo, the stroke size remains unchanged. I'd prefer these to scale w/ my resizing.  So, 1) how can I convert my logo so that it behaves as if I converted it to a PDF and then imported it?   and 2) For the rubber stamp tutorial, if I'm wrong about this missing step of merging my logo's objects, is there some other step that I'm missing?


Why .Net DateTime properties cannot be assigned to? It would be useful to be able to do things like:  DateTime saveNow = DateTime.Now; saveNow.Second = 0; //Error, it does not compile


Show that $\forall (x,y)$ in the first quadrant: $\frac {x^2+y^2}{4}\leq e^{x+y-2}$

I have the folowing exercise (which I've been thinking quite a while and couldn't figure out):  Show that $\forall (x,y)$ in the first quadrant: $$\frac {x^2+y^2}{4}\leq e^{x+y-2}$$  My idea was to work with maxima and minima, but I'm stuck... Any help will be much appreciated!


Java nullpointerException when initializing an arraylist

I tried to build the node object with a arraylist element for adding child node, and initialized successfully. However when i tried to add nodes into the arraylist the exception happened. How to solve the problem?  public class nodes{  int value=-2;  boolean root=false;  nodes parent;  ArrayList<nodes>Children;  public nodes(int value,ArrayList Children) {      this.value=value;      this.Children=Children;  }  public void setParent(nodes parent) {      this.parent=parent;  }  public void Add(nodes child) {     this.Children.add(child);  }    }     public class TreeHeight {                  int n;         int parent[];                  nodes Nodes[];         void read() throws IOException {             FastScanner in = new FastScanner();             n = in.nextInt();             ArrayList[]Children=new ArrayList[n];             parent = new int[n];//parent is an array that contains all elements                                   Nodes=new nodes [n];             for (int i = 0; i < n; i++) {                 //parent[i]= ;                 //index[i]=i;                 Nodes[i]=new nodes(in.nextInt(),Children[i]);                                           }             //Nodes[0].Add(Nodes[1]);             for (int vertex = 0; vertex < n; vertex++) {                 if(Nodes[vertex].value==-1) {Nodes[vertex].root=true;                 } for(int j=0;j<n;j++) {     if(Nodes[j].value==vertex) {         Nodes[j].setParent(Nodes[vertex]);         Nodes[vertex].Add(Nodes[j]);      } }                 }         }


Retrieving subset of log using regex.... how to approach?

I am very much new to regex and I need to create one to parse logs into a shorter subset of that log message.   For instance, I have the log:  System trap received SystemString=Mon Jan 07 15:36:07 2017. System 1464333684: Type: Timing Quality le-5 System, Class: Timing, Level: None, Action: Clear System, Flags: 0x15   And I would like to parse and retrieve from it:   Timing Quality le-5 System, Class: Timing   At first this looked really trivial to me, but after watching many tutorials on regex... I am confused on how to approach such a task. Where do I begin?   Thanks in advance.


HELP: I Broke Ubuntu By Uninstalling Compiz

I'm still getting used to Linux, having come from Windows.  I was receiving an error that "compiz" had crashed a few times so I figured I'd uninstall it.  sudo apt-get remove compiz sudo apt-get install compiz   I logged out then back in, after that, the GUI was totally gone and I have no idea how to get it back or what I need to do to restore the GUI to what it was before I killed poor Compiz.  GUI was pretty much unmodified after a fresh install of 14.04  How can I fix it? I'm not even sure how to get to a terminal or anything. The login screen looks normal, but after logging in, it's a totally bare desktop with my backround and a few icons.  No Dash, toolbar, etc.  Hot Keys don't seem to work either (Super = Dash doesn't work, etc); although I did accidently open "Disk" UI.  Not sure how.  Please Help! Right now I'm working off my W7 dualboot.


What did Professor McGonagall know about the Order of the Phoenix?

McGonagall was a trusted ally of Dumbledore in the cause against Voldemort. With this in mind, did she know about the plans and actions of the Order of the Phoenix?  And did she know about      Snape’s role as a double agent?


How to solve the error "Failed to launch Terminal" after upgrading python?

How to solve the error "failed to launch Terminal" failed to execute child process￼ GNOME-Terminal ( No such file or directory ) ? Please HELP us to solve this error. Currently I have upgraded Python to 3.7 version.   I have tried opening by clicking Alt+F2 and entered "gnome-terminal" but that too failed.  I tried "sudo apt-get purge gnome-terminal" in a shell opened on clicking "Ctrl + Alt + F3" keys which removed my terminal from the system   And then ran "sudo apt-get install gnome-terminal", I got terminal back but with the same error.


How do you calculate precision and recall for multiclass classification using confusion matrix?

I wonder how to compute precision and recall using a confusion matrix for a multi-class classification problem. Specifically, an observation can only be assigned to its most probable class / label. I would like to compute:    Precision = TP / (TP+FP)   Recall = TP / (TP+FN)   for each class, and then compute the micro-averaged F-measure.


The grammaticality of "that don't impress me much"

I'd like to know how the sentence "That don't impress me much" sounds to a native English speaker.  The phrase is the title of a song by Shania Twain, and to my eyes it contains a clear error. It is obviously intended, and I want to know what was the effect that the author wanted to obtain.  Other examples that come to mind:   “She's got a ticket to ride, but she don't care” — The Beatles “My love don't cost a thing” — Jennifer Lopez “It don't matter” — Akon “She don't care about me” — heard in the Lost series “It Don't Mean a Thing” — a jazz album title “The Sun Don't Lie” — another album title


Which chapter in the Bleach manga corresponds to the last episode in the anime?

I watched the Bleach anime first, and I heard that the continuation is only in the manga. So if it's possible, I'd like to know which chapter corresponds to the end of the anime to start reading. I don't want to dig through and reread the chapters which overlap with the anime.


how to archive file older then 5 days with 7z command

REM Exclude file types for archiving REM set EXCLUDE_FILES_TYPES=-x!*.rar -x!*.zip -x!*.7z set EXCLUDE_FILES_TYPES=-xr!*.zip   REM Delete files after archiving set DELETE_AFTER_ARCHIVE=-sdel  REM Archive files only older then days REM set ARCHIVE_FILE_OLDER_THEN=-to5d set ARCHIVE_FILE_OLDER_THEN=-5  set EXTRA_PARAM=%EXCLUDE_FILES_TYPES% %DELETE_AFTER_ARCHIVE% %ARCHIVE_FILE_OLDER_THEN%   REM ------------------------------------------------------------------------------------   REM Path to WinRAR executable in Program Files set path="C:\Program Files\7-Zip";%path% REM $Env:Path = $Env:Path + ";C:\Program Files\7-Zip"  REM Set your WinRAR installation path for local testing REM set path="C:\Program Files\7-Zip";%path%   REM Replace space in hour with zero if it's less than 10 SET hr=%time:~0,2% IF %hr% lss 10 SET hr=0%hr:~1,1%  REM This sets the date like this: mm-dd-yr-hrminsecs1/100secs Set TODAY=%date:~4,2%-%date:~7,2%-%date:~10,4%-%hr%%time:~3,2%%time:~6,2%%time:~9,2%   IF EXIST %EDI832_US_ARCHIVE_DIR% (     cd %EDI832_US_ARCHIVE_DIR%     7z a "%EDI832_US_FILE%_%TODAY%" %EXTRA_PARAM%


.net native writing to file vs any logging framework

are there any benefit of using log4net (or any other logging framework) vs just writing to file with native .net  until now I used my utility class to write to file because I didn't know that such frameworks exits so basically my question is there a point to ditch my class(which works fine for me) and convert to some logging framework my class  class FileUtils {      string mPath;     private static object locker = new Object();      public void createNewLogFile(string path)     {         try         {             lock (locker)             {                 mPath = path;                 string backUpPath = path + @".bak";                 FileInfo MyFile = new FileInfo(path);                   Directory.CreateDirectory(Path.GetDirectoryName(path));                  if (File.Exists(path))                 {                     if (new FileInfo(path).Length > Math.Pow(2, 20))                     {                         if (File.Exists(backUpPath))                         {                              File.Delete(backUpPath);                         }                         File.Copy(path, backUpPath);                      }                 }              }           }         catch (Exception ex)         {         //    outputFile.Close();             var t = ex;             throw;          }     }        public void log (string fileLocation ,bool newLine, params  string[] input)     {         createNewLogFile(fileLocation);         using (StreamWriter outputFile = File.AppendText(mPath))         {             outputFile.AutoFlush = true;              try             {                 if (newLine)                     outputFile.Write(Environment.NewLine + DateTime.Now.ToString("dd-MM-yy HH:mm:ss "));                   for (int i = 0; i < input.Length; i++)                 {                      outputFile.Write(input[i] + "  ");                                         }               }             catch (Exception ex)             {                 throw new Exception(ex.Message);             }             finally             {                 outputFile.Close();             }         }       }  }


Travel to Ireland on a Standard Visitor Visa for business meeting/conference

Can I travel to Ireland on a UK Standard Visitor visa on Indian passport for the purpose of attending a conference?


With "reject_sender_login_mismatch" I can no longer send email

I've added "reject_sender_login_mismatch" to "smtpd_sender_restrictions" as was suggested to me. Now I get this when sending an email:      <my_email@my_domain.com>: Sender address rejected: not owned by user my_email@my_domain.com   The logs of postfix:    localhost postfix/submission/smtpd[26211]: connect from unknown[11.22.33.44]   localhost postfix/submission/smtpd[26211]: NOQUEUE: reject: RCPT from unknown[11.22.33.44]: 553 5.7.1 <my_email@my_domain.com>: Sender address rejected: not owned by user my_email@my_domain.com; from=<my_email@my_domain.com> to=<some_external_email@gmail.com> proto=ESMTP helo=<[66.77.88.99]>   localhost postfix/submission/smtpd[26211]: disconnect from unknown[11.22.33.44] ehlo=2 starttls=1 auth=1 mail=1 rcpt=0/1 quit=1 commands=6/7   Note that all does work when I comment out "reject_sender_login_mismatch"  Why doesn't it work with it? How to fix this?  Here's a part of my postfix config:    virtual_mailbox_maps = pgsql:/etc/postfix/virtual_mailbox_maps.cf   smtpd_sender_login_maps = pgsql:/etc/postfix/virtual_mailbox_maps.cf   In the logs I also have this:    localhost postfix[26246]: /usr/bin/postconf: warning: /etc/postfix/main.cf: unused parameter: smtp_sender_login_maps=pgsql:/etc/postfix/virtual_mailbox_maps.cf   Also note that my IP is'nt static because I carry my laptop with me everywhere.


Set and read data in session between anonymous and authenticated user

On my Drupal 8 site, when an anonymous user "A" visit this link: https://www.example.com/page-1?data=12345678, I want to store the data value in a session and save it later to the user account under field_user_data when this same user "A" login/signup to the site.  Note: The query data will be unique for every single user and will not be used twice ever.  I thought the best way to go is by using the data value in a session and use it later when the same anonymous user becomes authenticated on the site.  So on site load and when user "A" is using the site as anonymous, I am saving the data value in a session using:  // Get query values from url. $request_query = Request::createFromGlobals(); $data = $request_query->query->get('data');  // Save the "$data" in a session variable. $tempstore = \Drupal::service('user.private_tempstore')->get('my_module'); $tempstore->set('data', $data);   and later, in another php file but within the same module, when the anonymous user "A" authenticate to the site, I am saving the session value to his user account as shown below:  // Get 'data' Session value $tempstore = \Drupal::service('user.private_tempstore')->get('my_module'); $data = $tempstore->get('data');  // Set 'data' value to user account. $authenticated_user->set('field_user_data', $data);  // Save $authenticated_user->save();   The problem is $data session is shared between all users and not being unique per user while $data value must be unique for every single user.  What is wrong with my code ? Using cookies will be a better approach for my use case ?  Update #1:  Using above code to store sessions or using the method provided here , both are working as expected but in only one case (For authenticated users)  When an authenticated user visit https://www.example.com/page-1?data=12345678 (where 12345678 will be unique per user), both above methods are working as expected and the value 12345678 is indeed saved to the authenticated user account under field_user_data field.  However, when User "A" visit https://www.example.com/page-1?data=12345678 as anonymous user and then later decided to login/signup, both above methods are not working for me!  Note: For now I am using cookies by using setcookie('data', $data, 0, '/'); and $data = $request->cookies->get('data'); and it is working for both anonymous & authenticated users.  But I would really prefer to get it done using sessions !


Planet where humans fight for access to algae

Set out on another planet where a human spaceship lands for a research and they observer a huge mass moving below them. On closer look this mass appears to be humans, and the density of the population increases towards the sea. The reason for this is algae,the only nutrition found on the planet. On a beach they discover tall, huge humans (developed due to the natural selection), controlling the best access to the algae. Eventually the researchers die, because humans eat them.


How to write to a NTFS partitioned drive from a Mac?

Looking for a good (preferably free) driver or way to enable read and write access to an NTFS hard drive from OS X 10.9.


Convert or open Oracle 7.3.x database in Oracle 11

I have a very old Oracle 7.x database that I need to open or convert to a new Oracle 11g. Here's the content of the old database:  control01.ctl control02.ctl control03.ctl findata01.ora finind01.ora gstdata01.ora rbs01.dbf system01.dbf system02.dbf system03.dbf temp01.dbf temp02.dbf tools01.dbf users.dbf  Note: the .ora files are binary (spfile). When mounting the old database the following error appears: ORA-00205: error in identifying control file  Ok, first I've tried to create a pfile from spfile:  create pfile='c:\ora\pfile.ora' from spfile='c:\ora...\findata01.ora'  I get "File created" but the pfile is empty.  I've tried to change the control files to:  alter system set control_files='c:\ora...\control01.ctl,c:\ora...\control02.ctl,c:\ora...\control03.ctl' scope=spfile;  But then I get the error message:  ORA-32001: write to SPFILE requested but no SPFILE is in use  Anyone know what else to try? I'm running out of ideas.  Maybe the database format has changed and it's not possible to open a 7.x database from inside 11.x? Or maybe there's a third-party tool to convert the database format?  Thanks in advance!


Combination proof for $n(n+1)2^{n-2}=\sum_{k=1}^{n}k^2\binom{n}{k}$

How can I show that   let $n$ and $k$ be integers.  $n(n+1)2^{n-2}=\sum_{k=1}^{n}k^2\dbinom{n}{k}$  It seems a bit confusing to me on the left hand side. You have a set of $n$ people on a team and you keep picking $k$ people who will play a match and you pick before that a captain $k^2$.


I would like to know if it's possible to load only 1 web page when Linux logs on with an automatic user. This server will be used only to display information, no interaction is required and even if the end user wants to interact with the X window / Window Manager (opening another window, running other apps, switching users, switching to Virtual consoles), he'll not be able to do (the Window manager will not let him).  I don't have in mind a specific Linux distribution or window manager, but more looking to see first if it's possible or not.  I looked on the Internet (Window managers, X window, embedded Linux), but I didn't find anything useful for my case  Don't hesitate to contact me if you need more clarification regarding my need.


I have conflict data from ACLED. The data is in CSV format. Given the nature of the data (image attached), when I am selecting the CSV option while importing the file in QGIS via "open data manager", "X" and "Y" fields do not appear as longitude and latitude respectively. The heading of the first column in the CSV file rather appears in the "X" and "Y" fields. However, if I select the option Custom delimiters and then semicolon (I deselect the option tab), then the problem gets sorted out. "X" field is then longitude and "Y" is latitude . Am I doing the right thing? I want to avoid problems appearing later.


I want to show that $\text {rank} ( AB)\le \min(\text{rank} B, \text{rank} A) $ and when the equality occurs? Please help me with this problem by giving hints, solving, or suggesting a book. Thanks


Should "rather" be used in this context?

Translating from german, the word "rather" (as replacement for "ziemlich") sounds kind of wrong to me, but I would like to check with an example: "Rather innovative", shouldn't it be "Quite innovative" or "Fairly innovative" instead? The context here is a basic rating (in english), with 4 values (imagine a dropdown):  "Not innovative" "Somewhat innovative" "(Rather) innovative" "Very innovative"  "The project is rather innovative" The word "rather" is also used in other 4-tier choices like that. It has been translated by a colleague and just sounded wrong to me, but I wanted to double check since neither of us is a native english speaker. Translation software offers "rather" as a possibility. What is the most naturally sounding choice here? Is "rather" the right word, or would another word be a better fit?


6 Volt Futaba Servo controlled by a 5V Arduino

I've been able to hook up a Futaba S3003 servo directly to my Arduino and it works perfectly. However, when I power it with an external 6 volt DC power supply (instead of the Arduino's onboard 5V) it fails to work.  I'm assuming I need to translate the 5v "language" of the Arduino to the 6v "language" that the servo now uses. Pretty new to this. Any and all help is greatly appreciated.  EDIT: My question, generalized, is how do I use an external power supply, that's more than 5V, with a servo and control it with an Arduino?  Here's a photo of how it's setup (and working).


How to uninstall software installed via Terminal?

I installed software using the sudo apt-get install [program name] command in the Terminal.  How should I go about uninstalling said program via. Terminal?  What should I specifically type in the Terminal?   The program does not appear in the Installed tab of Software Center It exists in the Software Center, but according to Center it hasn't been installed The program operates fine though when installed using above command


How to build a PPA from a git repository?

How can we build a PPA from a git repo? For example say that I have an icon theme hosted in Git. How can I add it to a PPA? (Note : I don't know much about Launchpad and PPAs)


I found this in . I've paraphrased for clarity.  There are 100 professors. Some are honest, while others are dishonest. There are more honest professors than dishonest ones. Honest professors always tell the truth, but the dishonest ones sometimes tell the truth and sometimes lie. You can ask any professor the following question about any other professor, "Professor Y, is Professor X honest?" to which he/she will answer yes or no. Design an algorithm that allows you to figure out which of the professors are honest with no more than 198 questions.  The bold part is the kicker. If liars always lied, then the problem is trivial - just ask 99 people about one guy. The majority would be the truthful answer, so you know your honest guys and your liars.  So, any advice? If you give the answer please put it in spoiler tags since I'm just looking for direction.


How can I fix a Canon lens with sand in the aperture diaphragm?

I have a 17-85mm Canon lens which I was using at the beach the other day. A sudden hard blow of wind caused sand to be thrown on me and my camera. Afterwards, the camera would give the Error 01 code related to faulty camera communication. I figured out this would always happen if I used a smaller aperture than the widest one possible. So my conclusion is: the diaphragm is stuck due to sand intrusion and only works when no closure is required. I already bought a new one but would like to try and fix the old one as a backup. Does someone have a guide or experience which can be of help here?  Update  Actually my "new" lens also has an issue (it not actually brand new, it was first used by my parents and is outside warranty noz). The issue is that the focus gets stuck in certain ranges at the extremes of the zoom. When at 85mm (and a bit below), the focus works well in the entire range but it gets stuck at infinity once it got there. Same at the 17mm end, but there the focus gets stuck at lower focal ranges. In the middle it moves freely. When in manual focus it is also impossible to move the focus out of these ranges. You can feel some slight resistance on the focus ring when moving towards the middle zoom region. Any thoughts on this as well? I noticed there were focus problems before but never really bothered, so the problem has been around for a while but it is "workable" by realising the focus using the ~40mm part of the zoom.


How to create a shortcut for ssh terminal login?

I want to create a desktop shortcut that automatically logs into a testserver via ssh, and shows the active terminal.  Script:  #!/usr/bin/env bash sshpass -p "mypass" ssh myusr@192.168.xxx.xxx   Link:  [Desktop Entry] Version=1.0 Name=Connect SSH Type=Application Exec=/home/<user>/Documents/testserver.sh Name[en_US]=Testserver   Question: it seems to work in general, but I don't see any terminal opening. How can I show the terminal that opened the ssh connection?


This is a question people seldom ask. In the English language, past participles are verbs that usually end with -ed. But bear seems to be an exception. It has bore and borne as past participles, but not beared. Why do they even exist? That doesn't make any sense. Update: I'm not familiar with the term Germanic language or inflectional morphology.


In my code, i've run a Junit test and the two for loops come up as yellow saying 1 of 2 branches missed. and there's a null pointer exception on the code in the loops. i don't see what the issue is so could someone please help me out? (adding more cus mostly code)  @Test public void testTicTacToeBoard() {     TicTacToeBoard board = new TicTacToeBoard();     CellState[][] expectedBoard = {             {CellState.EMPTY, CellState.EMPTY,CellState.EMPTY},             {CellState.EMPTY,CellState.EMPTY,CellState.EMPTY},             {CellState.EMPTY,CellState.EMPTY,CellState.EMPTY}     };     assertEquals(PlayerID.PLAYER_ONE, board.turn);     assertTrue(array2Dequals(expectedBoard, board.board)); }  public enum PlayerID {     PLAYER_ONE, PLAYER_TWO }  public enum CellState {     EMPTY(" "),     PLAYER_ONE("X"),     PLAYER_TWO("O");      private final String icon;      CellState(String icon){         this.icon = icon;     }      @Override     public String toString(){         return this.icon;     } }  /**  * Represent the game board as a 2D array of CellState. We use enum object  * to ensure that only the three possible values are used.  */ CellState[][] board;  /**  * Represents whose turn it is to play the next time play(int,int) is  * called. We use an enum object PlayerID to ensure only the two possible  * values are used. We cannot use a CellState object as the value EMPTY is  * not a valid value for a player. Therefore we use another enum type.  */ PlayerID turn;  /**  * The constructor must initialise board to a 3x3 2D array fill with the  * value CellState.EMPTY. In addition the turn should be initialised to the  * first player to play, i.e. PlayerID.PLAYER_ONE.  */ public TicTacToeBoard() {     this.turn = PlayerID.PLAYER_ONE;     for(int i = 0; i < 3; i++) {         for(int j = 0; j < 3; j++) {             this.board[i][j] = CellState.EMPTY;         }     }            }


"Biweekly", "bimonthly", "biannual", and "bicentennial"

What do lengths of time with the "bi" prefix mean"? I have understood bicentennial as once every two hundred years, but biannual as meaning twice a year. Do biweekly and bimonthly mean twice a week or month, or once every two weeks or months?  If this prefix is not used consistently, is there any rationale as to why it isn't?


calculate time difference between two hours in timeformat hh:mm:ss java

I  am trying  to calculate the difference between two hours. Time format must be hh:mm:ss! I implement this code:  public static String timeDifference(long timeDifference1) {      long timeDifference = timeDifference1 / 1000;     int h = (int) (timeDifference / (3600));     int m = (int) ((timeDifference - (h * 3600)) / 60);     int s = (int) (timeDifference - (h * 3600) - m * 60);      return String.format("%02d:%02d:%02d", h, m, s); }  public static void main(String[] args) throws ParseException {     Scanner sc = new Scanner(System.in);     while (sc.hasNext()) {         String timeStart = sc.next();         String timeStop = sc.next();         char lol[]=timeStop.toCharArray();         if(lol[0]=='0' && lol[1]=='0'){             lol[0]='2';             lol[1]='4';         }         String tetx=String.valueOf(lol);         timeStop=tetx;          char kk[]=timeStart.toCharArray();         if(kk[0]=='0' && kk[1]=='0'){             kk[0]='2';             kk[1]='4';         }         String hhh=String.valueOf(kk);         timeStart=hhh;          SimpleDateFormat format = new SimpleDateFormat("hh:mm:ss");          Date d1 = null;         Date d2 = null;          d1 = format.parse(timeStart);         d2 = format.parse(timeStop);          long diff;          if (d1.getTime() > d2.getTime()) {             diff = (int) (d1.getTime() - d2.getTime());          } else             diff = (int) (d2.getTime() - d1.getTime());          System.out.println(timeDifference(diff));      } }   Input must be:  10:03:43 15:00:58  13:00:00 14:00:00  00:00:00 12:05:00  12:05:00 00:00:00   And output:  04:57:15  01:00:00  12:05:00  11:55:00    But i get  04:57:15  01:00:00  00:05:00  00:05:00    How can i fix this?


I was wondering in C++ if I have an enum can I access the value at the second index?  For example I have  enum Test{hi, bye};   if I want 'hi', can I do something like Test[0], thanks.


Anyone notice that sometimes edits are not catalogued?

By virtue of the nature of the question, I can't give concrete evidence, since I don't record my screen, but over the past few days, I've tried to change a downvote or an upvote after an edit has appeared (I know that an edit appeared, because the content of the post obviously changed), but SO has no record of such an edit, so I can't change my vote.  Anyone know what's going on here/experienced similar issues?  The only thing I can think of is that there's some sort of threshold for what constitutes an edit that is significant enough to warrant a record, but that seems to be flawed.  Or perhaps, there's a significant amount of lag between an edit and its recording, but that doesn't appear to be true from my experience.    Apparently there's a five-minute grace period, in which edits are not logged, but it makes no sense to me that I can vote one way, you can change your answer, and if this occurs in a certain time period, then I cannot change my vote unless an additional edit has been made.    The other posts, while very similar to this one, seem to be more concerned with when you want to undo a down vote, but what if the opposite is true and there isn't an incentive for the OP to change their post (I'm concerned with both issues).  The quick fix is to edit the question and change your vote, which seems inappropriate.  There should be a non-hackish way to do this.


If a block is at rest on the incline plane at an angle of 30 degrees, would the maximum frictional force that would allow the block to stay in place be calculated using 30 degrees, OR would we have to find the minimum angle of the incline plane needed for the block to slide before we can determine the maximum frictional force? That is, find that minimum angle using tangent inverse of the coefficient of friction given (between the surfaces) and then substitute it in the formula for fs(max) = UsMgcos (minimum angle needed for block to slide) to get the maximum frictional force that would allow the block to stay in place?


we are trying to configure SSL certificate for our domain. SFMC account Executive is asking "Do you need 1 Configuration or 1 Domain with 2 configs?" what did he mean by that? Can someone make me understand.


Why does pronunciation of spells matter?

Obviously, spells in Harry Potter can be cast nonverbally as well as verbally.  In the first year Charms class, they haven't gotten up to nonverbal spells yet.  But as they are trying to cast Wingardium Leviosa, Hermione tells Ron that the reason he can't cast the spell is because he's pronouncing it incorrectly.  If the spell can be cast nonverbally, and therefore with no pronunciation at all, why should pronunciation matter for the verbal spell?  If you can cast spells by only thinking something, why does the pronunciation matter if you talk while you think it?


This might sound little lame,   Anybody please explain(if possible with example)  what is a good photograph ? How we can decide a photo which is good ? for an example if you are in a Deciding panel how you would decide or elect a photo as winner of a photography contest ?  What are the technical aspects that we need to consider ?   Not considering taste here   How actually judges judge theses photos.  Thanks in advance.


Vulnerabilities if encrypting the same data with 2 different keys

Let's say that Alice and Bob complete a key exchange and then Alice uses that key k1 to encrypt a 256-bit key kaes1 and sends it to Bob. From there, Alice and Bob exchange a lot of messages back and forth, using AES-256 to symmetrically encrypt the data with the key kaes1.  Then, Charlie comes along and wants to participate, so Alice and Charlie complete a key exchange and Alice then uses that key k2 to encrypt the same original kaes1 and sends it over to Charlie. From there, Alice and Bob and Charlie now exchange a bunch of messages symmetrically encrypted with AES-256.  Eve has been listening in this whole time, and she has all the data, but none of the keys. Does Eve gain an advantage if she knows that kaes1 was the payload for 2 different messages encrypted with 2 different keys k1 and k2?


Getting + installing gcc/g++ 4.9 on Ubuntu?

How do I install the latest version of gcc and g++?  I am using a variety of C++11 and C++1y features; which is why I need this.


I created a Java Application and get this Exception:  Exception in thread "main" java.lang.NullPointerException     at java.awt.Container.addImpl(Unknown Source)     at java.awt.Container.add(Unknown Source)     at javax.swing.JFrame.addImpl(Unknown Source)     at java.awt.Container.add(Unknown Source)     at Executer.<init>(Executer.java:21)     at Executer.main(Executer.java:14    Here is the code:   import javax.swing.*; import java.awt.*;  public class Executer {  private JLabel lblCommand; private JTextField txtEnter; private JButton btNext, btPrevious; private JPanel panel;  public static void main(String[] args) {     new Executer(); } public Executer() {     JFrame frame = new JFrame("Execute Script");     frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);     frame.setSize(900,400);     frame.setVisible(true);     frame.add(panel);      frame.setVisible(true);     MyPanel();     Text();     Buttons();     Fields(); } public void MyPanel() {     panel = new JPanel();     panel.setLayout(null); } public void Text(){     lblCommand = new JLabel("Enter Here");     lblCommand.setBounds(135, 50, 150, 20);     Font styleOne = new Font("Arial", Font.BOLD, 13);     lblCommand.setFont(styleOne);     panel.add(lblCommand); }  public void Fields () {     txtEnter = new JTextField();     txtEnter.setBounds(210, 50, 150, 20);     panel.add(txtEnter); } public void Buttons() {     btNext = new JButton ("Next");     btNext.setBounds(380,325,100,20);     panel.add(btNext);      btPrevious = new JButton ("Previous");     btPrevious.setBounds(260,325,100,20);     panel.add(btPrevious); }}   What is a NullPointerException?  How would I find out?


What does "a-crowding" mean in the following verse

From "O Captain! My Captain!" by Walt Whitman:  O Captain! my Captain! rise up and hear the bells; Rise up—for you the flag is flung—for you the bugle trills, For you bouquets and ribbon’d wreaths—for you the shores a-crowding, For you they call, the swaying mass, their eager faces turning;  While I cannot recall any concrete examples at the moment, I do remember encountering the prefix "a-" in poetry a couple of times before. Can anyone explain what it is all about?


In a plasma application (Helium or Argon Plasma), we would like to measure the current. The voltage is around 10kV AC and modulated with a function generator.  Currently we only have one of those rings that you put around the cable, but I read that those only work for high-ish amperage >1A. While using this device, we get an output of around 12mV peak to peak, put I think that this is very inaccurate.  Is there any cheap way (we are students) of measuring the current more precisely? Preferably without killing equipment and/or operators :)  For a low voltage circuit I would use a high accuracy resistor and measure the voltage drop across, but I think that this is too dangerous in such high-voltage applications.


I can't seem to clone an array without the changes in one being reflected in the other. I've tried Object.assign, slice, Array,from, all to no avail

The title pretty much sums it up. I am receiving an array from an API call, and storing it in a variable called this.ratesStore.aprRates. I then want to create a new array with the same data in it, called this.aprRates. However, no matter how I try, whenever I modify data in the "cloned" array, the other one is affected as well.  I've tried cloning the array via Object.assing, slice, Array.from, and spread operator, but I get the same issue every single time.  For instance, trying this:  console.log('apr rates - before:', this.aprRates); console.log('rates store apr rates - before:', this.ratesStore.aprRates[0].terms[0].rate);  this.aprRates = this.ratesStore.aprRates.slice(0);  console.log('apr rates - after:', this.aprRates[0].terms[0].rate); this.aprRates[0].terms[0].rate = 'chickens'; console.log('rates store apr rates - after:', this.ratesStore.aprRates[0].terms[0].rate);   Yields this output for me:  apr rates - before: undefined rates store apr rates - before: 1.89 apr rates - after: 1.89 rates store apr rates - after: chickens   Any idea why this is happening?? I'm losing my mind over here. I'm writing this as part of an Angular component, if that makes any difference.  Thank you for your help!


Why does Index Seek Used When Order By Is Present

I have this query: SELECT t.some_id AS id, t.*  FROM some_table t WHERE (t.first_col = '123' OR t.second_cold = '321') AND t.third_col != 'aaa' AND t.some_date >= :someDate AND t.some_date <= :someOtherDate ORDER BY t.some_date   I have rewritten it to: SELECT t.some_id AS id, t.* FROM some_table t JOIN (SELECT t.some_id, t.some_date FROM some_table t WHERE t.first_col= '123' AND t.third_col != 'aaa' AND t.some_date >= :someDate AND t.some_date<= :someOtherDate ORDER BY t.some_date OFFSET 0 ROWS UNION SELECT t.some_id, t.some_date FROM some_table t WHERE t.second_col = '321' AND t.third_col != 'aaa' AND t.some_date>= :someDate AND t.some_date<= :someOtherDate ORDER BY t.some_date OFFSET 0 ROWS) AS filtered_table ON t.some_id = filtered_table.some_id  ORDER BY t.some_date  and I have the following indexes: CREATE NONCLUSTERED INDEX first_col_index ON some_table ( first_col,                                                                                third_col, some_date,                                                                                some_id);  CREATE NONCLUSTERED INDEX second_col_index ON some_table ( second_col,                                                                                third_col, some_date,                                                                                some_id);  and in the execution plan I can see the initial filtering is done with Index Seek operation. However, I only need the rows sorted in the final table, so if I eliminate the order by clauses from the inner queries: SELECT t.some_id AS id, t.* FROM some_table t JOIN (SELECT t.some_id FROM some_table t WHERE t.first_col= '123' AND t.third_col != 'aaa' AND t.some_date >= :someDate AND t.some_date<= :someOtherDate UNION SELECT t.some_id FROM some_table t WHERE t.second_col = '321' AND t.third_col != 'aaa' AND t.some_date>= :someDate AND t.some_date<= :someOtherDate) AS filtered_table ON t.some_id = filtered_table.some_id  ORDER BY t.some_date  I'm now seeing two Clustered Index Scans (which is on the primary key, some_id) with a simpler execution plan overall.  Why are my indexes not enough to perform Index seek in the second query (without ordering)? Which query would be faster given that I have roughly 500K records in the table? Is there a better way to improve query performance (with different indexes or with any additional index to perform union operation faster, or rewriting my query)?


The tikz variable resets before the loop finishes

In tikz, I define a variable outside \foreach loop, and use \pgfmathtruncatemacro command to increase it inside the loop. Below is my MWE. \documentclass{article} \usepackage{pgfplots,tikz,tikz-3dplot}  \begin{document} \begin{figure}     \centering     \begin{tikzpicture}     \pgfmathtruncatemacro\j{1};     \foreach \i in {1,4,7}     {          \node at (\i,1.4) {\j};         \pgfmathtruncatemacro\j{\j+1};         \node at (\i+1.5,1.4) {\j};         \pgfmathtruncatemacro\j{\j+1};         \node at (\i,0) {\j};         \pgfmathtruncatemacro\j{\j+1};         \node at (\i+1.5,0) {\j};     }     \end{tikzpicture}  \end{figure} \end{document}  Instead of increasing the value of \j up to 12, it resets back to 1 after only one iteration of the loop. What am I doing wrong?


I have a URL button 'New Opportunity' which creates the new opportunity and takes the user to the edit page passing through some values through the button which is on Opp Related List in a custom object.  The problem is, now I need to adapt the majority of my custom buttons to Salesforce1 and this app doesn't accept custom buttons so I need to create a Publisher Action in order to replicate the same action.  I've created a Publisher Action redirecting to a Visualforce. Inside this visualforce I've tried passing the values through the sforce.one.navigateToURL(); function using the standard controller values  to redirect, but this doesn't seem to work. Do you know of a workaround for this?  URL Button Code: /006/e?&retURL=%2Fa0BS0000002pJhs&opp4={!Estudio_economico__c.Empresa__c}&opp3=No informar&RecordType=01220000000Iw8t&CF00N20000002GXnJ_lkid={!Estudio_economico__c.Id}&CF00N20000002GXnJ={!Estudio_economico__c.Name}


Why is the math for negative exponents so?

This is what we are taught: $$5^{-2} = \left({\frac{1}{5}}\right)^{2}$$  but I don't understand why we take the inverse of the base when we have a negative exponent.  Can anyone explain why?


Proof of the power series 1 + $x^2$ + $x^3$ + $\ldots$ + $x^n$ = $\frac{1}{1-x}$

Can anyone show me the proof of this equation:  $$ \lim_{n \to \infty} 1 + x + x^2 + x^3 + \ldots + x^n = \frac{1}{1-x}, $$  where $|x|<1$.    Edit: I have then additionally written $x$ on the left side.


Using jQuery to dynamically update the DOM with .blur and .click to switch out elements

I am newb with jQuery and would appreciate your help.  I am struggling a bit with jQuery DOM manipulation, where I have an <input>, and .on("blur") it updates the DOM, by removing the <input>, and inserts a
 with the <input> value, and when you click on the
, it must update the DOM, by adding back the <input> with the value of the
.   When I click on  the
, nothing happens. Any Ideas?  My current code:    $(document).ready(function() {    var inputValueByClassName = null;    $(".divInput").on("click", function() {     alert("clicked!")     $(".divInput").replaceWith($('<input type="text" class="textInput>'));     $(".divInput").html(inputValueByClassName);   });    $(".textInput").on("blur", function() {     inputValueByClassName = $('input[type="text"].textInput').val();     console.log(inputValueByClassName);     $(".textInput").replaceWith($('
' + inputValueByClassName + '
'));   }) });  <input type="text" class="textInput" value="123">


Can we improve the UI when a comment "is not eligible for flagging or voting"?

I came across an unusual question on Meta today:   I went to vote up some of the comments but couldn't:    I found some other questions on the matter:    - Anna says it's because the question is locked (in a comment)  - the accepted answer says it's because the question is deleted - not the case here, another answer says the comment has been deleted - also not the case here, and a third says the comment is from the old site and can't be voted, no mention of locking  again mentions locking   I believe the real reason is because of the migration: comments left before migration can't be voted on (or flagged, which I think is likely a problem) on the new site. Is this in fact the reason? And if so, could the little red box say so?        This comment is from another site and not eligible for voting or flagging   Would save a moment of confusion, right?


What is order of general linear group GL(3,Zp)?

I have tried for $GL(2,\mathbb{Z}_p)$ its $= (p^2-1)(p^2-p)$ Since as number of ways in which first row can be filled is $p^2-1$ by omitting the way in which all entries r zero and second row can be filled in $p^2-p$ ways by omitting the  ways in which d entries are multiples of first row. I have also  tried for for $GL(3,\mathbb{Z}_p)$ its found as $=(p^3-1)(p^3-p)(p^3-2p)$. Is it right?


Declaration and implementation of templated member functions

I'm trying to make a quick utility class that extends std::vector through composition. For this, I want to make it as generic as possible.  The class works well when declared and implemented in a single file (i.e. main.cpp):  main.cpp  #include <iostream> #include <algorithm> #include <vector>  template<typename T> class FVector {  public:      FVector(std::vector<T> vector): _vector(vector) {}      template <typename unaryOperation>     void forEach(unaryOperation op) {         std::for_each(_vector.begin(),_vector.end(),op);     };  private:      std::vector<T> _vector;  };  int main(int argc, const char * argv[]) {      auto printInt = [](int i){ std::cout << i << std::endl; };     std::vector<int> numbers{1, 2, 3, 4, 5};     FVector<int> fNumbers{numbers};     fNumbers.forEach(printInt);      return 0;  }   But when I try to put the class in its own .h and .cpp file, the compiler won't find the Constructor nor the function.   FVector.h  ... #include <vector>  template<typename T> class FVector {  public:      FVector( std::vector<T> );      template <typename unaryOperation>     void forEach(unaryOperation);  private:      std::vector<T> _vector;   }; ...   FVector.cpp  #include "FVector.hpp" #include <algorithm>  template <typename T> FVector<T>::FVector( std::vector<T> vector ): _vector(vector) {}  template <typename T> template <typename unaryOperation> void FVector<T>::forEach(unaryOperation op) {     std::for_each(_vector.begin(),_vector.end(),op); }   main.cpp  #include <iostream> #include "FVector.hpp"  int main(int argc, const char * argv[]) {      auto printInt = [](int i){ std::cout << i << std::endl; };     std::vector<int> numbers{1, 2, 3, 4, 5};     FVector<int> fNumbers{numbers};     fNumbers.forEach(printInt);      return 0;  }   error     Function 'FVector::forEach<(lambda at blah/main.cpp:95:21)>' has   internal linkage but is not defined   Clearly something in my syntax is very wrong, but I can't find how to declare/implement the functions.  Thanks!


What difference occurs when using the method defined using the prototype property of an object with the new keyword

My code works when I use my first case. Then I wondered about the second case. When the button is clicked, this.x and this.y values are undefined  My html code:  <!DOCTYPE html> <html> <head>  <script type="text/javascript" src="ObjectKavrami.js"> </script>  <title></title> </head> <body> <button id="demoObjectPrototype" onclick="onObjectWithPrototype()">JavaScript Object</button>  </body> </html>   Case 1: returns "115":  var areaCalc = function(x,y) {     this.x = x ;     this.y = y ; }  areaCalc .prototype = {         area: function() { return (this.x * this.y); } } var newarea = new areaCalc (5,23);  function onObjectWithPrototype () {      alert(newarea .area());  }   Case 2: returns NaN  var areaCalc = function(x,y) {     this.x = x ;     this.y = y ; }  areaCalc .prototype = {         area: function() { return (this.x * this.y); } } //var newarea = new areaCalc (5,23);  function onObjectWithPrototype () {      areaCalc(2,3);      alert(areaCalc.prototype.area());      //alert(newarea .area());  }   Why can't the method see x and y values?


How do I determine if a column is defined as a serial data type instead of an integer based off the catalog?

So I'm currently creating some SQL to read through the postgres (9.1) catalogs to build table definitions. However, I am encountering a problem with SERIAL/BIGSERIAL data types.  Example:  CREATE TABLE cruft.temp ( id BIGSERIAL PRIMARY KEY ); SELECT * FROM information_schema.columns WHERE table_schema='cruft' AND table_name='temp'; "db","cruft","temp","id",1,"nextval('cruft.temp_id_seq'::regclass)","NO","bigint",,,64,2,0,,,,,,,,,,,,,"db","pg_catalog","int8",,,,,"1","NO","NO",,,,,,,"NEVER",,"YES"   It gives me database name (db), schema name (cruft), table name (temp), column name (id), default value (nextval( ... )), and data type (bigint and int8 .. NOT bigserial) ... I realize that I could just check to see if the default value was a sequence - but I don't believe that would be 100% accurate since I could manually create a sequence and create a non serial column where the default value was that sequence.  Does anyone have a suggestion for how I might accomplish this? Anything other than checking the default value for a nextval(*_seq)?  Edited for SQL solution added here in case of TL;DR or new users unfamiliar with the pg_catalog:  with sequences as (   select oid, relname as sequencename from pg_class where relkind = 'S' ) select   sch.nspname as schemaname, tab.relname as tablename, col.attname as columnname, col.attnum as columnnumber, seqs.sequencename from pg_attribute col join pg_class tab on col.attrelid = tab.oid join pg_namespace sch on tab.relnamespace = sch.oid left join pg_attrdef def on tab.oid = def.adrelid and col.attnum = def.adnum left join pg_depend deps on def.oid = deps.objid and deps.deptype = 'n' left join sequences seqs on deps.refobjid = seqs.oid where sch.nspname != 'information_schema' and sch.nspname not like 'pg_%' -- won't work if you have user schemas matching pg_   and col.attnum > 0   and seqs.sequencename is not null -- TO ONLY VIEW SERIAL/BIGSERIAL COLUMNS order by sch.nspname, tab.relname, col.attnum;


I try to understand the subtleties of TeX programming, but it is not always easy. For example, in the following code :   \def\first{abc} \def\second{abc} \ifx\first\second OK!\else false \fi   I understand why the output is OK!.  But I do not understand why the output is false with this code :  \if\first\second OK!\else false \fi


Why do compilers not warn about out-of-bounds static array indices?

A colleague of mine recently got bitten badly by writing out of bounds to a static array on the stack (he added an element to it without increasing the array size).  Shouldn't the compiler catch this kind of error?  The following code compiles cleanly with gcc, even with the -Wall -Wextra options, and yet it is clearly erroneous:  int main(void) {   int a[10];   a[13] = 3;  // oops, overwrote the return address   return 0; }   I'm positive that this is undefined behavior, although I can't find an excerpt from the C99 standard saying so at the moment.  But in the simplest case, where the size of an array is known as compile time and the indices are known at compile time, shouldn't the compiler emit a warning at the very least?


What if the size of the Universe doubled?

My question has a silly formulation, but I want to know if there is some sensible physical question buried in it:   Suppose an exact copy of our Universe is made, but where spatial distances and sizes are twice as large relative to ours. Would this universe evolve and function just as ours?   Since mass is proportional to volume which is distance cubed, but strength of a rope is only distance squared, I think not everything would scale proportionally.   Does this mean that a universe with our physical laws that evolves like ours can only have one particular size? Or would the physical laws scale proportionally so that it evolves in the same way? If it has a particular size, what is it relative to? Another variation: suppose another exact copy of our Universe is made, but where everything happened twice as fast relative to ours. Would it evolve in the same way as ours?


What's wrong with my use of "anyone" and "their" in this sentence?

For a paper that I have to write for school, I have the following sentence* that my teacher claims is incorrect. I am not sure what is incorrect about it, but it has something to do with my usage of anyone and their.     Because of how the program works, anyone interested in using it only needs to have it installed on their machine.   What's wrong with my anyone - their usage?  *The sentence provided has been deliberately modified to make the subject of my paper ambiguous.


Annoying windows error when trying to remove folders

I started getting error when trying to delete one or more folders in Windows 8.1. The action can't be completed because the file is open in Windows Explorer - Close file and try again  I can't figure out what to do, do you know?


The number of regions into which a plane is divided by n lines in generic position

Suppose that $n$ lines are drawn on a plane in such a way that no lines are parallel and no three of them intersect at a point. Let $r(n)$ be the number of regions the plane is divided into after drawing the $n$ lines. Find a recursive formula and prove it without induction. Progress I found that the formula $r(n)=r(n-1) + n$ works but am having trouble proving it.


How do I add swap after system installation?

I did not create a swap partition during Ubuntu installation.  Later, I freed up some space and made a swap partition.  Now after each boot up, I am manually opening gparted to right-click the swap partition to turn on the 'swapon' option.  How can I automatically enable the swap partition at boot?  Also, if I had not created the swap partition, what are my other options?


Can't fix NullPointerException with JTextArea

I am trying to make a text based adventure that runs in a jframe but when i run the program i get a NullPointer error on line 97 (first time i append console in the game method) and I have no idea how to fix it. I am relatively new to java so its probably something simple that I just don't know.  my code is here  package window;  import java.awt.EventQueue;  import javax.swing.JFrame; import javax.swing.JPanel; import javax.swing.border.EmptyBorder; import javax.swing.JButton;  import java.awt.event.ActionListener; import java.awt.event.ActionEvent;  import javax.swing.JTextArea; import javax.swing.JTextField;  public class Gui extends JFrame {  public JPanel contentPane; public static JTextField input; public static JButton send; public static JTextArea console; public static JTextArea invintory; public static JTextArea stats; static String i = "";  /**  * Launch the application.  */    /**  * Create the frame.  */ public Gui() {     //variables      int Gold = 20;     int Health = 100;     int MaxHealth = 100;       //variables end     setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);     setBounds(100, 100, 450, 300);     contentPane = new JPanel();     contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));     setContentPane(contentPane);     contentPane.setLayout(null);      JTextArea console = new JTextArea();     console.setBounds(10, 11, 281, 214);     contentPane.add(console);      input = new JTextField();     input.setBounds(10, 236, 281, 20);     contentPane.add(input);     input.setColumns(10);      JTextArea stats = new JTextArea();     stats.setBounds(301, 11, 123, 53);     contentPane.add(stats);      JTextArea invintory = new JTextArea();     invintory.setBounds(301, 75, 128, 137);     contentPane.add(invintory);      JButton send = new JButton("Send");     send.addActionListener(new ActionListener() {         public void actionPerformed(ActionEvent arg0) {             String i = input.getText();             input.setText("");             stats.setText("");             stats.append("Health: " + Health + "/" + MaxHealth + "\n");             stats.append("Gold: " + Gold);         }     });     send.setBounds(301, 224, 128, 32);     contentPane.add(send);      stats.append("Health: " + Health + "/" + MaxHealth + "\n");     stats.append("Gold: " + Gold);  }  public static void game (JButton send, JTextArea console, JTextArea stats, JTextArea invintory, JTextField input, String i) {         //start     //START     //START     //START     //START     while (true) {                   console.append("You wake up open feild, with vast amounts of wheet in every direction");         console.append("There is a path going in either direction what do you want to do");         console.append("\t1. Go left.");         console.append("\t2. Go right.");            while (i == "") {         }         if (i == "1") {             console.append("1");             break;         }         else if (i == "2") {             console.append("2");             break;         }        }     //END     //END     //END     //END     }  public static void main(String[] args) {             try {                 Gui frame = new Gui();                 frame.setVisible(true);                 Gui.game(send, console, stats, invintory, input, i);             } catch (Exception e) {                 e.printStackTrace();             }          }  }


Proving this $F_{n+1} \cdot F_{n-1} - F^2_n = (-1)^n$ by induction

Where $n \in \mathbb{N}$   and  $$ F_n = \begin{cases} 0                 & \text{ if } n = 0 \\ 1                 & \text{ if } n = 1 \\ F_{n-1} + F_{n-2} & \text{ if } n > 1 \end{cases} $$  This is basically describing the famous Fibonacci sequence.  If we try the base case with 1, it works (for $0$ I am not sure...)  When $n = 1$  $2 \cdot0 - 1^2 = (-1)^1 = -1$  For the inductive hypothesis, we assume this $F_{n+1} \cdot F_{n-1} - F^2_n = (-1)^n$ is true.  Now, for the inductive step, we try to prove for $n+1$, so for  $F_{n+2} \cdot F_{n} - F^2_{n+1} = (-1)^{n+1}$.  Since $n$ is always a natural number, and it will be always or even or odd, the $-1$ raised to $n$ will be always either $-1$ (when $n$ is odd) or $1$ (when $n$ is even).   Thus, $F_{n+1} \cdot F_{n-1} - F^2_n$ = -($F_{n+2} \cdot F_{n} - F^2_{n+1}$).  Or simply: $$ (-1)^n = -(-1)^{n+1} $$ $$ 1 \cdot (-1)^n = -(-1)\cdot(-1)^n $$ $$ 1 = -(-1) $$ Which is true.  I don't know if this is sufficient... I can arrive at the second step and say that we know this $(-1)^n$ is equals to $F_{n+1} \cdot F_{n-1} - F^2_n$, but I am not sure...


What is the difference between Ctrl-z and Ctrl-c in the terminal?

Can anyone tell me the difference between ctrl+z and ctrl+c?  When I am in the terminal, both the combinations stop the current process, but what exactly is the difference between both?


Can I 'rename' an external exception class?

I'm using an external SDK which wants me to use  try {  ... }  catch (Ex20301Exception) {  ... }   I'd rather use  try {  ... } catch (CustomerOverCreditLimitException) {  ... }   Is there a way I can achieve this? Or do I have to live with comments?


Cypress: regular expression inside jQuery selector ":contains()"

I want to use Cypress and a regular expression to select an element which contains a certain text. This get() command works: cy.get('[data-cy=tile]').contains(new RegExp(myVar))  But this command fails: cy.get('[data-cy=tile]:contains(' + new RegExp(myVar) + ')')  Is there a way to use a regular expression within jQuery :contains()?


guest-kpjg0a:x:999:999:Guest:/tmp/guest-kpjg0a:/bin/bash   I have checked /etc/passwd, then here it is. Am I hacked? Yes, I am hacked.


How can I store the '€' symbol in MySQL using PHP?

I've set the PHP character set to utf-8:  header('Content-Type: text/html; charset=utf-8');   I've set the currency column in MySQL to varchar(1) with collation utf8_unicode_ci.  However, the following code in PHP:  $currency = '€'; $sql = "UPDATE myTable SET currency = '$currency' WHERE user = '$user'"; mysql_query($sql);   Produces the following character in MySQL:  â   How can I get the € symbol to store properly in MySQL?


Do I have to charge my phone before I use it the first time?

When I got my last phone, a SE k850i, I was recommended to charge it fully once before I even turned it on. Does this apply today as well, for my coming HTC Desire HD?   Why was I recommended to do so in the first place?


Drop down menu in main stackexchange site is not working?

When I click on the drop down menu in , it does not show the site browsing menu. Instead, it loads the homepage. But it is working fine on other Stack Exchange sites.


Captain Power and the Soldiers of the Future was a dystopian science fiction television series that aired in North America for only one season (1987-1988), and which had J. Michael Straczynski as its head writer.  The primary antagonist was "Lord Dread".  From :     With the new opportunities offered by the human-machine combination, [Dr. Lyman] Taggart becomes obsessed with the precision and "perfection" of machines and convinces himself that merging human consciousness with mechanical bodies is the next step in human evolution. OverMind [a supercomputer] achieves self-awareness and shares Taggart's beliefs as they take over Bio-Mech armies throughout the world and attack humanity in a conflict known as the Metal Wars.   Here is Lord Dread, as he appeared in the series:    Now, here is a typical Borg from Star Trek:    The Borg first appeared in 1989 (in ), two years after Lord Dread and his Bio-Mech army were introduced in Captain Power.  Given the similarity between Lord Dread and the Borg in both appearance and goals, is there any evidence that Lord Dread was an inspiration for the Borg in Star Trek?


How do you install Visual Studio 2010 Professional?

How can I install Visual Studio 2010 framework4 on Ubuntu 13.04?  My project was written with Visual Studio (visual basic) 2010 in Windows 7. Now that I installed Ubuntu 13.04, can I complete my project with it?


Bug: Can't post or access my questions on Android Enthusiasts

So I asked a question on Android Enthusiasts and when it loaded, I had a different very long username, only on that site, and I am not the only one experiencing this bug,  The difference is, when I try to load the question, it says "failed to load". And I also fail to ask a question, it says "error logged"


Every irrational number is the limit of a sequence of rational numbers

How can I use this fact to show that f(y)=y for every real number y, given that f is continuous


Is there a hypernym for "expense" and "income"?

I have several expenses and incomes in the application I'm currently coding. What can I call an entity like that, that is either positive (income) or (negative)? It should be related to money, if possible.  Edit: Not sure if I expressed myself clearly. I'm looking for a word like "money-transfer", "stream" or "money that goes over the table" (no matter which direction). A word that fits in a financial context.


If I don't want to set any special behavior, is it OK if I don't bother to have a robots.txt file?  Or can the lack of one be harmful?


I have AMD gpu, should I move to Ubuntu?

I'm using windows currently but because of programming, aesthetics, financial and other reasons I have decided to move to Ubuntu.  Problem is my device is a laptop with Intel CPU and AMD R7 M360 GPU and I have read online (like ) that AMD graphics are a mess in Ubuntu 16.04.  I'm not very familiar with how Ubuntu work or what some of these technical words used in the link above, Until now I have just simply wrote C++ codes in Ubuntu or any Linux environment.  Should I avoid moving to Ubuntu or is there a solution to this driver issue?  Thanks.


Hi when I do in one of my user controls in a WPF application,  this.KeyUp += new KeyEventHandler(ControlViewer_KeyUp);   or   this.KeyDown += new KeyEventHandler(ControlViewer_KeyUp);   or  this.AddHandler(Window.KeyDownEvent, new KeyEventHandler(ControlViewer_KeyUp), true);   I can never get the key events to fire when pusing a key on the keyboard.  Would anyone know why?


$(a_n+a_{n+1})$ is convergent implies $(a_n/n)$ converges to $0$

Let $(a_n)$ be a sequence such that $(a_n+a_{n+1})$ is convergent. Prove that $(a_n/n)$ converges to $0$.   $(a_n+a_{n+1})$ convergent to $L$ means that for all $\epsilon$, there exists $N$ such that for all $n\geq N$, $|L-a_n-a_{n+1}|<\epsilon$, or in other words $L-\epsilon<a_n+a_{n+1}<L+\epsilon$. How to proceed from here?


Is it true that a field is a vector space over a field?  This idea arises in me after reading the solution for the question the order of finite field is $p^n$.    I am wondering if it is possible to not consider subfield but just a field as a vector space over a field.  In fact, I don't quite get why a field is a vector space over its subfield. Why can't it be other fields?  I am having a lot of confusion here.


I am a Tier 4 student, from India in the UK.  I am applying for a Schengen visa with multiple entry, but in the application I am unsure of how to respond to the 'date of departure from the Schengen area'. I have at least three trips planned in 2016: 1. France (January, 4days) 2. Malta (February, 4 days) 3. Spain (May, 4days)    I was applying to the French Embassy, since that is the port of first call. I have the flight bookings of all, and the hotel bookings for France and Malta.  Could someone help?


void f(string message) {     string.Format(message,"x",y"); }   f() is called by g:  g() {    f(SomeJson+"{0}"); }   the curly braces in json are being interpreted as placeholders for values by string.format() in f(). IS there a way to have the curly braces escaped?


How to add UV mapped text with alpha to an object?

I'm probably doing this the wrong way. I'm trying to model a vodka bottle. Although, I'm stuck at one step. I have everything there except the text. I used two different methods of projecting the text as a decal using images as planes and both gave undesirable results. I have my bottle textured with a generated gradient. I don't want to combine the text and gradient into one uv map as I could deform the text and gradient in trying to map it to the correct place. What should I do? I feel like there's a simple solution that I'm not aware of...


Startup logo has not changed since I removed KDE

I installed KDE on Ubuntu 16.04, but after some time I removed it because it was slow, but although I've removed it, my startup logo is still Kubuntu not Ubuntu!  How can I make it turn back to the Ubuntu logo?


I got a question to find the output of below code snippet  int main(int argc, char const *argv[]) { float a=0.7; if(a<0.7)  std::cout<<"yes";  else  std::cout<<"no"; }   At first look, like everyone my answer was "no" because 0.7 is not  less than 0.7. But when i run it, output was "yes". I found an explanation about this which says C++ internally takes 0.7 as double value and here actually it is checking  whether 0.700 < 0.7ff which will be true. So i tried the same with another value 0.5. But then this program had "no" as output. Why it is so? Doesn't it really check whether 0.500<0.5ff?,  or all my  understanding about it is wrong?


Black hole entropy versus entropy of normal matter

It has been established that the entropy of a black hole is equal to:  $$ \frac{1}{4} \frac{c^3 A}{ G \hbar} k$$  Which if one substitutes for A the surface area of the event horizon:  $$16\pi\frac{G^2M^2}{c^4}$$  One gets for the entropy:  $$8\pi^2\frac{GM^2}{hc}k$$  My question is the following:  Entropy for ordinary matter very roughly scales with the number of particles in the system. Which for stars mostly composed of fully ionized hydrogen is proportional to the mass of the system. However for black holes this seems to scale with the mass squared.    Why is this? Does this seem to imply that matter falling into a black hole is heated to such an extreme that more particles are created (from energy gained by gravity or by decomposition of nuclei and nucleons into constituent particles) in such high numbers that entropy seems to have this proportionality to the mass squared? Do neutron stars have a similar relationship?


How do I make 2 lists correspond to each other?

I have 2 lists here: list1 = [happy, sad, grumpy, mad] list2 = [2, 5, 6, 9]  I want to make it so that the numbers are assigned to the emotions? (happy is equal to 2, sad is equal to 5, etc). Ideally, I want to make it so you can compare items from list1, for example: if happy > sad:     print ("you are happy")  I want to make this code as efficient as possible, so I do not want to separately assign each variable from list1 a number.


Do you say "outside classes", when mentioning study by yourself?

By taking courses, I have learned topic A. Through self-studying and discussion with others, I have explored topic B.    I also study topic A outside the classroom. What I want to emphasis is that topic B is not in my curriculum, but I study it on my own. Extracurricular activities can include both activities contributed to academic study although outside the normal curriculum, but also activities not contributed to academic study such as sports, volunteer work, etc. I want to emphasis the former activities. Do you say "outside classes", when mentioning study by yourself, i.e.      Outside classes, I have explored B.      If it were you, how would you rewrite the first quote for the same       meaning?    Thanks!


I have a MDB file that can't be opened. It seems like it's corrupted. Is there a best practice how to fix that?  I've already tried this tool StellarPhoenixAccessDatabaseRepair but it didn't help.  I need to make this file works again...  Thanks


"everyone", "everybody", "everything", and "everywhere" - singular or plural.

Are "everyone", "everybody", "everything", and "everywhere" singular or plural.   I have found people who are say they are singular but also people who say they are plural.  I can anyone give me an explanation?   Thank you