I'm trying to write a simple bit of code to get a input via BufferedReader and then execute some code within another method.  import java.io.*;   public class main {     public main() {      }     public static String input() {         BufferedReader br = new BufferedReader(new InputStreamReader(System.in));         String out;         try {             out = br.readLine();             return out;         } catch (IOException e) {                    e.printStackTrace();             return null;         }     }     public static void someCode() {         //some code     }     public static void main (String[] args) {         input();         if(input() == "Input") {             someCode();         }     } }   Thanks :)
I've been using the == operator in my program to compare all my strings so far. However, I ran into a bug, changed one of them into .equals() instead, and it fixed the bug.  Is == bad? When should it and should it not be used? What's the difference?
The strange thing is that opened scripts or newly opened ones are working fine. It's the new created C# scripts that are not working.  With not working, I mean the MonoBehaviour is not in light blue color it's in black color. In this screenshot I took, I marked it with a red circle.    What have I tried so far? I have closed Visual Studio and started over again.  Since it didn't solve it, I closed the unity editor and started it over again, to no avail.  I pressed 'clean solution', I pressed 'rebuild solution', I pressed 'build solution'.  What else can I do ? And why are the other scripts working fine? If I type gameo...it will auto complete it to GameObject but in this specific script it's just not working.  This is a screenshot of the editor. I have in the Hierarchy a Ladder object.  In the Assets I created a folder name Ladder and a script name Ladder. But this Ladder script is not working.    This is the Ladder script and this script was working before but once I created another script inside the ladder folder name Raise empty script the Raise script didn't work and now the Ladder is not working either. But other scripts are working fine.  using System.Collections; using System.Collections.Generic; using UnityEngine;  public class Ladder : MonoBehaviour {     public Transform charcontroller;      private bool inside = false;     private float heightFactor = 3.2f;      private void OnTriggerEnter(Collider other)     {             inside = true;     }      private void OnTriggerExit(Collider other)     {             inside = false;     }      private void Update()     {         if (inside == true &amp;&amp; Input.GetKey("w"))             charcontroller.transform.position += Vector3.up / heightFactor;     } } Flagging accepted "answers" How can we distribute Shamir's secret sharing scheme shares without a dealer? Let's say $k$ users have shares to a $(k,n)$ secret sharing scheme, and they want to issue new shares. How can they do this without collecting the shares together?  In particular, no set of $k-1$ users (including the new users) should be able to learn the shared secret during or after the share generating process. There is also no trusted third party.  One way to do this is by doing a secure multiparty computation. Is there a way to accomplish the task without a general multiparty computation scheme? Cannot find my keyboard layout I'm in Belgium (french part) and I cannot find the proper keyboard layout in Settings > Region and Languages > Input Sources.  the closest I found is the french (AZERTY) one but for the symbols such as ! and _ it's not the same keys...  what can I do to solve it ?  Thank you. Terminal appears with much delay when shortcut is used When I press Ctrl+Alt+T the Terminal opens after around 30 seconds. That's pretty annoying. If I open it with Alt+F2 and enter gnome-terminal the window appears instantly as usual.  I'm using Ubuntu 16.04 with gnome3.  Thank you for your help in advance! Finish an activity after a time period How can you profile a Python script? and other coding contests often have a maximum time to run or people boast of how fast their particular solution runs. With Python, sometimes the approaches are somewhat kludgey - i.e., adding timing code to __main__.  What is a good way to profile how long a Python program takes to run? Show $$\lim_{h \to \ 0} \frac{f(x + 2h) - 2f(x+h) + f(x)}{h^{2}} = f''(x)$$   Proof:  By definition:    $$f'(x) = \lim_{h \to \ 0} \frac{f(x + h) - f(x)}{h}$$  Using this idea it would imply:   $$1)\ \ f''(x) = \lim_{h \to \ 0} \frac{f'(x + h) - f'(x)}{h}$$  As such it is required that I find an expression for $f'(x+h)$. This is where I'm not sure if the step I took is legitimate.  An expression for $f'(x + h)$ is:  $$f'(x+h) =  \lim_{h \to \ 0} \frac{f(x + 2h) - f(x + h)}{h}$$  Combining this with the definition of $f'(x)$ and inserting it into 1) you arrive at: $$\lim_{h \to \ 0} \frac{f(x + 2h) - 2f(x+h) + f(x)}{h^{2}} = f''(x)$$   As required.    Concern: I feel a discomfort with this solution. Even though "mechanically" it worked out, if I am taking the limit as $h \rightarrow 0$ that would mean $x + 2h$ and $x + h$ both go to $x$. But I am attempting to use the idea that $x +2h$ goes to $x + h$. Perhaps it is a notation idea that I need to communicate better, but I feel it is larger than just that. Suppose that I create Material001  and Material002  in Material Properties and set them to some color. Can I use this 2 items in other buttons like Texture Properties, Object Data Properties etc. ? Where and how do I intertwine them with this button ? I'm trying to crack a cypher that I believe is Vigenère encrypted and I'm currently stuck.  I calculated the key length by finding repeated sequences in the cypher and calculating the the common factors.  Word    distance factors agzd    16       2,4,8,16        zna     92       2,4,23,46,92 zdc     54       2,3,6,9,18,27,54 csio    44       2,4,11,22,44 omy     46       2,23,46 zab     5        5   I assume the key-length is 4 as these are the once that are common factors, but from here on trying to map the correct caesar shiffre for each position I'm stuck.  Can somebody confirm that my key-length calculation has no errors which would explain why I can't solve the cypher.  Here is the cypher:  jD 2GSA 7HNA ZNA w.m. V7KXA 36HBM MKE5 /H SGP9 +R GKKJ 2I A4OTC KDBCUR. 19+R 8Y TKJ JG4 IGO6 6U4T OJ hH/BIK. 196 qFKT+9 BNJK ZD6+Q AGZD. kJ'R EaOP6 4NCR ZK 36 / AGZD6C/HOIE2D. x0ZNAC2S8IO8DI HB xX8D4D 0XK O66M 0Y MN62S 8TZABBD2Za8BI. lBJ HA+DF 6UU/ 2J /FOZDC6S8I OJ kDC8G OO 2BLCYZ O66M 0Y G 925F4 UL J2JHCTGH FHH3K Prove $e^{x+y}=e^{x}e^{y}$ by using Exponential Series I'm looking to install 32-bit windows with IIS to dual-boot with my 64-bit edition of windows on a laptop. I have a ten gig partition on my harddrive - is this large enough for a simple Windows install and a few programs?   I've never dual booted before, so I'm not quite sure how easy it is to mess up the process. Can you recommend any tutorials on how to set up a dual-boot configuration on Windows? Coefficients change signs I have a dataset where there is a high degree of multicollinearity, with all variables correlating positively with each other and the dependent variable. However, on some of the models I run I get a couple of significant negative coefficients. Basically there are two coefficients that depending on what variables I include in the model, I can manipulate their signs.  My understanding is that if the variance-covariance matrix only contain positive values, then all coefficients should also be positive. Is this correct? Error message: qgis_core.dll missing I have a fresh install of QGIS 2.4. When trying to open a .shp file I get the error message below.  I've followed their advice and have done several re-installs and also cleared all qgis files from my system (Parallels on Mac OS X 10.6) before those re-installs. I've tried QGIS 2.2 which caused the same problem.  Funnily all worked for a day, the following day and since not anymore...  Has anyone come across this before? App question timer shouldn't kick in until submission I attempted to ask a question using the iOS app, but it was rejected due to lack of a required tag. On adding the tag I found that I wasn't permitted to submit the question for another 60 seconds, even though this wasn't a new question.  Is this timer intentional, or should it not kick in for edits of questions not actually accepted by the site? What is the complexity of finding SHA-1 collisions? Given the , what is the complexity of finding a SHA-1 collision?  Marc Steven's  is still detailing about 260. Does the previous complexity still hold? Why does unequal amounts of RAM in each slot decrease performance? describes the RAM specifications for many of the MacBook laptops. In the section for my laptop (13" Pro Late 2011), it says:     Additional Notes: For best performance, fill both memory slots, installing an equal memory module in each slot.   This isn't the first time I've heard of this phenomenon, and it's definitely not specific to Apple.   Why is this the case? Other than the obvious decrease in available memory, why would it be worse to run with 6GB (1x4GB + 1x2GB) than with 8GB (2x4GB)? Closed form for $ \int_0^\infty {\frac{{{x^n}}}{{1 + {x^m}}}dx }$ I've been looking at  $$\int\limits_0^\infty  {\frac{{{x^n}}}{{1 + {x^m}}}dx }$$  It seems that it always evaluates in terms of $\sin X$ and $\pi$, where $X$ is to be determined. For example:  $$\displaystyle \int\limits_0^\infty  {\frac{{{x^1}}}{{1 + {x^3}}}dx = } \frac{\pi }{3}\frac{1}{{\sin \frac{\pi }{3}}} = \frac{{2\pi }}{{3\sqrt 3 }}$$  $$\int\limits_0^\infty  {\frac{{{x^1}}}{{1 + {x^4}}}dx = } \frac{\pi }{4}$$  $$\int\limits_0^\infty  {\frac{{{x^2}}}{{1 + {x^5}}}dx = } \frac{\pi }{5}\frac{1}{{\sin \frac{{2\pi }}{5}}}$$  So I guess there must be a closed form - the use of $\Gamma(x)\Gamma(1-x)$ first comess to my mind because of the $\dfrac{{\pi x}}{{\sin \pi x}}$ appearing. Note that the arguments are always the ratio of the exponents, like $\dfrac{1}{4}$, $\dfrac{1}{3}$ and $\dfrac{2}{5}$. Is there any way of finding it? I'll work on it and update with any ideas.    UPDATE:  The integral reduces to finding   $$\int\limits_{ - \infty }^\infty  {\frac{{{e^{a t}}}}{{{e^t} + 1}}dt} $$  With $a =\dfrac{n+1}{m}$ which converges only if   $$0 &lt; a &lt; 1$$  Using series I find the solution is     $$\sum\limits_{k =  - \infty }^\infty  {\frac{{{{\left( { - 1} \right)}^k}}}{{a + k}}} $$ Limit of $\lim_{n\rightarrow \infty} \sum^{n}_{i=1} \frac{1}{\sqrt {n^2 +i} }$ Let $\mathbb{R^{ n×n}}$ be the space of n × n real matrices. Show that if $ A(t) \in \mathbb{R ^{n×n}}$ is a differentiable function of $t$ then $\frac{d(det A(t))}{dt}$ is the sum of the determinants of $n$ matrices, in which the $i$th matrix is $A(t)$ except that the $i$th row is differentiated. Use this result to prove that the directional derivative of the determinant function at the matrix $A \in \mathbb{R ^{n×n}}$ along the direction $B \in \mathbb{R^{ n×n}}$ is given by $$(det)^{'} (A; B) = tr(Adj(A)B) = \langle Adj(A)^{T} , B \rangle $$ where $Adj(A)$ is the adjoint of $A$, and where the inner product on $\mathbb{R^{n×n}}$ is the trace inner product given by $\langle X, Y \rangle = tr(X^{T} Y )$ Conclude that $$D(det)(A) = Adj(A) ^T $$.