for (int outer = 0, index = 0; outer < keySize && blockIndex < keySize; outer++, blockIndex++) { //added a -1                 int i;                 for (i = 0; i < blockSize && index < shifted.size(); i++, index++) {                     //System.out.println("adding: " + shifted.get(index));                     //System.out.println("to: " + i);                      aBlock.set(i, shifted.get(index));                     //blocks.set(outer, aBlock);                                      }                 System.out.println("ablock" + aBlock + " index " + outer);                 blocks.set(outer, aBlock);  so I have a forloop that fills up a regular arrayList called aBlock, once the arrayList is filled i try to set it into a specific index in an arrayList of arrayList. I have already filled the blocks arrayList with other arrayLists that only have the elements 0. So I don't think the issue is that its an empty arrayList. Also printing out aBlock seems to print out the right arrayList but when I use .set inside of the forloop to set all of the arrayLists into the blocks variable it seems to set the last arrayList and copy it into every index. so every element inside of blocks is identical copies of the last aBlock element when it shouldnt be. how do i fix this issue? aBlock.set seems to work fine because I printed the aBlock element after it was filled each time and it contains the right values

I always thought Java uses pass-by-reference. However, I've seen a couple of blog posts (for example, ) that claim that it isn't (the blog post says that Java uses pass-by-value). I don't think I understand the distinction they're making. What is the explanation?


Apparently,   $$ \sum_{n = 0}^\infty \frac{n}{2^n} $$  converges to 2. I'm trying to figure out why. I've tried viewing it as a geometric series, but it's not quite a geometric series since the numerator increases by 1 every term.

How can I evaluate $$\sum_{n=1}^\infty\frac{2n}{3^{n+1}}$$? I know the answer thanks to , but I'm more concerned with how I can derive that answer. It cites tests to prove that it is convergent, but my class has never learned these before. So I feel that there must be a simpler method.  In general, how can I evaluate $$\sum_{n=0}^\infty (n+1)x^n?$$


Is there such a thing as a duplicate video finder that will look for duplicates based on video/audio comparisons of files rather than just the file size?

I have a directory full of media. I would like to search similar videos and hand-remove certain copies (those that are too short, too long, have watermarks, don't have watermarks, &c.).  How can I find videos that are somewhat similar to each other?


I've been setting up my scene and tried to render to check how the noise looks on the sunbed. Render looks like a total disaster - resolution on moon surface is way worse than it should be (displace is set to 7 on render and 5 on viewport), my glowing guy and the sunbed just vanished. Have no idea what's going on, all objects are checked to appear on render. pics:   rendered in cycles EDIT: I checked every possible cause in the answer and it didn't change the result. My question is about not rendering certain objects and rendering lower resolution moon surface than in viewport even though it's set to higher.

This is meant to solve this problem once and for all. What is every reason an object isn't showing up in a render or viewport in when using the cycles render engine?


I have this problem using the command ‘last’. My task is to find names of people, that have been logged in at night hours (22:00 - 5:00). So I’ve tried to save the first number (22) to a variable and wanted to compare, but it doesn’t work at all.  This is how it looks like.   @ a =  `last | cut -c 55-56 `   And I’ve also tried this:  @ a =  `last | tr -s “ “ “ “ | cut -d “ “ -f7 | cut -d “:” -f1 `   But none of this worked it always says “Ambiguous” and I really don’t know what I’m doing wrong. I’m new in this and I would be very thankful if somebody helped me. Thank you.

I want to assign the result of an expression (i.e., the output from a command) to a variable and then manipulate it – for example, concatenate it with a string, then echo it.  Here's what I've got: #!/bin/bash cd ~/Desktop; thefile= ls -t -U | grep -m 1 "Screen Shot"; echo "Most recent screenshot is: "$thefile;  But that outputs: Screen Shot 2011-07-03 at 1.55.43 PM.png Most recent screenshot is:   So, it looks like that isn't getting assigned to $thefile, and is being printed as it's executed. What am I missing?


I would like to build an application (in Java preferably) running on the iOS of Apple's iPhone. The thing is, that I don't have an Apple computer. I mainly use Linux, and Windows when I have to.  Is it possible to build applications for iPhone using the Linux platform? What type of software is best to learn the ropes of? Suggestions?

I've heard that you need to get a Mac if you want to develop iPhone apps. Is this true?   Is it possible to develop iPhone apps using Linux? If yes, what do I need and where do I download the necessary tools?


So I currently have an inconvenient partition config on my win7/ubuntu system. what i wanna do is to have the extended sdb3 moved ajar like in the  to later add a swap and home partition (latter is on another drive).  Despite the easy sounding explanation here  gparted only allows me to put a copy (sdb4) of sdb5 to the desired location. i already tried desperately to make that copy boot-able (UUID in grub) for hours with no progress so far so i am open for any input.

I have a hard disk, which was partitioned before (probably in Windows) like this:   Partition 0 - primary, 20Gb  Partition 1 - extended, 200Gb   I have unallocated space after Partition #1, so I wanted to increase the size of the Partition #0. At first I wanted to move the Partition #1 to the right, so I started Ubuntu from CD and called GParted. All the logical partitions inside the extended partition aren't mounted. I've assigned the Partition #0 as swap (temporarily) because it looks like the Ubuntu needs the swap even when started from CD.  The GParted can resize the extended partition (Partition #1) but it can't move it. The left arrow in the slider is not movable.  What might be a problem?  Also, the Partition #1 has a single flag on - it's "lba" flag. What's it for? Maybe it's the reason the GParted can't move it?


Question: Evaluate the integral $$\int_0^\infty \frac{1-\cos(ax)}{x^2}dx$$ where $a \in R$.  My attempt: So, I actually have a worked out solution for this, but I'm confused on a few points and I'm hoping to get some help. The solution considers the function  $$f(z) = \frac{1-e^{i|a|z}}{z^2},$$  and evaluates it around the contour $\Gamma = C_R \cup [-R,-\epsilon] \cup C_\epsilon \cup [\epsilon,R]$, for $R$ large, $\epsilon$ small, $C_R$ the semicircle in the upper half plane of radius $R$, and $C_\epsilon$ the semicircle in the upper half plane of radius $\epsilon$ but with negative orientation.  The next step they do is show that $|f(z)|$ on $C_R$ goes to $0$ as $R \to \infty$. I think that I understand this part, but I'm not 100% sure, so I'd just like to check:  $$\left|\frac{1-e^{i|a|z}}{z^2}\right| \le \frac{|1-e^{i|a|R\cos\theta} - e^{i|a|R\sin\theta}|}{R^2}\le \frac{2+|e^{-|a|R\sin\theta}}{R^2},$$  and the RHS of the above goes to $0$ as $R \to \infty$. So, first question: 1) is my above reasoning correct? In the solution, they have a $1 + |e^{-|a|R\sin\theta}$ as the numerator in the last term, but I'm not sure how to get that stronger bound, so I'm unsure if my weaker one is correct.  Ok, so after this they write:   $$\int_0^\infty \frac{1-\cos(ax)}{x^2}dx = \frac{1}{2}\Re\left(\pi i \cdot \text{res}_{0}f(z)\right)$$ $=\frac{\pi |a|}{2}.$$  This is the step that is driving me a little insane. I guess I must be missing something. So, I have a few questions here:  2) First of all, what I think they are saying is that  $$\int_\Gamma f(z)dz = \int_{C_R}f(z)dz + 2\int_{\epsilon}^{R}f(z)dz + \int_{C_\epsilon}f(z)dz,$$  and then taking limits as $\epsilon \to 0$, and $R \to \infty$. But what happens to the integral over $C_\epsilon$???   3) I guess maybe they are saying that as $\epsilon \to 0$, the integral over $C_\epsilon$ approaches the residue at $0$. But I don't understand why that's valid - why are we allowed to use the residue theorem on this integral? It's not even a contour, it doesn't have an interior, and I guess I'm just very confused here.  Thanks!

As usual, I have a ridiculously specific question about a tiny detail of a tiny calculation. There is a tremendous amount of context, so fair warning. I don't need a solution to this whole problem. I need a solution to one specific part, and it is a minor detail. I'll show what I've got so far, and point out my concern at the end.  Our problem is to use residue calculus to compute: $$\int\limits_{-\infty}^{\infty}\frac{\cos(2x)-1}{x^2}dx.$$  We note that this is equal to the real part of the easier-to-work-with integral: $$\int\limits_{-\infty}^{\infty}\frac{e^{2ix}-1}{x^2}dx,$$ and we use a "hippo's back" contour, formed by the positively-oriented half-circle $|z|\leq R$ in the upper half-plane and the line along the real axis from $-R$ to $R$, interrupted from $-\varepsilon$ to $\varepsilon$ by the negatively oriented half-circle in the upper half-plane of radius $\varepsilon$, so as to 'jump' over the simple pole at $z=0$.  Since this contour contains no poles or singularities, etc., the integral of our integrand around it is zero by Cauchy's Theorem. It is also a simple matter to show that the large half-circle's contribution is zero in the limit $R\to\infty$. So now we are left with the fact that in the limit $\varepsilon\to 0$, we obtain:  $$\int\limits_{-\infty}^{\infty}\frac{e^{2ix}-1}{x^2}dx=\lim\limits_{\varepsilon\to 0}\int\limits_{C_\varepsilon}\frac{e^{2iz}-1}{z^2}dz,$$  where $C_\varepsilon$ is the little negatively-oriented half-circle mentioned above.  Now, I know the trick in which the value of the right-hand side happens to give exactly $\pi i \text{Res}(f,0)$ (that is, half of what the full circle would give), and can use it to show that the result is $-2\pi$.  Okay, thanks for reading this far. Here is my actual question: Without resorting to tricks like the half-residue thing, how can we get this result from the right-hand side? That is, how do we prove rigorously that:  $$\lim\limits_{\varepsilon\to 0}\int\limits_{C_\varepsilon}\frac{e^{2iz}-1}{z^2}dz=-2\pi$$  I have been using the parametrization $z=\varepsilon e^{-it}$ with $t\in[0,\pi]$, where the negative in the exponential deals with the negative orientation, which almost always works in these situations, but not here, since the $\varepsilon$ does not entirely cancel from the denominator then as it usually does in these types of problems.  I have confirmed the result with Wolfram-Alpha using the original problem statement, and also noted a few other things, like that the original integrand can be expressed as $\frac{\sin^2(x)}{x^2}$, but gotten nowhere with that.  In a pinch, I'll use the 'half-residue' trick, but being able to do this simply from basic principles would be nice.


I know this  which implementation is about verb and \texttt such that you have something inside the phrase.  I do not want to change the phrase at all.  I want to have this as text in my document  \documentclass{article} \usepackage[T1]{fontenc} \begin{document} hp_feb04_macro.pdf \end{document}   Unsuccessful attempts for hp_feb04_macro.pdf  \verb|hp_feb04_macro.pdf|   which changes the uncerscore something something else (-, I think). And  \texttt{hp\_feb04\_macro.pdf}   which I do not like since my desktop search is then deteriorated.   How can you have underscore in your text without \verb and \texttt?

