i got array from user wanna hint in my assignment user input array elements and key and i'll check if the key found in the array or not and my output should be one line key found or not , and i tried more than time to fix it and thinking more but have no idea how to get only one output in same time i checking all array elements witch mean i'll get num of elements output lines ^_^   Scanner in=new Scanner(System.in);         System.out.println("Enter array size ? ");         int size=in.nextInt();         int input[] = new int[size];          for(int i=0;i&lt;size;i++){             System.out.println("Enter array element #"+i);             input[i]=in.nextInt();         }         System.out.println("Enter key ? ");         int key=in.nextInt();         for(int i=0;i&lt;size;i++){             if(key!=input[i]){                 System.out.println("key not found");             }else if(key==input[i]){                 System.out.println("key found");             }         }
I've been using the == operator in my program to compare all my strings so far. However, I ran into a bug, changed one of them into .equals() instead, and it fixed the bug.  Is == bad? When should it and should it not be used? What's the difference?
How do I undo the most recent local commits in Git? What are good strategies for booster drafts? I know that doing a booster draft can be somewhat complicated, because to really be good you need to know a lot about the set you're drafting (or be really good at evaluating cards quickly) and to pay attention to signal cards.    Besides going into the whole complicated strategies of knowing the set and paying attention to signal cards, what are some relatively simple/basic guidelines for drafting? Is there a way to assign a value to a variable, that value which we get in terminal by writing any command?  Example command: sensors  From that we get CPU temperature. How can I assign this value to a temp_cpu variable? They agreed to stay connected for hours in their provisional support group, looking for answers in their counterparts.   I want to change the bold part to say that they all shared the same problem.  Might end up using one of the above, but I feel like I need some more options to weigh in.    Edit for context: they all share the same rare cognitive impairment Derivation of E step in EM algorithm While im going through the derivation of E step in EM algorithm for pLSA, i came across the following derivation . Could anyone explain me how the following step is derived.   $\sum_z q(z) log \frac{P(X|z,\theta)P(z|\theta)}{q(z)}  = \sum_z q(z) log \frac{P(z|X,\theta)P(X,\theta)}{q(z)} $ What is the simplest organism that was observed to learn: change its behavior permanently in response to some event/stimuli in a way that this change persists even if the event does not happen again? Connect MacBook Pro to two external monitors Is there a way to connect my MacBook Pro to two external monitors (either VGA or HDMI; no Thunderbolt) in such a way that the Mac screen serves as a third monitor?  What hardware do I need? Prove that the multiplicative groups $\mathbb{R} - \{0\}$ and $\mathbb{C} - \{0\}$ are not isomorphic. Is my proof correct? I have made use of the fact isomorphism preserves order of elements, which I proved couple of exercises back. I am also interested in other ways of proving it. Is there a more explicit way or is this explicit enough?    Problem Prove that the multiplicative groups $\mathbb{R} - \{0\}$ and $\mathbb{C} - \{0\}$ are not isomorphic.  Solution Recall that isomorphism preserves order of elements and hence if there exists an isomorphism from $\phi: \mathbb{C}-\{0\} \mapsto \mathbb{R}-\{0\}$, then $x \in \mathbb{C} - \{0\}$, and $\phi(x) \in \mathbb{R} - \{0\}$, then $\vert x \vert = \vert \phi(x) \vert$. Now note that the element $i \in \mathbb{C} - \{0\}$ has order $4$. However, no element in $\mathbb{R}-\{0\}$ has order $4$. Hence, no isomorphism can exist. Hence, the multiplicative groups $\mathbb{R} - \{0\}$ and $\mathbb{C} - \{0\}$ are not isomorphic.    Thanks Subgroups of $\Bbb{R}^n$ that are closed and discrete How to find out how many games I have won with a specific race on ladder 1v1?  The profile screen just gives me the total wins and losses but I play with all three races and I would like to know my stats per race.  Thanks.  PS: I have been playing Starcraft from the release date but I don't have the old replays as I format my computer often. If A is invertible, prove that $\lambda \neq 0$, and $\vec{v}$ is also an eigenvector for $A^{-1}$, what is the corresponding eigenvalue? If A is invertible, prove that $\lambda \neq 0$, and $\vec{v}$ is also an eigenvector for $A^{-1}$, what is the corresponding eigenvalue?  I don't really know where to start with this one. I know that $p(0)=det(0*I_{n}-A)=det(-A)=(-1)^{n}*det(A)$, thus if both $p(0)$ and $det(0) = 0$ then $0$ is an eigenvalue of A and A is not invertible. If neither are $0$, then $0$ is not an eigenvalue of A and thus A is invertible. I'm unsure of how to use this information to prove $\vec{v}$ is also an eigenvector for $A^{-1}$ and how to find a corresponding eigenvalue. Optimal tiling of polygon using ArcGIS Desktop? I am trying to tile a polygon with a minimal number of fixed sized squares.  Currently I am creating a fishnet over my polygon then spatially joining the squares that intersect the polygon. This is not optimal.  Also note the squares can be shifted vertically/horizontally but not rotated.  My end goal: The polygon represents a clipped image and I want a tiling of the clipped image. Where each tile is 300px by 300px. Some overlap is fine if that makes the problem easier.  Current    Manually optimized    Are there any tools or algorithms that would help with this? I am proficient with Python and ArcMap.  The polygon was created from line features so I also have access to those segments. Maybe that would will help for generating the squares.  The entire polygon must be covered. MacTeX - TeX Live Utility broken after 2015 update Vectorize a PNG file in Adobe Illustrator CC 2017 I need to open a white PNG shape in Illustrator. I want to convert it into vector and change the color. In CS6 is very simple to do this. Can you help me to do this in CC? How do I show that $X = \left\{ (x,y) \in \mathbb{R}^2 \mid x \in \mathbb{Q}\text{ or }y \in \mathbb{Q}\right\}$ is path connected?    Note that $X$ is a topological space with subspace topology $\tau = \left\{ U \cap X \mid U\text{ is open in }\mathbb{R}^2\right\}$.  I only know two things (with respect to path connectedness):   A topological space $X$ is path connected iff for every $p,q \in X$, there is a continuous function $f: [a,b] \to X$ with $f(a)=p$ and $f(b) = q$.    Continuity $f$ is defined as for every open set in $X$, its preimage is open in $[a,b]$ (with subspace topology induced by $\mathbb{R}$ (with standard topology) )   Suppose $X$ and $Y$ are two topological spaces and $f: X \to Y$ is a continuous surjection. If $X$ is path connected, then $Y$ is path connected. Predict probabilities from Firth logistic regression in R I'm using the logistf package in R to perform Firth logistic regression on an unbalanced dataset. I have a logistf object:  fit = logistf(a~b)   Is there a predict() function like on that's used in the lm class to predict probabilities for future data points? Or do I have to manually input the estimated parameters from the Firth regression. $D_8$ as a derived subgroup Every undergraduate student knows that there are (exactly) two non-abelian groups of order 8: Dihedral ($D_8$) and Quaternion ($Q_8$). The group $Q_8$ has many interesting properties; simple of them are: it has unique element of order $2$, all subgroups are normal, etc. A property, which is strange and not obvious, the group $Q_8$ has, is that there is no group $G$ such that $G/Z(G)$ is isomorphic to $Q_8$. On the other hand, $D_8$ has no such property; there are (infinitely many) groups $G$ such that $G/Z(G)$ is isomorphic to $D_8$; example - $D_{16}$.   The question, I would like to ask, is related to a property of $D_8$, which is not shared by $Q_8$. There are (infinitely many) groups whose derived subgroup is $Q_8$; example- $SL_2(3)$. For groups $G$ of order &lt;100, one can check on GAP that $D_8$ is not a derived subgroup of any group. The natural question is then:  Question 1: Does there exist a finite/infinite group whose derived subgroup is equal to $D_8$?  Question 2: Does there exist a finite/infinite group whose derived subgroup is equal to (general) dihedral group $D_{2n}$ of order $2n$ ($n&gt;2$)? How to resize partitions? Previously, I have installed Windows 7 on my 320 GB laptop with three partitions 173, 84 and 63 GB each. The 63 GB partition was where the Windows was installed. The rest were for file containers.  Now I changed my OS to Ubuntu 12.04 LTS. I installed Ubuntu by replacing the entire Windows 7 on the 63 GB partition. The rest of the partitions remain as an NTFS Windows partition and I can still access them both (the 173 and 84 GB partitions).  Now I want to change the two partitions of Windows into an Ubuntu format partitions plus most importantly, I want to extend the 63 GB partition to more than a 100 GB because at the moment I am running out of disk space. Whenever I try to install any application, especially using wine, it always complains for a shortage of disk space.  How do I do the extending activity before I entirely format my laptop again and lose all the important files on my partitions? How do you pass a function as a parameter in C? I want to create a function that performs a function passed by parameter on a set of data. How do you pass a function as a parameter in C? Editing default custom object home screen I would like to add a custom button (URL to Flow) to my default home page for my custom object. Currently, I have a default "New" button to create a new record (see attached screen shot). I'm wanting to add my Flow custom button to this page. Is there a way to do this?  Cheers, Sean.