Ruby BST: why does this code need 'self' to make a new node?

I wrote the binary search tree code with Ruby. I'm now wondering why this code needs self in self.left = Node.new(3) to make a new node.  I was thinking that self can be removed like this left = Node.new(3)because in this case receiver is obvious(an instance to which insert_left method applied). But it seems wrong.. Can you please help me why my thought is wrong.  module BinaryTree class Node   attr_accessor :value, :left, :right  def initialize(value)   @value = value end  def insert(v)   case @value <=> v   when 1 then insert_left(v)   when -1 then insert_right(v)   when 0 then nil   end end   private def insert_left(v)   if left     left.insert(v)   else    self.left = Node.new(v)   end end  def insert_right(v)   if right     right.insert(v)   else     self.right = Node.new(v)   end end  end end


Does Tolkien ever refer to "Men" as Humans?

I'm asking this because I've recently come upon the conclusion that, as beings living on an entirely different plane of existence, they might simply not be Humans at all, and just Humanoids bearing a striking resemblance to our own species...  Is there any place in the books where this group is called Humans and not Men or Edain, Rohirrim... ?


How do I get an RSS feed of my YouTube subscriptions?

The default "Subscriptions" feed on the YouTube homepage shows all of the activity of the people that I am subscribed to on YouTube or have in circles on Google+. However, I'm most interested in new videos that the people I subscribe to (either on YouTube or by circling on Google+) create and post (neglecting comments or sharing other people's videos - what you see when you check the "show uploads only" checkbox on the YouTube homepage). However, being able to bring anything off of the YouTube homepage and into Google Reader as an RSS feed would be good.  Is there a way to do this?


Creating / Re-creating the X,Y,Z mesh Surface functions with the (u,v) options using python

Creating / Re-creating the X,Y,Z mesh Surface function with the (u,v) options using python in Blender 2.8x Does an example exist / anyone have an example of how to reproduce the X,Y,Z mesh Surface functions / ad-don with (u,v) options.  Just using python and Blender 2.8x? I'm trying to do some animation with it using python but I can't find a way to get just those particular functions I would need. This is the functions i'm talking about.  I'm referring to the arrows and highlighted sections below when referring to (u,v) options  (They are connected mathematically)


Functional completeness of $\{\text{or},\text{ xor}, \text{ xnor}\}$

I need to prove the  of $\{\text{or},\text{ xor},\text{ xnor}\}$ with the help of $\{\text{not},\text{ or},\text{ and}\}$ (which have been already proven to be functional complete). My attempt is that I only have to show that $\{\text{or},\text{ xor}\}$ is functional complete as $\text{xnor}$ is the negation of $\text{xor}$ while $\text{xor}$ is defined as $(x \wedge ¬y) \vee (¬x \wedge y)$. My attempt is to show that I can use $\{\text{or},\text{ xor}\}$ for $\{\text{not},\text{ or},\text{ and}\}$ but I already fail showing that $¬x$ can be replaced by $\{\text{or},\text{ xor}\}$... $¬x = ¬x+¬x = ¬¬(¬x+¬x)$ at this point I have no clue how to continue any constructive ideas?


I have a MySQL table called mst_order_details and it has column (order no) and it can be same order no it more time.  Each order number have related technique column I want to concat technique column according to order no  mst_order_details table :  order no   Technique ------------------------- 1           heat_seal 1           laser_cut 1           oil_filter 2           diamond cut 2           diamond cut   Output should be like this :   order no    Technique ---------------------------------------------  1          heat_seal/laser_cut/ oil_filter  2          diamond cut


On the primality of integers of the form $p^2+k$

I am not able to find an answer to the following question:     For which positive even integers $k$ is the integer   $$p^2+k$$ prime, where $p$ is a prime number $\gt5$?


Do you know a simple sound booster app for Mac?

Some videos on websites have the sound volume so low that even with all sound settings at maximum levels it's hard to listen.  I'm looking for an app that would allow me to boost the Mac's volume. Something similar to VLC volume controls.  I already looked at Audio Hijack, but it has way too much features for what I'm looking for. Anything free of charge would be a plus. :)


Malware Bruteforce Attack on software RAID server

A month ago or so I wanted to make sure I still had access to my Linux box while away from home.  I did NOT take the time to properly harden the box and got some malware installed into the init scripts and crontabs.  I since removed the default gateway so it is unable to send dDOS attacks outbound.  Unfortunately I am also running mdadm on the box.  I have the OS (/) on md0 and all of my files on md1 (/home).  I want to blow away the OS partition but am worried it may effect my /home (md1) partition.  What is the best way to fix this issue (without losing my /home partition)?


Is the Uncertainty Principle valid for information about the past?

My layman understanding of the Uncertainty Principle is that you can't determine the both the position and momentum of a particle at the same point in time, because measuring one variable changes the other, and both cannot be measured at once.  But what happens if I measure a charged particle with any number of detectors over a period of time? Can I use a multitude of measurements to infer these properties for some point in the past? If not, how close can we get? That is, how precise can our estimate be?


Why should I be punished for deleting my closed/protected answers and questions?

I don't see why why I should be warned about being made unable to ask or answer for deleting questions and answers I've put up when they have been deemed off-topic and closed, or voted down and become "protected" by Stack Exchange moderators.


Show that $\mathbb{E}(g(T-p)) < \mathbb{E}(g(S-p))$ for any convex function $g$ if $T$ and $S$ are estimators of $p$

The more detailed question.    I'm kinda having some trouble starting out with answering this question. My initial approach would be to $g(x)= x^2$ since that is a convex function and find the expected values of $(T-P)^2$ and $(S-P)^2$.  However I fear that that would be too specific since the question would like to prove for any convex function. Is there a way to prove this more generally?


Camera shot with close-up next to farther away standing person

While watching  I noticed a very characteristic camera shot. At a scene where the main character, Wendy, sits in her room at the computer (watching the supposedly foretelling fotos), her sister talks to her from the outside (asking if she can have the camera/fotos). There is a certain camera shot, where on the left side a frontal close-up of Wendy's face is shown, while on the right side you see her sister standing in full height inside the open door.    This shot immediately struck me as being somehow characteristic and out of place and infused feelings to me of some kind of older Hitchcock or Brian De Palma thriller or something the like. I also think to remember of having seen this kind of shot or something similar used in , where Jessica Lange is shown in front of the dresser talking to Nick Nolte who stands in the door or father away.  I would like to know if this technique has a certain name or theory behind it and where its origins lie, or if there is any particular director or movie who made this famous. It may be even that Final Destination 3 uses this especially in reference to some director or movie.