How can I produce the text Word_one_two in LaTeX?  I tried:  Samp\_Dist\_Corr   But, it doesn't quite look right. Also, I want it in the typewriter font, so actually, I'm doing:  \texttt{Samp\_Dist\_Corr}   I find it looks a bit like the underscore is merging in to the bottom of the "D", but maybe it's just because of the typewriter D?


I have just upgraded to High Sierra from Sierra, and immediately I noticed that screenshots would take a good 10-15 seconds before appearing on the desktop. How can I fix this?

Capturing screenshots on the Mac has gotten very slow recently.  It used to be nearly instantaneous but now it is taking more than 10 seconds for the image to appear on the desktop.  I seem to recall having this problem years ago. The workaround was to delete a large accumulation of log files that the os had built up. After I deleted these log files, the screen capture worked very fast again.  Problem is that I cannot remember where these log files are. Searched for quite some time and could not find the information.


When i scale down a logo in an illustrator files ( i expanded all the effects and appearances) i get some weird artefacts, the curves get distorted. Is their any way around this ? Because exporting the logo and importing it as PNG seems a bit dumb for print.

I am working in Illustrator (15.0.2 (CS5) or 16.0.0 (CS6)) and when I try to move objects small distances, they snap to the nearest two pixels on some invisible grid. I can't find anything in the preferences. Here are some screen shots:


I have looked at all the previously posted answers. None have answered my questions. This is my example:  I have a main document called paper.tex:  \documentclass[11pt,twoside,a4paper]{article} \usepackage{hyperref} \usepackage{xr-hyper}   \begin{document}  \title{Title}  \begin{abstract} Abstract   \end{abstract}  \maketitle  \section{Test} \label{sec:test} \input{sec/test}  \end{document}   In test.tex, I have two other documents:  \subsection{Test One} \label{sec:test1} \input{sec/test1}  \subsection{Test Two} \label{sec:test2} \input{sec/test2}   The test.tex contains a figure:  \begin{figure*}[tp!] \label{fig:fig1} \centering \caption{My Figure} \end{figure*}    I want to reference the figure from test2.tex:  \externaldocument{test1}  As show in \autoref{fig:fig1}.   Unfortunately, the output is not referencincing the figure as Figure 1, but as: subsection 1.1  Can you please correct my example?

