I see this a lot:     I shall say, Daphne, that my going to Athens on Saturday need not disturb our tea schedule one bit.   Versus what seems right to me:     I shall say, Daphne, that me going to Athens on Saturday need not disturb our tea schedule one bit.   I'm somewhat sure that the former is actually the right one, but the latter always seems like the right one to me.  Can both be used? If seems weird to say "my going to Athens" as opposed to "me going to Athens", but the more I use "me" in this context, the less I sound like a native English speaker (which I'm not) and it bothers me.

I assume that the following sentences are grammatically correct:   He resents your being more popular than he is. Most of the members paid their dues without my asking them. They objected to the youngest girl's being given the command position. What do you think about his buying such an expensive car? We were all sorry about Jane's losing her parents like that.   I'm still getting used to this possessive gerund structure. It sounded so weird to me at first. Is the structure used in both formal and informal contexts? Are there any alternative structures that result in the same meaning and are more frequently used? (Examples taken from )


I find that Unity Desktop is back on new distribution Ubuntu Unity. Can I install this Unity Desktop on existing Ubuntu 20.04?

I recently installed Ubuntu 18.04 and I'm not keen on the desktop environment. I want the desktop env. I used to have in Ubuntu 14.04. How can I get it?  I've attempted to use , but when I try to install the Unity's 7.2.5 version using the command:  apt install unity=7.2.5   it gives me   E: Version '7.2.5' for 'unity' was not found   For sure I need to add a PPA for this, but which one!?


I have just created a new account on networkengineering.stackexchange.com. How can I earn 100 rep on my StackOverflow account? I've read a number of posts on stackexchange regarding account associations, but I still don't quite understand how to gain this 100 rep.  Thanks!

On Stack Exchange, users may gain a certain level of reputation.  What does reputation do? How can a user gain or lose reputation?   See also   in the Help Center  - Maximum amount of votes a user can use in a day and reputation requirements to vote.  - How to get an exact overview of the actions that got you your reputation.  - A full list of all privileges granted at each reputation level on all sites.


For a positive integer $n$, prove that $$\sum_{d|n}{\mu^2(d)/\phi(d)=n/\phi(n)}$$ I suspect something is missing here. I guess there is on extra condition on $n$, which is $n$ must ne square free. Because when I substitute $n=20$, the equality does not hold. Can anyone clarify for me ?

I am trying to show that: \begin{equation} \frac{n}{\phi(n)} = \sum_{d \mid n} \frac{\mu^2(d)}{\phi(d)} \end{equation} where $\phi(n)$ is  and $\mu$ is the .  The identity clearly holds for $n=1$, so if we write $n=p_1^{a_1} \cdots p_k^{a_k}$ for the prime decomposition of $n$, the left-hand side becomes: \begin{eqnarray*} \frac{n}{\phi(n)} & = & \frac{p_1^{a_1} \cdots p_k^{a_k}}{\phi(p_1^{a_1}) \cdots \phi(p_k^{a_k})} \\ & = & \frac{p_1^{a_1} \cdots p_k^{a_k}}{(p_1^{a_1-1})(p_1-1) \cdots (p_k^{a_k})(p_k-1)} \\ & = & \frac{p_1 \cdots p_k}{(p_1-1)\cdots (p_k-1)} \end{eqnarray*}   Whereas the right-hand side becomes:  \begin{eqnarray*} \sum_{d \mid n} \frac{\mu^2(d)}{\phi(d)} & = & \sum_{\substack{d \mid n \\ p^2 \nmid d}} \frac{1}{\phi(d)} \\ & = & 1 + \frac{1}{\phi(p_1)} + \dots + \frac{1}{\phi(p_k)} + \frac{1}{\phi(p_1 p_2)} + \dots + \frac{1}{\phi(p_{k-1}p_k)} \\ & + & \dots + \frac{1}{\phi(p_1 \cdots p_k)} \\ & = & 1 + \frac{1}{p_1 - 1} + \dots + \frac{1}{p_k - 1} + \frac{1}{(p_1 - 1)(p_2 - 1)} + \dots + \frac{1}{(p_{k-1}-1)(p_k-1)} \\ & + & \dots + \frac{1}{(p_1 - 1) \cdots (p_k - 1)} \end{eqnarray*}  I am unsure of how to proceed from this point however. Any help would be much appreciated.


Is it appropriate to use a participle as I did it in the sentence below?  We often come across some resources published using a foreign language.  I suppose that if we used "which (or that) are", it would be grammatically correct.  We often come across some resources which (that) are published using a foreign language.

I know for a fact that for some verbs like 'say', 'indicate', 'know', 'claim', the deletion of 'that' is usually optional, though it's safer to include it. However,  does the same apply when 'that' is used to linked a subject to a independent clause?   To clarify with an example:   The worst thing is you don't even know who did it.  Or  The worst thing is THAT you don't even know who did it.   Which one is grammatically correct, if not both?  Note: I am having trouble finding something to refer to that specifically discusses the omitting of 'that' after verb-to-be. Providing me with a link would be greatly appreciated.  Many thanks in advance.


For a pair of random variables $Y$ and $Z$, is it possible that their ratio $X:=\frac{Y}{Z}$ is (exactly, not asymptotically) normally distributed? If so, could you offer an example of the distributions of $Y$ and $Z$ and the relationship between them (besides the obvious case where $Y$ is normal and $Z$ is a constant, as suggested by @gunes)?  P.S. A special case of my question has been answered here: . My question is more general than that.

The ratio of two independent normal distributions give a Cauchy distribution. The t-distribution is a normal distribution divided by an independent chi-squared distribution. The ratio of two independent chi-squared distribution gives an F-distribution.  I am looking for a ratio of independent continuous distributions that gives a normally distributed random variable with mean $\mu$ and variance $\sigma^2$?  There is probably an infinite set of possible answers. Can you give me some of these possible answers? I would particularly appreciate if the two independent distributions which ratio is computed are the same or at least have similar variance.


I am trying to see some properties of a CGRect and doing:  NSLog(@"%@", frame);   However, I get an error that says CGRect is not an id type. How would I print the frame to see attributes of it?

I want to be able to debug C structures without having to explicitly type every property that they consist of.  i.e. I want to be able to do something like this:  CGPoint cgPoint = CGPointMake(0,0); NSLog(@"%@",cgPoint);   Obviously the '%@' won't work, hence the question.


I would like to make an array of buttons, which later will help me construct the board with JButton, but whenever I try to call on the code below i get a NullPointerException on the addButton method. The Exceptions are with the actionPerformed and mouseReleased in the BasicButtonListener, which I don't really understand.  public Window(int size, MainWindow mainWindow) {         this.size = size;         this.mainWindow = mainWindow;         mainWindow.getWindowList().add(this);         model = new GamePlay(size);          JPanel top = new JPanel();          label = new JLabel();         updateLabelText();          JButton newGameButton = new JButton();         newGameButton.setText("New Game");         newGameButton.addActionListener(new ActionListener() {              @Override             public void actionPerformed(ActionEvent e) {                 newGame();             }          });          top.add(label);         top.add(newGameButton);          JPanel mainPanel = new JPanel();         mainPanel.setLayout(new GridLayout(size, size));          for (int i = 0; i < size; ++i) {             for (int j = 0; j < size; ++j) {                 addButton(i, j); //Line 50                 mainPanel.add(buttonMatrix[i][j]);             }         }          getContentPane().setLayout(new BorderLayout());         getContentPane().add(top, BorderLayout.NORTH);         getContentPane().add(mainPanel, BorderLayout.CENTER);     }       private void addButton( int i,                             int j) {         final JButton button = new JButton();          button.addActionListener(new ActionListener() {             @Override             public void actionPerformed(ActionEvent e) {                 Player newValue = model.step(i, j);                 button.setText(newValue.name());                  updateLabelText();                  Player winner = model.findWinner();                 if (winner != Player.NOBODY) {                     showGameOverMessage(winner);                 }              }         });          buttonMatrix[i][j] = button; //Line 81      }   And the MainWindow class:  private List<Window> gameWindows = new ArrayList<>();      public MainWindow() {          JButton small = new JButton();         small.setText("3 x 3");          small.addActionListener(getActionListener(3));          JButton medium = new JButton();         medium.setText("5 x 5");          medium.addActionListener(getActionListener(5));          JButton large = new JButton();         large.setText("7 x 7");          large.addActionListener(getActionListener(7));          getContentPane().setLayout(                 new BoxLayout(getContentPane(), BoxLayout.Y_AXIS));         getContentPane().add(small);         getContentPane().add(medium);         getContentPane().add(large);     }      private ActionListener getActionListener(final int size) {         return new ActionListener() {              @Override             public void actionPerformed(ActionEvent e) {                 Window window = new Window(size, MainWindow.this); //Line 43                 window.setVisible(true);                 gameWindows.add(window);             }          };     }

What are Null Pointer Exceptions (java.lang.NullPointerException) and what causes them?  What methods/tools can be used to determine the cause so that you stop the exception from causing the program to terminate prematurely?


I'm developing a predictive model on a dataset of about 25K observations with the response variable having ~60 classes. There are ~130 predictor variables, all of them binary. In this problem I care about predicting the right probabilities on the response variable and not about predicting one single value.  I'm dealing with an imbalanced dataset where the least common class in the response variable has a relative frequency of 0.004% and the most common one has 12%.  I've been trying different models using up-sampling inside the cross-validation training sets and have achieved a ROC of 80% on the unbalanced hold-out sets using Random Forests which is pleasantly good.   However, wouldn't up-sampling introduce error to the predicted probabilities? I'm thinking so because the probabilities are calculated with the training set which is artificially balanced. Another approach I'm considering is assigning higher weights to the uncommon cases when training the model. But wouldn't that be effectively the same as up-sampling?

We already had multiple questions about unbalanced data when using , , ,  and a number of other similar questions, what makes it a very popular topic! Unfortunately, each of the questions seems to be algorithm-specific and I didn't find any general guidelines for dealing with unbalanced data.  Quoting , dealing with unbalanced data     (...) heavily depends on the learning method. Most general purpose   approaches have one (or several) ways to deal with this.   But when exactly should we worry about unbalanced data? Which algorithms are mostly affected by it and which are able to deal with it? Which algorithms would need us to balance the data? I am aware that discussing each of the algorithms would be impossible on Q&A site like this, I am rather looking for a general guidelines on when it could be a problem.


I've been trying to prove that $$ \int_0^1 x^{-x}\text{d}x=\sum_{n=1}^{\infty} n^{-n} $$ Mathematica told me that's true, but I don't know how to solve it. Is there any way to prove it?

I need help with this exercise.  I need to prove $$\int_{0}^{1}x^{-x}\ dx=\sum_{n=1}^{\infty}n^{-n}$$  I think I should use some convergence theorem, but I'm stuck.  Thanks a lot!