The escape character not working with the code I write in the questions or answers (but not in the comment).  I can't write:  `\`something\``   As inline code, it appears like \something``, but it should be:  `address 1`   If I want to write \, it shouldn't be:  `\`   but  `\\`   edit  the way to do so as to use   `` `something` ``   it will appears like `something`   but it doesn't work like in comments so why this confusion to do the things in comments differently than the questions and answers i still believe that they should allow the escape character in the inline code for answers and questions but it's not essential now , even so if developers make that it will be a good thing for alot of people


If $\gcd(m,n)=1$, then $\mathbb{Z}_n \times \mathbb{Z}_m$ is cyclic.

If $\gcd(m,n)=1$, then $\mathbb{Z}_n \times \mathbb{Z}_m$ is a cyclic group.    Let's denote $\mathbb{Z}_n=\langle1_n \rangle$ and $\mathbb{Z}_m=\langle1_m \rangle.$ My proof goes as follows: since $|\mathbb{Z}_n \times \mathbb{Z}_m|=mn$ and $\gcd(m,n)=1$, $|\langle 1_n,1_m\rangle|=\text{lcm}(|\langle 1_n\rangle|,|\langle 1_m\rangle|)=mn$. Hence the direct product is cyclic. Is my proof correct?


BASH - never execute unless environment variable is defined and certain value

I would like to NEVER execute a method unless an environment variable is defined, and if it is it MUST be a certain value, say "DOIT".  I know how to check the value of an environment variable, but I don't know how to check if it's defined and not defined by empty ("").  Thanks


Prove: If $p$ is prime and $p \mid a_1a_2\dots a_n$, then $p \mid a_i$ for $i\in\{1, \dots, n\}$.

Euclid's lemma: If $p\mid ab$, then $p\mid a$ or $p\mid b$. Prove: If $p$ is prime and $p \mid a_1a_2\dots a_n$, then $p \mid a_i$ for some $i = 1, 2, \dots, n$. Proof by Induction: P(1): From $p\in\mathbb{P}$ and $p\mid a_1$ it follows that: \begin{equation*} p \mid a_i, \end{equation*} for $i = 1$. P(1) is true. P(2): If $p\in\mathbb{P}$ and $p\mid a_1a_2$ it follows from the lemma that if $p \nmid a_1$, then: \begin{equation*} p \mid a_2, \end{equation*} so \begin{equation*} p \mid a_i \end{equation*} for some $i = 1, 2$. On the other hand, if $p\mid a_1$, then the same conclusion is reached. P(2) is true. Now assume P(k) inductively: \begin{equation*} p \mid a_1a_2\dots a_k \rightarrow p \mid a_i \end{equation*} for some $i = 1, 2, \dots, k$. P(k+1) is also true because from $p \mid (a_1a_2\dots a_k)a_{k+1}$ two cases arise: Case I: $p\nmid a_1\dots a_k$. Using Euclid's lemma it follows that if $p\nmid a_1\dots a_k$, then: \begin{equation*} p\mid a_{k+1} \end{equation*} and thus: \begin{equation*} p\mid a_i, \end{equation*} for some $i = 1, 2, \dots, k+1$. Case II: $p\mid a_1\dots a_k$. By the inductive hypothesis, the conclusion may be reached: \begin{equation*} p \mid a_i, \end{equation*} for some $i = 1, 2, \dots,k, k+1$.


Prove that for all $a \in N$ and $b \in K, aba^{−1}b ^{−1} \in N \bigcap K.$

Let $G$ be a group and let $N$ and $K$ be normal subgroups of $G.$  All I can think of to start is by noting that if $N$ is a normal subgroup of $G$ then for all $x \in G, xax^{-1} \subseteq N.$ Also if $K$ is a normal subgroup of $G$ then for all $x \in G, xbx^{-1} \subseteq K.$ Not sure how to work with this to show $aba^{−1}b ^{−1} \in N \bigcap K.$


How to hide other SubSubsections in sidebar of beamerclass?

I make a translation of a 600 pages Book with the beamer class in Latex, so I have lots of Subsections and SubSubsections. I want to show all subsections of the current Section in the sidebar along with all the subsubsections of the CURRENT subsection. I came across a hint and made   \setbeamertemplate{subsubsection in sidebar shaded} {\vspace*{-\baselineskip}}   But that just hides all subsubsections but the current one. The best solution would be something like  \setbeamertemplate{subsubsection in sidebar shaded}[subsubsectionstyle=show/shaded/hide]   or any other way i can change the subsubsectionstyle. The best idea I had was   \setbeamertemplate{subsubsection in sidebar shaded} {\tableofcontents[subsubsectionstyle=show/shaded/hide]}   But that just creates over 3000 errors and didn't solved my problem . Is there anybody who has an idea to solve this Problem ?  Here is a MWE to show what i mean:      \documentclass[9pt]{beamer}  \usetheme[hideothersubsections]{Goettingen}  \begin{document}  \section{Section 1} \begin{frame} \frametitle{Section 1} \end{frame}  \subsection{Subsection 1.1} \subsubsection{SubSubsection1.1.1} \begin{frame} bla \end{frame} \subsubsection{SubSubsection 1.1.2} \begin{frame} bla \end{frame}  \subsection{Subsection 1.2} \subsubsection{SubSubsection1.2.1} \begin{frame} bla \end{frame} \subsubsection{SubSubsection 1.2.2} \begin{frame} bla \end{frame}  \section{Section 2} \begin{frame} \frametitle{Section 2} \end{frame}  \subsection{Subsection 2.1} \subsubsection{SubSubsection2.1.1} \begin{frame} bla \end{frame} \subsubsection{SubSubsection 2.1.2} \begin{frame} bla \end{frame}  \subsection{Subsection 2.2} \subsubsection{SubSubsection2.2.1} \begin{frame} bla \end{frame} \subsubsection{SubSubsection 2.2.2} \begin{frame} bla \end{frame} \end{document}   And one page of the output is:   As you can see, with the option [hideothersubsections] in  \usetheme[hideothersubsections]{Goettingen} subsections outside the current section are not shown in the sidebar. I want the same effect for the subsubsections with regard to subsections. So Subsubsection1.2.1 and SubSubsection1.2.2 should not be seen in the sidebar, because im in subsection 1.1  Therefore it should looks like this:   And when my slides move on and the subsections changes (from subec 1.1 to subsec 1.2), then the displayed subsubsection shall also change. It then should looks like this:   Of course the space between subsec 1.1 and subsec 1.2 should disappear.


Is there a way to clear quests from your journal in skyrim

I have a number of quests in my journal that are already done but got put in a second time due to an unfortunate conversation option. Does anyone know a way to clear these types of quests out of the journal or just drop a quest if necessary?


I have a file that is written in bytes like this  \r\x00\x00\x00\xd0{"a": "test"}   which has the following bytes  [13, 0, 0, 0, -48, 123, 34, 97, 34, 58, 32, 34, 116, 101, 115, 116, 34, 125]   when this file is read into Java I'm getting everything escaped  \\r\\x00\\x00\\x00\\xd0{"a": "test"}   when I do a .getBytes() on this string I get   [92, 114, 92, 120, 48, 48, 92, 120, 48, 48, 92, 120, 48, 48, 92, 120, 100, 48, 123, 34, 97, 34, 58, 32, 34, 116, 101, 115, 116, 34, 125]   I have to convert the string to the valid bytes, I don't have the ability to change how a file is read unfortunately.  I know in Python, you open a file with the 'rb' mode and you're good to go.  If java has that ability, I can't use it.  So in short, how can I convert the string Java reads into the original byte array that was written to the file?   Sorry if this question is stupid simple, but I am so green when it comes to Java.  EDIT: So I believe my question is different than the proposed "duplicate question" link.  It's not taking every literal value in the java string and converting that back to a byte.  The string in java has been escaped by the reader.  \x00 is now \\x00 which is not the same byte value.  So I guess I need some way of unescaping the string?  The file as viewed in a hex editor  0000000: 5c72 5c78 3030 5c78 3030 5c78 3030 5c78  \r\x00\x00\x00\x 0000010: 6430 7b22 6122 3a20 2274 6573 7422 7d0a  d0{"a": "test"}.   The string that java gets viewed in a hex editor  0000000: 5c5c 725c 5c78 3030 5c5c 7830 305c 5c78  \\r\\x00\\x00\\x 0000010: 3030 5c5c 7864 307b 2261 223a 2022 7465  00\\xd0{"a": "te 0000020: 7374 227d 0a                             st"}.


I have the stackoverflow app installed on my Galaxy Tab 3. Every time I open a question, no matter from which stack site, I receive a layout error, which makes the app unusable.


There was a better answer but mine got chosen as the correct one

I recently answered a question on Stack Overflow and although mine was selected as the accepted answer, I could clearly see that it isn't the best answer. How do I essentially compel the person that asked the question to choose another answer?


Given (p ∧ q), use the Fitch system to prove (q ∨ r).

I know this question has already been posted but I cannot seem to find an answer there.I am taking this course and I just cannot figure out how to solve this on the platform. Please I really need help with this. The link to the platform is: .  Thanks in advance I would trully be grateful to the person who tells me how to solve this on the given website. Thanks in advance!


How do I run .c file from the command line

I am beginning to work with micro controllers and programming them using C language.   All my programming experience is with Python language.   I know that if I want to test a script I have written in python, I can simply launch terminal and type in “python” with the path of the file I want to run.  I tried a web search, but most didn’t seem to understand what I was asking.  How do I run c from terminal?


Formal proof of $\lim \limits_{x \to 0} f(x)=\lim \limits_{x\to a} f(x-a)$

$\lim \limits_{x \to 0} f(x)=\lim \limits_{x\to a} f(x-a)$   My strategy (based off an answer to one of my previous questions) has been to set the two limits equal to some number c, so that $\lim \limits_{x \to 0}$ $f(x)=c$ and $\lim \limits_{x\to a}$ $f(x-a)=c$, and then to show both limits equal each other. So given an $\epsilon >0$, there is a $\delta >0$ such that,  if $0<|x-a|<\delta$, then $|f(x-a)-c|<\epsilon$  and  if $0<|x-0|=|x|<\delta$, then $|f(x)-c|<\epsilon$  How do I proceed from here to show that the two limits are equal?


Recently, my onCreate() method has been having a hard time connecting a Toolbar to a toolbar in my xml file.  Code:   super.onCreate(savedInstanceState);  setContentView(R.layout.content_two_player_game);  Toolbar toolbar = (Toolbar) findViewById(R.id.two_player_toolbar);  setSupportActionBar(toolbar);   The app compiles and runs in the main screen and the single player screen, but when I try and start the two player screen, it crashes. The ID is correct and yet the toolbar is still Null when I try setSupportActionBar(toolbar).  My error:      java.lang.RuntimeException: Unable to start activity ComponentInfo{com.phoenixdev.yahtzee/com.***.***.TwoPlayerActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.CharSequence android.support.v7.widget.Toolbar.getTitle()' on a null object reference   The activity_two_player_game.xml file:  <?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:layout_width="match_parent"     android:layout_height="match_parent"     android:fitsSystemWindows="true"     tools:context="com.phoenixdev.yahtzee.TwoPlayerActivity">      <android.support.design.widget.AppBarLayout         android:layout_width="match_parent"         android:layout_height="wrap_content"         android:theme="@style/AppTheme.AppBarOverlay">          <android.support.v7.widget.Toolbar             android:id="@+id/two_player_toolbar"             android:layout_width="match_parent"             android:layout_height="?attr/actionBarSize"             android:background="?attr/colorPrimary"             app:popupTheme="@style/AppTheme.PopupOverlay" />      </android.support.design.widget.AppBarLayout>      <include layout="@layout/content_two_player_game" />  </android.support.design.widget.CoordinatorLayout>


For any integer x, if x mod 15=7 then x mod 5=2, Make an outline for a proof of this statement being as explicit as possible, then prove the statement. I am a bit stuck on how to transform this into symbols. So far I have this: ∀x∈Z(x mod 15=7 → ∃q∈Z...?)


Limit approaching infinity of sine function

I'd like to ask a question which I have been reflecting on for some time now. What is the limit of: $f(x) = \sin(x)$ as $x$ tends to infinity?  As we know, the function has a definite value for each multiple of a value included between $0$ and $2\pi$, but, how can we know which value it will have at infinity?


Symmetric positive semidefinite closedness

Given $A,B$ symmetric positive semidefinite matrices of equal size it is clear $A^2,B^2,(A+B)^2,A+B$ are all symmetric positive semidefinite.  However is $2AB$ symmetric positive semidefinite?


Do US universities publish an official definition of what constitutes a particular race/ethnicity in the context of scholarships or admissions?

As an example, let's say someone with 1/16 of African American heritage applies for a minority scholarship and claims themselves as African American. Would they be rejected, all other factors being equal? If so, do universities generally publish a guideline of what constitutes a particular race in the context of scholarship applications or college admissions?  Note that this question is of practical value as there are presumably millions of people of mixed heritage living in the US at the moment.


Do I need a passport book if I am flying from Reynosa, Mexico to Cancun Mexico?

I am a US citizen and Im traveling to Reynosa, Mexico and then taking a flight from there to Cancun, Mexico. Will I need a passport traveling within Mexico.


Question is to find discriminant of polynomial $x^n-1$  I consider $f(x)=x^n-1=(x-a_1)(x-a_2)(x-a_3)\cdots(x-a_n)$  Now, $$f'(x)=[(x-a_2)(x-a_3)\cdots(x-a_n)]+\cdots+[(x-a_1)(x-a_2)\cdots(x-a_{n-1})]$$  $f'(a_1)=(a_1-a_2)(a_1-a_3)\cdots(a_1-a_n)$  $f'(a_2)=(a_2-a_1)(a_2-a_3)\cdots(a_2-a_n)$  $f'(a_3)=(a_3-a_1)(a_3-a_2)\cdots (a_3-a_n)$  and so on.. Now i need to know how many sign changes do i need to get something which looks like discriminant  I would write this in a matrix form to get some idea... $$\begin{bmatrix}12&13&14&15&\cdots&1n\\21&23&24&25&\cdots&2n\\31&32&34&35&\cdots&3n\\\\n1&n2&n3&n4&\cdots&n(n-1) \end{bmatrix}$$   See that i first row every element is in correct position i mean of the form $ij$ for $i<j$  In second row only one element is odd of the form $ij$ with $i>j$ but i want $i<j$ in discriminant so i would change this.. So my count starts... change sign 1  In third row there are two elements which are not behaving properly... So, I should change them also.. So, Now another  two changes... On the whole $1+2$ changes...  In fourth row there would be $3$ misbehaving children so my count is $1+2+3$  In last row every body is behaving badly so i have to make $n-1$ changes in that..  On the whole i have to make $1+2+3+\cdots +n-1=\dfrac{n(n-1)}{2}$ changes..  So, $f'(a_1)f'(a_2)\cdots f'(a_n)=(-1)^{\dfrac{n(n-1)}{2}}(a_1-a_2)^2(a_1-a_3)^2\cdots (a_{n-1}-a_n)^2=(-1)^{\dfrac{n(n-1)}{2}} Disc(f)$  But then $f'(x)=nx^{n-1}$  This tells me that $f'(a_i)=n(a_i)^{n-1}$   So, $$Disc (f)=(-1)^{\dfrac{n(n-1)}{2}}  n^n(a_1a_2\cdots a_n)^{n-1}=(-1)^{\dfrac{n(n-1)}{2}}  n^n(-1)^{(n-1)^2}=(-1)^{\dfrac{n(n-1)}{2}+(n-1)^2}$$  As $(-1)^{n-1}=(-1)^{(n-1)^2}$ i would replace my $(-1)^{(n-1)^2}$ with $(-1)^{n-1}$  $$Disc (f)=(-1)^{\dfrac{n(n-1)}{2}}  n^n(a_1a_2\cdots a_n)^{n-1}=(-1)^{\dfrac{n(n-1)}{2}}  n^n(-1)^{n-1}=(-1)^{\dfrac{n(n-1)}{2}+n-1}n^n$$  i.e., $$Disc(x^n-1)=(-1)^{\dfrac{(n-1)(n+2)}{2}}n^n$$  As nobody was giving answer to my question i was trying my best and started editing this when ever i thought i find some thing and this is its final stage... This is fully solved now...  Thank you..  Any other ways of approaches would be appreciated..   Thank you :)


Is there a word or phrase for this specific kind of abuse of ambiguity?

In Peter Pan 2: Return to Never Land, Captain Hook promises not to harm a single hair on Peter's head. Then, he plucks a single hair off of Peter's head and claims that is the one he chooses not to harm. The cleverness stems from the fact that we assume he meant any hairs on his head, but grammatically it could also refer to just a single hair. I know the phrase is an idiom, but I'm more interested in if there's a word for the logical substitution that can be made in the phrase.


Download specific file from a torrent using a cli client

I want to be able to download specific file from a magnet/.torrent (not all the files) using a cli client for my headless server. I know that GUI clients usually have this option but was looking for a command line tool. Though  answers on the options available, it doesn't cater to this specific question


Prove algebraically that $n(n+1)2^{n-2}=\sum_{k=1}^{n}k^2\dbinom{n}{k}$ where $n$ and $k$ are integers. I start with the fact that $(x+1)^n=\sum_{k=0}^{n}\dbinom{n}{k}x^k$ and differentiate both sides of the equation twice, with respect to $x$. The second derivative (with respect to $x$) of the above equation yields: $n(n-1)(x+1)^{n-2}=\sum_{k=0}^{n}k^2-k\dbinom{n}{k}x^{k-2}$. Now, I am not sure how to proceed. I know I'm supposed to set $x = 1$. But even then, I am missing the $(n+1)$ on the left hand side and there is still a $-k$ on the right hand side. Any help would be appreciated. Thank you.


Does this notation for the momentum in quantum mechanics make sense?

Let $P$ be the momentum operator. Susskind writes:  $$P |\Psi \rangle =-ih \frac d {dx} |\Psi \rangle$$ Then he states that this can be rewritten as $$-ih\frac {d \psi(x)}{dx}$$ Where $\psi(x)$ is the wave function belonging to $|\Psi\rangle$  It seems to me that the first equation is meaningless. How can we differentiate a state (a ket) w.r.t. $x$? (as opposed to the representation of that state in a wave function, as in the second equation).   Am I correct that this notation $\frac d {dx} |\Psi \rangle$ is hacky? If yes, how do we correctly write down the definition of the momentum operator in terms of the ket $|\Psi \rangle$? (i.e. without choosing a basis, and thus without using a wave function)


How would I convert a picture of a slanted surface into a straight one?

Suppose I took a picture of a whiteboard at an angle. If I could detect where the corners of the whiteboard are, what algorithms and linear projections could I use to convert this slanted view into a "head on" view?


I am trying to quote a sentence in line and to have it in italics so like " bla bla bla " and the text inside the quotation marks is in italic. How to do that?


Proving uniform boundedness of sequence of functions

Let $(f_{n})$ be a sequence in $C[0,1]$ that is equicontinuous on $[0,1]$, and let $p\in [0,1]$ be given. Show that if $(f_{n}(p))^{\alpha}_{n=1}$ is bounded, then $(f_{n})$ is uniformly bounded.  Can I use Arzela Ascoli theorem to prove the above problem?


Ok, so i made a scientific calculator recently and one of my friends was using it when he said that if he types in (2.1 * 3) the answer should be 6.3 but he recieves something like: 6.30000001.  Why does this happen? Is this some sort of bug in java?  EDIT: Its not just a problem with my calc, i also made a small java file for multiplying 2 numbers and i face the same probelem even in cmd


Ubuntu 18.04: Audio doesn't work unless I switch between outputs

On my fully updated Ubuntu 18.04.3 system, audio doesn't work unless I switch between outputs. When I boot my PC, the right output (stereo speakers) is already selected by default, but there is no audio from Chromium, Firefox, VLC or any other program. However, the GNOME speakers test works. I can hear "front left" and "front right" from there, but no audio from other programs. In order to fix that, I can simply switch to another audio output (e.g. HDMI out) and then switch back to the stereo speakers, and the audio will magically work. Any idea why? It's not a big deal because it takes a couple of seconds to switch between outputs, but it's kind of annoying to do that after every reboot.


why names containing dot are not taken in consideration in the result list using the command "apt-cache pkgnames "

System: Ubuntu 18.04 LTS  If you run the following command   $ apt-cache pkgnames python    . . . python3-case python3-rpy2 python3-pycurl-dbg python3-structlog python-natsort python-protobuf python-rpm python-starpy python3-rpyc python-nbxmpp-doc python-rpy python-jpylyzer-doc python-bottle-doc python-logbook python-pyside.qthelp python-agate-doc   The result list skip packages names like python3.7 python3.7-venv python3.6 python3.6-venv, I mean all packages names containing dot.  We have to run explicitly the below command to list all python packages containing dot in their names.  $ apt-cache pkgnames python3.    python3.7-venv python3.6-venv python3.6-examples python3.6 python3.7 python3.7-dbg python3.7-dev python3.7-doc python3.7-minimal python3.6-minimal python3.7-examples python3.6-dbg python3.6-dev python3.6-doc


Existence of the set of all subsets of a set

I'm reading a book on basic analysis and came across the result that given a set $X$, there exists a set $\{Y : Y$ is a subset of $X\}$. The proof is left as an exercise and the hint states that one can start with the set $\{0, 1\}^X$ and apply the replacement axiom, replacing each function $f$ with $f^{-1}(\{1\})$.  While the above route isn't difficult to understand, why can't we just define the required set as: $\{f(X) \mid f\colon X \to X\}$? I suppose this also requires the axiom of replacement (the objects in question being $X$ and $f$) and looks fine to me, but there could be a problem with this reasoning, otherwise the author would've used this definition. If so, what's the problem?   Apologies if this is a really basic question, but I'm working on improving my mathematical logic skills.


War Horse died, possible to get it back?

At some point I accidentally ran off a cliff with my War Horse which resulted in a death. After respawning, I noticed my War Horse was gone and the default Tennessee Walker was my main horse.   How did the War Horse disappear and is it possible to retrieve it?


How to make a texture that shines, or paint a material?

How can I make an arm with blood textures on it, and where there is blood, there is a shiny material?


Java - Adding Elements to Array of Hashmaps Produces Null Error

I am trying to create a 2d array of hashmaps. I do this with the following code:     @SuppressWarnings("unchecked")     Map<String, Boolean>[][] arrayBlock3 = (Map <String, Boolean>[][]) new Map[6][6];   When I try to add elements to the array however, at runtime there is a null pointer exception at the first line adding an element to the array.  The code to add an element is:      arrayBlock3[0][0].put("B", false);     arrayBlock3[0][1].put("G", false);     arrayBlock3[0][2].put("B", false);     arrayBlock3[0][3].put("B", false);     arrayBlock3[0][4].put("G", false);     arrayBlock3[0][5].put("B", false);    Error Message  Exception in thread "main" java.lang.NullPointerException at main.main(main.java:20)   I would really appreciate your help, thanks.


Word in table effecting gap between entries

I have a long word that describes all the values, so I don't want this big gap between A and B. The gap should be everywhere the same, so the word foooooo should not affect the gap between the values.   How to fix this?     \documentclass{article} \usepackage{booktabs}  \begin{document}  \begin{tabular}{@{} *5l @{}}    \toprule \emph{name} & \emph{fooooooo} &&&  \\\midrule Models    & A  & B  & C  & D  \\   Model $X$ & X1 & X2 & X3 & X4\\   Model $Y$ & Y1 & Y2 & Y3 & Y4\\\bottomrule  \hline \end{tabular} \end{document}


In the Kill Bill movie franchise, Hattori Hanzo breaks his 28 year old oath and makes the best sword in his life for Beatrice Kiddo.   There was no indication in the movies that Hanzo knew Bill. Then why did he break his oath and help Beatrice Kiddo just when she told him that she wanted to kill Bill?  What's the specialty about her that makes Hanzo help her?


I need to change an element's ID using jQuery.    Apparently these don't work:  jQuery(this).prev("li").attr("id")="newid" jQuery(this).prev("li")="newid"   I found out that I can make it happen with the following code:  jQuery(this).prev("li")show(function() {     this.id="newid"; });   But that doesn't seem right to me. There must be a better way, no? Also, in case there isn't, what other method can I use instead of show/hide or other effects? Obviously I don't want to show/hide or affect the element every time, just to change its ID.  (Yep, I'm a jQuery newbie.)  Edit I can't use classes in this case, I must use IDs.


Please guide. Traveling to India from USA. Am on Green Card in USA. Wanted to take a tourist stop of couple of weeks in Italy on the way. Problem is seems I will need a visa for my Italy stop. The Italian embassy do not have a interview date until July this is way past my travel dates. Kindly advise if I can get a Schengen visa from any other country for my travel to Italy. As indicated am stopping only in Italy and no other country in Europe this itinerary. Thanks for reading.


Problem while trying to install some packages

I am trying to execute this code:   sudo apt-get install g++ build-essential autoconf automake automake1.9 cmake doxygen bison flex libncurses5-dev libsdl1.2-dev libreadline-dev libusb-dev texinfo libgmp3-dev libmpfr-dev libelf-dev libmpc-dev libfreetype6-dev zlib1g-dev libtool libtool-bin subversion git tcl unzip    However I get this problem:   Package automake is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source  E: Package 'automake' has no installation candidate E: Unable to locate package automake1.9 E: Couldn't find any package by glob 'automake1.9' E: Couldn't find any package by regex 'automake1.9' E: Unable to locate package doxygen E: Unable to locate package libsdl1.2-dev E: Couldn't find any package by glob 'libsdl1.2-dev' E: Couldn't find any package by regex 'libsdl1.2-dev' E: Unable to locate package libgmp3-dev E: Unable to locate package libmpfr-dev E: Unable to locate package libelf-dev E: Unable to locate package libmpc-dev E: Unable to locate package libtool-bin   I have tried to use sudo apt-get update but I still get this error! Any idea?  The output of grep "^deb" /etc/apt/sources.list is:  deb http://old-releases.ubuntu.com/ubuntu/ xenial main restricted multiverse deb http://old-releases.ubuntu.com/ubuntu/ xenial-updates main restricted multiverse deb http://old-releases.ubuntu.com/ubuntu/ xenial universe deb http://old-releases.ubuntu.com/ubuntu/ xenial-updates universe deb http://old-releases.ubuntu.com/ubuntu/ xenial-backports main restricted universe multiverse deb http://old-releases.ubuntu.com/ubuntu trusty-security main restricted multiverse deb http://old-releases.ubuntu.com/ubuntu trusty-security universe deb http://archive.panda3d.org/ubuntu xenial main deb-src http://archive.panda3d.org/ubuntu xenial main deb http://archive.canonical.com/ xenial partner deb http://archive.ubuntu.com/ubuntu xenial universe main restricted multiverse


How can my Kobold carry all his weapons?

Carrying capacity, as defined on page 176 of the PHB is:     Carrying Capacity. Your carrying capacity is your Strength score multiplied by 15. This is the weight (in pounds) that you can carry, which is high enough that most characters don’t usually have to worry about it.   My Kobold Barbarian has a 16 in strength, meaning he can carry up to 240 lbs encumbered or 80 lbs unencumbered. He currently is carrying a Greatsword, 2 Handaxes, 4 Javelins, 2 Scimitars, 2 Sheilds, and an Herbalism Kit, which all equates to 39 lbs total (all of which are the standard size for the item). I know I can carry everything, but how would the mechanics work, especially with the large size of all the gear opposed to my 2'6" character


Simple Java If/Else if Statement Unfunctional

I was working on my game I am making, when I came across an error. My if/else if statement skips right to the else if statement, even if it shouldn't.  String neededCredits = "200";   if(Peeamnt.getText() == neededCredits) {         System.out.println("You can afford this"); JOptionPane.showMessageDialog(BuyPoopButton,         "You have unlocked the Poop Button for 200 Pee Credits!",         "Toilet Master",         JOptionPane.WARNING_MESSAGE); }     else if((!(Peeamnt.getText() == neededCredits))) {         System.out.println("You cannot afford this");         JOptionPane.showMessageDialog(BuyPoopButton,                 "You do not have enough Credits to buy this!\n"                 + "To buy it, you need 200 Pee Credits!",                 "Toilet Master",                 JOptionPane.ERROR_MESSAGE); }   Even if the text of Peeamnt is an even 200, the code will jump to the else if statement, telling me that I don't have 200 Pee Credits. (The game I am making included a lot of toilet humor.) Anyway, if anyone sees the error I have in this code, please let me know. Let me know if you need more code.


integers $n$ such that $(n-1)!+1$ is a power of $n$

Please, find all positive integers n for which (n-1)! +1 is a power of n.


Having changed the scene units and unit scale, how can I change the default size of new objects?

I am using blender most of the time to model things for my 3d printer. So a default unit in "meters" is not really helpful!  Within the scene settings it is simply possible to set the units to millimeter and the unit scael to 0.001 so everything seems to work as I want it to work...   But if I add a new primitive it uses its old default sizes in meters... so a new cube get's 2000 x 2000 millimeters instead of 2x2 or whatever will be useful..  Same for all other new objects...  How can I change the default sizes of new objects permanently?   And how can I change the settings in the application templates? Right now using ctrl+u changes the "general" template - perhaps because I loaded it before...   Thanks a lot and best regards Stefan


Does the Thorncaster Sliver's ability damage have to be assigned before or after blockers are declared?

If I have 5 slivers and one of them is a Thorncaster, will I need to assign the "1 damage to target creature or player" before or after my opponent declares blockers?  My guess is that it is as I attack, but I would like it to be after blockers are assigned.


Future Method: Too many future calls : 51

Working on a future method to post values to external web service. But since there is a limit of 50 callouts per invocation, I am getting error "Too many future calls : 51". Cases are loaded into salesforce from external ETL in bulk. So is there a way to workaround this error.   Class  public with sharing class caseTrigger {      //method invoked by trigger after insert     public void CaseInsert(List<Case> caseIns){           list<Id> caseIds = new list<id>();             List<Case> caseList = [Select id from case WHERE Id IN :caseIds];                 for(Case c : caseList){                     if(c.Status != 'closed'){                         caseIds.add(c.id);                     }                          if(f.caseId_User.size()>0){PostCases(caseIds);}      }     //postCases (future method)     @future(callout = true)     public static void PostCases(List<Id> Ids){         //prepare Json to post to webservice    } }


I am trying to model a time series that contains a sequence of zeros. I tried fitting an ARIMA model using auto.arima function from the forecast package in R but the MAPE is reported as infinity (probably due to division by zero). Moreover, the auto.arima fits an ARIMA(0,1,0) model over the data.   Can you suggest any types of models that may be appropriate for such data?


On which SE site should a question about the definition of logical operations be asked?

was recently asked on SO.  Whilst the question was specifically phrased in relation to MySQL, it's clearly applicable to most languages and is actually seeking a conceptual distinction between different classes of operation rather than any solution to a practical problem faced in software development.  In particular, given that comparison operators are fairly easily understood, it's really seeking a conceptual definition of logical operations: the OP's  reinforces this view.  As such, it doesn't neatly fit within any of the categories that are  for SO.  I feel that (perhaps once edited to exclude references to specific languages) it might better belong on another, more theoretical, site within the SE network.  Indeed, I flagged it for moderator attention:     I don't know on which SE site this question best belongs, but I have a feeling it isn't SO. Perhaps TCS? Or Philosophy? Or Math? Or maybe even Programmers?   But received the response:     declined - a moderator reviewed your flag, but found no evidence to support it   What further action, if any, should I take?  See also:


Lightning component redirect to URL in the same tab

I'm implementing a redirect in a Lightning component, but it's opening in a new browser tab. I want the redirect to happen in the same tab:  navigate : function(component, event, helper) {  var urlEvent = $A.get("e.force:navigateToURL");   urlEvent.setParams({     'url': 'http://www.myurl.com'   });   urlEvent.fire(); }   Is there a way to force it to redirect in the same browser tab?


If someone says that they had been to Florida on a recent trip, which one of the following would be a correct respone:   That must had been fun.  That must have been fun.    Or is there a better way of saying this?


It is well known that $\pi_2(G)$ is trivial for any Lie-group $G$. Is there an elementary proof of this, say, that can be understood with minimal homotopy theory?  Also, who gave the first proof of this theorem?


Const function calling non const or vice versa (to avoid duplication)?

Is there any advantage using one over the other:  class Foo { public:     const int& get() const     {         // stuff here         return myInt;     }      int& get()     {         return const_cast<int&>(static_cast<const Foo*>(this)->get());     } };   Or  class Foo { public:     int& get()     {         // stuff here         return myInt;     }      const int& get() const     {         return const_cast<Foo*>(this)->get();     } };   I only used the first one, but I just saw the second one used somewhere, so I am wondering.  The comment // stuff here could be a non-trivial check like retrieving the index of a table in order to return a ref on a member of the table (for example: myInt = myTable[myComputedIndex];) so I cannot just make it public. Thus table and any member are not const.


For $n\in\mathbb{N}$, evaluate $\int_0^n \cos(2\pi \lfloor x\rfloor\{x\})dx$

Can anyone please evaluate and explain this integral? Here $n$ is a positive integer. $$\int_0^n \cos(2 \pi \lfloor x\rfloor \{x\}) dx$$


How do you become a vampire/werewolf in Elder Scrolls Online

The game is released for a few days now. I have heard that you can turn into thoses beasts. I have a few questions about that   How do you turn into werewolf/vampire ? On the chat people said they can bite others but who bite them first? How long does the effect last ? Are there any cons ? Maybe if your are a vampire you take damage from the sun like in older Elder Scrolls ?


command line plink remote target capture traffic via jumphost

I am trying to capture remote host traffic via jumphost from a Windows machine and display in Wireshark.  When PUTTY GUI is used and configured as below   Created and saved SSH session (bastion-host) for the jumphost   Connection --> Data --> Auto-login username configured Connection --> SSH --> Auth --> jumphost private Key file for authentication configured  Created and saved another SSH session (target-host), where traffic capture will happen   Connection --> Data --> Auto-login username configured Connection --> Proxy --> Proxy hostname configured as proxy and port 22 Connection --> Proxy --> Telnet command or local proxy command as plink "bastion-host" -agent -nc %host:%port Connection --> SSH --> Remote command as "sudo tcpdump -i ens5 -w - not port 22" Connection --> SSH --> Auth --> target-host private Key file for authentication configured  Load and open saved session (target-host)   Result is   I can see traffic being captured and displayed on windows PUTTY terminal. And "tcpdump" is actually executed on target-host.   At this stage, I don't know how to redirect this to Wireshark.  Next and this is what I am trying to achieve, execute above setup via command line. Below is the complete command   plink.exe -proxycmd "putty.exe -ssh <username>@<jumphost-address> -i <private-key-file> -agent -nc <target-host>:22" -ssh <target-username>@<target-host> -i <target-private-key> "sudo tcpdump -ni ens5 -s 0 -w - not port 22" | "C:\Program Files\Wireshark\Wireshark.exe" -k -i -   Wireshark pops up but no traffic captured as I can't see "tcpdump" command getting executed on .  To confirm plink works, I tested similar command on a directly accessible host and everything works. Wireshark pops up with live traffic capture.  plink.exe -ssh -pw <password> <username>@<my-host> "/usr/sbin/tcpdump -ni ens192 -s 0 -w - not port 22" | "C:\Program Files\Wireshark\Wireshark.exe" -k -i -   So, I reckon something is wrong with the way I am using plink command.  Appreciate if someone can help me to rectify it.  Thanks  OS: Windows 7 Enterprise, 64 bit   PUTTY: Release 0.70


How to make the top bar of my terminal say what command is running?

I often run commands in parallel that take a long time to finish and sometimes I lose track of what is running where since they output basically the same sort of information on screen.   Do you know of any way to find out what command is running in what terminal?


Concrete Categories Where Epis are Just Surjections

Before I begin let me provide some background to fix notation/make the post more readable to interested outsiders. In a category $\mathscr{C}$ we say that a morphism $X\xrightarrow{f}Y$ is an epimorphism provided given any two morphisms $g_1,g_2:Y\to Z$ with the property that $g_1\circ f=g_2\circ f$ one may conclude that $g_1=g_2$. In simpler terms, they are "right cancellative". In most "nice" concrete categories the epimorphisms are precisely the surjective morphisms (for example in $\bf{Grp}$, $\bf{Mod}-R$, $\bf{Ab}$, $\bf{Vec}_k$). But, in some concrete categories this isn't true. For example we know that not all categories have this property. For example, in $\bf{Ring}$ the morphism $\mathbb{Z}\hookrightarrow\mathbb{Q}$ is a non-surjective epimorphism since any morphism out of $\mathbb{Q}$ is determined by its action on $\mathbb{Z}$ (I'm sure the generalization of this counterexample is obvious). Anyways, I was wondering if there was some kind of characterization, or more realistically intuition, for when a given concrete category has the property that the epimorphisms are precisely the surjective morphisms.  Thanks!


I would like to ask if anyone would help me to find a general formula for the sum of m members of the following series. \begin{equation}        \sum_{n=1}^{m} n^n = 1^1+2^2+\cdots + m^m \end{equation}  Thank you in advance.


No space following macro without argument

With a macro such as:  \def\naive{na\"{\i}ve}   I find that the space which I would hope to follow it, is absent. So, with  the \naive approach   I get     the naïveapproach   in the output. How do I bring back the space?


Kernel of a map $\mathbb{C}[x,y,z] \to \mathbb{C}[t]$

I'm having issues with a question in Artin, more specifically 11.3.3.e.  The question asks:     Find generators for the kernel of the following map: $\mathbb{C}[x,y,z] \to \mathbb{C}[t]$ given by $x \mapsto t$, $y \mapsto t^2$, $z \mapsto t^3$   Clearly we have $z-x^3$, $y-x^2$, and $z^2-y^3$ as elements of the kernel.  I'm not sure how to proceed.  The book uses the division algorithm in the relevant examples, but it only does that for the two-variable case. I can't see how to apply it here and I also have a hard time understanding why it works. The other four parts were straightforward maps substituting variables for numbers, this is the first that deals with parametrization.


(c++11) reading a file while simultaneously saving each each word in the file to a given vector

So to start off, the goal of this function below is to read each line in the text file (TitanData.txt). Each line has 3 pieces of information: Age, Passenger Class, and if the passenger survived (saved as "TRUE" or "FALSE") in order. I've created 3 vectors: vector Age, vector PassengerClass, vector Survived. The issue seems to be that the push_back functions aren't working properly. I've been looking for solutions for hours and I have yet to come across one so hopefully I can get an answer here. The function is below: void ReadFromFile(vector<int> Age, vector<string> PassengerClass, vector<bool> Survived) {     bool survived;     int age;     string Passenger_Class;      string val1, val2, val3;     ifstream infile;     infile.open("TitanicData.txt");     if (infile)     {         while (infile >> val1 >> val2 >> val3)         {             age = stoi(val1);             Age.push_back(age);               Passenger_Class = val2;             PassengerClass.push_back(val2);               if (val3 == "TRUE")             {                 survived = true;                 Survived.push_back(true);             }             if (val3 == "FALSE")             {                 survived = false;                 Survived.push_back(false);             }         }         infile.close();     } }


Evaluating this integral $ \small\int \frac {x^2 dx} {(x\sin x+\cos x)^2} $

The question:      Compute$$ \int \frac {x^2 \, \operatorname{d}\!x} {(x\sin x+\cos x)^2} $$   Tried integration by parts. That didn't work.  How do I proceed?


Stokes' Theorem states the following: \begin{equation*} \oint_c \textbf{F}\centerdot d\textbf{r}= \int\int_S (\nabla \times\textbf{F})\centerdot nd \textbf{S}\end{equation*} for a given C that is the boundary of a surface S.  Can $S$ be a closed surface, where c is the boundary, given that n= the unit normal vector correctly oriented?  Best Regards,  Thank You


I am using Amelia for multiple imputation, and I am satisfied with the imputed results. But I want to restrict the imputed variable to positive values. Is there a way that Amelia can handle it or should I use some other package which can take care of it.


I am struggling with understanding screen space reflections in EEVEE.  I am aware of the excellent answer to , however, this only talks about when an object is off screen entirely.  Maybe it is the same point (if so, I apologise), but can someone confirm for me that this is actually the correct behavior? The partial reflection seems so odd that I am having trouble believing this is how it is supposed to work.  Is the entire bottom face of the cube really supposed to be missing?


Show system of equations with one number and centered

I have an equation which I rearrange in several steps. I want to show this, by having a single numbered equation, which has an aligned equal sign on the right, and the terms left of the equal sign are centered in each line. So basically it looks like this:          (a+b)^3       =      (a+b)(a+b)^2     =     (a+b)(a+b)(a+b)    =   (1)   (a^2+2ab+b^2)(a+b)  = (a^3+3a^2b+3ab^2+b^3) =   I know about aligned, gather and split, but neither seems to achieve, what I want.  Update: This is no duplicate to the linked question, as I want a fixed sign on the right, and a horizontal centered alignement on the left. The linked question has no horizontal centering in it.


How to get file info(name & size) after select file from input type file?

$('.this_add').click(function(){    $('.add_upload').append('<input type="file" name="image[]" class="this_upload">');  var a = document.getElementById('abc');  $('input[type="file"]:last').click();  //$('input[type="file" name="image[]"]:last').remove();   }); $('.this_upload').change(function() {   alert(Math.round(this.files[0].size / 1023.274693583273) +'kb|'+ this.files[0].name); }); <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <html>    <body>       <button class="this_add">add</button>       <form action="" method="POST" enctype="multipart/form-data">          <input type="file" name="image[]" class="this_upload"/>          <input type="file" name="image[]" class="this_upload"/>          <input type="file" name="image[]" class="this_upload"/>          <div class="add_upload"          <input type="submit"/>       </form>           </body> </html>     When the Add button is clicked then it will generate a new input type file, but i can't get the file info after selecting a file from it. But it works if i selecting a file from the others input type file?


How fast can I travel to incubate eggs in Pokemon Go?

I bike to work often, and thought hatching eggs on my ride would be a great way to use up all these eggs I'm collecting....  But, even though I kept my phone on for my 20km ride, the incubator said I moved about 2km during my ride.  I am assuming this is because biking is too fast for incubation?  Do we know what a top speed for incubation is?


How can I use an if statement to while reading from a file?

I am almost brand new to programming. I am in my second college course. I have spent hours looking online and on here looking for help. I have to sort the salaries by year and add them together. I thought I could make an if statement to sort the salaries into different arrays, but it does not appear to be working. As you can see by the code output, it shows invalid year, but it also pops up that the year is 2014. The file that I am reading from follows this format: 2014 Employee Smith,John 2000 0 (this is one line and there are 9 more like it). Thanks for any help and advice.  public class JohnSummersProject1 {  public static void main(String[] args) {      int count = 0;     String[] year = new String[10];     String[][] employeeType = new String[10][2];     String[][] name = new String [10][2];     String[][] monthlySalary = new String [10][2];     String[][] micellanious = new String[10][2];     String line = "";     String splitBy = " ";     BufferedReader inputStream = null;     String[] input = new String[5];     String year2014 = "2014";       try {         String x = (args[0]);         inputStream = new BufferedReader(new FileReader(x));         while ((line = inputStream.readLine()) != null && line.length()!=0) {             input = line.split(splitBy);             year[count] = input[0];              employeeType[count][0] = input[1];             if(year[count] == year2014){             name[count][0] = input[2];             monthlySalary[count][0] = input[3];             micellanious[count][0] = input[4];             System.out.print(year[count] + " ");             System.out.print(employeeType[count][0] + " ");             System.out.print(name[count][0] + " ");             System.out.print(monthlySalary[count][0] + " ");             System.out.println(micellanious[count][0]);             }             else if(year[count] == "2015"){             employeeType[count][1] = input[1];             name[count][1] = input[2];             monthlySalary[count][1] = input[3];             micellanious[count][1] = input[4];             System.out.print(year[count] + " ");             System.out.print(employeeType[count][1] + " ");             System.out.print(name[count][1] + " ");             System.out.print(monthlySalary[count][1] + " ");             System.out.println(micellanious[count][1]);         }             else{                 System.out.println("Invalid year");             }             count++;          }     }      catch (IOException io) {         System.out.println("File IO exception" + io.getMessage());         System.exit(0);     } finally {         try {             if (inputStream != null) {                 inputStream.close();             }         } catch (IOException io) {             System.out.println("Issue closing the Files" + io.getMessage());         }     }     for(int i = 0; i <year.length; i++){      System.out.println("Year " + year[i] + " Employee type = " +        employeeType[i][0] + " Name: " + name[i] + " Monthly count = " +              monthlySalary[i][0] + "extras: " + micellanious[i][0]);     } }   }


How to get the latest entry for each item for in a Month with a single SQL query

I am trying to write a query to pick one entry for each item for each month but the latest in the month from the following table:  Name  | Date      | Value a     |2015-01-01 |   1 a     |2015-01-02 |   2 b     |2015-01-03 |   1 b     |2015-01-04 |   1 b     |2015-01-03 |   3 c     |2015-01-02 |   2 c     |2015-01-29 |   10 a     |2015-02-10 |   2 a     |2015-02-20 |   1 c     |2015-02-10 |   2 c     |2015-02-22 |   23 b     |2015-02-25 |   1 b     |2015-02-19 |   2   return should be:   a     |2015-01-02 |   2  b     |2015-01-04 |   1  c     |2015-01-29 |   10  a     |2015-02-20 |   1  b     |2015-02-25 |   1  c     |2015-02-22 |   23   I wonder how would this be achieved instead of sending multiple queries to SQL server for each month I would like to load all the values with one query then filter the collection on the memory. Otherwise I would end up writing a query as below:  SELECT Name,Date, Value FROM MyTable mt INNER JOIN ( select max(Date) as MaxDate     FROM [MyTable] m WHERE YEAR(Date) =YEAR(@date)       AND MONTH(Date)=MONTH(@date)) mx ON t.Date = mx.MaxDate)   And this query needs to be run for each month.  Any better idea to return all entries with a single query?   Thanks,


sources.list with tilde symbol (sources.list ~) generated in /etc/apt directory

I am running Ubuntu 16.04 and new to Ubuntu. Please let me know what I did wrong: In my system a sources.list~ file and also a trusted.gpg~ file was generated.


I'm unable to install PHP5 in Ubuntu 16.04

root@areeb-Inspiron-3420:/var/www/html# apt install php5 Reading package lists... Done Building dependency tree        Reading state information... Done Package php5 is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source  E: Package 'php5' has no installation candidate root@areeb-Inspiron-3420:/var/www/html# apt-get install libapache2-mod-php5 Reading package lists... Done Building dependency tree... 50% Building dependency tree        Reading state information... Done Package libapache2-mod-php5 is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source  E: Package 'libapache2-mod-php5' has no installation candidate   What should I do now?


Edwards Hersheys creme pie made in 2013 ok to eat?

I just happened to see it in the freezer and it looks really good hasn't been opened or thawed but everywhere I look I seem to get a different answer on weather it would be okay to eat or not. Hopefully I can get an answer here before its thawed out lol :) Thanks yall


What is the default root password when was never set at installation time?

On a standard desktop installation, I created my administrative and user login. Further with some applications, the system ask for the root password.  So my question is: What will be the default password for the root login when I never created it during the installation process?


Will the magnetism from a hard drive corrupt another hard drive while stacked(when not running)

I have some hard drives that are not being used anymore but I still have to use them sometimes do stacking the hard drives corrupt the data?


Render mode has no texture or color when using GPU

When I enter rendered mode it looks like this:  When I enter CPU render device it looks fine. Is it a GPU issue or a software issue?


Why does everybody think Jon Snow is this character's son?

I get the abduction of Lyanna and the rest of that whole theory. But in the show we got a clear answer about Lyanna being Jon's mother but why does the father have to be Rhaegar?  I mean it was war, it could be anyone, for example, a soldier raping Lyanna while she was captive. Yes, Jon must be her son but why does everyone automatically suppose the father's identity?


After upgrading from 13.04 to 13.10 I get a black screen (ubuntu)

After upgrading my 13.04 vm to 13.10 when I run my 13.10 vm all I get is a black screen with flashing _. I can alt f1-f6 to get into tty1-6 and I ran apt-get update & upgrade but still no luck.. When I try to run gui apps from the tty1 it states that GtkWarning: could not open display.  And when I type unity the error says no DISPLAY variable set, setting it to :0 unity-panel-service: no process found  Can someone help me to get unity working again?  The link you gave me did not fix the problem and since this is virtual machine i dunno which video card it is using


I'm using VM Ware (specifically the player) and i'd like to attach a multiple mouses and have one for each VM (same idea with keyboard but i havent tried keyboards yet). I'd like several people using their own vm. I cant seem to figure out how to lock the mouse into the VM. If i plug in a mouse windows uses both of them and i need to click onto an instance of vmware to get the mouse working there.  I tried clicking the USB area at the bottom of the player window and i got the error message     Cannot connect "BRAND USB Optical Mouse" to this virtual machine. The host requires this device for input.   Is it possible to dedicate a mouse/keyboard to a VM instance? I'm willing to use another VM software (but preferably free)


Why do myelinated axons conduct impulses faster?

How does the myelination help in better conduction? I would prefer answers that are not too technical please.


combining function declaration and expression doesn't work

I was reviewing function declaration and function expression, separately, no problem  function add(a,b){return a+b}; var add2 = function(a,b){return a+b}; add(1,2)// 3 add2(1,2) // 3   But if I try to combine them the function declaration gets ignored  var add3 = function add4(a,b){return a+b} add3(1,2) // 3 add4(1,2) // ReferenceError: add4 is not defined   I have no real case where I would need this type of declaration but I'm trying to understand why it wouldn't work  Anybody knows the right bit of literature ?


Number Solving Game not Updating Random number upper and lower bounds...Java

So I was coding a simple game where the computer guesses a number you are thinking of between 1 and 1000. The code is as follows hwoever whenever I run this, no matter what i tell the computer wether i say higher or lower, it never updates the minimum and maximum to narrow in on the answer, ye the logic looks correct to me. :  package com.company; import java.util.*;    public class Main {      public static void main(String[] args) {         //set and initialize variables         int currentGuess;         int min = 0;         int max = 1000;         boolean guessedCorrectly = false;         String userInput;         Random rand = new Random();          //Create user input object         Scanner user_input = new Scanner(System.in);          //Explain Game Rules to User         System.out.println("Please think of a number and I will try to guess it.");         System.out.println("You can respond h for higher, l for lower, and c for correct: ");          //Main Game Loop         while (guessedCorrectly == false){             currentGuess = min + rand.nextInt(max - min + 1);             System.out.print("Is your number " + currentGuess);             userInput = user_input.next();             if (userInput == "h"){                 min = currentGuess;             }else if (userInput =="l"){                 max = currentGuess;             }else if (userInput == "c"){                 guessedCorrectly = true;             }else{                 System.out.println("Please enter an h for higher, l for lower, or c for correct ");             }           }         System.out.println("Congratulations to MEEEEEE, I guessed it correctly!");     } }   Any Ideas?


How to get a reflex edge on a non-convex mesh

I am trying to implement a convex decomposition and I need to find the convex vertex on a mesh. Is there a algorithm that I can use to find the convex vertex on a mesh.


I'll be at my uncle's house just in case you need to reach me.   I'll be at my uncle's house should you need to reach me.      Could you tell me what is the difference between those?


Are numbers in which all substrings are primes finite regardless of base?

For no particular reason I stumbled upon the sequence/set of all numbers where all substrings of the decimal representation is prime (A085823). It's quite easy to see that this must be a finite set. My approach was that the digits must alter between 3 and 7 eventually (since a prime can't end with 2 or 5 for larger than that and a prime can't consist of just two non-1 digits, those would be dividable by 2, 5 or 11) and we can see where it ends.  But if we change the base that approach fails. For example in base 8 a prime can end in 3, 5 or 7 AFAICS so such numbers can end in a altering sequence of 3, 5 and 7s but having tree digits to alter between there's always a way to vary the sequence.  I tried to write a python snippet to produce such numbers in different bases and for those I've tested the program seem to hang (ie don't seem to find any more numbers). Is it true that there are only a finite number of such numbers for every base?


when coding in python 2.7, I have a problem about the interal environment of function. Here is the simple sample code:  m=3  def f(x):     return m*x   when I type f(5) in Python Console, it returns 15, which is in line with my expectation. However, when I edit the code to:  m=3  def f(x):      m=m+1     return m*x   the console returns UnboundLocalError: local variable 'm' referenced before assignment, and I do not understand why.  I think there is no difference for variable m between these two cases. However, one is correct while the other isn't.


Convert big endian to little endian when reading from a binary file

I've been looking around how to convert big-endian to little-endians. But I didn't find any good that could solve my problem. It seem to be there's many way you can do this conversion. Anyway this following code works ok in a big-endian system. But how should I write a conversion function so it will work on little-endian system as well?  This is a homework, but it just an extra since the systems at school running big-endian system. It's just that I got curious and wanted to make it work on my home computer also  #include <iostream> #include <fstream>  using namespace std;  int main() {    ifstream file;     file.open("file.bin", ios::in | ios::binary);     if(!file)       cerr << "Not able to read" << endl;    else    {       cout << "Opened" << endl;        int i_var;       double d_var;        while(!file.eof())       {          file.read( reinterpret_cast<char*>(&i_var) , sizeof(int) );          file.read( reinterpret_cast<char*>(&d_var) , sizeof(double) );          cout << i_var << " " << d_var << endl;       }    }    return 0; }   Solved  So Big-endian VS Little-endian is just a reverse order of the bytes. This function i wrote seem to serve my purpose anyway. I added it here in case someone else would need it in future. This is for double only though, for integer either use the function torak suggested or you can modify this code by making it swap 4 bytes only.  double swap(double d) {    double a;    unsigned char *dst = (unsigned char *)&a;    unsigned char *src = (unsigned char *)&d;     dst[0] = src[7];    dst[1] = src[6];    dst[2] = src[5];    dst[3] = src[4];    dst[4] = src[3];    dst[5] = src[2];    dst[6] = src[1];    dst[7] = src[0];     return a; }


If dinosaurs were here so much longer than humans, why did their natural selection not account for higher intelligence, as is the case in humans?


If $\{f_n\}$ converges uniformly and each $f_n$ is bounded, show that $\exists M>0$ s.t. $|f_n(x)| \leq M$

Problem Statement:  Let $\{f_n\}$ converge uniformly on a set $E$. Suppose that each $f_n$ is bounded. Prove that there exists an $M > 0$ s.t. $|f_n(x)| \leq M$ for all $x \in E$ and all $n = 1,2, ...$.  Proof:  If each $f_n$ is bounded by some $M_n > 0$ then can't we just take $M = \text{max}\{M_n\}$?  I don't see what's so difficult here. Am I not using the fact that $\{f_n\}$ converges uniformly?


Prove that if $n\geq1$ then $\binom{2n}{2}=$

Prove that if $n\geq1$ then $$\binom{2n}{n}=\sum_{k=0}^{n}(\binom{n}{k})^2$$    This is what I have so far:   By the Binomial Theorem: $$\binom{2n}{n}=\frac{(2n)!}{(2n-2)!n!}=\frac{2n!~}{n^2(n-1)^2(n-2)^2...1}$$  By the definition of summation: $$\sum_{k=0}^{n}(\binom{n}{k})^2=(\binom{n}{0})^2+(\binom{n}{1})^2+(\binom{n}{2})^2+(\binom{n}{3})^2+...+(\binom{n}{n})^2$$  By the Binomial Theorem => $$\sum_{k=0}^{n}(\binom{n}{k})^2=1^2+(\frac{n!}{(n-1)!})^2+(\frac{n!}{(n-2)!2!})^2+(\frac{n!}{(n-3)!3!})^2+...+1^2$$  $$=1+\frac{n!n!}{((n-1)!)^2}+\frac{n!n!}{((n-2)!)^2(2!)^2}+\frac{n!n!}{((n-3)!)^2(3!)^2}+...+1$$  This is where I get stuck. I'm not sure how to continue from here. I know that what I am getting is starting to look a lot like what I want it to look like but I don't know how to finish, nor am I sure that I've done it correctly to this point. Help?


I was reading another thread  and came across a technical term  that I didn't know. I went to wikipedia for more information and saw a picture there where the caption says      Rheum in cat eyes.    Shouldn't it be cat's eyes with the possessive 's? Or either is possible? If so, can you please explain why?


What's the physical significance of the off-diagonal element in the matrix of moment of inertia

In classical mechanics about rotation of rigid object, the general problem is to study the rotation on a given axis so we need to figure out the moment of inertia around some axes. In 3-dimensional case, we have a matrix (i.e. moment of inertia tensor)  $$   I =  \left( \begin{matrix} I_{xx} & I_{xy} & I_{xz}\\ I_{xy} & I_{yy} & I_{yz}\\ I_{zx} & I_{zy} & I_{zz} \end{matrix} \right) $$  I am curious what's the physical significance of the matrix element. I guess the moment of inertia in element $ij$ is the moment of inertia when the object is rotating about the axis $ij$. For example, $I_{xy}$ is the moment of inertia when the object is rotating about $xy$ axis and $I_{yy}$ is the moment of inertia when the object is rotating about $y$ axis, is that correct?  When I read further into the text, it then introduce the a method to diagonalize the moment of inertia tensor such that the non-vanishing elements only appears on diagonal. In that case, the text call the diagonal elements as the principal moment of inertia, my question is what's the physical significance of the principal moment of inertia?


I'm pleased to hear that you (passed/ have passed) the exam. Which one is right? [ Closed ]

Could you tell me which is the right sentence please?   I'm pleased to hear that you passed the exam. I'm pleased to hear that you have passed the exam.   Thanks!


the explain of "had true teachers been" structure and meaning of "theta"  Mr. Evans and his associates after the first disturbance, physical and mental, caused by this spirit irruption, settled down to study what it really meant. They came to the conclusion that the matter could be divided into three phases. The first phase was the actual proving to the observer that the thing was real. The second phase was one of instruction, as even the humblest spirit can bring information as to his own experience of after-death conditions. The third phase was called the missionary phase and was the practical application. The Shakers came to the unexpected conclusion that the Indians were there not to teach but to be taught. They proselytized them, therefore, exactly as they would have done in life. A similar experience has occurred since then in very many Spiritualistic circles, where humble and lowly spirits have come to be taught that which they should have learned in this world had true teachers been available. One may well ask why the higher spirits over there do not supply this want? The answer given to the author upon one notable occasion was, "These people are very much nearer to you than to us. You can reach theta where we fail."


How can I reduce the noise inside an airplane? I am thinking of something like a headphone however I don't know what is the name of those headphone, the one that specially some workers in the loud workplace use. I searched for some of them but I just find some noise reduction headphone for playing music.


Awesome symbols and characters in a bash prompt

I just ran across a screenshot of someone's terminal:    Is there a list of all of the characters which can be used in a Bash prompt, or can someone get me the character for the star and the right arrow?


Use of the definite article before superlative adjectives

We achieve the best financial outcomes through highest ethical standards according to our Compliance Code, cost controlling, and protecting our assets, environment, and people.    Is it correct to write this sentence without the article the before the superlative adjective highest?


Does all "going to" s here mean the same?

When you back up the car you're going to back it up until your body is even with the middle portion of the trunk on the other car. Then at that point you're going to turn your wheel all the way to the right, and you're going to create an angle. What you're going to do is your car is going to be in a position like this when you turn the wheel to the right, OK.    I have a greatvdeal of time figuring out what all these going to s really mean . Does all of them mean the same here? I know what it means. It is talking about something that would hapoen in the future. But all these in this short speech is confusing .


Ubuntu 16.04 Server Fresh Install - Can't ping gateway & no wifi network at all

I just did a fresh install of Ubuntu 16.04 on a desktop computer. During the installer, the auto network script failed so I configured it manually (entered my own IP, entered in the subnet mast, entered in the default gateway) and everything was okay with no problems. It connected successfully and finished the install.  Now that it's installed, I'm not getting any network connectivity - I can't even ping the gateway. I'm using wifi and am unable to use ethernet. ifup/ifdown on enp2s0 doesn't have an issue. I tried with DHCP, but DHCP just hanged and didn't solve it either. I also verified the requested IP address wasn't in use on the network.  root@ubuntu:/home/liam#  lshw —class network  *—network      description: Ethernet interface      product: RTL8111/8168/8411 PCI Express Gigabit Ethernet      vendor: Realtek Semiconductor Co., Ltd.      physical id: O      bus info:  pci@0000:02:00.0     logical name: enp2s0      version: 06      serial: b8:97:5a:32:c1:5f     size: 10Mbit/s      capacity: 1Gbit/s      width: 64 bits      clock: 33MHz      capabilities: pm msi pciexpress msix vpd bus_master cap_list      configuration: autonegotiation=on broadcast=yes driver:r8169      resources: irq:25 ioport:d000(size=256) memory:f0004000-f000  *-network DISABLED      description: Wireless interface      physical id: 1      bus info: usb@1:2     logical name: wlxec086b1eaf1b      serial: ec:O8:6b:1e:af:1b      capabilities: ethernet physical wireless      configuration: broadcast=yes driver:r8188eu multicast=yes     Output of /etc/network/interfaces  # This file describes the network interfaces available on your system # and how to activate them. For more information, see interfaces(5).  source /etc/network/interfaces.d/*  # The loopback network interface  auto lo  iface lo inet loopback   # The primary network interface  auto enp2s0 iface enp2s0 inet static          address 192.168.1.200         netmask 255.255.255.0          network 192.168.1.0          broadcast 192.168.1.255          gateway 192.168.1.254          # dns-* options are implemented by the resolvconf package         dns-nameservers 192.168.1.254          wpa-ssid ATT548CA          wpa-psk frank777  #auto enp2s0 #iface enp2s0 inet dhcp  #       wpa-ssid ATT548CA #       wpa-psk frank777    EDIT: Wireless Info Script results:


When Summoning Custom Villager, Can you trade enchanted gear?

Here is my command: /summon Villager ~1 ~ ~ {Offers:{Recipes:[{buy:{id:"diamond",Count:1},maxUses:9999999,sell:{id:"diamond_boots",Count:1,ench:[{id:0,lvl:1000}]},rewardExp:false}]}} and it doesn't work. How can I integrate enchanted gear into a villager's trading palette?


Why does this result only apply to primes congruent 3 mod 4?

Problem statement (and solution):     Let p be a prime satisfying $p \equiv 3 \pmod{4}$. Show that if the equation $x^2\equiv a \pmod{p}$ is soluble, then its solution is given by (1):   $$x \equiv \pm a^{\frac{p+1}{4}} \pmod{p}$$    Solution: $x^2 \equiv a \pmod{p}$ implies that $(a\mid p) = 1$ So by Euler's criterion: $a^{\frac{p-1}{2}} \equiv 1 \pmod{p}$  if (1) holds, we have: $x^2 \equiv a^{\frac{p+1}{2}} \equiv a^{\frac{p+1}{2}} * a^{\frac{p-1}{2}} \equiv a^p \pmod{p}$  By Fermat's Little Theorem, $a^p \equiv a \pmod{p}$  This quite obviously also works in the other direction. My only real question is, why does the problem statement limit the space to primes congruent to 3 mod 4? Why would this exact proof not work for primes congruent 1 mod 4? What am I missing?


I have prepared a cover page and the first chapter of my dissertation. Both of these are in different tex files.  I read that in order to have everything in a master file you need to use the include command. It does not work for me so far.  Here is the minimal example.  % cover_page.tex \documentclass[10pt,a4paper]{article} \usepackage[latin1]{inputenc} \usepackage{amsmath} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{graphicx}  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   %%%%%%% %%%%%%%%%%%%%%%%%%%%%%         TITLE, AUTHOR FOLLOWS            %%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  \title{\textbf{{\huge Proposal}} \\[8pt] Essays on ...} \author{by Me} \date{} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%    DOCUMENT BEGINS    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   \begin{document} \maketitle \thispagestyle{empty} % no number in the first page  \vspace{3cm} \begin{center} Advisor:  \end{center}  \vspace{2.5cm}   \begin{minipage}[c]{14.5cm} \centering Proposal  \end{minipage}    \vspace{3cm}  \begin{minipage}[c]{14.5cm}  \centering Department \\   University \\ \end{minipage}   \vspace{2.5cm} \begin{center} \date{A month} \end{center}  \newpage \thispagestyle{empty}  \begin{center} \begin{tabular}{lllll}  Advisor & \hspace{2cm} & \hspace{1cm} & Me & \hspace{2cm} \\[25pt]   \cline{1-2}\cline{4-5}  \textit{Signature} & & & \textit{Signature} &  \\[25pt]   \cline{1-2}\cline{4-5}  \textit{Date}  & & & \textit{Date} &  \\   \end{tabular}   \end{center}   \end{document}   Now let us move on chapter_1.tex  \documentclass[10pt,a4paper]{article} \usepackage[latin1]{inputenc} \usepackage{amsmath} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{graphicx} \title{My title} \author{PSK} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%    DOCUMENT BEGINS    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  \begin{document} \maketitle \thispagestyle{empty} % no number in the first page  \newpage  Some stuff here   \end{document}   And last, but not least the master file:  \documentclass{article}  \begin{document} \include{cover_page.tex} \include{chapter_1.tex}  \end{document}


What old movie had people living in a simulated world of bar-coded cardboard props?

It had a matrix like plot -- the protagonist starts to get glimpses of a dark, drab world underneath what appears to be a perfect existence. The defining moment is when       he is chased by armed cops and he looks back to see the reality: a  bunch of pajama clad people pointing L-shaped wooden pieces at him. He  smiles and keep running. None of the make believe bullets hit him.   He goes onto find that the world consists mostly of cardboard and wooden props with barcodes identifying what they're supposed to be. A signal tells peoples' brains what they should see. A name like "Arora" is mentioned but I cannot exactly recall.


I have an iPhone SE running iOS 12 and the battery is running out quickly,   How can I found out what is draining the battery and how can it be prevented?


Exchange old US dollar bills in Australia

I am in Brisbane and have two $100 US dollar bills from the 1985 series. I went to money exchanges and banks, but no one is accepting it. Any idea where I can change them in Australia and, in particular, the Queensland area?


I am running a regression on the impact of Gender on unemployment,  however when I control for Test score the intercept increases.  When I interpret it, it means that controlling for test score increases unemployment - which doesn't seem to make sense.  Therefore, I am wondering as to why it would be the case that when you control for a variable the intercept increases?


How to restore MBR (or whatever the issue) so windows 7 can boot?

I was going to install Ubuntu 14.04, so I tried creating two partitions from Windows 7. (I'm new to this partitioning thing.) Initially I had(rounded) C: 150 GB, D: 150 GB, E: 175 GB, 25 GB unallocated  I did this: Right click on unallocated storage (25 GB) -> New Simple Volume... -> Simple volume size in MB (2048 for swap and rest for root) -> Do not assign a drive letter -> Do not format this volume -> Finish  Now I cannot boot into Windows, It only shows a black screen and a cursor.  I booted up Ubuntu installer through pen drive  It shows(rounded)  Device          Type        Size        Used        System /dev/sda     /dev/sda1               1 MB        unknown     Windows7(loader)        (must be the MBR, I guess)     /dev/sda2   ntfs        104 MB      0 MB     /dev/sda3   ntfs        150 GB      94 MB     /dev/sda4   ntfs        340 GB      2517 MB                             (as if two drives are joined together.)   What do I do? I need to recover the Windows, its settings and all the programs installed.  My computer doesn't have CD drive, I can only use USB flash drive.


mssql return single row from one to many tables


Specified cast is not Valid (Visual Studio)

In my main form code, I've added this:  public static ShoeStyle selectedStyle;   ShoeStyle is the name of an enum I have in a class. I want selectedStyle to contain the name of whatever I select in my combo box. Like this  private void cmbShoeList_SelectedIndexChanged(object sender, EventArgs e) {     selectedStyle = (ShoeStyle)cmbShoeList.SelectedValue;                        }   But when I run the program, it gives me the error:     specified cast is not valid.   I'm not sure how I can fix this. I've heard of the term cast before but am unfamiliar with it


Java variables updating after void method

I'm slightly confused how Java works, I know the following to be true:  public static void main(String[] args) {     int c=0;     changeC(c);     System.out.println(c); // 0 }  public static void changeC(int c) {     c++; }   We know c outputs 0 because the changeC method does not change the original c  Now I'm looking at a , and it seems to following a similar concept.  Here is the code:  public int numIslands(char[][] grid) {     int count=0;     for(int i=0;i<grid.length;i++)         for(int j=0;j<grid[0].length;j++){             if(grid[i][j]=='1'){                 dfsFill(grid,i,j);                 count++;             }         }     return count; } private void dfsFill(char[][] grid,int i, int j){     if(i>=0 && j>=0 && i<grid.length && j<grid[0].length&&grid[i][j]=='1'){         grid[i][j]='0';         dfsFill(grid, i + 1, j);         dfsFill(grid, i - 1, j);         dfsFill(grid, i, j + 1);         dfsFill(grid, i, j - 1);     } }   In this case, the grid is passed to the void function dfsFills(). Yet, whatever dfsFill() does to grid, the grid in the numIslands() function is also updated.  Why does this act differently than my first example? Is one pass by reference and the other pass by value?


If $(6,n)=1$, prove that $n^2-1$ is divisible by $24$.


I made a fluctuating circuit that controls an LED to be on or off, How does it work?

I have this circuit,  The two ends represent the positive and negative terminals of the battery.  Values   R6-4.7K R1-470K R2-470K R3-4.7K C1-.1 uf C2-.1 uf    All transistors are NPN. Can someone please explain how this circuit causes fluctuations?I have no idea whats going on here. please help


How can I see the battery status of my Logitech wireless mouse?

Is there a way to monitor the mouse's battery status in Kubuntu? I have a  and in Windows I can use the default software (from official site) to monitor battery status and do other things like editing some mouse buttons etc.  Is there any software to do same thing or just monitoring battery status (applets, widgets, software etc.)?


Can a Fighter without multiple attacks use Two-Weapon Fighting?

If you are a level 5 fighter who just picked up two-weapon fighting, even if you don't have multiple attacks, would you be able to attack with two weapons?   Specifics: Weapon training: blades, heavy; using a pair of Longswords +1


How can I prove that $\gcd(a,b)=1\implies \gcd(a^2,b^2)=1$ without using prime decomposition?

How can I prove that if $\gcd(a,b)=1$, then $\gcd(a^2,b^2)=1$, without using prime decomposition? I should only use definition of gcd, division algorithm, Euclidean algorithm and corollaries to those. Thanks for your help!


will downloading ubuntu erase windows? And what will happen to my files (pictures, documents etc.)

Will installing Ubuntu erase Windows? What will happen to my files (pictures, documents etc.)  What will the installation do automatically?


In this MWE I'd like to have the footnote with no footnotemark in text or footnote. I'm surprised that I couldn't find an answer elsewhere on this site - perhaps I haven't looked properly.    \documentclass{memoir} \usepackage{lipsum} \usepackage[textheight=4in]{geometry}  \newcommand{\chapternote}[1]{% \footnote{\emph{#1}}% }  \begin{document}  \chapter{One}  \begin{quotation} Some introductory material here \ldots \end{quotation}  \chapternote{Information about this chapter -- without footnotemark,   please.}  \lipsum[1]  \end{document}   Edit: followup question. I'd like to have normal footnote numbering for all the ordinary \footnote s. Footnote counter should reset at the start of each section.


What fundamental force is at play in electron degeneracy pressure?

For example 2 electrons repel each other because they experience electromagnetic force, matter particles attract each other because they exert gravitational force on each other, fusion is possible because of overcoming coulomb force etc, now my question is what force is pushing the electrons apart under immerse gravitational force such as white dwarf star? Pauli exclusion principle is not a force unless I'm mistaken.


Most of the examples quoted for usage of Dependency Injection, we can solve using the factory pattern as well. Looks like when it comes to usage/design the difference between dependency injection and factory is blurred or thin.  Once someone told me that its how you use it that makes a difference!   I once used  a DI container to solve a problem, later on I redesigned it to work with a simple factory and removed references to StructureMap.  Can anyone tell me what is the difference between them and where to use what, whats the best practice here?


what onscreen keyboard is this? trying to disable

I accidentally enabled this annoying keyboard and I'm desperately trying to uninstall or disbale it. Any help will be greatly appreciated.  Yes, it is not onboard.  Thanks!


What is the symbolism of the colors assigned to Istari wizards?

The 5 known  wizards all had different colors (Saruman the White, Gandalf the Gray, Radagast the Brown and two blue ones, with the later changes of Gandalf to white and Saruman to 'many colors').  Is there a (preferably in-universe) explanation for the reason/symbolism behind the specific colors? The Wikia article linked above doesn't list any.


How do I see that the representing matrix of the dual map $f^*$ between finite-dimensional dual spaces is given by the transpose of the representing matrix of $f$? Here I want to assume that the matrix $f^*$ is represented with respect to the dual basis.  Apparently this result is very well-known, but I would like to see proof of this.


Let $A$ and $B$ are matrices on field $F$ of size $m \times n$ and $n \times m$ respectively. Can we claim, that nonzero eigenvalues of matrices AB and BA are the same and each of them has the same multiplicity for this matrices if:  a) $F = \mathbb{C}$  b) $F$ — arbitrary field?


Num Lock function has changed after upgrading to UBUNTU 13.10

I faced a strange function  I installed ubuntu 13.10 and all the time the number pad on the right of my keyboard is typing number without pressing Num Lock and when I turn it on It does the job when Num Lock is normally off .   does anyone have this problem ? and any idea how to fix it ?


I have installed a fresh Ubuntu on a desktop PC and connected my TP-Link (model: tl-wn8200nd) to it but it won't turn on. I tried it on a Windows PC and it turned on just fine. Please note that I'm completely new to Linux.


Change niceness (priority) of a running process

Is it possible to set a new nice level of a running process with a known id?  Does this operation require root access, or just being the owner of the process?


Is there any way to modify or remove the italic correction in all math environments globally? I don't like the uneven spacing it causes when there are multiple variables multiplied together or multiple points in the same polygon, but I don't want to keep having to use "\mathit". I've looked at a number of questions here such as  but couldn't find any that explains how to redefine the italic correction, and I don't know much about LaTeX to be able to do it myself.


How to split the strings in a particular column of a dataframe based on the value of another column?

I am trying to split the strings in a column tweet_text if the column lang is en Here is how to do it on a string: s = 'I am always sad' s_split = s.split(" ")  This returns: ['I', 'am', 'always', 'sad']  My current code which does not work: df['tweet_text'] = df.apply(lambda x: x['tweet_text'].split(" ")  if x['lang'] is 'en' else x['tweet_text'], axis = 1)  Dictionary of data: {'lang': {1404: 'en',   1943: 'en',   2169: 'en',   2502: 'de',   3981: 'nl',   4226: 'en',   7223: 'en',   8557: 'de',   11339: 'pt',   11854: 'en'},  'tweet_text': {1404: 'I am always sad when a colleague loses his job and Frank is not just a colleague he is an impoant person in my',   1943: 'It remains goalless at FNB Stadium between Kaizer Chiefs and Baroka at halftimeRead more',   2169: 'Which one gets your vote 05',   2502: 'Was sagt ihr zu den ersten Minuten',   3981: 'En we gaan door speelronde begint vandaagTegen wie speelt jouw favoriete club',   4226: 'Quote tweet or replyYour favourite Mesut Ozil moment as a Gunner was',   7223: 'How to follow the game live The opponent Current form Did you know The squad Koeman said It must b',   8557: 'BAYERN BAYERN BAYERN BAYERN BAYERN BAYERN BAYERN BAYERN BAYERN BAYERN BAYERN BAYERN BAYERN BAYERN BAYERN BAYERN',   11339: '9o golo para',   11854: 'have loads of boss stuff available on their store products available including the m'}}


I just switched over from Windows 7 to Ubuntu and am completly new to how Ubuntu works, is there a walkthrough that i havnt found for properly installing Tera Online for Ubuntu? If not could someone tell me how to get a working Tera game going :)


"there is no such" vs "there is no such a..."

I often meet two constructions which differ, as it seems, only by the choice of article: "there is no such [condition ...]" and "there is no such  a [condition ...]". What actually is the difference between them?


Why is $y + x = 3$ not the same as $y^2 + x^2 = 9$

I know this is impossible, but why is the following not possible:     $y + x = 3$ is the same as $y^2 + x^2 = 9$   They're meant to be equivalent.


Change the Folders list that Windows 8.1 Shows when File Explorer is Launched

I launch File Explorer on Windows 8.1 by pressing the Win+E shortcut.   When File Explorer opens it shows a right panel called "Folders" (circled in Red in my screenshot)    I'd like this pane to show my Explorer Favorites instead (those things displayed under the Favorites tree node in the left pane. How can I change this "Folders" view?


Equilateral Triangle from three complex points

I need some help proving this, I've seen it proven in the other direction (prove the formula if it is an equilateral) but cant figure out how to prove it this way around.     Given three complex numbers $z_1, z_2, z_3$ prove that the points $z_1, z_2, z_3$ are vertices of an equilateral triangle in $\Bbb C$, if $$z_1^2 + z_2^2 + z_3^2 = z_1z_2 + z_1z_3 + z_2z_3$$


Do harmonic numbers have a “closed-form” expression?

One of the joys of high-school mathematics is summing a complicated series to get a “closed-form” expression. And of course many of us have tried summing the harmonic series $H_n =\sum \limits_{k \leq n} \frac{1}{k}$, and failed. But should we necessarily fail?      More precisely, is it known that $H_n$ cannot be written in terms of the elementary functions, say, the rational functions, $\exp(x)$ and $\ln x$? If so, how is such a theorem proved?    Note. When I started writing the question, I was going to ask if it is known that the harmonic function cannot be represented simply as a rational function? But this is easy to see, since $H_n$ grows like $\ln n+O(1)$, whereas no rational function grows logarithmically.  Added note: This  asks a similar question for “elementary integration”. I guess I am asking if there is an analogous theory of “elementary summation”.


Show that there exists $i$ and $j$ with $1 \leq i<j \leq 51$ satisfying $a_i$ divides $a_j$.

Let $a_1<a_2<...<a_{51}$ be the given distinct natural numbers such that $1 \leq a_i \leq 100$  for all $i=1,2,....,51$. Then show that there exists $i$ and $j$ with $1 \leq i<j \leq 51$ satisfying $a_i$ divides $a_j$.    There are $25$ primes less than $100$. So we must take the set $\{a_1,...,a_{51}\}$ such that the set does not contain all $25$ primes. Because if the set contains all $25$ primes then any number other than these prime would divisible by one of the prime. But from here I can not proceed further. Please help me to solve this.


Wordpress crops some thumbnails but not others?

For some reason Wordpress is cropping some of my thumbnails proportionately rather than to specific dimensions for some images, and cropping them to specific dimensions for others.  I want it to crop all my thumbnails to 728 x 410 pixels, but some of them are taller than 410 pixels.  Here is what I have in my functions.php:  add_image_size('main-thumbnail', 728, 410, true);   Here is what I have in my content.php:
<a href="<?php the_permalink(); ?>"> <?php the_post_thumbnail('main-thumbnail'); ?>
   This works for some images but not for others, and I don't know what is causing this.  I have also regenerated my thumbnails using the Regenerate Thumbnails plugin but nothing changed.  What is the reason for this?


Using crawl rules to exclude Allitems.aspx, DispForm.aspx

Is anyone having any idea on how to exclude List Forms from Search result.  I tried lot many things suggested on google, but none of them seems to be working.


Prove that if $F$ is a finite field having q elements, then $a^{q-2}=a^{-1}$ for a nonzero $a \in F$

This is a proposition from J.S.Golan's "The Linear Algebra a beginning graduate student ought to know".  I can't understand why it's so. Obviously, the order of $a$ is finite - higher than $1$ and lower than $q+1$. But what next?


How may I add text into the citation basket?

By using \cite{} command, I know how to add a reference. For example, by using code \cite{xxx}, Lemma 1  I have the following output  However, now I want to achieve the following:  i.e., put some text inside the basket generated by \cite{} command. How may I do this? Moreover, for some reasons, my template does not allow me to use natbib package... Thank you for your help!


This is related to the 'number of times your profile is visited by others'.  How exactly does it work? For example, in my profile page, profile view count is 171.


Collection of Undergraduate, Graduate, and PhD theses?

Is there some webpage with a collection of thousands of theses of undergraduates, graduates, and PhD students from all kinds of sciences and where they are freely accessible like on ArXiv or (mostly) adsabs.harvard.edu?


Is “come September” a kind of inversion?

From NPR, transcript .     Michelle Scott is reading from the Common Core math standards for   fifth-graders. She'll be teaching fifth next year, along with John   Gries. And together, they're writing—and rewriting—lessons   they'll need come September.   For the last sentence, did he want to say, “they're re-writing lessons they'll need if September comes”? He inverted the last part, put the verb “come” in the front and omitted “if”, right?   As far as I could determine, it seems only “if” with subjunctive voice could be used in this way. I don't think it's a subjunctive voice. In my impression, the subjunctive voice stands for those occasions when you're not sure whether it will happen or not, such as “If it were to rain, I'd pick you up.”   September will come sooner or later (it's not in limbo), so I'm wondering how to explain the sentence.


We built a website targeting different regions but with the same English language (Ireland, England and America). The content for the most part is the same set up on 3 different subfolders.  http://www.example.com/ - targeting the United States in WMT  http://www.example.com/ie - targeting Ireland in WMT  http://www.example.com/uk - targeting UK in WMT  Do I have duplicate content issues to be worried about?  If so, how do I get around this issue?   Also is there anyway of finding out if Google have in some way penalised these pages for having the same content on other pages trageting different countries? I have not received any messages from Google in WMT saying there is duplicate so I'm not sure if this is an issue.


How to remove whitespace after abbreviations

How can I remove unwanted white-space present when using macros from the abbrevs package?  \documentclass{report} \usepackage{abbrevs} \begin{document} Socretes (470-399\BC) annoyed Aristophanes. % gives (470-399 B.C. ) not (470-399 B.C.) \end{document}


I'd like to know if in mathematics exist the ratio between two vectors. If yes, when is it used?  Thank you so much.