\documentclass{article} \usepackage{algorithm}  \begin{document} \setcounter{section}{54} \section{A section with no label} \begin{algorithm} \label{myalg} \caption{An algorithm with the label `myalg'.} \end{algorithm} Reference to myalg: \ref{myalg}. \end{document}   With this code, the reference givens 55 (the section number); if I move the label after the caption command, I get the correct reference (1).  Why should this be the case? I find it confusing: when thinking about an algorithm as an environment, you expect to be able to label it right after you began it. At the very least I would expect some kind of error or "??" to appear, rather than the previous environment or reference-able entity being used.


I'm a citizen of Bangladesh holding Bangladeshi Passport. I have a residence permit for both Finland and Sweden. I'll be traveling to Stockholm by Turkish Airlines which has a layover in Istanbul Airport. Do I need to take a visa to go outside of the airport for a short city tour?

I am travelling from Toronto to Kuwait via Istanbul on Jan 10, 2018. I hold Indian passport. I have 5 hours' layover at Istanbul for my connecting flight. Both my flights are Turkish Airlines. I want to go out of airport and do shopping before connecting to next flight. Do I need transit visa or e-visa?


I was looking for a PPA of Gnome 3.32 for Ubuntu 18.04.2 . But I couldn't find one . Currently Ubuntu 19.04 has Gnome 3.32 . Then Will Ubuntu 18.04.3 include Gnome 3.32 ?

I know there are already reports on gnome-shell being a massive memory hog, but my question is this: Will gnome 3.30.1 ever hit Ubuntu 18.04, or am I stuck with this memory leakage forever until I upgrade Ubuntu?  Thanks  Edit: I'm asking about this particular instance. Will Ubuntu be updated to gnome 3.30.1 at some point in the future, or will I need to do it manually or upgrade Ubuntu?


If $X$ is a topological space, then a functional $\varphi:X\to\mathbb{R}$ is lower-semicontinuous (l.s.c) if $\varphi^{-1}(a,\infty)$ is open in $X$ for any $a\in\mathbb{R}$. If $X$ is a Hilbert space, then $\varphi$ is weakly l.s.c if it is l.s.c on $X$ with its weak topology.   My question: If $X$ is a Hilbert space and $\varphi:X\to\mathbb{R}$, then $\varphi(x)\leq \liminf{x_n}$ whenever $x_n$ converges weakly to $x$ $\Rightarrow$ $\varphi$ weakly l.s.c?  I read this in "A invitation to Variational Methods in Differential Equations". It isn't a exercise, maybe a definition.

Let $X$ be a real Banach space, let $f:X\rightarrow \overline{\mathbb{R}}$ be a functional. We have known that:   If $f$ is weakly lower semicontinuous then $f$ is weakly sequentially lower semicontinuous; If $f$ is weakly sequentially lower semicontinuous then $f$ is lower semicontinuous.   a) I would like to construct two counterexamples to show that the reverse is not true.      (It is interesting to find counterexamples in Hilbert space.)  b) When do these concepts coincide?  Thank you for all help and comments.


I would like to control the speed of a small 3 volt dc motor with a potentiometer. What specification for the potentiometer would I need for this?

My question is at the end (to change the speed) we are controlling the input voltage of a DC motor in both PWM (pulse width modulation) and variable resistance cases. Is the only reason for choosing PWM to obtain a better precision or not consuming extra power? If it is the only reason it seems odd to use PWM equipment for simple demonstrations.


As we have seen in the final episode of Westworld season one, hosts are attacking guests with firearms. But we know that all the firearms used in Westworld are provided by Delos Corp., and that firearms can't kill or injure humans. So how is it possible?   We have seen a similar thing in the .

In the first episode of the show Westworld, Ed Harris (a "guest" / human) is being shot at by James Marsden (a "host" / robot). It is as though Ed Harris has a force field around him; the bullets all miss or are blocked.  In the third episode of the series, guest Jimmi Simpson is shot by a host in town. The "bullet" knocks Jimmi Simpson down, and leaves a mark on his chest.  Is this an inconsistency in the scripts, or has the Westworld park changed the way guns work, or do guests get to determine how they'll be affected by being shot by hosts?


I am a newbie to Ubuntu.   Is it possible to install and run Ubuntu in pen drive or external hard disk without disturbing Windows XP on my laptop?  I don't mind dual boot for  running Ubuntu or Windows XP whenever required, but don't want to install Ubuntu in the internal hard disk in which XP is installed.

If you are hurrying to reply, System → Administration → StartUp Disk Creator -- no, that's not what I'm talking about.   I want to try Ubuntu 11.04's Unity without touching my existing Ubuntu install.  To do this, I need to install the nVidia drivers first (sigh).  To do this, I need changes to persist a reboot.  To do this, I need to really install Ubuntu on a USB key.  How do you do that?    What I tried   I tried to make a USB key from , then boot from it, then choose "Install Ubuntu." The installer refused to install to the installation media itself. I tried, from my installed copy of Ubuntu:  sudo kvm /dev/sdb --cdrom .cache/testdrive/iso/ubuntu_natty-desktop-i386.iso   ...but the installer didn't detect the disk properly.


I don’t understand why you can go through with an empty bottle (no matter the size) but you can’t go through with a large bottle that has less than 100ml of liquid in it.  All these regulations are supposedly there for safety reasons but it doesn’t seem like really.

If I understand the TSA's  in the US correctly, you are allowed to take two 3-ounce containers of a liquid on a plane, but not a single 6-ounce container of the same liquid. Is this really how the policy works? If so, what was the rationale for regulating carry-ons like this?


Back before chrome became the default browser for Android, there used to be a stock Android browser called "Browser" (anyone who used a stock version of Android before 4.2 knows what I'm talking about)  Anyhow, It had a feature that allows you to save a Web page for later reading but that browser no longer exists and that feature doesn’t seem to exist in chrome.   Does this mean that now I have to install a third party app (such a Pocket) to save articles for later reading??

There are situations I require to save a "complete" web page for offline reading. I can easily do that on Windows by saving the web page, but not on Android.  I am using Chrome on Android and I don't see a "save" option. Instead, I see "Save link" which, I believe, saves "only" the "pure HTML" version of a site of which the link leads to.  I have tried this but, when I view it in the HTML Viewer a lot of necessary CSS formatting and all the images were lost, which made the information misleading and incomplete respectively. (PS I thought I downloaded the complete page and the fault was that of the HTML Viewer for not rendering every thing, but I was wrong, as the desktop Chrome also displayed the "only HTML" version when I transferred those pages to my laptop through Bluetooth).  So, my question is: How can I download "a complete" web page on my Android smart-phone. It's OK if I can't view it on my smart-phone, but every thing should be in place when I view it on my laptop after transferring it. It is also OK if it is saved as a PDF file.  (PS I'm asking this as I use internet very often in my smartphone because my laptop is not connected to the internet. Also I want to transfer it to my laptop because I don't want to view those "important" pages on a small screen, it's inconvenient).


I heard this sentence in a series.  I would be a fan of your work if you could get us two seats on the next flight.  What is the conditional type of this sentence?

1)So as promised by me , I would be doing it for you. 2)So as promised by me , I will be doing it for you. A person said first sentence to me , when I did the work he asked. What happens if he used will instead of would ? What is the difference in meaning between these two sentences?


I answered this question with a link to the vendor documentation that I believed addressed the issue.    My answer was deleted because...     Link-only answers can become invalid if the linked page changes.   That make sense to me. So I edited my answer to replicate the pertinent information from link I provide while still referencing the link.  How do I get my answer undeleted? I voted to undelete it, but I get a message that says "A moderator has deleted this post and it cannot be undeleted".  I understand wanting to not allow answers that could become stale (dead links). Should I post a new answer with the information from the link?  Thanks

What circumstances can cause a question or answer to be deleted, and what does that actually mean?    How can a post be deleted? When can't I delete my own post? Can I still see my post even after it's deleted? Can I see a list of my deleted posts? How can I undelete one of my posts? What does deletion mean for a post? How do votes to delete work? What are the criteria for deletion? What else should I know about deleted posts? If I flag my question with a request to delete it, what will happen?       For more information, see the articles about  and  in the .


Can somebody help? I have been soaring every day trying to find Uxie, along with the Pathless Plain, Trackless Forest, Fabled Cave, and I also might want to know the chances of finding Crescent Island.

There are a lot of legendaries available in ORAS, however a lot of them will only show up/be available if certain prerequisites are met.  I know Groudon/Kyogre are available through the Story, and      Rayquaza & Deoxys   through the postgame Delta episode, but what about the other available legendaries? What do I need to do to catch them?


To be more specific, let’s say a privately-held company XYZ decides to raise funds by going public. They go for an IPO, and a portion of the equity now becomes public. Let’s say the initial Share price is $10. Thanks to the IPO, the company XYZ has access to much more capital to fund its business operations. And the company works tirelessly to 1) make the company an attractive investment to new investors, and 2) to make shareholders happy by paying attractive dividends. I understand this.   Now, 20 years after the IPO if the company trades for $200 per share, does the company XYZ have access to the increased share price through any means? If so, how?

After a company has issued shares, why should it care if the value of the shares fluctuate? Since the shares are now publicly traded, if the value fluctuates, that is strictly a transaction between buyer and seller, none of whom are directly related to the company. E.g. if I sell X an iPhone for $100, why should I care if X is selling the iPhone to Y for 1 dollar or 1000 dollars? I have got my $100, so I need not bother. No?


Closed--you can come back to where you started by going all the way in one direction. Very small--the expansion of the universe, if inevitable, will not be able to prohibit this kind of round-about travel  Is that even possible?  if yes, what will the twin paradox look like?  if no, why not?

Take the following gedankenexperiment in which two astronauts meet each other again and again in a perfectly symmetrical setting - a hyperspherical (3-manifold) universe in which the 3 dimensions are curved into the 4. dimension so that they can travel without acceleration in straight opposite directions and yet meet each other time after time.  On the one hand this situation is perfectly symmetrical - even in terms of homotopy and winding number. On the other hand the Lorentz invariance should break down according to , so that one frame is preferred - but which one?  So the question is: Who will be older? And why?  And even if there is one prefered inertial frame - the frame of the other astronaut should be identical with respect to all relevant parameters so that both get older at the same rate. Which again seems to be a violation of SRT in which the other twin seems to be getting older faster/slower...  How should one find out what the preferred frame is when everything is symmetrical - even in terms of GRT?  And if we are back to a situation with a preferred frame: what is the difference to the classical Galilean transform? Don't we get all the problems back that seemed to be solved by RT - e.g. the speed limit of light, because if there was a preferred frame you should be allowed to classically add velocities and therefore also get speeds bigger than c ?!? (I know  is only a local theory but I don't understand why the global preferred frame should not 'override' the local one).  Could anyone please enlighten me (please in a not too technical way because otherwise I wouldn't understand!)  EDIT Because there are still things that are unclear to me I posted a follow-up question:


I have this series:   $${1\over 1\cdot3}+{1\over 3\cdot5}+{1\over 5\cdot7}+. . .$$  I am supposed to choose a test that will prove that this series converges. I think that it looks like a telescoping series, but I have no idea how to find the general term for it. I haven't been able to find much help online. I can see that this series probably converges to zero, but that's not an appropriate answer to this problem.   How do I find the general term?  Edit: The other question does not address how this was found:  $${1\over (2n-1)(2n+1)}$$  I don't know how to find that on my own, and that is what I'm looking for.

Trying to prove that above stated question for $n \geq 1$. A hint given is that you should use $\frac{1}{(2k-1)(2k+1)}=\frac{1}{2}(\frac{1}{2k-1}-\frac{1}{2k+1})$. Using this, I think I reduced it to $\frac{1}{2}(\frac{1}{n^2}-(\frac{1}{3}+\frac{1}{5}+\frac{1}{7}+\cdots+\frac{1}{2n+1}))$. Just not sure if it's correct, and what to do with the second half.


I'm working on a customized calculator, which is working pretty well except that I can't figure out how to get the generated numbers to display commas within the number. For example, it might spit out "450000" when I need it to say "450,000".  gives a number of suggestions on how to create a new function to deal with the problem, but I'm rather new to JavaScript and I don't really know how to make such a function interact with what I have now. I'd really appreciate any help as to how to get generated numbers with commas! :)  HTML:

         Percentage:	         <input id="sempPer" type="text">

         Price:	         <input id="unitPrice" type="text">

         <input id="button" type="submit" value="Calculate">

     Market Share	     Partner A	     Partner B

     1%

      </form>   JavaScript:

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 new to SharePoint 2013. I have developed an app using vs 2012. When I try to deploy the app, then I am getting the below error.  Error : Sorry, apps are turned off. If you know who runs the server, tell them to enable apps.   I have google it and find the below link:  http://technet.microsoft.com/en-in/library/fp161236.aspx   In this link, they are saying that Click Start, point to Administrative Tools, and then click DNS.  But I have not find DNS or DNS Manager.  Can any one help me.

I am getting this message when I want to add a app:     Sorry, apps are turned off. If you know who runs the server, tell them   to enable apps.


What is the difference in the meanings of the following sentences:      If you asked me, I would say no.     If you were to ask me, I would say no.    I know that these sentences express imagination of the speaker. But they look similar to me. I don't know which one is correct to use depending on the different context. Which sentence expresses more possibility of your asking ?  I think that 'were to'  could also express the meaning 'by chance' or happen to' for example: 1."If you were to ask me (If you happened to ask me or by chance) I would say no." Am I correct here ?  My question is about difference between these two sentences and which one is correct to use depending on different context.  I'm expecting an helpfull answer. Thank you very much in advance.

If they were to cancel the deal, I would be devastated. If they canceled the deal, I would be devastated.  My thextbook says, the "if ... were to" construction gives much less probability for something to happen. But an American said to me that it is not, he does not perceive it when he hears it.


I have several small corrections to apply to a paper which is currently under review. The errors are - as far as I can say - not very significant. There is a citation which it would be good to include, but maybe is not crucial (I only recently discovered a paper which deals with a somewhat related problem), plus a number of typos that I recently discovered.  What is the correct way to proceed? Should I update the paper and send the corrected version to the publisher, or would it be better to wait for the referee reports and apply these corrections together with the ones the referees request? Or have I lost my chance to correct the paper when I sent it for publication, and have to accept that I can't apply the corrections I want?   There is a  where the accepted suggestion is to send in the corrections; however that is a significantly more serious correction than in my case. My field is mathematics, if this matters.  Edit: This question is very similar to  with the slight difference that there they consider an error in a paper and worry about a possible rejection, and here I'm mostly concerned about modifying a paper in a way that (in my opinion) makes it better but not necessarily more correct.

I have submitted a research article and later realized that it has a slight error.  The paper is now under review. I have proposed a few theorems; one theorem contains a slight error that can easily be removed. The methodology is correct. Would this cause the rejection of my paper?


For a very specific example, say you have a software developer who makes some changes to a product, then does no testing of the changes and then releases the product only to find that the customer finds the product no longer works.  The person is too hasty and not diligent enough to follow a careful process.

I would like to use the sentence     He was 'over-eager' to implement his plan, leading to failure.   I am looking for a single word which expresses over-eagerness in a negative sense.  TIA


I want to get the "Burning Skies" dragon mod for skyrim, but it says you have to backup your saves first. It requires a lot of other things, but of course, it only has information about it on the Windows 7 and Vista. I have it on my windows 8 and it runs fine. I already have one mod but it's minor and doesn't really affect the gameplay. If anyone wants to see this mod, it's on the Skyrim Nexus (sorry, I don't know how to post links).

I can't find those that I need to delete. What's the location of those files?  How can we manage them?


i will mostly be using ubuntu for afking multiple games, so my question is, should I get 14.04 or 15.10?

What are the differences between an Ubuntu Long Term Support release (LTS) and a normal release?


I have a questions about Mathematical Logics.  (1) if x is not free in A, formula ∀x(A->B)->A->∀xB is valid.  (2) ∀x(A->B)->A->∀xB is not valid.  I don't know why these two questions have different answer when they have condition "if x is not free in A" can anybody prove or explain these questions? I really need your help.

I have no idea whether this question is way too specific or whether something similar has already been asked (we still need to work out a way to search for formulas I guess).  Anyways here I go: I want to show that some choice of (logical/quantifier) axioms for a Hilbert derivation system (first order logic, one sort) can prove all the axioms of some other choice.  I have the following at my disposal:  Axioms:   (fot): first order tautologies (i.e. inserting formulas for the propositions in a propositional tautology) (aax): $\forall x A[x] \to A[t]$ (where $t$ is any term and we assume no conflicts with free variables getting bound, $[...]$ denotes replacement)   Inference rules:   (mp): modus ponens (aru): $\frac{A\to B}{A\to\forall x B}$ where $x$ is not free in $A$.   I want to show that this system proves the formula:  $\forall x (A\to B) \to(A \to \forall x B)$ for $x$ not free in $A$ (which I will assume in the following).  This is of course very similar to (aru), but I want this formula, which is of course a stronger statement. I am quite lost here.  Here are my failed attempts: With (aax) and (aru), I easily get the provable rule $\frac{\forall x(A\to B)}{A\to\forall x B}$ which is the formulation of my goal formula as a rule (weaker).  I even get   $$\frac{\bar\forall(A\to B)}{A\to\forall x B}$$ where $\bar\forall$ denotes the universal closure of the following formula.  Using the Deduction Theorem (which I proved for this theory) I get that my system proves $$\bar\forall(A\to B)\to(A\to\forall x B).$$ but that is not exactly what I am looking for.


I am writing an article and when i generate the bibliography i can't see it in the article.  The result when I cite an author is : "?".   I don't know how i could fix it, anyone could help me?  Thank you! Cheers!  The preamble is:  \documentclass[preprint,12pt,authoryear]{elsarticle} \usepackage{multirow}  \usepackage{graphicx} \usepackage{siunitx} \sisetup{detect-weight, detect-display-math} \sisetup{detect-inline-weight=math} \sisetup{mode=text,per-mode=symbol} \usepackage{multirow} \usepackage{makecell} \usepackage{booktabs} \usepackage{graphicx} \usepackage{pgfplots} \usepackage{pdflscape} \pgfplotsset{compat=newest} \usetikzlibrary{plotmarks} \usetikzlibrary{arrows.meta} \usepgfplotslibrary{patchplots} \newlength\fwidth \setlength{\fwidth}{0.8\textwidth} \usepackage{tikzscale} \pgfplotsset{plot coordinates/math parser=false} \usepackage{overpic} \usepackage{tikz} \usepackage{pgfplots} \pgfplotsset{compat=1.15} \usepackage{float} \usepackage{natbib} \usepackage[margin=2.5cm]{geometry} \usepackage{bicaption} \usepackage{makecell} \renewcommand\theadfont{\bfseries} \renewcommand\theadgape{} \usepackage[skip=1ex, labelfont=bf]{caption} \usepackage[skip=0.333\baselineskip]{caption} \usepackage{amssymb} \bibliographystyle{model3-num-names}   blablabla  \section*{References} \bibliography{bilbiography}

I've browsed the forums and found a number of posts that have addressed this issue, but none of the solutions seem to work for me. I have the following script that I just copied from the bibtex home page to get familiar with it. Instead of the citation number I get a question mark. I compile using Latex+Bibtex+Latex+Latex+PDFLatex+ViewPDF just as has been previously suggested and the problem persists.   \documentclass[11pt]{article} \usepackage{cite}  \begin{document}  \title{My Article} \author{Nobody Jr.} \date{Today} \maketitle  Blablabla said Nobody ~\cite{Nobody06}.  \bibliography{mybib} \bibliographystyle{plain} \end{document}   My bibliography (Bib.bbl)  @misc{ Nobody06, author = "Nobody Jr", title = "My Article", year = "2006" }    Looking at previous posts one thing that is concerning is that my .bbl looks empty as shown below. Further, I don't have a .blg  \begin{thebibliography}{}  \end{thebibliography}


let $X_1,X_2,\ldots,X_n$ be random sample of bernoulli distribution with parameter of $\displaystyle\frac{\theta_1}{\theta_1+\theta_2}$ and let $Y_1,Y_2,\ldots,Y_n$ be random sample of geometric distribution with parameter $\theta_1+\theta_2$. If the two samples are independent of each other, how can I calculate the limiting distribution $\displaystyle\frac{\sum_{i=1}^n X_i}{\sum_{i=1}^n Y_i}$.

Let $X_1,X_2,\ldots,X_n$ be a random sample of Bernoulli distribution with parameter $\frac{\theta_1}{\theta_1+\theta_2}$ and $Y_1,Y_2,\ldots,Y_n$ be a random sample of geometric distribution with parameter $\theta_1+\theta_2$. If the two samples are independent of each other, how can I calculate the limiting distribution of $\dfrac{\sum_{i=1}^n X_i}{\sum_{i=1}^n Y_i}$ ?


I'm getting linker errors when trying to compile my code  1>main.obj : error LNK2019: unresolved external symbol "public: __cdecl Grid<class Grid<class PointData *> *>::Grid<class Grid<class PointData *> *>(struct glm::tvec3<float,0>,int,float)" (??0?$Grid@PEAV?$Grid@PEAVPointData@@@@@@QEAA@U?$tvec3@M$0A@@glm@@HM@Z) referenced in function "void __cdecl `dynamic initializer for 'grid''(void)" (??__Egrid@@YAXXZ) 1>main.obj : error LNK2019: unresolved external symbol "public: __cdecl Grid<class Grid<class PointData *> *>::~Grid<class Grid<class PointData *> *>(void)" (??1?$Grid@PEAV?$Grid@PEAVPointData@@@@@@QEAA@XZ) referenced in function "void __cdecl `dynamic atexit destructor for 'grid''(void)" (??__Fgrid@@YAXXZ)   This is the line causing it in main.cpp  Grid<Grid<PointData*>*> grid(glm::vec3(0, 0, 0), 1000, 10000);   Even though I have implemented a template class with the specialization for pointers, I still get the error  template<class T> class Grid {...}  template<class T> class Grid<T*> {...}    template<class T> Grid<T>::Grid(glm::vec3 origin, int resolution, float size) {     grid = new T*[size*size*size];     this.origin = origin;     this.size = size;     this.gresolution = resolution;     this.cell_size = size / resolution; }  template<class T> Grid<T*>::Grid(glm::vec3 origin, int resolution, float size) {     grid = new T*[size*size*size];     this.origin = origin;     this.size = size;     this.gresolution = resolution;     this.cell_size = size / resolution; }   What am I doing wrong here? Thanks in advance!

Quote from :     The only portable way of using templates at the moment is to implement them in header files by using inline functions.   Why is this?  (Clarification: header files are not the only portable solution. But they are the most convenient portable solution.)


#include<iostream> using namespace std;  class base { private:     int id = 6; public:     friend void display(); };  void display() {     base b;     cout<<"Display id" <<b.id<<endl;     cout<<"Display id", b.id; }  int main() {     display();   }   Output:   Display id6 Display id   Can someone explain that why cout<<"Display id", b.id;  is not throwing error? and if comma (,) is acceptable then what will be the behavior of variables written after comma (,).  Thanks in advance.

How does the comma operator work in C++?  For instance, if I do:  a = b, c;     Does a end up equaling b or c?   (Yes, I know this is easy to test - just documenting on here for someone to find the answer quickly.)  Update:  This question has exposed a nuance when using the comma operator.  Just to document this:  a = b, c;    // a is set to the value of b!  a = (b, c);  // a is set to the value of c!   This question was actually inspired by a typo in code.  What was intended to be  a = b; c = d;   Turned into  a = b,    //  <-  Note comma typo! c = d;


Let's say I have a statement like this:  I just saw you come online, and I wanted to see how your day was going.   Now, am I right to use the . at the end of that sentence? I've written it like this in the past because I thought the . was wrong:  I just saw you come online, and I wanted to see how your day was going; how's it going?   Is the latter more appropriate? I mean at least it asks the question.

I'm wondering how it is correct to structure sentence and what punctuation should be used. In particular, is the next sentence correct:     I was wondering if there's any progress on the issue.    Or should I put a question mark in the end of it. Also, can it be restructured to:     I was wondering: is there any progress on the issue?


What is the origin of the letter d in dmesg?  :     dmesg (display message or driver message)   No reference are given for this assertion - it could just as well be "debug message".  What is the etymology of dmesg?

Is there any explanation/history behind the name of the command dmesg (which prints out some kernel messages)?


I need to rename all folders and files to lowercase, I looked on this forum and found the following command find . -name * -type f -exec rename 'y/A-Z/a-z/' '{}' \;  I tried this, and while the command runs fine with no error message, some files are still uppercase.  I also found this online find ./ -depth -exec rename 's/(.)/([/])/$1/\L$2/' {} \;  Oddly enough, this worked for one of my folders but not the other one. I'm a linux noob, does anyone know what is going on? I appreciate your time.

Path:  / DIRECTORY_ROOT        /SUB_DIRECTORY   And convert that to:  / directory_root        /sub_directory   I tried: rename 'y/A-Z/a-z/' * but it only changes the root directory and not sub directories. I'm new to Ubuntu, thanks for the help!


I'm learning C and I'm wondering about the difference between writing type* variable and type *variable.

Why do most C programmers name variables like this:  int *myVariable;   rather than like this:  int* myVariable;   Both are valid. It seems to me that the asterisk is a part of the type, not a part of the variable name. Can anyone explain this logic?


It seems that basic nosiness is a natural part of the human condition. If it weren’t, why would people watch the endless string of reality shows on TV? Peering into the lives of others seems to satisfy a deep yearning, if not just idle curiosity. It’s perhaps for this reason that so many of us enjoy chatting with strangers when we’re thrust together by circumstance. Whether on line in the supermarket, waiting in a waiting room, or sitting next to a fellow passenger, it seems almost endemic for someone to initiate a conversation. New research shows, if not where that curiosity comes from, at least how you can best satisfy it.   What does “if not where that curiosity comes from,at least how you can best satisfy it”mean?

Let there be given this sentence (which came from an ):     The contest has become personalised, if not bitter.   Then what does the phrase if not mean?   Seeking after is a general guide or rule of such usage.


Prove that if $k \in \mathbb {N}$ and $a>1$, then $\lim\limits_{n\to\infty} \frac{n^k}{a^n}=0$  I have this, I want to know if what I did is correct.  Let be  $a^n>1>0$, then:  $1>\frac{1}{a^n}$  Then:  $|\frac{1}{a^n}|<1$  Aplying archimedean property,for $ε>0$ exists $n \in \mathbb {N}$ such that:  $nε>n^{k+1}$  Then:  $ε>\frac{n^{k+1}}{n}=n^k$   Let be $ε>0$, exists $N=max(1,ε)$ that if $n>N$  $|\frac{n^k}{a^n}-0|=|\frac{n^k}{a^n}|$  $=\frac{n^k}{a^n}$  $<ε (1)= ε$  Therefore the sequences converges to zero.  Thank, you.

In other words, how to prove:  For all real constants $a$ and $b$ such that $a > 1$, $$\lim_{n\to\infty}\frac{n^b}{a^n} = 0$$  I know the definition of limit but I feel that it's not enough to prove this theorem.


Is the following sentence in the passive voice?      She was supposed to phone Jack last night.   If yes, What is the active voice version of it?

If I say     I'm supposed to go.   Is supposed to here an adjective in a passive construction?


Simple question: i want to load two modules  /usr/sbin/modprobe ip_nat_ftp  /usr/sbin/modprobe ip_conntrack_ftp   I can put those lines in rc.local or use /etc/sysconfig/iptables-config But at reboot firewalld overwrite my choices and doesn't load modules Question : how to instructe firewalld to load those two modules?

I'm stumped. I've seen the  about editing /etc/sysconfig/iptables-config, but I'm running CentOS 7 (and webmin/virtualmin), which uses firewalld instead of iptables.  How do I get modprobe nf_conntrack_ftp to persist after a reboot? I tried setting up a cron on reboot to issue the command, but that didn't work (and is probably the wrong way to go about it anyway).  Right now after every reboot I have to login and type in the command manually in order to get FTP connections to work correctly.  Thanks.


I have done the follow:   chown'd it to a group chmod 775 usermod   this is the status of the permission drwxrwxr-x  3 root www-data 4096 Mar 22 23:11 html  The groups my user is in ubuntu : ubuntu adm dialout cdrom floppy sudo audio dip www-data video plugdev netdev lxd  But if I do touch test it just gives me a permission denied. Am I missing something.  As for a little background, I'm running a Ubuntu server on AWS. I'm also trying to give my apache user writing permission in the html folder.

I changed permissions of a file (chmod g+w testfile) and running ls -l testfile gives:  -rwxrwxr-x 1 user1 user1 0 2011-01-24 20:36 testfile   I then added a user to that group ("/etc/group" has user1:x:1000:user2 line), but am failing to edit that file as user2. Why is this so?


I was trying to set up my Mac to run custom Python scripts from anywhere without having to type python [script.py] or the explicit file path.   The script is called "testscript". I put the script in my own bin directory (separate from /usr/local/bin), called /User/Patrick/bin, and added it to my path so when I type echo $PATH it comes up correctly like so:   /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/User/patrick/bin:/usr/local/go/bin`.    I already added the line #!/usr/bin/env python to the top of the file, I already did chmod 700 testscript, but I still can't call testscript from anywhere. Have things changed since OSX Yosemite?

I have this directory /foo/bar/. Inside, I have a python file named myfile.py. I made it executable by adding (at the top):  #!/usr/bin/env python   Then, I made it executable by issuing   chmod +x myfile.py   I edited my path by issuing  sudo nano /etc/paths   I added /foo/bar/ to it.  The problem is that although I can run myfile.py by typing ./myfile.py while I am inside /foo/bar/, it doesn't work from any other location. What am I doing wrong?  Thank you.


I want to increase the size of a particular text. Suppose I want to write the following:   "I am a hungry cat I want to drink the rains I am not thirsty"   I want the middle line to be written in big and I want the 1st and 3rd line to write very small. How can I do that?

The standard font packages make global changes to the fonts in my document. What if I want to use a particular font for just a portion of my text?   How do I find the right name of the font? How do I select the font? How do I restrict the scope of the font change?     There are separate answers for different flavors of TeX (quick links):


(This is a short version of the question intended to post, because the original is just TOO LONG)  From  and various others (including 2 links deleted by the system as part of the clean up process, unfortunately...) we learnt how to manipulate partial derivatives rigorously.  We have learnt in undergraduate on how to write chain rules of multivariable functions using chain rule diagrams such as this one (variables that are kept constant are shown explicitly because the function is written in full)    $$\frac{\partial f(A(B,C),D(B,C)) )}{\partial B}=\frac{\partial f(A(B,C),D(B,C))}{\partial A(B,C)}\frac{\partial A(B,C)}{\partial B}+\frac{\partial f(A(B,C),D(B,C))}{\partial D(B,C)}\frac{\partial D(B,C)}{\partial B}$$  Or using another notation according to the link  $$\left.\frac{\partial f}{\partial B}\right|_C=\left.\frac{\partial f}{\partial A}\right|_D\left.\frac{\partial A}{\partial B}\right|_C+\left.\frac{\partial f}{\partial D}\right|_A\left.\frac{\partial D}{\partial B}\right|_C$$  Things looks fine. However when you have a function that look something like this     Attempt to write a chain rule gives a bizarre result for at least one of the variables  $$\left.\frac{\partial f}{\partial A}\right|_D$$ $$\color{red}{\left.\frac{\partial f}{\partial D}\right|_{A?}}=\left.\frac{\partial f}{\partial A}\right|_{D?}\frac{dA}{dD}+\color{red}{\left.\frac{\partial f}{\partial D}\right|_{A?}} \hspace{12 mm} [*]$$  If we consider the red terms identical, then we get $$0=\left.\frac{\partial f}{\partial A}\right|_{D?}\frac{dA}{dD}$$     Why the bizarre result? How to interpret or explain it (both geometrically and mathematically?)

Suppose $f=f(x,y(x))$.  Then applying the chain rule we get $\frac{\partial f}{\partial x}=\frac{\partial f}{\partial x}\frac{\partial x}{\partial x}+\frac{\partial f}{\partial y}\frac{\partial y}{\partial x}=\frac{\partial f}{\partial x}+\frac{\partial f}{\partial y}\frac{\partial y}{\partial x}$.  From this it seems that it always holds that $\frac{\partial f}{\partial y}\frac{\partial y}{\partial x}=0$.  Where's the mistake?


How do you write a shell script that sends an email memo to all employees when a particular process is launched?


I'm reading Dirac's book about QM. I reached the point (in my edition on page 37) where he tells it is possible, given the eigenkets of an observable, express any other ket in function of them (as he said before, for the definition of observable, its eigenkets form a complete set). So he writes this:  Let us examine mathematically the condition for a real dynamical variable $\xi$ to be an observable. Its eigenvalues may consist of a (finite or infinite) discrete set of numbers or, alternatively, they may consist of all numbers in a certain range, such as all numbers lying between $a$ and $b$. In the former case, the condition that any state is dependent on eigenstates of $\xi$ is that any ket can be expressed as a sum of eigenkets of $\xi$. In the latter case the condition needs modification, since one may have an integral instead of a sum, i.e. a ket $| P \rangle$ may be expressible as an integral of eigenkets of $\xi$, $$ | P \rangle = \int | \xi' \rangle d\xi' $$  I would expand this infinite sum as follows (considering the general case where there are multiple eigenkets associated with a specific eigenvalue): $$ | P \rangle = \int | \xi' \rangle d\xi' = \xi' |\xi'_1 \rangle + \xi' |\xi'_2 \rangle + \cdots + \xi' |\xi'_n \rangle  + \xi'' |\xi''_1 \rangle + \xi'' |\xi''_2 \rangle + \cdots + \xi'' |\xi''_m \rangle + \cdots +  \xi^{(j)} |\xi^{(j)}_1 \rangle + \xi^{(j)} |\xi^{(j)}_2 \rangle + \cdots + \xi^{(j)} |\xi^{(j)}_i \rangle$$ Using $n, m, j, i$ as arbitrary values. So I understand that if the eigenkets, due to hypothesis, form a base, it is possible to express any ket using a linear combination of them, but in a linear combination there must appear some coefficients, which inside this integral don't appear. And, also, how is it possible to integrate an eigenket with respect of its eigenvalue? They aren't strictly connected, are they? More, he gives then this other expression: $$ | P \rangle = \int | \xi'_c \rangle d\xi' + \sum_r | \xi^r_d \rangle $$ I interpret this based on the problems I had with the previous one?

Page 37 of Dirac's book The Principles of Quantum Mechanics, states  The condition for the eigenstates of $\xi$ to form a complete set must thus be formulated, that any ket $|P\rangle$ can be expressed as an integral plus a sum of eigenkets of $\xi$, i.e. $$|P\rangle = \int |\xi'c\rangle\; d\xi' + \sum\limits_{r}|\xi^rd\rangle$$ where the $|\xi'c\rangle$, $|\xi^rd\rangle$ are all eigenkets of $\xi$, the labels c and d being inserted to distinguish them when the eigenvalues $\xi'$ and $\xi^r$ are equal, and where the integral is taken over the whole range of eigenvalues and the sum is taken over any selection of them.  I find it inconsistent that the eigenkets under the integral are weighted by what appears to be a differential eigenvalue $d\xi'$, yet all the eigenkets under the summation are weighted by the value 1. Is this correct?


I found the next exercise and its respective solution while studying calculus.  Let $(x_n)\in\mathbb{R}$ be a sequence. Suppose that every subsequence $({x_n}_k)$ has a "sub-subsequence" $({{x_n}_k}_j)$ that converges to $0$. Show that $\displaystyle\lim_{n\to \infty} x_n=0$  Proof:  Suppose that $x_n \not\to 0$. Then, there is an $\varepsilon _0>0$ such that, for every $N\in\mathbb{N}$ $$|x_n|\geq\varepsilon_0$$, for some $n\geq N$.   Then, it's possible to construct a subsquence $({x_n}_k)$ such that $|{x_n}_k|\geq\varepsilon_0>0$ for every $k\in\mathbb{N}$.   This subsequence $({x_n}_k)$ cannot have any subsequence that converges to $0$ (contradiction).  My questions are: Why can we affirm that it's possible to construct a subsequence $({x_n}_k)$ such that $|{x_n}_k|\geq\varepsilon_0>0$, for every natural number $k$? And why can we affirm that the subsequence $({x_n}_k)$ cannot have any subsequence that converges to $0$?

Let $(x_n)_{n\in \mathbb{N}}$ be a sequence of real numbers. A well known result is:     The sequence $(x_n)_{n\in \mathbb{N}}$ converges to $a\in \mathbb{R}$ if and only if every subsequence $(x_{n_k})_{k\in \mathbb{N}}$ converges to $a\in \mathbb{R}$.   Now, I'm working on an exercise which essentialy asks to prove the following:     The sequence $(x_n)_{n\in \mathbb{N}}$ converges to $a\in \mathbb{R}$ if and only if for every subsequence $(x_{n_k})_{k\in \mathbb{N}}$ there is a (sub)subsequence $(x_{n_{k_j}})_{j\in \mathbb{N}}$ which converges to $a$.   Now, one direction is trivial. If in fact $(x_n)_{n\in \mathbb{N}}$ converges to $a$, then by the result I've mentioned, every subsequence of $(x_{n})_{n\in \mathbb{N}}$ converges to $a$. Let then $(x_{n_k})_{k\in \mathbb{N}}$ be an arbitrary subsequence. In that case, we know that it is a subsequence of itself, and hence we've found a (sub)subsequence which converges to $a$.  The other way around seems quite complicated for me. The reason is as follows: I must assume that every subsequence $(x_{n_k})_{k\in \mathbb{N}}$ has a (sub)subsequence which converges to $a$ and the proof that the original one converges to $a$.  My problem is exactly that "a". If it had all (sub)subsequences converging to $a$, then by the result i've mentionted, the subsequence $(x_{n_k})_{k\in \mathbb{N}}$ would converge to $a$. In that case, we would have every subsequence converging to $a$ and the result would follow.  My idea to prove the claim was then:  First remember that a subsequence is the restriction of the original one $x: \mathbb{N}\to \mathbb{R}$ to an infinite subset $\mathbb{N}'\subset \mathbb{N}$. In that case a (sub)subsequence is the restriction of $\tilde{x} = x|\mathbb{N}'$ to an infinite subset $\mathbb{N}''\subset \mathbb{N}$. But since $\tilde{x}$ is the restriction of $x$ to $\mathbb{N}'$ and since $\mathbb{N}''\subset \mathbb{N}'$, the restriction of $\tilde{x}$ to $\mathbb{N}''$ is itself the restriction of $x$ to $\mathbb{N}''$.  In other words, every (sub)subsequence can be viewed as a subsequence of the original one. Considering this, by hypothesis every subsequence has a (sub)subsequence which converges to $a$. But by this argument, this means that we can replace every subsequence with a convergent one. And then we can use the result I stated.  Is my idea correct? Is this really the way to prove the claim? My only doubt is that I need every subsequence converging to $a$ to use the result. In this case I can't see how I can argue that this implies every subsequence converges to $a$.  How can I finish this proof?


Lets consider that I have a text file named text.txt. So, now I made a file named showtext.html in which I have to write javascript such that it can display the text present in text.txt. I assume it would be like :  Text ( text.txt )   Show me up !   HTML ( showtext.html )  <!DOCTYPE html> <html> <body> <script>    var src = "text.txt";    document.write( value.get( src ) ); </body> </html>   Output of showtext.html  Show me up !   In, the above function the value.get() gets and then writes the value of the text.txt. So, can javascript really do such ? How can I make the value.get() ? Will it support only .txt extension or can support any custom extension ? Or this can only be done with PHP ?

Is there local file manipulation that's been done with JavaScript? I'm looking for a solution that can be accomplished with no install footprint like requiring .  Specifically, I'd like to read the contents from a file and write those contents to another file. At this point I'm not worried about gaining permissions and am just assuming I already have full permissions to these files.


I have a unit test that needs to work with XML file located in src/test/resources/abc.xml. What is the easiest way just to get the content of the file into String?

I've been using the idiom below for some time now. And it seems to be the most wide-spread, at least on the sites I've visited.  Is there a better/different way to read a file into a string in Java?  private String readFile(String file) throws IOException {     BufferedReader reader = new BufferedReader(new FileReader (file));     String         line = null;     StringBuilder  stringBuilder = new StringBuilder();     String         ls = System.getProperty("line.separator");      try {         while((line = reader.readLine()) != null) {             stringBuilder.append(line);             stringBuilder.append(ls);         }          return stringBuilder.toString();     } finally {         reader.close();     } }


I want to uninstall Ubuntu that I have partitioned on my hard drive.   I want it uninstalled so that I can install the new version for Windows that allows for dual booting (alongside Windows). How do I get to the area where I can access Ubuntu that was partitioned?  I want to get to in so I can uninstall it before I install Ubuntu for Windows.     I tried creating an ISO image of Ubuntu on my USB drive, but I couldn't access the Welcome page of the program so I could get to the Allocate drive space portion, but it never showed up. Is that the way to go about it?

I have absolutely no experience with Linux, and I desperately need to get my computer back up and running again with Windows.  How do I remove Ubuntu and reinstall Windows?    Editor's note: many of the answers are about removing Ubuntu from dual-boot but keeping Windows (which is a bit complicated), while other answers are about removing Ubuntu from single-boot (which is easy: basically just format the disk while installing Windows). The question as written is ambiguous between dual-boot or single-boot.


I have a Windows 7 PC, and I think it has something to do with the F3 key. I don't have the Fn (function) key, I tried pressing F3 with all the keys I have, and have had no luck.

When I press F3 to see the debug screen in I use Minecraft 1.8.1, some information is missing.   Most notably, there are no X, Y, Z coordinates.     What happened to my debug overlay?


I added a line  xrandr --output HDMI1 --rotate right  in /etc/rc.local to rotate one of my monitors at startup, but it doesn't work (

How can I run the following xrandrcommand on startup?  xrandr   cvt 1368 768  xrandr --newmode "1368x768_60.00"   85.25  1368 1440 1576 1784  768 771 781 798 -hsync +vsync xrandr --addmode VGA1 1368x768_60.00 xrandr --output VGA1 --mode 1368x768_60.00


When I login, system accepts my password to use system.  But, when I try to update software programs, system says "manipulation error" or something like that.    Went to login screen with Ubuntu recovery mode and tried to reset password using mount -re, etc but says password unchanged.  What am I doing wrong?

I'm working on a Ubuntu system, and my client has completely forgotten his administrative password. He doesn't even remember entering one; however it is there.  I've tried the suggestions on the website, and I have been unsuccessful in deleting the password so that I can download applets required for running some files. Is there a solution?


Finding $$\lim_{n\rightarrow \infty}\sum^{n}_{k=0}\frac{\binom{n}{k}}{n^k(k+3)}$$   Try: $$\sum^{n}_{k=0}\frac{\binom{n}{k}}{n^k(k+3)}=\frac{n^3}{(n+1)(n+2)(n+3)}\sum^{n}_{k=0}(k+1)(k+2)\frac{\binom{n+3}{k+3}}{n^{k+3}}$$  Could some help me to solve it , thanks

Evaluate $\displaystyle \lim_{n\rightarrow \infty}\sum^{n}_{k=0}\frac{\binom{n}{k}}{n^k(k+3)}$.   $\bf{My\; Try::}$ Although we can solve it by converting into definite Integration.  But I want to solve it without Using Integration.  So $\displaystyle \lim_{n\rightarrow \infty}\sum^{n}_{k=0}\frac{\binom{n}{k}}{n^k(k+3)} = \lim_{n\rightarrow \infty}\sum^{n}_{k=0}\frac{(n-1)(n-2).......(n-k+1)}{k!\cdot n^{k}\cdot (k+3)}$  Now How can i solve after that, Help required, Thanks


In this question, Shadow Wizard doesn't have gold badge shown near his name, however he closed this question, having gold support badge and .        Is it a bug or I am missing something?

Here's a counter-example of the expected gold circle icon:    Compare with:    I'm not certain of when the powers came into play, precisely, but since FredOverflow is neither a moderator nor the owner of that post, I can't see how else he would have marked it as a duplicate single-handedly except for this gold badge power.  Unless I'm missing something…


After starting to use Ubuntu 16.04, I find that many reasonable vi settings are off (before that I was on Scientific Linux, don't remember which version). This includes things like language highlighting, remembering the cursor's last line, search highlighting, remembering the last search, line number at screen bottom...   I tried to remedy some of these in ~/.vimrc and in /etc/vim/vimrc, which didn't always work.   Before I go on tackling each of the problems individually, I wonder if there is something big that I'm missing which might account for lacking all of these?   Edit:  It was suggested that this is a duplicate of . Not exactly. It turns out that the answers in that question give a partial answer to this question if they are combined with the answers to a third question. Therefore, I add all this as an answer, since it would be useful to anyone else facing the same problem.

When you type vi in the terminal, the following output is shown  ~                             VIM - Vi IMproved                                 ~                                                                              ~                               version 7.3.547                                  ~                           by Bram Moolenaar et al.                             ~           Modified by pkg-vim-maintainers@lists.alioth.debian.org              ~                 Vim is open source and freely distributable                    ~                                                                                ~                        Help poor children in Uganda!                                                                                So according to this, vi must be launching VIm. But when you type  vim it gives  aditya@aditya-desktop:~$ vim The program 'vim' can be found in the following packages:  * vim  * vim-gnome  * vim-tiny  * vim-athena  * vim-gtk  * vim-nox Try: sudo apt-get install <selected package>   This shows that vim is not installed. Notably man vi and man vim launch the same man pages.  So what does the vi command actually launch?


I am writing a Java application where I have to extract information from a JSON file. I want to get every element of a JSON array using Regex. I found this expression \[([^]]+)\] which works only with non-nested arrays, but not for the example below.    list[  0{     somedata{...},     sublist0[         somedata(...),         somedata(...)         ],     key: value, },  1{     somedata{...},     sublist1[         somedata(...),         somedata(...)         ],     key: value, }, .... , N{     somedata{...},     sublistN[         somedata(...),         somedata(...)         ],     key: value, } ], somedata{...}   For this example, the expression matches element 0, sublist1, sublist2 ... sublistN and ignores the other elements from the elements. I am looking for the appropriate regular expression because I can't use any external libraries for this project. The elements' names may also vary.

Is it possible to write a regular expression that matches a nested pattern that occurs an unknown number of times? For example, can a regular expression match an opening and closing brace when there are an unknown number of open/close braces nested within the outer braces?  For example:  public MyMethod() {   if (test)   {     // More { }   }    // More { } } // End   Should match:  {   if (test)   {     // More { }   }    // More { } }


I've read the answers to this question, but still don't understand what to do:    I am logged onto my Ubuntu server as root. I have the following command in my .profile:  alias test-alias="echo test"   I have the following command in my crontab file:  11 9 * * *      source /root/.profile; test-alias > /root/tmp.output 2>&1   When this command runs, the only output present in tmp.output is:  /bin/sh: 1: test-alias: not found   What am I doing wrong here? How can I use my test-alias in my crontab file? I want to use the alias directly in the command, I don't want to create additional scripts to run the alias.

I have some commands in my .profile that I want to invoke from my crontab.   For example, if I have,   alias notify-me="~/bin/notify.pl -u user1" alias notify-team="~/bin/notify.pl -u user1 user2 user3 user4 ...."   I'd like to just invoke the alias  0 11 * * * notify-team   so if the list in my .profile is updated, I don't have to update the crontab, too. However, I don't seem to be able to use aliases in my crontab. Is there a work around?  I tried the suggestions  to set up the environment (e.g. /bin/bash -lc and the script-wrapper script). It seems like that works for scripts but not aliases.  Any ideas?


I have 1 chocolate and 3 children. I want to decide which child gets the chocolate using a toss of a fair coin. I also want each child to be equally likely to get the chocolate. How do I do this?

I have a 5-sided dice, and I want to use it to simulate a 7-sided dice. Is there a way to do this with a finite number of rolls?


Implementing a single-qubit gate in a multi-qubit register is relatively easy. For example, this gate:    This is equivalent to $I \otimes H \otimes I$. If the $H$ gate was on the first bit, it would be $H \otimes I^{\otimes 2}$ etc.  What about this gate?    There doesn't seem to be any Kronecker product of the CNOT matrix that will produce the correct matrix for this. Is there a simple way to calculate the matrix for the general case of a multi-qubit gate on a larger register?  I imagine it could be done by rearranging the qubits to put the gate on the first qubits of a register, and then reversing the rearrangement after the gate. This is a lot harder than the single-gate case though.

In a three-qubit system, it's easy to derive the CNOT operator when the control & target qubits are adjacent in significance - you just tensor the 2-bit CNOT operator with the identity matrix in the untouched qubit's position of significance: $$C_{10}|\phi_2\phi_1\phi_0\rangle = (\mathbb{I}_2 \otimes C_{10})|\phi_2\phi_1\phi_0\rangle.$$ However, it isn't obvious how to derive the CNOT operator when the control & target qubits are not adjacent in significance: $C_{20}|\phi_2\phi_1\phi_0\rangle.$ How is this done?


Suppose you want to fix your brother's bicycle, but this time it seems that you cannot do it and at the end of your work, you find that you have caused an extra damage to that bicycle, too! :)      We have an proverb which says:" You wanted to shape/fix someone's eyebrow but you blinded their eye!"   Is there any idiom or proverb that can convey the same connotation?

I'm looking for an expression that conveys an excessive risk management approach that ends up having a worse effect than what it is trying to protect against.


In C# I have the following object:  public class Item { }  public class Task<T> { }  public class TaskA<T> : Task<T> { }  public class TaskB<T> : Task<T> { }   I want to dynamically create TaskA or TaskB using C# reflection (Activator.CreateInstance). However I wouldn't know the type before hand, so I need to dynamically create TaskA based on string like "namespace.TaskA" or "namespace.TaskAB".

The title is kind of obscure. What I want to know is if this is possible:  string typeName = <read type name from somwhere>; Type myType = Type.GetType(typeName);  MyGenericClass<myType> myGenericClass = new MyGenericClass<myType>();   Obviously, MyGenericClass is described as:  public class MyGenericClass<T>   Right now, the compiler complains that 'The type or namespace 'myType' could not be found." There has got to be a way to do this.


I often need to download sets of links from a webpage and it's very inefficient having to click all the links one by one. For example, at the moment I want to download the lecture notes on  webpage. Is there some way I can batch download them? I am using Linux and Firefox in case that information is useful

Do you know a good software to download all PDF links in a web page??  Operating system is Windows 7.


I've learned that in Java, arrays are passed by reference, meaning that they can be modified within functions. However, I recently came across this piece of code that confused me, because it seems to show inconsistent behavior. import java.io.*; import java.util.*;  public class TestProgram {      public static void fMethod(int[] f){         f[0] = 9;         f[1] = 7;         f = new int[4];     }      public static void main(String[] args){         int[] fParam = new int[3];         fMethod(fParam);         System.out.println(Arrays.toString(fParam)); // prints [9, 7, 0]     } }  Because the function fMethod() seems to reset f to a new int[4] at the end, I expected to see [0, 0, 0, 0] printed to the console. However, it seems that only the f[0] = 9 and the f[1] = 7 lines were actually executed, while the last line was ignored. I find this strange. Can somebody please point me in the right direction?

I always thought Java uses pass-by-reference. However, I've seen a couple of blog posts (for example, ) that claim that it isn't (the blog post says that Java uses pass-by-value). I don't think I understand the distinction they're making. What is the explanation?


I have file look like this...  abc100200300 abmen abc100200300 arcxi xyz200300300 aelmi   How do I print the lines that have duplicates (based on examining just the first 12 characters) to a separate file?  so in the separate file I should have  abc100200300 abmen abc100200300 arcxi


I'm trying to develop a character calculator for a RPG, and it could evolve into a turn based combat / text based RPG. One of my concerns is how to handle the equipment stats / buff system.   Currently each of my buffs / equipment object and my character object itself has a member bonusstats, which is a struct containing a (potentially) very large amount of possible modifiers (attributes, misc_skills, protections, secondary_stats, etc and their multiplier versions).  struct BonusStats {     int attribute[8], misc_skill[30], protection[9], HP, MP, ... ;     //define constructor, operator+=, reset function }   And everytime an actualize call is requested every stat is recomputed:  Character::Actualize() {     this->bonusstats.reset();     for /*iterate through vector of buffs and equipped items*/ {         this->bonusstats += item->getBonusStats();     } }   While this is a rather simple approach I am concerned about two things mainly:  1.- Is it performance-wise acceptable? I get the feeling that having to sum two structs containing 100 elements just to add a buff is not a very good practice. Would there be any practical advantage in using a function like Character::ApplyStats( std::function<void(BonusStats*)> itemstats) instead?  2.- How could I implement more complex buffs than stat modifiers? For example, reflecting x% damage when blocking a melee attack. The thing that comes to my mind is to create complex stats like percent_damage_reflected_on_melee_block and check its value everytime conditions are met. Is it a good approach?

Overview:  Lots of games with RPG-like statistics allow for character "buffs", ranging from simple "Deal 25% extra damage" to more complicated things like "Deal 15 damage back to attackers when hit."  The specifics of each type of buff aren't really relevant.  I'm looking for a (presumably object-oriented) way to handle arbitrary buffs.  Details:  In my particular case, I have multiple characters in a turn-based battle environment, so I envisioned buffs being tied to events like "OnTurnStart", "OnReceiveDamage", etc.  Perhaps each buff is a subclass of a main Buff abstract class, where only the relevant events are overloaded.  Then each character could have a vector of buffs currently applied.  Does this solution make sense?  I can certainly see dozens of event types being necessary, it feels like making a new subclass for each buff is overkill, and it doesn't seem to allow for any buff "interactions".  That is, if I wanted to implement a cap on damage boosts so that even if you had 10 different buffs which all give 25% extra damage, you only do 100% extra instead of 250% extra.  And there's more complicated situations that ideally I could control.  I'm sure everyone can come up with examples of how more sophisticated buffs can potentially interact with each other in a way that as a game developer I may not want.  As a relatively inexperienced C++ programmer (I generally have used C in embedded systems), I feel like my solution is simplistic and probably doesn't take full advantage of the object-oriented language.  Thoughts?  Has anyone here designed a fairly robust buff system before?  Edit: Regarding Answer(s):  I selected an answer primarily based on good detail and a solid answer to the question I asked, but reading the responses gave me some more insight.  Perhaps unsurprisingly, the different systems or tweaked systems seem to apply better to certain situations.  What system works best for my game will depend on the types, variance, and number of buffs I intend to be able to apply.  For a game like Diablo 3 (mentioned below), where nearly any bit of equipment can change a buff's strength, the buffs are just character stats system seems like a good idea whenever possible.  For the turn-based situation I'm in, the event-based approach may be more suitable.  In any case, I'm still hoping someone comes along with a fancy "OO" magic bullet which will allow for me to apply a +2 move distance per turn buff, a deal 50% of damage taken back to the attacker buff, and a automatically teleport to a nearby tile when attacked from 3 or more tiles away buff in a single system without turning a +5 strength buff into its own subclass.  I think the closest thing is the answer I marked, but the floor is still open.  Thanks to everyone for the input.


I have following three sub-folders in a folder in Windows-10. I sort them by clicking on the Name column-header and they show in the following order:   01 1 02   According to  :  "... To determine which of two strings comes first in alphabetical order, their first letters are compared. If they differ, then the string whose first letter comes earlier in the alphabet comes before the other string "  Now if I compare the first letters of '1' and '02' then clearly '0' comes earlier in the alphabet, which is why it seems logical that above '01' comes before '1'. Very Good!  Then why does '02' NOT come before '1'?  Is Windows-10 FileExplorer sort-by-name NOT sorting by alphabetic ordering? Why not?

The behaviour described below occurs on Windows-7 systems and on Windows XP. We operate in a dual-language environment - English and Hebrew.  When in Windows Explorer we sort files by name, the order in which they are listed is not what we would expect. Here is a list of file names as sorted by Windows Explorer (all of the files have a .pdf suffix):   1G110033H-PP 19C050G-PP-ORB 19C050H-PPRM 19C100H-PPRM 19C-MBPS-PP 19C-MBPS-PP-1 29AAC050-PP 29AAC100-PP 29AAC100-PPUL   29B004064-PP 101AC050-PP 101AC100-PP 101B100-PPE 1091003G-PPFSUL 10108033G-PPSA 10125033H-PPM     It looks to me that first the items are sorted according to the position of the first alphabetic character in the name, and then, within those groups, they are sorted in "normal" alpha-numeric order.  That is, all the files with an alpha character in the first position are on top of the list, followed by those with the first alpha character in the second position, followed by those with the first alpha character in the third position, and so on.  An alternate way of looking at this is that, in a file name composed of numbers and letters, the sort treats the first group of numbers in the name as the major sort node, with the rest of the name being the secondary sort node.  Now that I understand the sequencing logic, it's not a big problem, but I was wondering why this happens?


I'm playing a warlock in 5e. I've been peeking through Google, but have found contradicting answers. What IS the Expanded Spell List? Is it a second spell list? Is it just spells I can get just like any other spell? What is it?

Expanded Spell List   The Fiend lets you choose from an expanded list of spells when you learn a warlock spell. The following spells are added to the warlock spell list for you.   Should this mean, that unlike the Cleric, a Warlock does not gain the Patron spells in addition to the spells known?  So a 1st level Cleric with 16 Wis can prepare 4 spells, plus 2 from the Domain, but a Warlock only knows 2 spells, no matter what?


I'd like to take some levels as a Wizard; in-game, the Wizard in my party teaches me some magic so that I can become a practicing Wizard. But, I haven't come up with a reason why I don't have exactly the same spells as my teacher.   In fact, I am not 100% sure how I get new spells as a Wizard. When I gain a level as Wizard I can add two new spells to my spellbook. For me, this brings up a lot of questions.  Do I have to find these spells first, for example on a scroll or in another spellbook? Would I need to pay 50 gp and spend 2 hours learning spells, per spell level? To me, that doesn't make any sense. So, I assume that I just pick two new spells with each level and additionally I can add the spells I find to the spellbook.  Do I “invent” the spells, e.g. “I would really like to be invisible, so I'll figure out a spell that makes me invisible”? I think that'd be an odd way to go about it. Perhaps it goes more like, “Oh, I remember that one afternoon when my mentor tried to explain how Fireballs work; now I finally understand it, so I can cast Fireball from now on.”  Summary Question: Where do the two new spells come from?

I can't find anything in the D&D 5e books about learning spells as an arcane spellcaster.  I have a question:   As, say, a Wizard levels up and gets new spell slots, does he need to go to a library and find the spell somewhere? Could he learn a spell he saw someone else cast?


I have hp laptop with intel processor with Ubuntu 14.10 preinstalled in it which is customized. I want to remove that customization and make it original as earlier. SO I want to reinstall Ubuntu in it. Please send me a link to download Ubuntu and install it on Ubuntu os (for reinstallation).

I'm new to Linux. I'm using Ubuntu 11.04. Now i want to install Ubuntu 12.04 .  I got an ISO  image of Ubuntu 12.04 Desktop. I put this image in to a pen drive which is formated,set the boot option boot from usb but nothing happened .  I searched this over the net and on Ubuntu website but nobody has given the complete steps . someone say you can install from the Ubuntu also ,someone says u can  do a fresh installation from usb pen drive you need to make you pen drive bootable etc. etc. .  My problem is that i don't know the exact steps how ton install Ubuntu from usb pen drive?  All I want to do is to completely remove my Ubuntu 11.04 and install Ubuntu 12.04 from usb pen-drive.  Can any body tell me how to make a pen drive bootable ?  How to install Ubuntu 12.04 from pen-drive?  Please give me a step by step procedure with screenshots.  Thanx in advance


Sometimes it's greyed out, sometimes it registers a press but does not respond. Sometimes minimising the app and returning resolves the issue, but generally the fastest solution is to manually close and reopen the app.    App Version: 1.4.3.7 Device: iPhone 6 OS Version: Version 9.2.1 (Build 13D20)

iOS app 1.4.3, iOS 9.2.1  While viewing a post, the app somehow ended up in a state where it refuses to do much of anything.  What does work:   Swipe-scrolling vertically Jumping to the previous / next post using the up / down buttons    Everything else, though, has no effect:   Swipe-scrolling horizontally will not return to the previous view Tapping on a code block will not zoom to code-block view Tapping Delete button to delete a post will show a confirmation dialog, but saying yes will not cause deletion The Add Comment button brings up the text field, but I cannot type anything in it; I can only dismiss it None of the other buttons (Share, More, etc.) do anything Cannot view user profiles or revision history Tapping on links in a post or comment will not show a web page Tapping on a tag shows some visual feedback with a temporary color change, but doesn't do anything else   I still receive push notifications, but tapping on them doesn't take me anywhere.


\begin{equation}   \left\{\begin{array}{@{}l@{}}     2x\equiv7\mod9 \\     5x\equiv2\mod6   \end{array}\right.\,. \end{equation} Can this system of congruences be solved? I notice that $(9,6) = 3 \ne 1$ so I can't apply the Chinese theorem of remainders, but this doesn't imply that it can't be solved, so I thought to rewrite the second equation in two different equations, like this: \begin{equation}   \left\{\begin{array}{@{}l@{}}     2x\equiv7\mod9 \\     x\equiv0\mod2 \\     5x\equiv2\mod3   \end{array}\right.\,. \end{equation} But the problem still here: $(9,3) = 3 \ne 1$, so it can be solved or is it impossible?

I have to see for which value of $a$ this system is solvable: $$ \begin{cases}   3x \equiv a\pmod{28}\\   ax \equiv4\pmod{21}\\ \end{cases} $$ I check the two congruences separately: $$ \gcd(3,28)=1\mid a\;\checkmark $$ $$ \gcd(a,21)\mid4 \iff \gcd(a, 21) = 1 \iff a \not\equiv 0\;(7)\;\land a \not\equiv 0\;(3) $$  $$ \begin{cases}   3x \equiv a\pmod{4}\\   ax \equiv4\pmod{3}\\ \end{cases}\\ \gcd(4,3) = 1\;\checkmark $$ $$ \begin{cases}   3x \equiv a\pmod{7}\\   ax \equiv4\pmod{7}\\ \end{cases} $$ and from here I can't go on.  So, my problem is that I can't figure out how to check if a system of congruences is solvable.  EDIT:  maybe I found the solution: $ \gcd(7,7) = 7\mid a-4 \iff a = 11+7k \land a \not\equiv 0\;(7)$


What is a suitable algorithm that can be used to generate random, but likely humanly distinguishable, graphic square icons?  Icons, from 57x57 up to 1024 square, such as used for mobile apps, preferably using something like Core Graphics commands/operations? (or an equivalent)  I tried filling square bitmaps with rand(), but they all look like mud, very hard to distinguish between by sight.

How does Stack Overflow auto-generate the gravatars for those users who do not upload a picture or who have not created a Gravatar icon?    Where do these random avatars come from, and how can I generate them for my own site?


I am trying to make a trivia game using an api, and my elements are not clickable.  After I make the api call, I am looping through my responses and using jQuery I am making each response into an html p tag element.  My next step is to determine which response is the correct one, but first I want to test each element with a click listener.  This is where I am currently stuck.  There is no response when I click any p tag.  There should be a message logged into the console.  Any idea's to help me out?  $(document).ready(onReady);  function onReady() {   console.log("jQuery in tha house!");   $("#btn").on("click", askQuestions);   $("#answer").on("click", determineCorrect); } let axiosbtn = document.querySelector("#axios"); let url = "https://opentdb.com/api.php?amount=1";  function shuffle(array) {   let currentIndex = array.length,     temporaryValue,     randomIndex;    while (0 !== currentIndex) {     randomIndex = Math.floor(Math.random() * currentIndex);     currentIndex -= 1;      temporaryValue = array[currentIndex];     array[currentIndex] = array[randomIndex];     array[randomIndex] = temporaryValue;   }    return array; }  let askQuestions = () => {   axios     .get(url)     .then(res => {       $("#question").html(res.data.results[0].question);        rightAnswer = res.data.results[0].correct_answer;       let answers = [rightAnswer];       let wrongAnswers = res.data.results[0].incorrect_answers;       wrongAnswers.forEach(wrong => {         answers.push(wrong);       });       let newAnswers = [];       $.each(answers, (i, answer) => {         newAnswers.push("
" + answer + " " + "
");       });       shuffle(newAnswers);       $("#answers").html(newAnswers.join(""));       console.log(shuffle(newAnswers));       console.log(rightAnswer);     })     .catch(err => {       console.log("Error", err);     }); };  let determineCorrect = () => {   console.log("Determine Correct"); };
Random Trivia

         <button id="btn">Get Random Trivia Question</button>

I have a bit of code where I am looping through all the select boxes on a page and binding a .hover event to them to do a bit of twiddling with their width on mouse on/off.  This happens on page ready and works just fine.  The problem I have is that any select boxes I add via Ajax or DOM after the initial loop won't have the event bound.  I have found this plugin (), but before I add another 5k to my pages with a plugin, I want to see if anyone knows a way to do this, either with jQuery directly or by another option.


As per my knowledge orange color object (say orange) absorbs other color light except orange color light. So we can see orange object as orange.   If this is true then is it possible "In a ideal light free room, If we put pure red light on a pure orange color object, we will see nothing? Because orange color object will absorbs red light"

I'm confused, does the absorption and emission determine the color of something? Or does that only happen when something is emitting energy?  When light hits an object, the photons get absorbed, then emitted with a different wavelength right?


here the src code   let mod_src_0 = "str1"; let mod_src_1 = "str2"; let mod_src_array = [mod_src_0,mod_src_1]; let mod_src_export = [];  let mod_obj = function(){      let temp = {};     for(let mod in mod_src_array){         temp.id = mod_src_array[mod];          mod_src_export.push(temp);     }        console.log(mod_src_export)   } mod_obj()   and the result is [ { id: 'str2' }, { id: 'str2' } ] instead of [ { id: 'str1' }, { id: 'str2' } ]  why is this happening? does it have anything to do with the javascript array.push function?

The primitive types (number, string, etc.) are passed by value, but objects are unknown, because they can be both passed-by-value (in case we consider that a variable holding an object is in fact a reference to the object) and passed-by-reference (when we consider that the variable to the object holds the object itself).  Although it doesn't really matter at the end, I want to know what is the correct way to present the arguments passing conventions. Is there an excerpt from JavaScript specification, which defines what should be the semantics regarding this?


I am sampling from a random process $X$ and I would like to calculate $R^2$ for the cumulative sum of the samples: $$x_1,..x_n$$        $$y_n=\sum_0^n x_i$$  $$R^2_n=RSQ( [1,2,...n], [y_1,y_2,..,y_n])$$  The calculation becomes increasingly slow as $n$ grows. Do you know any incremental way to update $R^2$ at every new sample, without recalculating it from the beginning every time?

I'm analysing some data where I would like to perform ordinary linear regression, however this is not possible as I am dealing with an on-line setting with a continuous stream of input data (which will quickly get too large for memory) and need to update parameter estimates while this is being consumed. i.e. I cannot just load it all into memory and perform linear regression on the entire data set.  I'm assuming a simple linear multivariate regression model, i.e.  $$\mathbf y = \mathbf A\mathbf x + \mathbf b + \mathbf e$$  What's the best algorithm for creating a continuously updating estimate of the linear regression parameters $\mathbf A$ and $\mathbf b$?   Ideally:   I'd like an algorithm that is most $\mathcal O(N\cdot M)$ space and time complexity per update, where $N$ is the dimensionality of the independent variable ($\mathbf x$) and $M$ is the dimensionality of the dependent variable ($\mathbf y$). I'd like to be able to specify some parameter to determine how much the parameters are updated by each new sample, e.g. 0.000001 would mean that the next sample would provide one millionth of the parameter estimate. This would give some kind of exponential decay for the effect of samples in the distant past.


I am trying to run a logistic regression with one class (class 0, n = 513) over-represented compared to the other one (class 1, n = 173).  So far, in order to correct for the biased intercept, I just resampled the class 0 in order to get n = 173, then ran a logistic regression, then stocked the estimates. Finally I calculated the median of all these coefficient.  The issue I have is that I am not so sure my method is correct, and I am not so sure how I could report z values and other stats usually obtained in summary of glm.

Okay, so I think I have a decent enough sample, taking into account the 20:1 rule of thumb: a fairly large sample (N=374) for a total of 7 candidate predictor variables.   My problem is the following: whatever set of predictor variables I use, the classifications never get better than a specificity of 100% and a sensitivity of 0%. However unsatisfactory, this could actually be the best possible result, given the set of candidate predictor variables (from which I can't deviate).   But, I couldn't help but think I could do better, so I noticed that the categories of the dependent variable were quite unevenly balanced, almost 4:1. Could a more balanced subsample improve classifications?


I'm trying to work out the partial derivatives of a function $L$ in terms of $x_i$: $$ A \in \mathbb{R}^{m x n} \quad b \in \mathbb{R}^m \quad x \in \mathbb{R}^n $$ $$\begin{aligned} L(x) &= \left\|{Ax - b }\right\|^2 \\&= (Ax-b)^T(Ax-b) \\ &= x^TA^TAx - b^TAx - x^TA^Tb + b^Tb\end{aligned}$$ All four of these terms are scalars so I think I can transpose the third term to get: $$\begin{aligned} &= x^TA^TAx - 2b^TAx + b^Tb\end{aligned}$$ I'm a little stuck on how to transform $x^TA^TAx$ further. Calculating the partial derivatives, the final term $b^Tb$ is constant so goes to zero, the second term has coefficient vector $2b^TA$ so we just drop the $x$, its again the first term I'm stuck on: $$\frac{\partial{L(x)}}{\partial x} = ??? -2b^TA$$ What's the derivative of $x^TA^TAx$ in terms of $x$?  How you work it out? Update: After looking at the potential duplicate, I think I'm mostly covered - however it's not immediately obvious to me why: $$\frac {\partial(x^TMx)} {\partial x}=(M+M^T)x$$ How is this rule derived?

It's stated that the gradient of:  $$\frac{1}{2}x^TAx - b^Tx +c$$  is   $$\frac{1}{2}A^Tx + \frac{1}{2}Ax - b$$  How do you grind out this equation? Or specifically, how do you get from $x^TAx$ to $A^Tx + Ax$?


As in the title, I was creating a list of things I want and couldn't think of a word for the file name. Is there a single word I could use to mean "things I want/desire"?

Something a bit professional sounding?  In a scenario where there was also a bunch of Requirements, this situation could be easily solved by labelling one as Required and this specific bunch of things as Optional. But in an independent context, where no requirements exist to provide contextual flavor, what can be a concise way of referring to a bunch of things that would be great if you could have / have access to, but they're not things you need to have / have access to.  Perhaps the word which fits -  Required : Optional :: Requirements : ????  ETA: Though I'm also hoping for a better word than optional which also conveys the extra / positive nature of 'it would be really good to have this, even if it's not a requirement'.


I would like to use LaTeX system to do my assignments as I am starting graduate program in applied mathematics.  Please can you suggest me good typesetting package system that would help create documents quicker. I see plenty of options  and would like some advice on which one to pick. I am a newbie.

What editors/IDEs are available for easing the process of writing TeX/LaTeX documents? Please state some useful features like code completion, spell checking, building final DVI or PDF files, etc.  This question is undergoing a systematic refurbishment, see  on Meta. If you’d like to see another editor feature covered here or to take care of an editor that’s not covered yet, share your ideas in that meta question.  List of editors Links to answers.


I've got an old Dell d630 that's running xp and I want to use ubnutu on it. It seems to be a 32 bit machine and have been trying to boot it up from a flash drive with no success.

How do I burn the latest 12.10 790 MB ISO to a CD?  My burning software says insert a disk but 700 MB CD's are too small. I tried a DVD and that didn't work either.


I have a custom tikzset with code provided by: . To be self-contained, here is the Latex I'm using directly:  \begin{tikzpicture}[auto] \tikzset{% pics/underbrace/.style args={#1,#2,#3}{% % a pic for putting an underbrace under certain columns % #1 = left column % #2 = right column index % #3 = label text code = {        \pgfextractx\colL{\pgfpointanchor{M-1-#1}{south}}  % x-coords of columns        \pgfextractx\colR{\pgfpointanchor{M-1-#2}{south}}        % draw the delimiter with the correct width        \node[rectangle, below delimiter={\}}, minimum width=\dimexpr\colR-\colL-1pt]               at ($ (M-1-#1)!0.5!(M-1-#2) $){};        % the label        \node at ($ (M-1-#1.south)!0.5!(M-1-#2.south) $)[below=1mm]{$\scriptstyle #3$};        }     },  } \matrix (M)[matrix of math nodes,row sep=1cm,column sep=1mm]{   x! & 2x! & 3x! & \ldots & (n-x-1)x! & (n-x)x! & (x+1)!\\  };  \pic{underbrace={1,2,2}};  \pic{underbrace={2,3,3/2}};  \pic{underbrace={5,6,\tfrac{n-x}{n-x-1}}};  \pic{underbrace={6,7,\tfrac{x+1}{n-x}}}; \end{tikzpicture}   It works nicely to produce a pdf locally, but the tikzset is causing my tex to not be accepted by arXiv. The relevant error message is as follows:  ! Undefined control sequence. l.879 \pic {underbrace={1,2,2}}; ?  ! Emergency stop. l.879 \pic {underbrace={1,2,2}}; ! ==> Fatal error occurred, no output PDF file produced!   I'm assuming this is an issue with arXiv using an older version of Latex. Does anyone know a workaround?

Since arXiv is still using outdated libraries, it doesn't have an up to date TikZ version, which is very inconvenient for me since I'm using TikZ 3.0. Consequently, I get lots of error messages when I submit my article like missing tikzlibraryquotes.code.tex or tikz-cd isn't working properly or doesn't accept certain arguments.  What do I do?