In my program I'm trying to loop specific actions depending on the value of the String args[0].  I have a conditional tree setup, but no matter what args[0] is, it always chooses the last else option as opposed to the option I want it to be.  Here is the relevant code:  public static void main(String[] args) {     int a = Integer.parseInt(args[1]);     int b = Integer.parseInt(args[2]);     int c = Integer.parseInt(args[3]);     int d = Integer.parseInt(args[4]);      for (int i = -a; i <= a; i++)     {         for (int j = -b; j <= b; j++)         {             for (int k = -c; k <= c; k++)             {                 for (int l = -d; l <= d; l++)                 {                     if (args[0] == "rational-class")                         rationalClass(a,b,c,d);                     else if (args[0] == "rational-instance")                         rationalInstance(a,b,c,d);                     else if (args[0] == "complex-class")                         complexClass(a,b,c,d);                     else if (args[0] == "complex-instance")                         complexInstance(a,b,c,d);                     else                         System.out.println("error");                 }             }         }     }  }

I've been using the == operator in my program to compare all my strings so far. However, I ran into a bug, changed one of them into .equals() instead, and it fixed the bug.  Is == bad? When should it and should it not be used? What's the difference?


i have a C# application that is crashing "stopped working" and i am not a C# guru. From what i saw on the internet, the main reason for a C# application crash is an unhandled exception (i don't know why you're not forced to use try catch in c# like in java). Is there a way to catch an unhandled exception that occurred anywhere in the application? Like in Main maybe? I don't really want to go through 50 classes and properly add try catch blocks.

I wonder how can I write a catch'em all exception handler in the application level which will give the user the option to resume the application flow?


Beware of the beginners question.  I read about the new Kubuntu Version (15.10) that was released these days. I am using the previous release (15.04).  Is there something I need to do to get the new release version or will my system semi-automatically receive the version like the other updates I get from time to time (by getting a notification in the tray that offers me to install available updates)?

What are the different ways I can use to upgrade Ubuntu from one release to another?


I see it both ways with a comma before a sentence-ending 'too' and a comma on each side of 'too' when it's the second word in a sentence. Are these commas really needed? Would you personally use them? I think we could leave these sentences as is without the commas. Do you concur?   He too makes a few unforced errors, and we're at deuce.  (Comma  needed before and after 'too'?) She too admired his looks and his courtliness. (Comma needed before and after 'too'?) She admired his looks and his courtliness too. (Comma before 'too'?) He wanted to go too but decided not to. (Comma before and after 'too'?) He wanted to go too, but he decided not to.(Comma before and after 'too'?) He too puts commas around 'too'. (Comma before and after the first 'too'?)   Headline: Obama Says He Too Is a Poverty Fighter In D.C., He Offers Contrast With Edwards (Comma before and after 'too'?)

Consider the following examples:   "And it is a bottle, too." "And it is a bottle too."   Is there a semantic difference between these two sentences? Or do they mean the same thing, with or without the comma before "too"? If not, what is the correct usage of the comma in context of "too"?


I have algebra problem from a friend, that is 1=-1!!! because   $$-1=-1^{3}=-1^{^{\frac{6}{2}}}=\sqrt{(-1)^6}=\sqrt{1}=1$$  I can not see what is wrong with this?  I will appreciate it any help.

I know there is something wrong with this but I don't know where. It's some kind of a math fallacy and it is driving me crazy. Here it is: $$-1= (-1)^3 = (-1)^{6/2} = \sqrt{(-1)^6}= 1?$$


I have a string:  Input:     "Feature.. sklsd " AND klsdjkls 9290 "Feass . lskdk SDFSD __ ksdljsklfsd" NOT "Feuas" "Feature.lskd" OR PUT klasdkljf al9- .s.a, 9a0sd90209 .a,sdklf jalkdfj al;akd      I need to match any character except OR, NOT, AND, "Feature.any_count_of_characters"  the last one is important this start with: "Feature.   This is followed by any number of characters and then ends with: " character.  I'm trying to solve this using lookahead or lookbehind but I can get the expected output, only a portion of characters that I don't want.  My expected output is      "Feature.. sklsd " AND klsdjkls 9290 "Feass . lskdk SDFSD __ ksdljsklfsd" NOT "Feuas" "Feature.lskd" OR PUT klasdkljf al9- .s.a, 9a0sd90209 .a,sdklf jalkdfj al;akd    All that is in black.  To test it i'm using these links:  http://gskinner.com/RegExr/ http://regexpal.com/   Thanks.  EDIT  Check this link   inside the link i get matched some expression. But i don't need the expression that matched. i need the inverse, how i can get it?  Thanks.

I'm trying to get a regex that will match:  somefile_1.txt somefile_2.txt somefile_{anything}.txt   but not match:  somefile_16.txt   I tried  somefile_[^(16)].txt   with no luck (it includes even the "16" record)


is a great resource for viewing manpages not installed in the system. However, it uses some weird programming to redirect short URLs like http://manpages.ubuntu.com/ls.1 to http://manpages.ubuntu.com/manpages/wily/en/man1/ls.1posix.html, and it always picks the latest release. Otherwise, it works fine when using lynx with the full URL. It even looks like a normal manpage:    The redirection doesn't work in lynx (or elinks or w3m). Just to check, I tried on my Arch Linux elinks, which apparently does support JavaScript:  $ elinks -version ELinks 0.13.GIT a3751107033599b835eaafa61177c8d4dda4b7ef-dirty Built on Oct 31 2013 20:43:18  Features: Standard, IPv6, gzip, bzip2, UTF-8, Periodic Saving, Viewer (Search History, Timer, Marks), Cascading Style Sheets, Protocol (Authentication, File, CGI, FTP, HTTP, URI rewrite, User protocols), SSL (OpenSSL), MIME (Option system, Mailcap, Mimetypes files), LED indicators, Bookmarks, Cookies, ECMAScript (SpiderMonkey), Form History, Global History, Scripting (Lua, Spidermonkey ECMAScript), Goto URL History    didn't redirect either. That's that for the suggestions from   Using the full URL would be workable if I knew the section, which is not always the case. Is there a program which can bring up the online manpage, preferably for the running Ubuntu version? In case of matches in multiple sections, it should behave like man does.

How can I get information about a package before installing it, from the terminal?  I mean something like man pages, but accessible even before the package is installed.


In my apple account there is $0.15. When ever I try to change my country it says "you have store credit balance; you must spend your balance before you can change stores."  If there is a way to change countries please share your info.

I moved to Canada and I want to change my country of region from USA to Canada, but when I try to change it ( by click on my account in the iTunes Store and going to my Account Page) it showed me this error: "You have a store credit balance; you must spend your balance before you can change stores"    I must mention I have redeem 100$ to my account but I don't have any intention to spent it now, what is my option?


I search in some post, and say that the number $N$ of emitted electrons is  $$N=\frac{IA}{hf}=\frac{P}{hf}$$  but $f$ is for fixed incident frequency  what happens if I want to calculate $N$ for a range of frequency for example between $f1$ and $f2$ ? I think that the general formula for $N$ is   $$N=\frac{IA}{h}\int_{f1}^{f2}\frac{df}{f}$$  Is it correct?

I know how to calculate the kinetic energy of the emitted electrons   $$KE=hf-\phi$$  And the number of the emitted electrons, but this is valid for a certain frequency  $$N=\frac{IA}{hf}=\frac{P}{hf}$$  What happens if I have a frequency range? for example between λ1 and λ2?  BTW: It's not homework, I'm an engineering student,  not a physics student


Let $x$ be a non-zero (column) vector in $\mathbb{R}^n$. What is the necessary and sufficient condition for the matrix $A = I − 2xx^T$ to be orthogonal?

Let $x$ be a non zeo (column) vector in $\mathbb{R}^n$. What is the necessary and sufficient condition for the matrix $A = I-2xx^t$ to be orthogonal?


I'm considering an arbitrary, non-degenerate ellipse here, i.e., without assuming that it's centred on the origin or either axis, nor oriented at any specific angle.  I know either 5 points on the perimeter $(x_1,y_1)$ through $(x_5,y_5)$, or the general cartesian equation $Ax^2+Bxy+Cy^2+Dx+Ey+F=0$ where $F = 0$ or $1$.  The two forms are equivalent as it's easy to solve the simultaneous equations for 5 values of $(x,y)$ to get $A$ through $F$ when the ellipse isn't degenerate. These uniquely define one ellipse - or a conic at any rate ;-)  But what I'm really after are the cartesian foci and its eccentricity (I can get everything else I might need from these: the major/minor axes, rotate the ellipse to align with the axes, or find its equation in polar form if needed).   I can't find a way to do that......

Is there a generalized way( a particular conic section of any shape,for instance an ellipse without determining its major/minor axis) to find the centre,vertices,foci,focal radii,letus rectum,eccentricity,etc when exists of any parabola,ellipse,hyperbola?(dealing separately)  $ax^2+by^2+cx+dy+exy+c=0$ ($a,b,c$ not all zero)


I would like to list out files of all folders which are having all type of files like hidden,non-permissible and normal files etc. and it needs to be done all platforms like windows,linux and mac. I wrote a snippet in java  to figure out it but it is able to print only normal files.When the execution comes to non-permissible file it throws an exception stating NullPointerException and execution gets stopped.Is there any way to traverse through the folders with root permissions?.  public static void main(String[] args) throws IOException {              File[] drives;                 FileSystemView fsv = FileSystemView.getFileSystemView();              // returns pathnames for files and directory                 drives = File.listRoots();               // for each pathname in pathname array                 if (drives != null && drives.length > 0) {                     for (File aDrive : drives) {                         System.out.println("Drive Letter: " + aDrive);                          listFilesAndFilesSubDirectories(aDrive.toString());                     }                 }           }          private static void listFilesAndFilesSubDirectories(String filePath) {             // TODO Auto-generated method stub             File directory = new File(filePath);             File[] fList = directory.listFiles();             for (File file : fList){                 if (file.isFile()){                     System.out.println(file.getAbsolutePath()+"\n**************************");                  } else if (file.isDirectory()){                     listFilesAndFilesSubDirectories(file.getAbsolutePath());                 }             }         }   and the exception it throws is below  Exception in thread "main" java.lang.NullPointerException     at com.dlp.Test.listFilesAndFilesSubDirectories(Test.java:35)     at com.dlp.Test.listFilesAndFilesSubDirectories(Test.java:40)     at com.dlp.Test.listFilesAndFilesSubDirectories(Test.java:40)     at com.dlp.Test.listFilesAndFilesSubDirectories(Test.java:40)     at com.dlp.Test.main(Test.java:24)   Kindly help me to overcome this issue. Thanks.

What are Null Pointer Exceptions (java.lang.NullPointerException) and what causes them?  What methods/tools can be used to determine the cause so that you stop the exception from causing the program to terminate prematurely?


The time derivative of acceleration (m/s²) is jerk (m/s³).  I know that when you push on an object, there cannot be true instantaneous acceleration, which leads to infinite jerk, because the object must compress ever so slightly before it starts to move.  However, what if an object is suspended in a vacuum using an electromagnet? When the power is cut, would it release all attractive force instantaneously in exactly no time? Would the jerk be infinite at the moment of the start of free fall? Note: Acceleration will be in standard gravity.  Also, what if the object is hung by a string, and the string snaps due to too much tension (for example, object too heavy)? Will the jerk be infinite?  Also, how about snap (m/s⁴) and crackle (m/s5)?

This might be a very vague and unclear question, but let me explain. When an object at rest moves, or moves from point $A$ to point $B$, we know the object must have had some velocity (1st derivative of position) during that trip. It's also true that the object had to have accelerated to gain that velocity (2nd derivative)... if we extend this argument, is it logical to say that the object must have experienced jerk (3rd deriv.) to gain that acceleration? And so on and so forth... 3rd, 4th, 5th position derivatives? Or is my logic flawed somewhere?


I have recently noticed that when two objects with blurry shadows cast by the same light source are brought close to each other, their shadows appear to merge in a way where one shadow appears to "bulge" and meet the other even though the two objects are not in contact. I noticed this in my bathroom while I was brushing my teeth. Here is a gif of the same:  I thought that this might have to do with diffraction (although diffraction is a phenomenon that only occurs when light meets objects that are of size comparable to its wavelength, which is not the case here) or the umbrae and penumbrae of the blurry shadows but I'm not sure. I am aware of  question that seems to ask about a similar phenomenon, but have decided to post mine anyway because:  It is related to the shadows cast by the Sun while in my case it is just a bathroom light The answer to it, although a fantastic one, concludes that this effect is captured by the camera due to the limitations of its sensor even though I was able to capture it on my phone with high resolution and the video is indistinguishable from what I saw with my own eyes. Moreover, my bathroom is not brightly lit at all, which is what the answer suggests is required for this effect to be seen or captured by the camera.  Hence, I am inclined to believe that there is something more to it. I was also able to easily recreate this effect using my table lamp, and found that the object that is further from the light source seems to be the one whose shadow "bulges" outward towards the shadow of the object closer to the source of light. This agrees with the gif above as my finger in it is closer to the bathroom light than the faucet, which is the one whose shadow appears to bulge towards the shadow of my finger. It also seems that the blurrier the shadow (i.e. the closer the object is to the light source), the greater is the "bulging" effect although I have not thoroughly tested this. Does anyone have a clear explanation for this phenomenon? Edit While searching about this phenomenon on the web, I came across  Wikipedia page that describes it as the "Shadow blister effect". Although the page is pretty barebones and lacks citations, it seems to agree with my observations about the positions of objects with respect to the light source and each other, and suggests that:  The effect takes place when two objects are located at varying distances between a non-point light source and a backdrop upon which their shadows are cast. As the two objects move transversely such that their shadows approach each other, the object nearest the light source will begin blocking light from reaching the inside of the other object's penumbra, thereby expanding its umbra. This expansion of the further object's umbra will continue until the umbras of both objects meet. This effect can be demonstrated and understood using ray theory.

I was laying on my bed, reading a book when the sun shone through the windows on my left. I happened to look at the wall on my right and noticed this very strange effect. The shadow of my elbow, when near the pages of the book, joined up with the shadow of the book even though I wasn't physically touching it.   I have posted :The video seems to be the wrong way up, but you still get the idea of what is happening.  What is causing this? Some sort of optical illusion where the light gets bent?  Coincidentally, I have been wondering about a similar effect recently where if you focus your eye on a nearby object, say, your finger, objects behind it in the distance seem to get curved/distorted around the edge of your finger. It seems awfully related...  EDIT: I could see the bulge with my bare eyes to the same extent as in the video! The room was well light and the wall was indeed quite bright.


I'm setting up a continuous deployment user, agent, on my Ubuntu Server 16.04 instance.  He is in the sudo group. He has also been added to visudo as such:  agent ALL=(ALL) NOPASSWD: /bin/systemctl   I want him to be able to start and stop systemd services without a interactive console session.  However when he executes the command systemctl stop my.service, he gets the following message:  Authentication is required to stop 'my.service'.  Multiple identities can be used for authentication:  1.  Ubuntu (ubuntu) 2.  ,,, (user1) 3.  ,,, (user2) 4.  ,,, (agent)   Choose identity to authenticate as (1-4):   This defeats my CI/CD software.  Is there any way that I can prevent this screen from showing up? My sudoers file is default, excepting that one modification:  root    ALL=(ALL:ALL) ALL  # Members of the admin group may gain root privileges %admin ALL=(ALL) ALL  # Allow members of group sudo to execute any command %sudo   ALL=(ALL:ALL) ALL  agent ALL=(ALL) NOPASSWD: /bin/systemctl

I have a service (kado-demo.service) that a normal user (kado) should be able to restart without entering any password.   I created /etc/sudoers.d/user_restart and added  kado ALL=NOPASSWD: /bin/systemctl restart kado-demo.service   Permissions:  -r--r-----   1 root root   585 Mar  5 10:47 user_restart   As user k, I now should be able to execute the given command, but this happens:  /bin/systemctl restart kado-demo.service  ==== AUTHENTICATING FOR org.freedesktop.systemd1.manage-units ===  Authentication is required to restart 'kado-demo.service'.   Multiple identities can be used for authentication:   (...)   Which is the same result as before I added the file.   The /etc/sudoers contains  #includedir /etc/sudoers.d   And I even get the same result when I add content of the user_restart file directly to /etc/sudoers.  I'm running out of ideas...


Apart form the following, what are the other properties of a good cryptographic Substitution box or the S-Box:   Changing one input bit should change about half of the output bits. Each output bit should depend on every input bit.

What desirable properties should an S-box have?  My current standard selection process is to just pick them at random and verify that they fit the following criteria:   The probability that any random two bits $S[a]_b$ and $S[c]_d$ are equal (for any random $a$, $b$, $c$ and $d$) is 50%. The probability that any random two bits $S[a]_n$ and $a_n$ are equal (for any random $a$ and $n$) is 50%. No entries exist such that $S[a] = a$ No entries exist such that $S[a] = \bar{a}$   Are there any other important properties that need to be applied?  Edit My reasons for asking are that I wish to combine this S-Box design with a CBC mode cipher as discussed on .


If I were a Force user and were to cast a Force push targeted at another person standing so far away, would they have the ability to dodge it or would the person, no matter how fast they reacted, still be affected and hit by it?  To put in a crude manner: does the Force behave the same way that a projectile does or does its effect manifest at the point of the target?  I hope this makes sense. If not, please voice your concern(s) and I'll do my best to clarify.

For instance, if a Jedi Force-pushes something 1000 meters away, is the effect instantaneous or is there a propagation delay, something like the speed of light?


Is it possible to minimize or close any application or browser by mouse click.  If I click any icon on launcher then the application opens but if I click on the same icon then it does not get close or minimize.  I need to go to the minimize or close button for the same.  Please let me know.

I don't know if this is a feature or a bug, but clicking on an active application's launcher icon doesn't minimize it. It is terribly inconvenient for folks using a persistent Unity bar to click minimize button every time. Is there any way to add minimize functionality to the launchers?


I am completely stumped by the following MWE, on which any run of pdflatex except the very first run results in a citation-free .bcf file, whereupon biber complains:  WARN - The file 'mwe.bcf' does not contain any citations!  The problem disappears if I do either one of the following:   comment out \tableofcontents; comment out \usepackage{tikz}; switch the documentclass from  (downloaded ) to amsart.   \documentclass[smallextended]{svjour3} % \documentclass{amsart} \usepackage{filecontents} \begin{filecontents}{\jobname.bib} @misc{Knuth:2014,     Author = {Knuth, Donald E.},     Howpublished = {\url{http://www.informit.com/articles/article.aspx?p=2213858}},     Title = {Twenty Questions for Donald Knuth},     Year = {2014}} \end{filecontents}  \usepackage[backend=biber,backref=true]{biblatex} \bibliography{\jobname} \usepackage{tikz}  \begin{document}  \tableofcontents   \section{One} \cite{Knuth:2014} \printbibliography[heading=bibintoc]  \end{document}   If debugging(?) the Springer classes is (understandably) deemed not tex.se’s job then I’d still appreciate a pointer on where else to ask.

When using the Springer class svjour3 (can be obtained ), I stumbled upon a problem with \cite. Look at the following minimal example:  \documentclass{svjour3}  \usepackage{todonotes}  \usepackage{biblatex} \addbibresource{references.bib}  \begin{document} \cite{test1} % \cite{test2} \tableofcontents \cite{test1} \cite{test2} \end{document}   You can use two arbitrary bib entries with keys test1 and test2 in references.bib for this.  When you compile this, both cites of test1 work, but the cite to test2 does not work. Anything of the following fixes the issue:   comment out the todonotes package, comment out the \tableofcontents, or use the article class instead of svjour3.   I checked the definition of \tableofcontents in svjour3, which is  \newcommand\tableofcontents{%     \section*{\contentsname}%     \@starttoc{toc}%     \addtocontents{toc}{\begingroup\protect\small}%     \AtEndDocument{\addtocontents{toc}{\endgroup}}%     }   Indeed, using article with this definition of \tableofcontents also fails. Any insights on what's happening here? Is this expected behavior or a bug in svjour3?


I'm going to do my best to outline our current setup and our plan and hopefully you guy can assist in the best possible setup.  We have two offices (A and B).  Each office has about 10-15 systems.  3 systems in each office are attached directly (usb) to a printer.    Each office has a decent line with more than capable bandwidth.  Maybe I should be using VPN routers?  We have a powerful server (2012 r2) in a seperate NYC data-center with a full gigabit connection.  Due to having multiple locations needing to access the same software, we have setup a remote desktop services / domain controller on that system.  It also serves as a VPN server.  The office systems are all connected individually to the VPN server and assigned a static IP address (192.168.50.2-254).  The systems with printers attached in each office have the printer shared over the VPN.  The printers are then deployed using gpedit to all the users.    The printing however is extremely slow.  Test pages tend to freeze for a good 30 seconds before spooling.  Then it takes another 30-40 seconds to finish spooling and send it off to the printer.  We have another similar setup where we used server 2008 and it does not have this same problem.  Does anyone have any idea what could be getting in it's way?  Is there an alternate setup I should consider?

Our setup is as follows:  Two offices (A and B) connected with OpenVPN Access Server.  One Windows Server 2008 R2 Standard    Housed in remote datacenter. Terminals at both offices connect through RDP in order to use a particular piece of software concurrently. Network Connected printers (Deployed with GPO) that are connected to separate terminals at each office (and shared) are used with this software to print things throughout the day.   We are experiencing extremely slow printing times.  Opening printer properties can take 30-60 seconds and printing times range from 30-180 seconds with no apparent reason.  File sizes remain < 1mb.  This happens with each of our printers.  All different models.  The server massively underutilized with a 6-core AMD, 16GB ram, 4x 120GB SSDs, and a 100 megabit port.  Our VPN does not seem to be a bottleneck either.  I've been attempting to find ways to increase print speed.  So far no success.  What can you advise?


I've been trying to use the gather* environment for non-aligned centered equations within enumerate but I would like to prevent the new line that gather* inserts at the beginning of each item. Is there any easy way to do this? I tried inline gathered but it does not center the equations in the middle of the line like gather* does.

Related (but not the same):         Earlier today I asked a question about aligning equations in an enumerate environment and got an answer that seemed to work for the example I gave, but it turns out I wasn't really specific enough for my problem.  I'm using align* environments, often as the only part of a list item. (If you're wondering why I'm not using more words to introduce the align*, these are mostly homework solutions where most of the work is algebra, etc.)  Here's my code and what it makes (above the middle line):  \begin{enumerate}   \item \begin{align*}     x^2 + y^2 &= x^2 + (iy)^2 \\               &= (x + iy) (x - iy)   \end{align*}   \item \begin{align*}     \frac{1}{n^2-4} &= \frac14 \frac{4}{(n-2)(n+2)} \\                     &= \frac14 \left( \frac{1}{n-2}-\frac{1}{n+2} \right)   \end{align*} \end{enumerate}     I'm trying to make the baseline of the first line of the align* environment the same as the number's baseline—I want the first line of the align* to have the same vertical position (centered horizontally in the same way) relative to its number as in the second half of my picture. (Side question: why is there so much space before the align* starts?)


Since I got a new ssd and the limit of TBW is 100, I just want to predict how long it will last considering my day by day usage. Each day I do the same staff with my pc, so I just need to monitor for let's assume one week how many gigabytes I write on my ssd. Is there a simple software that release kind of benchmark for each day or session? Thanks.

As far as I know, the only con against switching to an SSD except its price is the tendency to fail soon (relatively to conventional HDDs) in case used in active read-write operation. Is there an efficient way to predict the failure?


Let $\Omega \subset \Bbb R^n$ be a convex set and $f: \Omega \to \Bbb R$ be continuous. Show that $f$ is convex if and only if for all $x,y \in \Omega$, $$f\left (\frac{1}{2}x + \frac{1}{2}y \right ) \leq \frac{1}{2} f(x) + \frac{1}{2} f(y)$$ Give a counterexample to the same statement without the assumption that $f$ is continuous. $\Rightarrow$ is obvious but I am not getting any clue for the other side. I was trying to proceed using the bisection method e.g. for $f(\lambda x+(1-\lambda )y)$ I was trying to approach $\lambda f( x)$ by halving the numbers say $\frac{\lambda x+(1-\lambda )y}{2}$ and same with $(1-\lambda)f( y)$ but it seemed to be not working. Please help me with the proof and the counterexample.

Given that $$f\left(\frac{x+y}{2}\right)\leqslant \frac{f(x)+f(y)}{2}~,$$ how can I show that $f$ is convex. Thanks.      Edit: I'm sorry for all the confusion. $f$ is assumed to be continuous on an interval $(a,b)$.


To achieve my goal as of this question  I want to assign a link to the menu item id.  Within php code I wrote this:  <?php $app = JFactory::getApplication(); $menu = $app->getMenu(); $item = $menu->getItem(474); ?>   and the jquery code is as you see is :  var $link = $('<a>',{     class: 'all-news-link',     href: <?php $item; ?> // **here how to assign the link which is assigned in php?** });  $('#custom-module .moduletable:nth-child(2) h3').append($link);     update  As per the provided link I used json_encode but also not solved my problem. Its even not alerting now.  <?php $app = JFactory::getApplication(); $menu = $app->getMenu(); $link1 = $menu->getItem(474); ?>  <script> $(document).ready(function(){   var $link = $('<a>',{     class: 'all-news-link',     href: <?php echo json_encode( $link1 ); ?> }); $('#custom-module .moduletable:nth-child(2) h3').append($link); alert("hi"); // it is not alerting });  </script>      when href: '' used its alerting "hi" but when I use php json_encode() its even not alerting means jquery is invalid

What is the easiest way to encode a PHP string for output to a JavaScript variable?  I have a PHP string which includes quotes and newlines.  I need the contents of this string to be put into a JavaScript variable.  Normally, I would just construct my JavaScript in a PHP file, à la:  <script>   var myvar = "<?php echo $myVarValue;?>"; </script>   However, this doesn't work when $myVarValue contains quotes or newlines.


If a creature with trample attacks me and I block with a creature on which damages are prevented, will I receive extra damage over my creature toughness?  Examples: ,

Say I have a 4/4 creature with trample. I attack, and my opponent blocks with a...   : Does my 4/4 trampler's extra 3 damage carry over even though the blocking creature wasn't dealt lethal damage? Does the situation change if my 4/4 trampler also has infect?  Can I even deal lethal damage to it? 0/1 Creature with protection from my creature's color: Can I deal damage to it at all?   When does the damage carry over to my opponent? I made all of these hypothetical creatures 0/1 for simplicity's sake. I know the creatures actually linked to are slightly different, but I believe this will simplify the answers.


It is established by different observations a 13.4 Gyr and 93 Glyr diameter Universe. However, how can be sure about the size of the Universe if there are portions of it we can not see? Is due to recollapse due to gravity?

Ok, from astronomical observations we can tell that the observable matter is separating - so rewind the clock about 13.7 billion years and it was all at a single point.  However, how do we distinguish between the following two options:     Universe is expanding   Matter distribution is increasing into infinite void   Clarification 1: (My notion of) The traditional notion is that all time/space/matter was created at the instant of the big bang.  I.e. BB was inital conditions of: $t=0$, $V=0$, $E=very big$  People say "the universe is expanding", rather than "observable matter is separating".  Why is this?  How do we know that the big bang event wasn't started by all matter condensed at a single point within a larger (otherwise empty) universe?  How do we know that BB wasn't: $t=0$, $V(universe)>0$ but $V(matter)=0$, $E=very big$?


I want to create a shortcut to Whatsapp web that will open it in Firefox as if it were a standalone application. Ideally: No tabs, address, or extentions visible. Indexed as an application when using alt-tab. Is there any way to achieve this?

I'm essentially wanting to create a desktop shortcut to open a window of Firefox without tabs, locked address bar, no menu, etc.  Similar to what some pop ups look like or what Chromium Desktop Apps look like.  What options can I use to accomplish this from the command line?


$$ z = 1 + 2i \ (complex \ number) \\ z^n = a_n + b_ni \ (a_n, b_n \in \mathbb{Z}, n \in \mathbb{N}^*) \\ We \ know \ that: \ b_{n+2} - 2b_{n+1} + 5b_n = 0 \\ a_{n+1}=a_n-2b_n \\ b_{n+1}=b_n+2a_n $$  Prove that $ z^n \notin \mathbb{R} $  What I tried:  We know that $ b_{n+2} - 2b_{n+1} + 5b_n = 0$  If $ z^n \in \mathbb{R} $ it means that $ b_n = 0 $  So,  $ b_{n+2} - 2b_{n+1} = 0 $ and I tried to get a contradiction but I can't because I get $ -3b_n = 0 $.  How can I solve this problem? Thank you!

$$ z = 1+2i \ (complex \ number) \\ z^n = a_n + b_ni \ \ \ (a_n, b_n \in \mathbb{Z}, n \in \mathbb{N}^*) $$ Prove that $ b_{n+2} - 2b_{n+1} + 5b_n = 0$  How can I solve this? Thank you!  EDIT: Or please tell me your ideas.


Prove that $|f^\prime(0)| \leq 2Re (f(0))$. I have no idea on how to proceed in this question. I cannot use Schwarz lemma since we have no information about $f$ at 0. I also do not understand how the property $Re(f(z)) >0$ relates to the question. Any help would be appreciated.

$\textbf{Problem.}$ Suppose $f$ is a holomorphic function on $\{z\in\mathbb{C}:|z|<1\}$, the open unit disk, with the property that Re$f(z)>0$ for every point $z$ in the disk. Prove that $|f'(0)|\leq 2\text{Re}f(0)$.  This is a problem that appeared on a qualifying exam in some graduate school. What I tried is, define $\displaystyle\varphi(z)=\frac{z-1}{z+1}$, then this sends the open right half plane onto the open unit disk, so let $\hat{f}=\varphi\circ f(z)$, then its image is contained in the open unit disk. And I wanted to use the Schwarz lemma, but then the origin had to be fixed, so define $\displaystyle\psi(z)=\frac{\hat{f}(0)-z}{1-\overline{\hat{f}(0)}z}$ and let $\tilde{f}=\psi\circ\hat{f}$, then the image of this is still contained in the open unit disk and it fixes the origin so the Schwarz lemma $|(\tilde{f})'(0)|\leq 1$ could be applied. But after all the calculation, I got $$|f'(0)|\leq\frac{|f(0)+\overline{f(0)}+2|f(0)|^{2}|^{2}}{2|f(0)+1|^{2}|f(0)|}$$ but, for example, if the magnitude of the imaginary part of $f(0)$ is quite bigger than the magnitude of the real part of $f(0)$, then this doesn't result the desired inequality but actually means that the desired inequality is wrong instead. I also thought about composing some different function to the RHS of $\hat{f}$ and use the Schwarz lemma but it didn't seem to work.  Maybe I should try something else, but what could be tried instead?


I have here a very long table list and the client is telling me that all the data are important and they wanted to see it. Is there any way to make this a user friendly?

We're building a web-based platform where the main dashboard shows a table of data for users to view and analyze. As we're growing this tool, we seem to be adding more and more columns and are running out of horizontal space on smaller screen resolutions (we're seeing some data wrap). It is important to the user to view all columns at once, so column hiding is somewhat out of the question, as is horizontal scrolling (per the boss's request and because horizontal scrolling sucks anyways). I was wondering if anyone knew of a clever UI for tables with many columns.  EDIT  Below is a screen capture of the layout of the table. Unfortunately for security purposes I had to blur out the column titles. This example has rows with practically no data in them, but in use they will have lots of data that will expand wider than their respective column titles. In response to some of the answers, it is imperative that the user see all the columns, as they are all necessary to analyze the data to make certain decisions. All the data is numeric aside from the first three columns. Thanks again for any feedback.    Ok so I see that uploading this image doesn't really do it justice... it takes up the full width of the screen at 1680x1050 resolution (22") and as data fills in the columns, the left column w/the text shrinks down a bit.  EDIT 2 I just wanted to say thank you to everyone's awesome ideas. I can only select one answer, but a lot of your ideas have proven very useful and may end up in the final product. Thanks again!


I recently installed DataGrip from JetBrains, I extracted in /usr/local/share and I added into my ~/.zshrc to execute from the terminal like this  DATAGRIP_HOME=/usr/local/share/DataGrip/ export PATH="$PATH:~/.local/bin:$DATAGRIP_HOME:$DATAGRIP_HOME/bin:$JAVA_HOME:$ACTIVATOR:$ACTIVATOR/bin:$SCALA:$SCALA/bin:$TMUXIFIER:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games"   Every time I execute datagrip.sh the proccess keep attached into the terminal and I get all the log of the application  which is the way to detach it?

I opened Cairo-dock in my terminal with: open cairo-dock and that worked but if I close the terminal it goes with it. How can I keep it open regardless of the terminal?


I am creating a directed graph that represents a maze. One of the mechanics in the maze is to flip the direction of nodes. I am just reading the nodes from a file and I want to change the direction of node so it is opposite. By direction I mean N,W,S etc. However, my function does not work when using the String from the scanner and returns null when doing a system out. But does work when putting in a made up string, for example String test = "E" and then test = flipDirection(test). This sets test to "W". So I know that the flipDirection function and the String compares are valid. The output for the first line is "E" and then null.   public Digraph(){      FileReader reader = null;     Scanner scan = null;       try {         reader = new FileReader("input.txt");         scan = new Scanner(reader);         scan.nextLine();          while(scan.hasNextLine()){              //read in unflipped nodes             int row = scan.nextInt();             int col = scan.nextInt();             char color = scan.next().charAt(0);             String circle = scan.next();             String direction = scan.nextLine();               //add a node to the graph             Vertex v1 = new Vertex(row, col, color, circle, direction);             addNode(v1);              //add a flipped node             System.out.println(direction);             direction = flipDirection(direction);             System.out.println(direction);             Vertex v2 = new Vertex(row, col, color, circle, direction);             addNode(v2);           }       } catch (FileNotFoundException e) {         System.out.println(e.getLocalizedMessage());     }  }   public static String flipDirection(String d){      String flip = null;       if(d.equals("N"))         flip = "S";     if(d.equals("S"))         flip = "N";     if(d.equals("E"))         flip = "W";     if(d.equals("W"))         flip = "E";     if(d.equals("NW"))         flip = "SE";     if(d.equals("SE"))         flip = "NW";     if(d.equals("NE"))         flip = "SW";     if(d.equals("SW"))         flip = "NE";     return flip; }  public class Vertex {    //name of vertex and a pointer to the first node in its adj linked list  public int row; public int col; public char color; public String direction; public String isCircle;   public Vertex(int row, int col, char color, String isCircle, String direction) {     super();     this.row = row;     this.col = col;     this.color = color;     this.isCircle = isCircle;     this.direction = direction; }  @Override public String toString() {     return "Vertex [row=" + row + ", col=" + col + ", color=" + color             + ", direction=" + direction + ", isCircle=" + isCircle + "]"; }   And this is what the input file looks like, without the extra spaces. The direction is the last part of text in each line  7 7  1 1 R N E  1 2 B N W  1 3 B N NW  1 4 R N NW  1 5 R N S

I've been using the == operator in my program to compare all my strings so far. However, I ran into a bug, changed one of them into .equals() instead, and it fixed the bug.  Is == bad? When should it and should it not be used? What's the difference?


I had posted a question about category theory some months ago, and I got answered that there are two ways to study Category Theory.  One is to treat Category Theory as a logic system independent from Set Theory, and another is to treat Category Theory in the context of ZFC.  I have no reason to study the first one. (because even though one has proved a theorem in some logic system independent from ZFC, logically it need not to be true in ZFC) Is there any advantage of the first one over the second one?  Also, I want a nice introductory Category theory text book (in the sense of the second version). Please recommend me a textbook :) Thank you in advance !

What are the best books and lecture notes on category theory?


I need help. Any Minecraft coders out here? Can you code a command for something like this? it is for, Minecraft Java 1.16.5 on Apex Hosting servers. Request: Code a summon command for a villager with the following trades: 1: 15 Emerald = 1 Mending book 2: 15 Emerald = 1 Unbreaking 3 book 3: 15 Emerald = 1 Protection 4 book 4: 15 Emerald = 1 Thorns 3 book 5: 15 Emerald = 1 Sharpness 4 book 6: 15 Emerald = 1 Efficiency 5 book 7: 10 Emerald = 1 Fortune 3 book 8: 5 Paper = 10 Emerald 9: 4 Emerald = 20 XP bottles 10: 2 Emerald = 10 books

I'm trying to set up a shop system in a vanilla minecraft realm and villagers seem like the most streamlined method of doing so, however I'd also like to make it so that other players on the server can program their own villager, or have me program it for them as an operator so that other players can trade with each other through the villager. I figure that since villagers now have a secret inventory, they can collect items, but I was wondering if there's any way to access the items traded to them or if they just disappear.  Currently my thoughts are that a player would initiate a trade, the villagers sells would be linked to individual slots in a chest and the villager buys could be linked to another chest, allowing the player to fill a chest and thus 'program' their villager, and that finally a third chest would be filled with the item the villager receives, while the chest containing the trades would decrement the specific number of the item in the relevant slot.


After several years of using my Canon Rebel T3 on and off, I've decided to upgrade my camera and start actually learning photography. My main interests are in landscapes and night/astrophotography. I've been reading lots of reviews about the brands that currently excel in these fields and see Nikon mentioned a lot. However, as I've been told, Canon lenses cannot mount onto Nikon bodies. Being a student, I don't have much money and having to buy new lenses on top of a camera body is something I wouldn't want to resort to.   Would it be better for me to jump ship to Nikon and start from there or should I continue with Canon and use the few lenses I already own?

I have only started shooting recently, as a hobby. I use Canon EOS M100. I use a EF to EF-M adapter to use EF 50mm f/1.2L USM.  The camera seems to have trouble focusing and light metering (with auto ISO overexposing the image a lot). The red AF assist light seems to be hitting the lens.  Should I switch back to an appropriate EF-M lens (15-45mm f/3.5-6.3 IS STM) or upgrade to a full frame body?  I understand that what I'm asking for is very subjective, and depends on the needs and my requirements as a photographer.  I am asking for experience with feelings of "fighting your equipment". Am I a bad photographer complaining about their equipment or a photographer hitting the limits of their equipement?  I like to shoot natural-light (so sometimes low-light) portraits, street photography. Fast focus, image stabilisation, large aperture... these seem unachievable on an EOS-M camera body.


Confusing title, right?  You can flag a question as a duplicate here.    Now, click on "it should be closed for another reason".    Why is there a duplicate duplicate button?

We've changed the flagging format from today(AFAIK) as below,        looks good.  But, when I select it should be closed for another reason...  I can see the same reason duplicate on the top.        What is the need of placing that reason over there? It should not be there. Please remove the dupe.


I am trying to retrieve the last id inserted into a particular table so I can use it in another, but keeping getting the following error message:  Update 1     Additional information: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right   syntax to use near 'select last_insert_id() FROM booking)', '0', 'MK12   5DR,162,Windsor Street,Wolver' at line 1   // Open connection and insert booking string query =     "INSERT INTO booking (operator_id, plot_id, postcode, datetime, stops, mileage, price, passengers, name, note, phone, status) VALUES ('" +     _operatorId + "', '" +     _plotId + "', '" + _postcode + "', '" + _datetime + "', '" + _stops + "', '" + _mileage + "', '" +     _price + "', '" + _passengers + "', '" + _name + "', '" + _note + "', '" + _phone + "', '" + Status +     "');"; for (int i = 0; i < _waypointList.Count; i++) {     query +=         "INSERT INTO waypoint (booking_id, sequence, address, lat, lng) VALUES (select last_insert_id() FROM booking)" +         "', '" +         i + "', '" + _waypointList[i] + "', '" + _lat + "', '" + _lng + "');"; } var dbObject = new DbConnect(); dbObject.InsertBooking(query);   Update 2  Made a few changes:  // Open connection and insert booking string query =     "INSERT INTO booking (operator_id, plot_id, postcode, datetime, stops, mileage, price, passengers, name, note, phone, status) VALUES ('" +     _operatorId + "', '" +     _plotId + "', '" + _postcode + "', '" + _datetime + "', '" + _stops + "', '" + _mileage + "', '" +     _price + "', '" + _passengers + "', '" + _name + "', '" + _note + "', '" + _phone + "', '" + Status +     "');"; for (int i = 0; i < _waypointList.Count; i++) {     query +=         "INSERT INTO waypoint (booking_id, sequence, address, lat, lng) VALUES ((select last_insert_id() FROM booking), '" + i + "', '" + _waypointList[i] + "', '" + _lat + "', '" + _lng + "');"; } var dbObject = new DbConnect(); dbObject.InsertBooking(query);   Now I'm getting the following error message:     Subquery returns more than 1 row   Any idea how I could resolve it?

What is the equivalent of SQLServer function  in mySQL?


We all know that gravity decreases as we go upward, we also know that gravity decreases as we go inside the earth? I don't know why gravity decreases as we go downward or inside the Earth? Please explain?

Would the effect of gravity on me change if I were to dig a very deep hole and stand in it? If so, how would it change? Am I more likely to be pulled downwards, or pulled towards the edges of the hole? If there would be no change, why not?


I am reading some question where i find this code, it seems to be easy but i can't understand how this function:(function() {} ()) works.    Please help me to understand that how the value of var foo=6 and bar=9 is only consider in bar=bar+foo  <!DOCTYPE html>

What is the scope of variables in javascript? Do they have the same scope inside as opposed to outside a function? Or does it even matter? Also, where are the variables stored if they are defined globally?


I want to change the format of an amount when a client writes for example 1200100.22 input change format by 1,200,100.22 $.   $('#prix').bind('change', function(){     var nStr = $(this).val();       nStr += '';     x = nStr.split('.');     x1 = x[0];     x2 = x.length > 1 ? '.' + x[1] : '';     var rgx = /(\d+)(\d{3})/;     while (rgx.test(x1)) {         x1 = x1.replace(rgx, '$1' + ',' + '$2');     }     console.log(x1 + x2);     $prix = x1 + x2;     $("prix").val($prix);   }); <!DOCTYPE html>       <meta charset="UTF-8">     <meta name="viewport" content="width=device-width, initial-scale=1.0">     <title>rules</title>
     <form id="myform">
       prix *       <input type="text" name="prix" id="prix" class="form-control"/>
     <button class="btn btn-theme">valider</button>     </form>

I would like to format a price in JavaScript. I'd like a function which takes a float as an argument and returns a string formatted like this: "$ 2,500.00"  What's the best way to do this?


I am reading this text:    When there is a linear factor that appears r times, why do we have to write the factor up to r times in the factorization? So in the example under 7, why does $x^2$ appear as $x$ and $x^2$ on the right side?   In example 4, also, how do we know that x-1 is a factor? From there, how do you know that $x^2 - 1$ is another factor? From there, why do we write the partial fraction decomposition with $x-1$ twice but to different powers? I know that it's raised to the second power and that's why the term appears twice... but why do we do this?  This sums it up, but I'm sure why we have to write the terms up to r when there are repeated factors:

I'm learning about partial fractions, and I've been told of 3 types or "forms" that they can take  (1) If the denominator of the fraction has linear factors:  $${5 \over {(x - 2)(x + 3)}} \equiv {A \over {x - 2}} + {B \over {x + 3}}$$  (2) If the denominator of the fraction has quadratic factors that don't factorise:  $${{2x + 3} \over {(x - 1)({x^2} + 4)}} \equiv {A \over {x - 1}} + {{Bx + C} \over {{x^2} + 4}}$$  (3) If the denominator has a factor that repeats:  $${{5x + 3} \over {(x - 2){{(x + 3)}^2}}} \equiv {A \over {x - 2}} + {B \over {x + 3}} + {C \over {{{(x + 3)}^2}}}$$    I'd appreciate it if someone could explain to me how these equivalence relationships are derived, essentially how do they take the forms that they do? I sort of understand the first one, but the other two I don't.  Thank you


A photon has both impulse and energy. If it is absorbed in an atom from level E1 to E2 what happen to the impulse. Does the atom acquire the impulse of the photon? If so it would get some acceleration and this is some excessive kinetic Ek?

Suppose I have an atom in its ground state $|g⟩$, and it has an excited state $|e⟩$ sitting at an energy $E_a=\hbar\omega_0$ above it. To excite the atom, one generally uses a photon of frequency $\omega$ equal (or sufficiently close to) the transition frequency $\omega_0$, and this will stimulate a transition.  One thing that is often left by the roadside,* though, is the fact that the incoming photon has momentum as well as energy, and that if the atom wants to swallow the energy it also needs to swallow the momentum. So, in the nuts and bolts of states and operators,     how does one describe the transfer of momentum during an atomic transition?   In addition to this, the fact that this recoil momentum is rarely mentioned is a good indication that it is also rarely an issue. Why is it that in most circumstances we can safely ignore the photon's momentum when describing electronic transitions?  *Apart from treatments of Doppler cooling, which simply take the momentum transfers for granted and do not explain how and why they happen.


I've migrated from Windows to Ubuntu, So searching all those back up tools and software alternatives with Windows to Linux.  For Windows, there exists RECOVA, GetDataBack Disk recovery softwares; but those are for only NTFS & FAT don't have EXT partition support.  For Ubuntu, is there any Package for recovery?

Are there any tools, methods, incantations to recover recently deleted files on Ubuntu?  If it makes any difference, I want to recover a  2.x database file. But would be better to have a method/tool that works on any kind of file.


I drafted a thesis in MS Word, using block sentence formatting. It looks very nice. Of course, for the final version, I'm going to use Latex, however when transitioning from MS Word to tex, pdftex (texlive) chose to hyphenate pretty much each word at the end of a line.. and complain alot where it couldn't.  Word manages to get along without hyphenation by adjusting the word spacing on each individual line, which imo looks better. Is there a way to achieve this in Latex?  EDIT: I'm not looking for a solution to "fix" hyphenation for words that would otherwise cause \hbox problems, I want to avoid hypenation alltogether by giving pdftex more freedom to add space between words.  EDIT2: Ok, people get a bit focused on my slight exaggeration of how often Latex/pdftex uses hyphenation. Please focus on the actual question: Can I disable hypenation by forcing latex/pdftex to adjust word spacing to fit the words, respecting hbox bounds. This way and not the way that is suggested in the "possible duplicates", which i read before posting this.

I can't find where I can remove any kind of hyphenation and just have LaTeX just do a line break.  edit: Honestly speaking I just don't like to read hyphenation anywhere and that's the only reason why I wanted to remove it. It is a matter of style, probably unexpected in LaTeX.  The document has only a summary in a different language and I used the language packages to hyphenate properly.


If events $A_1,...A_n$ are independent (in total), show that $$P\left(\bigcup\limits_{i=1}^nA_i\right)=1-\prod\limits_{i=1}^{n}\left(1-P(A_i)\right).$$  Could someone show how to prove this statement?

I was asked to prove the following:  If $\{ E_1,E_2,\ldots,E_n\}$ is a fully independent set of events, prove that:  $$ P\left(\bigcup_{i = 1}^n E_i \right) = 1 - \prod_{i = 1}^n \left[ 1 - P(E_i) \right]  $$  (Hint: use complements)  I got the following:  Let $\alpha = E_1\cup E_2 \cup \cdots \cup E_n = \{E^C_1 \cap E^C_2 \cap \cdots\cap E_n^C\}^C$. Then, $\alpha^C = \{ E^C_1 \cap E^C_2 \cap \cdots \cap E^C\} $.  Assuming that the set of complements of each ${E_i}$ is also fully independent, we have:  \begin{align} & P(\alpha^C) = \prod_{i = 1}^n P(E_i^C)  = \prod_{i = 1}^n \left[ 1 - P(E_i) \right] \\ & P(\alpha) = 1 - P(\alpha^C) = 1 - \prod_{i = 1}^n \left[ 1 - P(E_i) \right] \\ & P(\bigcup_{i = 1}^n E_i) = 1 - \prod_{i = 1}^n \left[ 1 - P(E_i) \right] \end{align}  However, even though I know (by Googling it) that my assumption is true, I'm unable to prove it so I could validly use it as a lemma. Is there another way to prove this equality?


I'm fairly new to using both blender and unity but my end goal is to have my blender asset in unity just as it appears in blender. So essentially, I have two basic cube mesh's that are scaled to the size I need and both connected together. The bottom cube mesh had a simple black and white material added to it. In the nodes, I displaced it a little to add texture and I also added a color burn to make it gold colored. The top cube had a basic marble material added and a slight displacement along the sides again to add texture. The problem is when I place the object in unity, the textures created from the slight displacement on both objects and the gold coloring from the color burn do not show up. The basic materials are transferring over just fine as does the basic cube mesh. Like I said though, I am new to this so I'm not sure what other information might be helpful but let me know and I will provide whatever info is needed. Thanks in advance for any help.

I used node textures in a mesh I exported to .FBX.  I then imported it into Unreal Engine 4 and it didn't import any textures; I clicked the Upload Textures option in Unreal Engine.  Is there something I'm doing wrong or is it Blender?


I want to install a Canon 2900 printer driver in Ubuntu 16.04.  Please show screen shots of the full procedure.

How do I install the driver for Canon LBP 2900 printer in Ubuntu 14.04?  I have tried installing drivers from the official CANON support and checked other answers on Ask Ubuntu but so far no results.


What is the principle circulating sugar in the blood and is the major energy source of the body?

What are the grammatical rules determining whether to use which or what?  I usually go by intuition. It's "What car are you looking at?" and "What bicycle do you like most?" but "Which song did you sing?" Quite often, I don't know whether to use what or which.  How can I tell?


I currently have what I believe is a lambda function with C# (fairly new to coding & haven't used a lambda function before so go easy), which adds duplicate strings (From FilteredList) in a list and counts the number of occurrences and stores that value in count. I only want the most used word from the list which I've managed to do by the "groups.OrderBy()... etc) line, however I'm pretty sure that I've made this very complicated for myself and very inefficient. As well as by adding the dictionary and the key value pairs.                 var groups =         from s in FilteredList         group s by s into g         // orderby g descending         select new         {             Stuff = g.Key,             Count = g.Count()          };  groups = groups.OrderBy(g => g.Count).Reverse().Take(1);  var dictionary = groups.ToDictionary(g => g.Stuff, g => g.Count);  foreach (KeyValuePair<string, int> kvp in dictionary)             {                    Console.WriteLine("Key = {0}, Value = {1}", kvp.Key, kvp.Value);                              }               Would someone please either help me through this and explain a little bit of this too me or at least point me in the direction of some learning materials which may help me better understand this. For extra info: The FilteredList comes from a large piece of external text, read into a List of strings (split by delimiters), minus a list of string stop words. Also, if this is not a lambda function or I've got any of the info in here incorrect, please kindly correct me so I can fix the question to be more relevant & help me find an answer. Thanks in advance.

I have a list of items   John ID Matt ID John ID Scott ID Matt ID John ID Lucas ID   I want to shove them back into a list like so which also means I want to sort by the highest number of duplicates.   John ID 3 Matt ID 2 Scott ID 1 Lucas ID 1   Let me know how I can do this with LINQ and C#.  Thanks All  EDIT 2 Showing Code:      List<game> inventory = new List<game>();     drinkingforDataContext db = new drinkingforDataContext();     foreach (string item in tbTitle.Text.Split(' '))     {          List<game> getItems = (from dfg in db.drinkingfor_Games                                where dfg.game_Name.Contains(tbTitle.Text)                                select new game                                {                                    gameName = dfg.game_Name,                                    gameID = Boomers.Utilities.Guids.Encoder.EncodeURLs(dfg.uid)                                }).ToList<game>();          for (int i = 0; i < getItems.Count(); i++)         {             inventory.Add(getItems[i]);         }     }      var items = (from xx in inventory                  group xx by xx into g                  let count = g.Count()                  orderby count descending                  select new                     {                         Count = count,                         gameName = g.Key.gameName,                         gameID = g.Key.gameID                     });      lvRelatedGames.DataSource = items;     lvRelatedGames.DataBind();   This query displays these results:   1 hello world times 1 hello world times 1 Hello World. 1 hello world times 1 hello world times 1 hello world times 1 Hello World. 1 hello world times   It gives me the count and name, but it doesn't give me the ID of the game....  It should display:   6 hello world times   234234 2 Hello World.  23432432


I've just changed the Graphics card on my Mac Pro 3,1. I've installed a Nvidia Quadro FX 4800. Everything is fine, the only thing is the when I boot the Mac the classic grey screen with the Apple logo and a progress bar has disappeared. When pressing the button the screen is black and then it goes directly to the password screen. How can I do to make the silver screen return?

I've got a PC video card that I'd like to get boot screen support for on my Mac Pro. In particular, it is a Gigabyte R9 270X. The card is supported on the Mac once it boots, but I would like to get boot screen back since my old 8800GT has been baked in the oven a few too many times by now :-)  I've seen numerous guides on the internet about flashing the BIOS on the video cards and also ones that speak about adding the EFI BIOS, but in the haphazard forum approach, it isn't clear how this all works. To some degree, I've recently come away with the notion that you don't get rid of the existing BIOS, but rather add an EFI partition to it that the Mac would recognize. If that assumption is correct, then it would lead me to believe that adding an EFI BIOS that works on a similar card (R9 280X or 7950 which are both close but not quite) should work since I'm assuming that the existing BIOS would be similar enough to hook in. Failing that, I'm not clear how you would get a card-specific EFI BIOS for boot screen support.  Anyone an expert on this? I'm just really having a hard time trying to sift through all this and hoping to get a more direct answer!


I'm currently playing a DnD 3.5 campaign and the only sources we are currently using are: the PHB, the Dungeon Master Handbook, the Monster manual.  Now there seem to be a lot of other books out there, some belonging to DnD 3.5, some not. I'm a bit confused as towards how it all works. I understand of course that we can just choose what books to use. But which books are considered part of DnD 3.5? And is there a difference to DnD 3.5e? (i.e. what does the e stand for?)

I'm new to d20. I recently acquired a bunch of D&D books and I'm sure they are all either 3.0 or 3.5, but it doesn't say in the book which version it is. How can I tell which version the book is?  For instance, I have "Complete Warrior - A Player's Guide to Combat for All Classes". It's hard back, published in '03. Is it 3.0 or 3.5?  Another example, I have "Sword and Fist - A Guidebook to Fighters and Monks". Perfect Bound, published in '01. Is it 3.0 or 3.5?


If I were to say that I was a former student of a particular person (for this purpose let's pretend his/her name is Eve), would I add an apostrophe s to the name because I would be referring to them as being one of their students? In other words, would I say:         "I'm a former student of Eve."   "I'm a former student of Eve's."

As  shows, we nearly always use the possessive form of personal pronouns for friend of mine/his/ours/etc.  But when it comes to actual names, we prefer  without the possessive apostrophe. That preference is even more marked with, say, . Not that I think the usage itself is particularly American - it's much the same with .  Personally, I find friend of him grates. In general I've no strong feelings either way as to whether it's friend of Peter or friend of Peter's (though I deplore the possessive in ), but in line with many others, I really don't like the possessive in relation to things like countries.  Why is this?   Edit: Noting an apparent "progression" (pronoun -> person -> nation) marked by reduction in use of the possessive, I checked at a finer "granularity". NGram shows that although it does occur,  virtually "flatlines" against friend of mine. But the bias reduces through of you, of us, and by the time I get to  it's much less extreme. There seems to be something "egocentric" about the double possessive.  Presumably when babies learn to speak, they soon notice that possessive pronouns, possessive apostrophes, and the word "of", all do the same job. Parents would correct a child who says "of mine's", but probably wouldn't even notice the same "redundancy" in "of Peter's". Younger speakers are unlikely to even be talking about something "of America's". Perhaps as we mature we tend to discard the "double possessive" for the more "distant" things that only adults are likely talk about, but we keep it for "closer" people because that's how we spoke when we were younger.  EDIT2 I note that I'm a great fan of him is vanishingly rare compared to ...fan of his, but with ...fan (of John) the double possessive occurs far less often than ...friend (of John's). Usage seems to be affected by the noun before "of" as well as the one after it. This is getting complicated...


I have installed Windows 10 and now I want to install Wubi... Is it possible?

I'm absolutely new to Linux. I would like to know how to install Ubuntu alongside the pre-installed Windows 8+ OS.  Should I do it with Wubi, or through the Live USB/DVD?  What steps do I need to take to correctly install Ubuntu?


I really like the new "Following" feature! In addition, it would be helpful to see a list of those questions being followed for easy reference, should I come across answers when studying.  On the Activity page, there is a line that includes:  Summary  Answers  Questions  Tags  Badges  Favorites  Following   Would it be possible for "Following" to be added to this line showing posts followed? I realize, now, that I could have clicked "Favorite" also when choosing to "Follow", but it's too late for the several already selected.

We are happy to announce that the  follow question and answer feature is now live across the Network, including Stack Overflow, all Stack Exchange sites, and all Meta sites. (International Stack Overflow sites will have it turned on in a day or two once we have translations all set.) You can follow any question or answer (that you did not author) by clicking on the [follow] button that is shown in the menu immediately below the post (alongside the [share] button):    After you have followed a post, you will get inbox notifications for all new answers (in the case where you followed a question), comments, edits, and notices. You will not receive notifications for any action that you performed. As was mentioned in the earlier post, we are not making changes at this point to the notifications received by a post owner, or due to @mentions. The initial release had been planned to only include question following. Thanks to many folks who chipped in over the past few weeks, we are happy to release both question and answer following at the same time. These are available in both the regular and mobile views. We are still planning on two more related releases:  Follows profile tab and question listing filter: A tab for follows will be added to your user profile activity page. Each user will be able to view this tab that will provide a listing of followed questions and answers, with standard sorts, and the ability to unfollow from the listing. Users (with the exception of moderators and authorized staff) will not be able to see this information about other users (nor will it be made public in the API, SEDE, or data dumps). We will be renaming the Favorites feature to Bookmarks. As we mentioned in the preview post, the feature will be the same as Favorites, with the name and icon updated to more accurately represent user expectations and usage. And you will be able to both "bookmark" and "follow" a question.  We hope that this new feature will allow you to have better access to the content that you care about and want to keep tabs on. Update (June 11, 2020): The user profile tab and the rename of Favorites to Bookmarks have been released.


I was using  when my USB flash drive suddenly wasn’t being recognised and IntelliJ became unresponsive. I tried safely removing it but it wasn’t showing up there, so I force closed IntelliJ, plugged it out and plugged it back in and now the entire drive is read-only. Doesn’t appear to be corrupted. I can still access all my files. I just can't run any programs or write to any files without moving them off the drive.  I’ve tried changing the following value to 0 in regedit.exe. But I still get the error “The disk is write protected”.  Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\StorageDevicePolicies\WriteProtect   I’ve tried using diskpart to remove its Read-Only attribute, to which it responds “Disk attributes cleared successfully”, despite not recognising that it was read-only in the first place. But then when I try to clean the flash drive using it, it says:     DiskPart has encounted an error: The request could not be performed   because of an I/O device error.   I’ve tried deleting its contents using diskmgmt.msc but when I right click it, its “Delete Volume” option is greyed out.  Is there anything I can do?  It’s a GOODRAM USB 3.0 64GB flash drive and I’m on Windows 8. Any other specs can be provided if needed.

When I plug in my USB flash drive, it shows up on my computer as write-protected or read-only. I am unable to transfer data to it, nor can I modify or delete any files already stored on it. I also cannot repartition or reformat the drive using Windows Disk Management, DiskPart, GParted, or other tools. The drive does not have a write-protect switch.  Why did this happen and what can I do about it? Is there a way to remove the write protection?  (Note that this can happen with some memory cards, too, as they often use controllers similar to those used in flash drives. In some cases, the system may report that the drive or card was formatted successfully even though it was never actually formatted; the original data reappears when the device is reinserted.)     This question comes up often and the answers are usually the same. This post is meant to provide a definitive, canonical answer for this problem. Feel free to edit the answer to add additional details.


In the theory of big-bang  elements were  formed in a particular order. Firstly hydrogen and in last iron formed. But at third no. Lithium was formed which should be present in enormous amount in universe. So where did it go?

One of the major impediments to the widespread adoption of electric cars is a shortage of lithium for the batteries.  I read an article a while back that says that there is simply not enough lithium available on the entire planet to make enough batteries to replace every gasoline-powered car with one electric car.  And that confuses the heck out of me.  The Big Bang theory says that in the beginning, there was a whole bunch of hydrogen, and then lots of hydrogen started to clump together and form stars, and those stars produced lots of helium through fusion, and then after helium, all the rest of the elements.  That's why hydrogen is the most common element in the universe by far, and helium is the second most common.  Well, lithium is #3 on the periodic table.  By extrapolation, there ought to be several times more lithium around than, say, iron or aluminum, which there is definitely enough of for us to build plenty of cars with.  So why do we have a scarcity of lithium?


In my thesis I have a list of abbreviations between the list of tables and the first chapter. I want to continue the page numbering from the other prefix parts (roman) and then switch to arabic with the first page of the introduction.   I use fancyhdr and redefined the plain settings, which works great for everything except for my list of abbreviations.   The page right before is the list of tables with page number iii and the first page of the abbreviations has a iv. However, the second page of the list of abbreviations suddenly starts with a 1, followed by a 2 on the next page.   How do I get roman numbers for all pages of the abbreviations? The list is done using longtable. I tested using tabbing too and had the same problem.   My document class is \documentclass[a4paper,11pt,oneside, numbers=noenddot]{scrbook}  Here are my fancyhdr settings:  \usepackage{fancyhdr} \pagestyle{fancy} \renewcommand{\chaptermark}[1]{%     \markboth{\MakeUppercase{\thechapter \quad \ #1}}{}}  \fancypagestyle{plain}{%     \fancyhf{} % clear all header and footer fields     \fancyhead[LE,RO]{\thepage} %pagenumber on chapter pages,     }  \fancyhf{} \fancyhead[LO]{\leftmark} \fancyhead[LE,RO]{\thepage}   The prefix part of the main document looks like this:  \renewcommand{\contentsname}{Table of contents} \tableofcontents \pagenumbering{roman} %start page numbering i, ii, iii, ... \renewcommand{\listfigurename}{List of Figures} \cleardoublepage \addcontentsline{toc}{chapter}{\listfigurename} %list of figures in table of content  \listoffigures  \renewcommand{\listtablename}{List of Tables}  \cleardoublepage   \addcontentsline{toc}{chapter}{\listtablename} %list of tables in table of content  \listoftables   \cleardoublepage \addcontentsline{toc}{chapter}{List of Abbreviations}  \input{pre/listA.tex}   and the input pre/listA.tex looks like this:  \chapter*{List of Abbreviations}  \markboth{LIST OF ABBREVIATIONS}{List of Abbreviations} \pagenumbering{roman} \setcounter{page}{4}  \section*{Symbols and units}   \begin{longtable}{lll}      $a_s$ & Angstrom constant - clear-sky days [-]  \\     $b_s$ & Angstrom constant - completely overcast days [-] \\ \end{longtable}  \section*{Abbreviations}  \begin{tabular}{ll}      ASCE & American Society of Civil Engineers \\     \end{tabular}  \renewcommand{\chaptermark}[1]{%     \markboth{\MakeUppercase{\thechapter \quad \ #1}}{}}

In my Master thesis, I would like to have the title page without any page number and an acknowledgments section and the table of contents with roman numbers. The rest of the document should be numbered arabic.  I have tried this, to have roman numbers for the Table of contents and normal numbers for the rest.  \documentclass[12pt,ngerman,openany]{report} \usepackage{titlesec} \usepackage{titletoc} \usepackage{cite} \usepackage[a4paper]{geometry} %\usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage[ngerman]{babel} %\usepackage{ngerman}{babel} \usepackage[T1]{fontenc} \usepackage{graphicx} \usepackage{float} \selectlanguage{ngerman} \usepackage{amssymb} \usepackage{amsmath} \usepackage{url} \usepackage{epstopdf} \usepackage{scrhack} \usepackage{listings} \usepackage{caption} \titleformat{\chapter}{\rmfamily\huge}{\textbf\thechapter.}{25pt}{\huge\textbf} \defcaptionname{ngerman}{\lstlistingname}{Code} \defcaptionname{ngerman}{\lstlistlistingname }{Codeverzeichnis}  \lstloadlanguages{R}  \lstset{% general command to set parameter(s)    basicstyle=\sffamily\footnotesize, % print whole listing small    keywordstyle=\sffamily\footnotesize\bfseries, % ubold black keywords    identifierstyle=, % nothing happens    commentstyle=\sffamily\footnotesize\slshape, % green comments    stringstyle=\sffamily\footnotesize, % typewriter type for strings    showstringspaces=false, % no special string spaces    numbers=left,    numberstyle=\sffamily\footnotesize,    stepnumber=1,    numbersep=10pt,    showspaces=false,    showtabs=false,    frame=lines,    morecomment=[l]{\%},    float=htbp,    numberbychapter=true  }   \begin{document} \let\cleardoublepage\clearpage   \pagenumbering{roman}  \tableofcontents  \clearpage  \vspace*{75mm} \chapter{Einleitung} \section{Motivation} bla bla bla \section{Ziel}  bla bla \chapter{Stand der Technik zur Mustererkennung} \section{Die Zeitreihen} bla bla \subsection{Beschreibung} bla bla \subsection{Erklärung}  bla bla  \subsection{Vorhersage} bla bla \subsection{Kontrolle} bla bla \section{Feature Extraktion} bla bla \subsection{Autokorrelation} \subsection{Was ist Autokorrelation?} bla bla   \subsection{Autokorrelation und Zeitreihen} bla bla  \subsubsection{Zeitreihe-Diagramm}  bla bla \subsubsection{Lagged Streudiagramm} bla bla  \subsubsection{Autocorrelation-Function (Korrelogramm)} bla bla \subsection{Spektralanalyse} \subsection{Was ist Spektral-Analyse} bla bla \end{document}


I have a file which is comma separated. I have to find specific text and then delete complete line.  e.g.  123,aaa,bbb,888,8881 124,bbb,ccc,999,8881 125,ccc,ddd,888,8883   I have to delete the line containing 888.

Suppose there are two files in web/ named foo.php and bar.php. The 1st line of foo.php is "sdajgeSTRINGdsad" and the 10th line of bar.php is "gdfhu98324STRING". The task is to first locate these two files, then delete 1st line of foo.php and 10th line of bar.php given that the specified string is "STRING".


Imagine if you will, a strand of fiber optic cable 186,000 miles long. A pulse of light is sent through the stationary cable: it takes 1 second for light to travel the entire length of the cable.  Now again, imagine this same fiber optic cable travelling at 98,000 miles per second and a pulse of light is sent through the cable.  In this instance both the cable and the pulse of light are travelling in the same direction.  How long does it take the light to travel the length of the cable?  Would it take the light 2 seconds to travel the 1 light second of distance through the cable?  Carl Sagan, "Thou shalt not add thy speed to the speed of light"  Yet again, picture this same fiber optic cable is travelling at 98,000 miles per second..  but this time the pulse of light is sent in the opposite direction that the cable is moving.  Does the light take only half a second to travel the 1 light second of distance?  if the cable is moving at 99.9% the speed of light and a pulse of light is sent perpendicular to the course of the cable...  is the information lost because the light cannot move in the direction the cable is moving AND its path within the fiber optic cable?

Let's say I fire a bus through space at (almost) the speed of light in vacuum. If I'm inside the bus (sitting on the back seat) and I run up the aisle of the bus toward the front, does that mean I'm traveling faster than the speed of light? (Relative to Earth that I just took off from.)


I have a US stock brokerage account, and I am a non-resident alien. From my understanding, dividend income of non-resident aliens is taxed at a flat 30% rate (assuming no applicable tax treaties). I am currently resident in a jurisdiction with no applicable tax treaties with the US.  In June 2020, I bought 10 shares of VTIP (Vanguard Short-Term Inflation-Protected Securities ETF). In October 2020, I was paid a dividend of $2.80 of which 30% ($0.84) was withheld. In December 2020, I was paid a dividend of $3.33 of which 30% ($1.00) was withheld.  Surprisingly, I got a $0.84 and $1.00 refund in February 2021. I checked the Form 1042-S provided by the stock brokerage firm, and noticed that I was somehow exempted from all tax. Can someone explain what happened? Why was my tax rate 0%? UPDATE: I now understand the situation after reading all these pages:    Bogleheads forum:   Bogleheads wiki:  Relevant section: Interest distributions paid as dividends  Bogleheads wiki:  Relevant section: Special exemption for interest distributions paid as dividends

Are the rules different for qualified versus non-qualified dividends? Assuming no DTAA exists between the US and the country of residence.


I want to establish causality between two variables/attributes of some time series data.   Is there any method to prove and establish the causality mathematically?

In his 1984 paper , Paul Holland raised one of the most fundamental questions in statistics:     What can a statistical model say about   causation?   This led to his motto:     NO CAUSATION WITHOUT MANIPULATION   which emphasized the importance of restrictions around experiments that consider causation.  Andrew Gelman makes :     "To find out what happens when you change something, it is necessary to change it."...There are things you learn from perturbing a system that you'll never find out from any amount of passive observation.   His ideas are summarized in .  What considerations should be made when making a causal inference from a statistical model?


Imagine a photon hits a hydrogen ion and is absorbed, how do the nucleon of the hydrogen knows and start to accelerate? Any difference between this and hydrogen ion in a electric field?

Suppose I have an atom in its ground state $|g⟩$, and it has an excited state $|e⟩$ sitting at an energy $E_a=\hbar\omega_0$ above it. To excite the atom, one generally uses a photon of frequency $\omega$ equal (or sufficiently close to) the transition frequency $\omega_0$, and this will stimulate a transition.  One thing that is often left by the roadside,* though, is the fact that the incoming photon has momentum as well as energy, and that if the atom wants to swallow the energy it also needs to swallow the momentum. So, in the nuts and bolts of states and operators,     how does one describe the transfer of momentum during an atomic transition?   In addition to this, the fact that this recoil momentum is rarely mentioned is a good indication that it is also rarely an issue. Why is it that in most circumstances we can safely ignore the photon's momentum when describing electronic transitions?  *Apart from treatments of Doppler cooling, which simply take the momentum transfers for granted and do not explain how and why they happen.


My organization has a site feed web part on the home page of our intranet site where user's can post what's going on throughout the company. The current SharePoint default for the site feed is to display 20 items. I have not been able to find a way to modify this default setting. Any Ideas?   This is for the "SITE FEED / Microblogging" web part

Newsfeed (within a site, as a microfeed) works really nicely on Sharepoint, except for the fact that I can't limit the Newsfeed webpart to a certain height (or number of posts). It looks like it is stuck at 10 and there's no way to change this from the interface/webpart editor. In some instances, the webpart can be so tall and not very wieldly.  So, granted there's no way to tweak it from the Sharepoint UI, is there a way to do it using another tool/via programming method, so we can set the initial post number to, say, 5 posts only?  Many thanks!


I have a linux computer accessible from the internet and I have registered a free dynamic DNS service, let's say its address on the internet is xx.yy.com.  On this computer I have two processes listening: tomcat on port 80 and a small program written by myself on 8080.  As expected I can reach these two respectively with the URLs "xx.yy.com" and "xx.yy.com:8080". I would like to set up a third-level domain to bind to the 8080 port, so that when I type (e.g.) "aa.xx.yy.com" on a browser it has the same effects of "xx.yy.com:8080".  I have no clue on how to do that, can it be done via tomcat configuration (I would rather it be a system configuration than having to rely on tomcat)?  Do I have to set up some daemon to do it for me (I have read about bind)?  Can it be done so that the port 8080 is hidden? I have realized that my work network blocks outgoing connections on ports that are not 80 or 443. So I figured out that a good solution to that may be to move tomcat on another port and put something on 80 to internally redirect  traffic to the correct socket. Can it be done? How? Any guide around?  Thank you

My apologies if this has been asked before. I haven't found an adequate solution so... yeah.  When a specific domain, "example.com" is accessed, I want it to act normally. In other words, it should go to port 80 as expected and interact with Apache.  When a different sub-domain, "mc.example.com" is accessed, I don't want it to access the Apache web server. I want it to go interact with a different program, listening on, say, port 4096. Thus, going to "mc.example.com" would have the same/similar function as "example.com:4096". The service is Minecraft  When a third sub-domain, "vpn.example.com" is accessed, I want it to go interact with a different service, listening on, say, port 687. The service is openVPN  Is there a simple way to do this? If so, what is it? Does it involve configuring a VirtualBox in Apache (a method I tried and failed miserably. xD)? Or can it be done using ipTables? If it means anything, I am running 32-bit Centos 5.5(I believe. Its a recent version of Centos)


This is how I think Linux signals work:  Each process have a default signal handler for each signal, some signals's default signal handler terminates the process, while other signals's default signal handler simply ignores the signal, etc.  The following table shows all the actions that a default signal handler can take (this table is from this ):     Term   Default action is to terminate the process.      Ign    Default action is to ignore the signal.      Core   Default action is to terminate the process and dump core (see          core(5)).      Stop   Default action is to stop the process.      Cont   Default action is to continue the process if it is currently          stopped.   You can override the default signal handler with your own signal handler by using  (which I think is deprecated) or .  Am I correct so far?  Now my question is: Are there some signals that you cannot override their default signal handler?

In general, to kill processes we generate signals like SIGKILL,SIGTSTP etc.  But how is it known who ordered that particular signal, who has sent it to a particular process, and in general how do signals perform their operations? How do signals internally work?


Prove that $a<b+\epsilon$ for all $\epsilon>0$ implies $a\le b$   Can anybody help me with this question? I am new to this topic.

I am reading Tom Apostol's Analysis and come across this theorem.   Should $a \leq b$ if $a\leq b+\epsilon$ for all $\epsilon >0$?   I don't doubt the proof in the book but I don't understand the intuition or geometric explanation behind this. Could somebody shed some light on this equation? I just started studying analysis on my own.$\ \ $