I published a paper two years ago, and recently I realized two sub-figures (Fig.3c and Fig.3d) in my publication are wrong. When drawing those two figures, I forgot to put one parameter in the equation so resulted in the wrong figures. Nobody has spotted this mistake yet. Now this publication has around 12 citations, but none of them really discussed anything about two wrong figures. These two figures don't affect key conclusions at all, nor does it affect other figures at all. If I really need to publish a correction, I need to change the figure and change two sentences related to these figures. But I want to correct it anyway, for being a science guy with integrity. So I wonder in my case, I should contact the editor and request a correction, right? I hope these mistakes wouldn't result in a retraction, and that would be really bad.

What's the best way to make corrections to a published paper? Should I amend the original paper and mention in a footnote (or similar) what was changed and why or prepare a completely separate document and put that on my website/append it to the original paper?  I'm not so much worried about how to get it to the publishers that handle the paper, but rather about how to go about it. I would especially like to hear from people who have done something like that or know someone who did.


I am trying to understand the code here:   Mainly because I want to translate it into python.  Here is a snippet:  for(n_test = N, I_n_test = I_N; n_test > m; n_test--) {    // Loop invariants:   // - I_n_test is the number of inliers for the n_test first correspondences   // - n_best is the value between n_test+1 and N that maximizes the ratio                          I_n_best/n_best   assert(n_test >= I_n_test);   ...   ...   // prepare for next loop iteration   I_n_test -= isInlier[n_test-1]; } // for(n_test ...   So what does this do I_n_test = I_N; in the loop statement ?  Is it a stopping condition ? Shouldn't it be "==" then ?


Why we use "in" in: I worked in the mailroom.  While we use "at" and "in" in:   I worked in a place. I worked at a place.

Which one is correct?     Wind up working in a gas station (song name by Frank Zappa)   or     He knew that Old Joe didn’t work at the gas station anymore   (an example from Grammar textbook.)   Or may both variants be acceptable?


In Goblet of Fire, Voldemort tells the Death Eaters at the Little Hangleton graveyard how he needed his father's bone to regenerate. The fourth and sixth books imply that Little Hangleton is definitely a small, primarily Muggle community. The Death Eaters would have been able to reason out Voldemort's likely blood status from this information alone, if they wished. They could also easily have glanced at the gravestone Harry had been bound to and seen the name of Voldemort's father -- "Riddle" -- and, being mostly interrelated purebloods themselves, they would know that there was no pureblood Riddle family in Britain.  And more to the point, he outright tells the Death Eaters his father is a muggle.     "You think I was going to use my filthy Muggle father's name forever?   I, in whose veins runs the blood of Salazar Slytherin himself, through   my mother's side? I, keep the name of a foul, common Muggle, who   abandoned me even before I was born, just because he found out his   wife was a witch? No, Harry - I fashioned myself a new name, a name I   knew wizards everywhere would one day fear to speak, when I had become   the greatest sorcerer in the world!"   None of them seem surprised to hear this, so apparently they already knew.  Barty Crouch Jr. already knew Voldemort was Tom Riddle Jr. and could easily have learned that Tom Riddle Sr. was a muggle. He alluded to this when he spoke to Harry.     The Dark Lord and I", said Moody, and he looked completely insane now,   towering over Harry, leering down at him, "have much in common. Both   of us, for instance, had very disappointing fathers... very   disappointing indeed. Both of us suffered the indignity, Harry, of   being named after those fathers. And both of us had the pleasure...   the very great pleasure... of killing our fathers to ensure the   continued rise of the Dark Order!".   When did the Death Eaters learn the leader of their pure-blood ideology was a half-blood? Did they learn back when Tom was a student at Hogwarts? During the First Wizarding War? Some other time?

We know that some people were aware of the fact that Lord Voldemort was Tom Marvolo Riddle prior to his return in Goblet of Fire; at the very least his close soon-to-be-Death-Eater "friends" and Albus Dumbledore:  “Very few people know that Lord Voldemort was once called Tom Riddle. I taught him myself, fifty years ago, at Hogwarts..." ... underwent so many dangerous, magical transformations, that when he resurfaced as Lord Voldemort, he was barely recognizable. Hardly anyone connected Lord Voldemort with the clever, handsome boy who was once Head Boy here.” (Professor Dumbledore to Weasleys, Chamber of Secrets, CHAPTER EIGHTEEN, Dobby’s Reward)  and  “Voldemort,” said Riddle softly, “is my past, present, and future, Harry Potter…” He pulled Harry’s wand from his pocket and began to trace it through the air, writing three shimmering words: TOM MARVOLO RIDDLE Then he waved the wand once, and the letters of his name rearranged themselves: I AM LORD VOLDEMORT “You see?” he whispered. “It was a name I was already using at Hogwarts, to my most intimate friends only, of course. ...  (Tom's Diary manifestation in the Chamber of Secrets).  QUESTION: Who - based on canon (books/interviews/pottermore) - knew about the fact that Lord Voldemort was Tom Marvolo Riddle prior to Ginny being taken to the Chamber of Secrets? Obviously, Albus Dumbledore and Tom himself. Who else?


If you delete Minecraft from your iPad, will you get your worlds back when you download it again?

On my iPad I want to make a server.  It worked on a different WiFi.  When I got back to mine, it does not work.  So I think if I delete it, the server will be back.  Is that true?


Windows 10  QGIS 2.14.3-ESSEN  OSGEO4W install  (current)  64-bit  Processing toolbox.  Grass tools do not work  Neither 6 nor 7. 6 makes sense as I do not see OSGEO4W installing it but 7 tools are not working either.  My Grass folder (7) appears to be C*:\OSGeo4W64\apps\grass\grass-7.0.4*  They are activated (I know they are not in the screenshot). Grass 7 works as a standalone.    Error message:     Missing dependency. This algorithm cannot be run :-(  The specified   GRASS GIS 7 folder does not contain a valid set of GRASS GIS 7   modules. Please, go to the Processing settings dialog, and check that   the GRASS GIS 7 folder is correctly configured   What exactly should go in these four yellow boxes?  Now when I try to manually enter my path to grass 7 I get a new error message (below). No msys folder exists in the latest version of OSGEO4W 64-bit so I cannot set this.  .  This solution () appears to point to a spam link now and not mysys.

I went to step 4 from  guide and extracted LAStools to my C drive and just made the folder there.   I can't do step 8 because it seems to already be in "advanced interface". Then, step 9 mine only says "Options".   Step 10 is where I get the error message and it won't go past that step. I keep getting this error message. Can anyone help me get this installed?


When I want to challenge my friend to do something (like a bet), what would you call such a person? Challenged person? Challengee?   For example:      I challenge my friend to kiss a girl and he'll receive 4 pints. I'm   the challenger, he's the [...]

The words "challenge" and "challenger" are well-known, but is there such a term as "challengee" - as I read somewhere? In other words, what would be an appropriate term to describe the person challenged, for instance, to play a challenge match? Unsure whether to ask for the "antonym" of challenger.


I came across this integral in a text $$\int_{-1}^{1} \frac{cosx}{e^{\frac{1}{x}}+1}.$$ This was the approach used in the text: Let $$g(x)= \int_{-1}^{1} \frac{\cos x}{e^{\frac{1}{x}}+1}$$ Then $g(x)$ is equivalent to $$g_{e}(x) + g_{o}(x),$$ that is, it is the sum of an even function $g_e$, and odd function $g_o$. Then $$\int_{-1}^{1}g(x) = \int_{-1}^{1}g_{e}(x) \ + \int_{-1}^{1}g_{o}(x)$$ Then it took $$\int_{-1}^{1}g_{o}(x) \text{ as } 0$$ Talked about symmetry of odd function from the point of view of integrals as area under a graph Can someone please explain this better—I don't really get  it. is this as a result of the limit of the integral $(1,-1)$ or is there any other reason?

When evaluating the integral $$\int^1_{-1}\frac{\cos(x)}{1+e^{1/x}}dx,$$ the author says that the odd part of the function integrates to $0$ over $-1$ to $1$. I have calculated the even part of the function ($\frac{1}{2}\cos(x)$), so the integral is equal to $\sin(1)$. But why exactly does the odd part integrate to $0$?


I've been puzzled by this deceptively simple-looking complex number modulus inequality proof.     Show that:$$||z_1|-|z_2||\leq |z_1+z_2|.$$ State the condition for the equality to hold.   I tried  $\because|z_1|\leq |z_1+z_2|+|z_2|$, by triangle inequality  $\therefore|z_1|-|z_2|\leq |z_1+z_2|$  but then I do not factor the modulus on LHS and my proof is insufficient. I thought I could simply take the modulus both sides, but then I realised that for say $5>-6$, applying modulus in this manner yields $5>6$ which is obviously wrong.  I feel like perhaps I need to express $z_1$ and $z_2$ as $r_1cis\theta_1$ , etc but I am unsure in how to approach this method.  Any help  would be greatly appreciated. Thanks in advance.

prove $|z_1 + z_2| \geq ||z_1| - |z_2||$ I have proved the original triangle inequality.  Using the original I have ended up with $$|z_1+z_2| \geq |z_1| - |z_2|$$ and $$|z_1+z_2| \geq -(|z_1|-|z_2|)$$  but does this mean the result holds? I mean, if we had say $|x| \geq 10$, then that means that $x \geq 10$ or $x \leq -10$, so i don't see how to conmclude the result from here


I need an image the biggest possible and then show it in landscape. I use koma options in a classic thesis flavour. I don't find any solution to have it bigger than the textwidth but staying in the center of the page.   I have tried with  \KOMAoptions{paper=landscape}  \begin{addmargin}   can anyone help? no solution  Thank you

Based on the first answer from a previous post , I tried to get a figure on an A3 page in my thesis. However, it does not turn out as it should: the picture does not get centered on the page. Otherwise it works. (see below for example output).  What I would like: The picture centered on the page and the caption on the inner half of the A3 page, just as if it were an A4 page. Any ideas? I also do need hyperref working ...   \usepackage[demo]{graphicx} \usepackage{lipsum}  \usepackage{afterpage} \usepackage{changepage} \newenvironment{hugepage}%  {\clearpage   \pagestyle{empty}  % turn off display of page numbers, headers, ...     \changepage{247mm}{370mm}{25mm}{15mm}{}{}{}{}{}} % switch to A3  {\clearpage   \changepage{160mm}{247mm}{25mm}{25mm}{}{}{}{}{}} % back to A4  \begin{document}  \afterpage{%  \pdfpagewidth=2\pdfpagewidth  \pagestyle{empty}  \begin{hugepage}    $\,$   \begin{figure}[!t]      \includegraphics[width=308mm,height=229mm,page=1]{figures/aaa.pdf}     \caption{Left side image A3.}   \end{figure}  \end{hugepage} }  \newpage  \afterpage{%  \pdfpagewidth=2\pdfpagewidth  \pagestyle{empty}  \begin{hugepage}    $\,$   \begin{figure}[!t]      \includegraphics[width=308mm,height=229mm,page=2]{figures/aaa.pdf}     \caption{Right side image A3.}   \end{figure}  \end{hugepage} }  \lipsum{3} \end{document}   Page 2 (the A3 page) looks like this:   The problem is, that the picture is not center aligned. The caption is on the right side of the odd and the even page, but it should be on the right side of the even and on the left side of the odd page.  Other suggested solutions are:   (Not an option since it requires memoir class).   (Which results in non-centered image as well. And the caption got centered as well, but it should not be). Code of which looks like this:  \afterpage{% Insert after the current page \clearpage \KOMAoptions{paper=A3,paper=landscape,pagesize} \recalctypearea \begin{figure}[p] \centering    \includegraphics[width=308mm,height=229mm,keepaspectratio]{largeimage}%    \caption{A large image which required A3} \end{figure} \clearpage \KOMAoptions{paper=A4,pagesize} \recalctypearea }   However, it messes up with the page numbers. (see page 3).


My Xterm always print:      tony@tony-ThinkPad-Edge-E540:~$      I want it to print only   ~$   How can I do that?

Currently it is:   michael@Castle2012-Ubuntu-laptop01:~/Dropnot/webs/rails_v3/linker/spec/controllers$   Outside of renaming my machine and directory structure...  How could I make it be something more like:  michael:controllers$


I'm designing my own Sonoff with ESP32, with power monitoring capability. Now before I start my own design, I took a look at Sonoff design. In the Sonoff POW the power metering IC has a 0R resistor, while the datasheet of HLW8012 did not have any 0R resistor. The 0R an an SMD 1206 resistor, and I don't quite understand its purpose.  What's the purpose of 0R here?  Moreover, Is the transformer enough to make the Mains isolated from the power supply, or we should go for extra safety and mains isolation stuff?

In the , the both 33nF capacitors , 1K resistor and 0.1uF capacitor are connected to GND. I'm not sure where should I connect those ends of components marked with GND symbol, (To Live, To Natural or the DC GND). I can't read Chinese, I don't really know what everything mean there.  Live directly connects to the shunt resistor and this means that live is also GND (0 volt reference) for the chip? Should I connect those end of components marked as GND symbol to Live wire?


I just bought a laptop (Sony Vaio fit 15), is a touch laptop with 8GB RAM, i7 processor (2.00 - 3.10ghz). I have installed Windows 8.1, and I would like to know which exact version of Ubuntu should I buy or download to get the maximum performance.  I'm not an Ubuntu user and I do not know much about Ubuntu, but I want to get started in this.

I'm thinking about installing Ubuntu Desktop, but I don't know what flavor is the best for my system. What are the minimum and recommended hardware requirements? What kind of CPU? How much memory? Should I have Hardware Acceleration? What flavor should I use?  This is an attempt of a canonical answer. My answers have the "official  requirements", the recommended are a mix of official sources and opinion based (along with the answer it's told the source). You can comment or edit if you feel that the information is obsolete or incomplete. It is a good rule of thumb that any system capable of running Windows Vista, 7, 8, x86 (Intel) OS X will almost always be a lot faster with any Ubuntu flavor even if they are lower-spec than described below.


Consider an $n \times n$ matrix $A$ with the property that the row sums all equal the same number $s$. Show that  $s$ is an eigenvalue of $A$. [Hint: Find an eigenvector]  My attempt:  By definition: $Ax = sx$ which implies that $(A - sI)x = 0$  $s$ is an eigenvalue for $A$ iff $\det(A - sI)  = 0$  When you do $A - sI$ the sum of each row is now $0$. I think that's important but I don't know what it means. So this is where I'm stuck

Let $A$ be an $n \times n$ matrix.  $i)$Prove that if the sum of each row of $A$ equals $s$, then $s$ is an eigenvalue of $A$.  $ii)$Prove that if the sum of each column of $A$ equals $s$, then $s$ is an eigenvalue of $A$.  I think that being an eigenvalue of $A$ implies that $sv=Av$ for some vector $v$. Furthermore, I know that $[a_i] = s$ if we let $a_i$ denote the i-th row of $A$. However, I do not seem to be able to find a link between these two facts. Could anyone please help me out?


I'd appreciate any help you can give.  I'm running Win 10 Home build 19041.1052. Recently a new app has mysteriously appeared.  It looks like the MSN taskbar app, which I don't have installed on my system. See attached jpg of weather and task manager.  Notice there's no "MSN" app listed in the task manager.  2 questions:  how do I find this app? how do I permanently uninstall it?  Malwarebytes and AVG say nothing's wrong, but I still don't trust the widget/app/whatever, especially since it doesn't show as any type of installed application.

After the last Windows update (), I got this weather icon on the taskbar and clicking on it shows the news, weather and traffic information. How can I remove it?


trying to copy one char pointer to another but getting segmentation fault, cant really see whats   going on. I also tried doing q = my_strcpy(q, p) but doesnt work. Any help is appreciated.     #include <stdio.h>   char *my_strcpy(char *destination, const char *source);   int main()    {          char *p = "Avani";         char *q = "";         my_strcpy(q, p);         printf("%s", q);         return 0;    }    char *my_strcpy(char *destination, const char *source)      {        char temp = *source;           while (temp != '\0')             {                 *destination = temp;                 // Increment the pointers, so that they point to the next indexes                 source++;                 destination++;                 // Reassign value of temp to the next value                 temp = *source;             }             // Copy the null terminator             *destination = '\0';              // Return pointer to the destination             return destination;         }

The following code receives seg fault on line 2:  char *str = "string"; str[0] = 'z';  // could be also written as *str = 'z' printf("%s\n", str);   While this works perfectly well:  char str[] = "string"; str[0] = 'z'; printf("%s\n", str);   Tested with MSVC and GCC.


Let's say you have a system that removes everything within a square made up of 4 position points. This square is calculated by taking the center point and adding or subtracting the range from this center point seen here: int xmin = x - range; int ymin = y - range; int xmax = x + range; int ymax = y + range;           for (int i = xmin; i <= xmax; i++) {      for (int j = ymin; j <= ymax; j++) {           bounds[j, i] = 0;      } }  How would I change these bounds to be in a circular range instead of a square?

Given staggered isometric map and a start tile what would be the best way to get all surrounding tiles within given radius(middle to middle)?   I can get all neighbours of a given tile and distance between each of them without any problems but I'm not sure what path to take after that. This feature will be used quite often (along with A*) so I'd like to avoid unecessary calculations.  If it makes any difference I'm using XNA and each tile is 64x32 pixels.


The question is the following:     Let $f$ be a polynomial of the ring $R[x_1, \ldots, x_n]$, with $R$ any ring, and let $\mathrm{cont}(f)$ be the ideal generated by the coefficients of $f$. Why if $\mathrm{cont}(f)$ contains a non-zerodivisor of $R$, then $f$ is a non-zerodivisor of $R[x_1, \ldots, x_n]$?

Let $A$ be a commutative ring. I am trying to show that if $f(x_1,x_2,\ldots, x_r) \in A[x_1,x_2,\ldots, x_r]$ is a zero divisor then there exists $a$ in $A-\{0\}$ such that $af=0$ in $A[x_1,x_2,\ldots, x_r]$.    What I have tried so far as following. I am using induction on $r$ (not fixing the ring). The base case is for $r=1$ which I did assuming the minimal degree of $g$ for which $fg=0$ holds. So my induction assumption is for $r \geq 2$ whenever $f$ is in $A[x_1,x_2,\ldots x_r]$, $n<r$ is a zero divisor there is $a$ in $A-\{0\}$ such that $af=0$. So for the final step I take $f(x_1,x_2,\ldots, x_r) \in A[x_1,x_2,\ldots, x_r]$ is a zero divisor. Now since $A[x_1,x_2,\ldots, x_r]=A[x_1][x_2,x_3,\ldots, x_r]$ by induction hypothesis there is $g$ in $A[x_1]-\{0\}$ such that $fg=0$.      I cannot proceed further. Am I correct so far? Please help me. Thank you.


Hey guys i am wondering if it is possible to edit grub at ubuntu 13.04 to show option to boot from live iso image on the hard drive ?, also to show option to boot to ubuntu at same time sure.

I found that it can be done with loopback as follows  menuentry "Lucid ISO" { loopback loop (hd0,1)/boot/iso/ubuntu-10.04-desktop-i386.iso linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=/boot/iso/ubuntu-10.04-desktop-i386.iso noprompt noeject initrd (loop)/casper/initrd.lz }   But it works only with ubuntu or its derivatives. How it should be written if I want to boot other live images like fedora, cent, opensuse etc. ?  Edit: I found some other entries but all of them are probably debian based.  menuentry "Linux Mint 10 Gnome ISO" {  loopback loop /linuxmint10.iso  linux (loop)/casper/vmlinuz file=/cdrom/preseed/mint.seed boot=casper initrd=/casper/initrd.lz iso-scan/filename=/linuxmint10.iso noeject noprompt splash --  initrd (loop)/casper/initrd.lz }  menuentry "DBAN ISO" {  loopback loop /dban.iso  linux (loop)/DBAN.BZI nuke="dwipe" iso-scan/filename=/dban.iso silent -- }   menuentry "Tinycore ISO" {  loopback loop /tinycore.iso  linux (loop)/boot/bzImage --  initrd (loop)/boot/tinycore.gz }   menuentry "SystemRescueCd" {  loopback loop /systemrescuecd.iso  linux (loop)/isolinux/rescuecd isoloop=/systemrescuecd.iso setkmap=us docache dostartx  initrd (loop)/isolinux/initram.igz }   Edit2: How to chainload grub and syslinux from grub2?  Edit3: I want to boot other live images without any removable devices and use grub2 so need menu entries specific to grub2.


I have a question about the TexMaker editor. In some cases the auto correct does not find typing errors in the script, and I don't know why, it seems strange to me, but seems to be linked to the use of citations. Here a screenshot of the problem.     Have you encoutered such a problem ?

more like a "Bug"-Report, but maybe anyone knows a good workaround?  I use latest texMaker on Mac, with biblatex and using \parencite{}. It seems the spellchecking ignores everything before the \parencite{}.  See example Image, marked text gets ignored and after \parentcite{} it works.    EDIT: Thanks for the quick response! Here are some more minimal tests.    Texmaker 5.0.2  Packages:  \usepackage[english]{babel} \usepackage[latin1]{inputenc} \usepackage[]{multicol} \usepackage[nameinlink,noabbrev, english]{cleveref} \usepackage{blindtext}   and a few PDF Packages, if needed I can give full list.  Cheers Hannes


I am a newbie when it comes to java web programming. I tried doing a javamail code. here is my code      import java.util.Properties;..       public class SendEmail {      public void sendEmail(final CodeToEmailCommand emailSender) {       try {         Properties props = System.getProperties();          props.put("mail.transport.protocol", "smtp");         props.put("mail.smtp.host", "smtp.gmail.com");         props.put("mail.smtp.auth", "true");         props.put("mail.smtp.port", "465");         props.put("mail.smtp.socketFactory.class", "javax.net.ssl.SSLSocketFactory");         props.put("mail.smtp.socketFactory.port", "465");         props.put("mail.smtp.socketFactory.fallback", "false");         props.put("mail.smtp.ssl.trust", "*");          Session mailSession = Session.getDefaultInstance(props, new javax.mail.Authenticator() {             protected PasswordAuthentication getPasswordAuthentication() {                 return new PasswordAuthentication(emailSender.getUsername(), emailSender.getPassword());             }         });          mailSession.setDebug(true);          Message mailMessage = new MimeMessage(mailSession);          mailMessage.setFrom(new InternetAddress(emailSender.getFromEmail()));         mailMessage.setRecipient(Message.RecipientType.TO, new InternetAddress(emailSender.getToEmail()));         mailMessage.setSubject(emailSender.getSubject());          mailMessage.setContent(emailSender.getMessage(), "text/html");         mailMessage.setSubject(emailSender.getSubject());         Transport transport = mailSession.getTransport("smtp");         transport.connect("smtp.gmail.com", emailSender.getUsername(), emailSender.getPassword());         transport.sendMessage(mailMessage, mailMessage.getAllRecipients());      } catch (Exception ex) {         ex.printStackTrace();     }      }     }   But it kept giving me this exception  DEBUG: setDebug: JavaMail version 1.4.4 DEBUG: getProvider() returning javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.s mtp.SMTPTransport,Sun Microsystems, Inc] DEBUG SMTP: useEhlo true, useAuth true DEBUG SMTP: trying to connect to host "smtp.gmail.com", port 465, isSSL false javax.mail.MessagingException: Could not connect to SMTP host: smtp.gmail.com, port: 465;   nested exception is:     javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException:  PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderExc eption: unable to find valid certification path to requested target      ..   I tried changing ports. Enabling firewall (in cmd) but it is still not working. Pls. Help. I am running out of ideas

Is it possible to send an email from my Java application using a GMail account?  I have configured my company mail server with Java app to send email, but that's not going to cut it when I distribute the application. Answers with any of using Hotmail, Yahoo or GMail are acceptable.


So suppose I only have 6 sided dice, or D6. I want to play an RPG where a D20, or D10 is required. Can I simulate a D20 or D10 or any other sided die, using one or more D6?

Just for fun, I am trying to find a good method to generate a random number between 1 and 10 (uniformly) with an unbiased six-sided die.  I found a way, but it may requires a lot of steps before getting the number, so I was wondering if there are more efficient methods.  My method:   Throw the die and call the result $n$. If $1\leq n\leq 3$ your number will be between $1$ and $5$ and if $4\leq n\leq 6$ your number will be between $6$ and $10$. Hence, we reduced to the problem of generating a random number between $1$ and $5$. Now, to get a number between $1$ and $5$, throw the die five times. If the $i$th throw got the largest result, take your number to be $i$. If there is no largest result, start again until there is.   The problem is that although the probability that there will eventually be a largest result is $1$, it might take a while before getting it.  Is there a more efficient way that requires only some fixed number of steps? Edit: Or if not possible, a method with a smaller expected number of rolls?


I realized that cat sth and cat < sth both happen to give same output. Are they the same?

I was working through a tutorial and saw use of both cat myfile.txt and cat < myfile.txt. Is there a difference between these two sequences of commands? It seems both print the contents of a file to the shell.


When I run a program (for example grep or ls) without a pager, its output is colored. However when I run it piping its output to less, no colors are shown.  For example, this command outputs colored output:  grep -r something   but this doesn't:  grep -r something | less   Why? How can I see colors through less?

I have installed python-pygments and using it for syntax highlighting with less as described by mankoff  I put a function in my .bashrc  cless () {     pygmentize -f terminal "$1" | less -R }   it is enabling syntax highlighting with less. But when I am going to open a file like /etc/fstab or /etc/apt/apt.conf a error saying  Error: no lexer for filename '/etc/apt/apt.conf' found   I found option to show pygmentize the lexer with -l at this . But what will be the appropriate lexer for such files? and how to use it?


I'd like to make a chart of every family member I know of, similar to    I don't want a pedigree showing all ancestors (like ) but a chart including every niece, in-law, and grand-uncle I know of. I have a GEDCOM file with 140 people in it so far.  I made a "Family Lines Graph" using Gramps.  (1) Is there an efficient way to include everyone as People of Interest? Like a "select all" function?  (2) Are there other programs that can prepare similar charts? I think the Gramps chart isn't very pretty, and it would be great if I could, e.g., make the vertical position of family members correspond to their date of birth or marriage, or if I could emphasize some people by making their pictures bigger.

I have now almost completed my family tree, having each branch going back to approximately the French revolution, discovering dozens of previously unknown ancestors.  I would like to share the family tree with my family, the problem is that I cannot have a tree in a nice format that could be printed on a standard A4 sheet (maybe using both sides or whathever).  I have a SVG tree that use graphics, but it is unconventionally large and if scaled down to a A4 sheet, the text would be so small that it would not be legible. The maximum width is of about 50 ancestors of a generation, then it goes sparse again.  I'd like to know if a format exist where the family tree (with direct ancestors only) would be printable, with names but also other complementary information, and the format should be printable as not all my family users are particularly skilled with computers.


I'm planning on playing a grapple-oriented monk in my group's next 5e campaign, and was wondering about Martial Arts unarmed attacks while grappling.  Can a monk grapple a single target, attack them with a one-handed weapon, and then make an unarmed strike off of that attack?  I'm pretty sure I can do so if my non-grappling hand isn't holding a weapon, but I think the rules suggest that I can't do this if my non-grappling hand is holding a weapon.

What are the global restrictions of making an unarmed strike? As it is considered a weapon, I suppose one must have a "hand free" to "punch". However, there are some gray areas I can't find any answers to.  For example, the Monk class allows a player to add an additional unarmed strike to his Attack action, as a bonus action. If one is using a Versatile weapon, can he attack using both hands, making the damage 1d8 and still make use of his additional unarmed strike(s)?  Additional remark: The extra unarmed strike granted by Flurry of Blows has no restrictions regarding the weapon(s) held. Am I missing any implied restrictions here? Or is a Monk somehow able to hold a two-handed weapon and still make use of Flurry of Blows ? If that is the case, I am to believe the unarmed strike from FoB would not be considered as weapons.  Would that also mean that if a monk is wielding a quarterstaff with two hands, he could open with an attack of [1d8 + Dex] damage, followed by an unarmed strike of [1d6 + Dex] damage with a bonus action (using Martials Arts) ?


I am trying to figure out if it is possible to browse my favorite questions by tags (similar to how we browse normal questions), but I don't know exactly how I can do this.  Does anyone know how can I do that? Or is such functionality not currently available for favorite questions?

Favorite questions on Stack Overflow I feel is highly unused feature of all the features provided on the site. (This again is my personal opinion)  I have favorited around 90 question till date and it gets very very very difficult if I want to search for a question which I remember I have favorited, which defeats the entire purpose of one favouriting a question, so here is my small suggestion.  Favorites by tags  Screen 1        Screen 2        Please share your opinions on this.


Why is gravitational potential energy negative? How is it different from other forms of energy? I recently saw a video by Dr. Michio Kaku, he said that the total energy content of the universe is zero, since gravitational potential energy is negative, thus balancing all the positive energy. Can anyone help me out here?

I usually think of gravitational potential energy as representing just what it sounds like:  the energy that we could potentially gain, using gravity.  However, the equation for it (derived by integrating Newton's law of gravitational force)...  $$PE_1 = -\frac{GMm}{r}$$  ..has me thrown for a loop, especially after .   If potential energy really meant what I thought it did, then it would always have to be non-negative... but this equation is always negative.  So what does "negative potential energy" mean!? If $KE + PE$ is always a constant, but PE is not only negative but becomes more negative as the particles attract, doesn't that mean the kinetic energy will become arbitrarily large?  Shouldn't this mean all particles increase to infinite KE before a collision? If we are near the surface of the earth, we can estimate PE as $$PE_2 = mgh$$ by treating Earth as a flat gravitational plane.  However, $h$ in this equation plays exactly the same role as $r$ in the first equation, doesn't it?   So why is $PE_1$ negative while $PE_2$ is positive?  Why does one increase with $h$ while the other increases inversely with $r$? Do they both represent the same "form" of energy?  Since $PE_2$ is just an approximation of $PE_1$, we should get nearly the same answer using either equation, if we were near Earth's surface and knew our distance to its center-of-mass.  However, the two equations give completely different answers!  What gives!?    Can anyone help clear up my confusion?


Let's say we have the expression $a^b \mkern-10mu\mod\! c$ and $b$ is really large, e.g. $37^{165}\mkern-10mu\mod 65$.  How to work this out by hand?  There's a way to avoid the large exponent.

I've read about Fermat's little theorem and generally how congruence works. But I can't figure out how to work out these two:   $13^{100} \bmod 7$ $7^{100} \bmod 13$   I've also heard of this formula:  $$a \equiv b\pmod n \Rightarrow a^k \equiv b^k \pmod n $$  But I don't see how exactly to use that here, because from $13^1 \bmod 7$ I get 6, and $13^2 \bmod 7$ is 1. I'm unclear as to which one to raise to the kth power here (I'm assuming k = 100?)  Any hints or pointers in the right direction would be great.


I have removed the harddisk and plugged into another PC running Windows and tried to get the data through but couldn't. Can anyone guide me on how can I get the data, because I cannot get to my lockscreen in Ubuntu Version 18.04.

For some reason I can't boot my system. I get an error akin to Operating System Not Found.   I tried bootrepair, and that didn't work. So then I decided I would just save my personal files, wipe everything, and reinstall.   But in the live session, when I go to the /home directory, my username folder isn't there, instead it goes to the Live CD's desktop and other directories. Is there some other error occurring? Is there a way to recover the files?


There's a folder on my desktop called like 'example' and when I try to delete it it says "You require permission from the computer's admistrator to make changes to this folder" when checking the properties; the Current owner says "Unable to display current owner."  I have tried many solutions found online, including enabling & signing into the adminstrator account, but haven't been able to fix it. My situation is extremely similar .  I can't even open the folder. I am running Windows 7 x64 Home Premium. I can't do anything to the folder because I need permission from my 'computer administrator' It's extremely weird, and I can't fix it. Thanks in advance!  UPDATE: Yes, I'm adminsitrator on my computer.

I'm unable to delete some folder on my external hard disk. I tried them to delete in safe mode too but I'm not able to perform this. This is a big headache to me now. Even I'm the admin and it still needs the admin privileges to delete them. So how can I get rid of from this trouble?  Please help me!


Could anyone explain the contradiction that he will use to prove the theorem?  Especially when he said that:" the idea now is to construct a family of trigonometric functions ${p_{k}}$ that peaks at 0, and so that $$\int p_{k}( \theta) f(\theta) d\theta \rightarrow \infty as\ k\ \rightarrow \infty.$$ This will be our contradiction, since those integrals tends to zero by assumption."  I do not see what is the assumption that makes them tends to zero and why the integral above tends to $\infty.$      Thanks. they are attached in the following photos.

Theorem 2.1 : Suppose that $f$ is an integrable function on the circle with $\hat f(n)=0$ for all $n \in \Bbb Z$. Then $f(\theta_0)=0$ whenever $f$ is continuous at the point $\theta_0$.      Proof : We suppose first that $f$ is real-valued, and argue by contradiction. Assume, without loss of generality, that $f$ is defined on $[-\pi,\pi]$, that $\theta_0=0$, and $f(0) \gt 0$.      Since $f$ is continuous at $0$, we can choose $ 0\lt \delta \le \frac \pi2$, so that $f(\theta) \gt \frac {f(0)}2$ whenever $|\theta| \lt \delta$. Let $$p(\theta)=\epsilon + \cos\theta,$$   Where $\epsilon \gt 0$ is chosen so small that $|p(\theta)| \lt 1 - \frac \epsilon2$, whenever $\delta \le |\theta| \le \pi$. Then, choose a positive $\eta$ with $\eta \lt \delta$, so that $p(\theta) \ge 1 + \frac \epsilon2$, for $|\theta| \lt \eta$. Finally, let $p_k(\theta)=|p(\theta)|^k$, and select $B$ so that $|f(\theta)| \le B$ for all $\theta$. This is possible since $f$ is integrable, hence bounded.      By construction, each $p_k$ is a trigonometric polynomial, and since $\hat f(n)=$ for all $n$, we must have $\int_{-\pi}^{\pi} f(\theta)p_k(\theta)\,d\theta=0$ for all $k$.   I understood the first paragraph clearly. But the rest is not making it's way into my head.   In the beginning of second paragraph, how does the given range works for choosing $\delta$? If the continuity is used to get the range, then how? How can we choose $\epsilon$ so small such that, $|p(\theta)| \lt 1 - \frac \epsilon2$, whenever $\delta \le |\theta| \le \pi$? How can we choose positive $\eta$ with $\eta \lt \delta$, so that $p(\theta) \ge 1+ \frac \epsilon2$, for $|\theta| \lt \eta$. Why do we must have $\int_{-\pi}^{\pi}f(\theta)p_k(\theta)\,d\theta=0$ for all $k$?


I see the character    in many papers, which looks different than the standard math character $z$.  Why is this character used, and what is the command for it?

I noticed that the letter z is different from other font. Is there any special command for this?


I know that muggle-borns get escorts and such, and that their letters are delivered in person, but what happens if they have school on their birthday? Does the escort return on the weekend, or do they wait for summer or what?

A lot of the fanfiction seems to like to give Hermione her letter in September to coincide with her birthday. That just doesn't seem very logical for the Statute of Secrecy, as you then have 10 out of every 12 10-year-old wizards and witches knowing about magic while finishing the school year (assuming even distribution of birthdays).   It seems to me that this is just asking at least one of them to brag about knowing magic and spill the secret.   Also this would mean that the poor kid born on 30 of August would only have 2 days to adjust to being magical before being shepherded off to a boarding school in the middle of nowhere.  From another point of view, getting such news on your birthday can screw up a lot of celebration plans.  Also, from rereading the memory from Dumbledore where he introduced magic to Tom, there is no mention of snow or even closeness to his birthday from the caretaker.  I believe this view came from the fact that Harry got his letter on his birthday but that piece of fanon seems to forget that letters were being sent up to at least a week or 2 beforehand (leading to the Dursleys hiding on a rock in the sea in the first place).


I am trying to replace all occurrences of a keyword inside an html document except those that are found inside a button, anchor or image tag. I have created a fiddle with the code that I am working with: Could I please have some help getting the correct regular expression to exclude occurrences found inside images, anchors and buttons?   jQuery(document).ready(function($) {   var keyword = 'ARC';    $('p, h1, h2, h3, h4, h5, h6, td, th, li').each(function() {     var src_str = $(this).html();     var pattern = new RegExp('(?<!<button.*?>||)' + keyword + '(?!\/?>|<\/a>|<\/button>)', "gi");      var match = pattern.exec(src_str);     if (match) {       $(this).html(src_str.replace(pattern, '' + keyword + ''));     }   }); });
   About the ARC

   ARC activity & recreation center Columbia Parks And RecreationThe ARC is Columbia, Missouri’s popular health club, fitness center, and place to exercise and have fun. This 73,000 sq. ft. facility has an indoor leisure pool, gymnasium (including basketball,   volleyball, and pickleball), strength training equipment and weights, cardio equipment, indoor track, group exercise classes, and much more! ARC Link <button>ARC Link</button>

I basically need to highlight a particular word in a block of text. For example, pretend I wanted to highlight the word "dolor" in this text:
     Lorem ipsum dolor sit amet, consectetuer adipiscing elit.

     Quisque bibendum sem ut lacus. Integer dolor ullamcorper libero.     Aliquam rhoncus eros at augue. Suspendisse vitae mauris.
  How do I convert the above to something like this:
     Lorem ipsum dolor sit amet, consectetuer adipiscing elit.

     Quisque bibendum sem ut lacus. Integer dolor ullamcorper     libero. Aliquam rhoncus eros at augue. Suspendisse vitae mauris.
  Is this possible with jQuery? Edit: As  , this is quite possible without jQuery - but I was hoping there might be a special method of jQuery which would let you do selectors on the text itself. I'm already using jQuery heavily on this site, so keeping everything wrapped up in jQuery would make things perhaps a bit more tidy.


Let $f$ a concave function such as $f(0)=0$.  $$f :\mathbb{R^+}\rightarrow \mathbb{R}$$  I want to prove that, for all $x,y\in \mathbb{R^+}$: $f(a+b)\leq f(a)+f(b)$  My idea: Since $f$ is concave then for all $t\in [0,1]$, $f(t.a+(1-t)b \geq tf(a)+(1-t)f(b).$  And by taking $t=1/2$ then we'll have : $f((a+b)/2)\leq 1/2(f(a)+f(b)).$  and if we take $b=0$, then we'll have $f(ta)\geq tf(a)$  But I could not get to resault.

Well If I've got a nice understanding, this proof involves the use of Rolle's and/or Mean Value Theorems. But I don't even an idea of how to start. We already know that  $$f\text{ concave}\Rightarrow f''<0$$ but, then...


When modeling data sampled in the field, I often come across the problem of determining the Family of the dependent variable for GLM (or GLMM). An example: in an ecological study, I have ~ 60 patches.  I have sampled territories of an animal species within these patches as well as a set of explanatory variables.  The number of territories per patch (NTP) is the dependent variable in a GLM.   NTP is integer with values between 0 and 14:      How can I test for the family of NTP?  Any help appreciated as this is an issue many ecologists come across each time they conduct statistical analysis.

I have fish density data that I am trying to compare between several different collection techniques, the data has lots of zeros, and the histogram looks vaugley appropriate for a poisson distribution except that, as densities, it is not integer data. I am relatively new to GLMs and have spent the last several days looking online for how to tell which distribution to use but have failed utterly in finding any resources that help make this decision. A sample histogram of the data looks like the following:   I have no idea how to go about deciding on the appropriate family to use for the GLM. If anyone has any advice or could give me a resource I should check out, that would be fantastic.


I was reading a piece on the comparison of APS-C to full frame sensors. In this article, it mentioned that full frame sensors can have larger individual "photo sites", and can therefore capture more light.  Here is the quote...     It is not the number of pixels that really counts - APS-C models such   as Canon's EOS 7D and EOS 550D have almost as many photosites, thanks   to their 18-million pixel count - but the size of the photosites is   crucial to image quality.      Bigger individual light sensors capture more light - and this means   that less electronic noise is created. You notice this most as you   increase the ISO setting - with this noise creating a coloured mosaic   pattern that is particularly noticeable in shadow areas.   Is this true? If I control for variables like aperture relative to the sensor, would a full frame sensor get higher exposure?

Lots of people say that full frame sensors receive more light than cropped sensors. I have never found a proof of this claim so I tried to do the computation by myself, and proved the contrary! Could you tell me if I am wrong ?  We want to compare the same frame with the same depth of field. I'm not concerned by the quantity of photons by photosite, which is unrelated to sensor size but to the density of pixels. I have neglected effects like vignetting or angle effect on the edge of the micro-lens array. Here is my simple reasoning :  If you want the same  α~2arctan(size/2f) with a full-frame sensor and a crop sensor with crop ratio c, you have to multiply the focal length by approximately c. Now, in order to maintain the , the f-number N have to be divided by c. If we measure the "amount of light" with the well defined  Ev provided by the same frame of the same scene (so the  is fixed), we have Ev ~ f/N.  Putting all together, Ev_crop = Ev_ff x c², so the cropped sensor receive more light than the full frame sensor !  For those who are interested in the price of two equivalent systems, one with a FF+50mm+135mm and the other with Crop+35mm+85mm, see this .


I want to make an function which will take variable number of arguments of different types. My problem is how can i parse the argument types. Like caller can pass arguments of any type in any order (without specifying format specifier). So at the calling function how can i differentiate between types.  How to print all values passed by the caller in the function var_argument ?   Let say I want to do sprintf inside var_argument function of the parameters passed by the caller  Here is my C code  #include <stdio.h> #include <stdarg.h> void var_argument(int num,...);  int main() {  var_argument(3,"Hello",7.87f,6);  var_argument(3,7.87f,"Hello",6);  return 0; }  void var_argument(int num,...) {  char str[80]; /* What code should I write to differentiate between types and to print all the values passed by the caller */        va_list list;  va_start(list,num);   /* How to do sprintf of the parameter passed to this function and store   the formatted output in the array str  */ }

Say I have a C function which takes a variable number of arguments: How can I call another function which expects a variable number of arguments from inside of it, passing all the arguments that got into the first function?  Example:  void format_string(char *fmt, ...);  void debug_print(int dbg_lvl, char *fmt, ...) {     format_string(fmt, /* how do I pass all the arguments from '...'? */);     fprintf(stdout, fmt);  }


There seem to be quite few tutorials for that but they are either for having both live and installed, or supporting old 32 bit systems and so on and have some complicated steps. I simply want to install it on a USB drive like I would install it on a HDD and have it boot on both UEFI (my macbook pro) and BIOS systems (desktop PCs).  I just tried that by booting from live install pendrive and installing to the other, but since the laptop had HDD with its own install, the installation process was offering to install on just that. When I choosed to do something else from the install, and selected the usb drive, it installed it but didn't work. I have no idea how to create the necessary partitions on my own, so that might be the reason. So, is there an easy way to do this since i'm really unexperienced?

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.


A Thinkpad T61p died (motherboard), I think hdd is ok.   I then mounted the hdd in a Thinkpad R61i; after hardware change warning, it gave BSOD and instantly shut down.   Is it possible to maintain the Windows installation on this disk?  In case how can I best make this happen?   EDIT: I have a full Windows 7 license (not OEM).

I have a Windows 7 64-bit installation on my current PC, and I want to move it to a new PC .. I do NOT have a problem with licensing, as the new system already has its own new Windows 7 license, which I intend to use.  I want to use my existing installation, because it has 3 years worth of installed office related software development software, which installing again could take weeks !  I'm assuming that I can use Windows 7's Backup and Restore feature to backup a system image to a network location, then restore that network stored system image on the new PC ?  Again, like I said, I don't have a WIndows 7 licensing issue, as both machines are corporate provided and come with their own licences.


My android and PC has been hacked. Apps are being manipulated. Private data is remotely fetched. Files and photos from my PC are also fetched. The apps are being manipulated in runtime as well.   I work from home. So my most important data is on phone and PC. I am a poet and a blogger. The most intimidating issue is I found changes in my drafts which I didn't make. Also some drafts are missing. I am really terrified.   My question:  Can I get back the full control and saftety to store my data privately again? There must be some solution, how to get back full control of phone and computer again? How to prevent data from theft after reset?  Thanks.

What should I do if my Windows computer seems to be infected with a virus or malware?  What are the symptoms of an infection? What should I do after noticing an infection? What can I do to get rid of it? how to prevent from infection by malware?   This question comes up frequently, and the suggested solutions are usually the same. This community wiki is an attempt to serve as the definitive, most comprehensive answer possible. Feel free to add your contributions via edits.


I am surprised that I get an error when I add Verbatim to content of minipage that had \fbox around it. Removing the \fbox removes the error. But I need to put frame around the minipage. I can't use framed package, since tex4ht does not work with it () that is present in texlive 2014.  MWE  \documentclass[]{article} \usepackage{fancybox,fancyvrb}     \begin{document} \fbox{ \begin{minipage}[t]{\textwidth} \begin{enumerate} \item one       \begin{Verbatim}     this is verbatim   \end{Verbatim}     \item two \end{enumerate} \end{minipage} } \end{document}   error  >lualatex foo.tex This is LuaTeX, Version beta-0.79.1 (TeX Live 2014) (rev 4971)   restricted \write18 enabled. (./foo.tex LaTeX2e <2014/05/01> Babel <3.9l> and hyphenation patterns for 79 languages loaded. (/usr/local/texlive/2014/texmf-dist/tex/latex/base/article.cls Document Class: article 2014/09/29 v1.4h Standard LaTeX document class (/usr/local/texlive/2014/texmf-dist/tex/latex/base/size10.clo)) (/usr/local/texlive/2014/texmf-dist/tex/latex/fancybox/fancybox.sty Style option: `fancybox' v1.4 <2010/05/15> (tvz) ) (/usr/local/texlive/2014/texmf-dist/tex/latex/fancyvrb/fancyvrb.sty Style option: `fancyvrb' v2.7a, with DG/SPQR fixes, and firstline=lastline fix  <2008/02/07> (tvz) (/usr/local/texlive/2014/texmf-dist/tex/latex/graphics/keyval.sty)) (./foo.aux) Runaway argument? this is verbatim \end {Verbatim}  ! Paragraph ended before \FV@BeginScanning was complete. <to be read again>  \par  l.18 }  ?    When removing the \fbox, it works:  \documentclass[]{article} \usepackage{fancybox,fancyvrb} \begin{document} \begin{minipage}[t]{\textwidth} \begin{enumerate} \item one \begin{Verbatim}  this is verbatim \end{Verbatim} \item two \end{enumerate} \end{minipage} \end{document}   Using framed works in pdf, but not in tex4ht, so I can't use it.   \documentclass[]{article} \usepackage{fancybox,fancyvrb} \usepackage{framed}  %can't use this in tex4ht \begin{document} \begin{framed} \begin{minipage}[t]{\textwidth} \begin{enumerate} \item one \begin{Verbatim}  this is verbatim \end{Verbatim} \item two \end{enumerate} \end{minipage} \end{framed} \end{document}  htlatex foo.tex (/usr/local/texlive/2014/texmf-dist/tex/generic/tex4ht/html4.4ht) (/usr/local/texlive/2014/texmf-dist/tex/generic/tex4ht/html4-math.4ht)) (./foo.aux) ! You can't use `\prevdepth' in horizontal mode. \nointerlineskip ->\prevdepth                                -\@m \p@  l.19 \end{framed}  ?    So I am stuck now. I need a way to put frame around some text, that contains Verbatim, that is all, but have it work with both pdf and tex4ht. That is why I am using \fbox and minipage  Is there a way to make \fbox work with the minipage having Verbatim in it?  Why adding fbox gives an error with Verbatim in minipage? So many strange interactions between Latex packages.  texlive 2014 and Miktex 9

Typically, to box in some text, I use the following:  \fbox {     \parbox{\linewidth}{     This is some text! Blah blah blah...     } }   However, say I have a verbatim block within that. It will never compile. Anyone know how I could draw a box around text which contains a verbatim block? I should note that I want to be able to draw a box around not just a verbatim block. For example, I would want to draw a box around something like:  This is text. \begin{verbatim} This is some more text. \end{verbatim} And this is even more text.


Does the standard normal distribution have a heavy right tail? How to prove it? Does the standard log-normal distribution have a heavy right tail? How to prove it? Thanks!

(This is based on a question that just came to me via email; I've added some context from a previous brief conversation with the same person.)  Last year I was told that the gamma distribution is heavier tailed than the lognormal, and I've since been told that's not the case.   Which is heavier tailed? What are some resources I can use to explore the relationship?


I'm trying to modify a JTextField's text when a row in a table is selected, however when I select a row, a NullPointerException is thrown and I can't seem to find a solution.  table.getSelectionModel().addListSelectionListener(new ListSelectionListener() {         @Override         public void valueChanged(ListSelectionEvent event) {              if (!event.getValueIsAdjusting() && !recordTable.getSelectionModel().isSelectionEmpty()) {                  field.setText("Test!");             }         }     });   ERROR:  Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException at packagename.MOTFrame$1.valueChanged(RecordFrame.java:127) at javax.swing.DefaultListSelectionModel.fireValueChanged(DefaultListSelectionModel.java:184) at javax.swing.DefaultListSelectionModel.fireValueChanged(DefaultListSelectionModel.java:154) at javax.swing.DefaultListSelectionModel.setValueIsAdjusting(DefaultListSelectionModel.java:685) at javax.swing.plaf.basic.BasicTableUI$Handler.setValueIsAdjusting(BasicTableUI.java:953) at javax.swing.plaf.basic.BasicTableUI$Handler.mouseReleased(BasicTableUI.java:1166) at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:290) at java.awt.Component.processMouseEvent(Component.java:6533) at javax.swing.JComponent.processMouseEvent(JComponent.java:3324) at java.awt.Component.processEvent(Component.java:6298) at java.awt.Container.processEvent(Container.java:2236) at java.awt.Component.dispatchEventImpl(Component.java:4889) at java.awt.Container.dispatchEventImpl(Container.java:2294) at java.awt.Component.dispatchEvent(Component.java:4711) at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4888) at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4525) at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4466) at java.awt.Container.dispatchEventImpl(Container.java:2280) at java.awt.Window.dispatchEventImpl(Window.java:2746) at java.awt.Component.dispatchEvent(Component.java:4711) at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758) at java.awt.EventQueue.access$500(EventQueue.java:97) at java.awt.EventQueue$3.run(EventQueue.java:709) at java.awt.EventQueue$3.run(EventQueue.java:703) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:90) at java.awt.EventQueue$4.run(EventQueue.java:731) at java.awt.EventQueue$4.run(EventQueue.java:729) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80) at java.awt.EventQueue.dispatchEvent(EventQueue.java:728) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93) at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)   Any help is greatly appreciated.

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


Hello everyone i would like to know if the PHP code used by me for registration in my Android App is vulnerable to Mysql Injection or not.  I would also like to know if the Android Apps are vulnerable or not to Mysql Injection and if anyone has any advice to give me on how to defend myself from these attacks.    <?php      if($_SERVER['REQUEST_METHOD']=='POST'){   // echo $_SERVER["DOCUMENT_ROOT"];  // /home1/demonuts/public_html //including the database connection file        include_once("config2.php");             $idAKr = $_POST['idAKr'];     $cell = $_POST['cellulare'];     $nome = $_POST['nome'];     $cognome = $_POST['cognome'];     $data = $_POST['data_nascita'];     $sesso = $_POST['sesso'];     $ristorante = $_POST['ristorante'];         if($nome == '' || $cognome == '' || $data == '' || $ristorante =='' ){             echo json_encode(array( "statusr" => "false","message" => "Inserisci tutti i dati") );      }else {                           $query= "SELECT * FROM Ristoratori WHERE nome='$nome' AND cognome='$cognome' AND data_nascita='$data' ";             $result= mysqli_query($con, $query);                       if(mysqli_num_rows($result) > 0){                  echo json_encode(array( "statusr" => "false","message" => "Utente già registrato!") );             }else if{             $query= "SELECT * FROM Ristoratori WHERE ristorante='$ristorante'";             $result= mysqli_query($con, $query);                       if(mysqli_num_rows($result) > 0){                  echo json_encode(array( "statusr" => "false","message" => "Nome ristorante già in uso") );                          }             else             {               $query = "INSERT INTO Ristoratori (idAKr,cellulare,nome,cognome,data_nascita,sesso,ristorante) VALUES ('$idAKr','$cell','$nome','$cognome','$data','$sesso','$ristorante')";              if(mysqli_query($con,$query)){                                   $query= "SELECT * FROM Ristoratori WHERE nome='$nome' AND cognome='$cognome' AND data_nascita='$data' AND ristorante='$ristorante' ";                          $result= mysqli_query($con, $query);                      $emparray = array();                          if(mysqli_num_rows($result) > 0){                            while ($row = mysqli_fetch_assoc($result)) {                                      $emparray[] = $row;                                    }                          }                 echo json_encode(array( "statusr" => "truer","message" => "Registrazione completata!" , "datar" => $emparray) );              }else{                  echo json_encode(array( "statusr" => "false","message" => "Errore") );             }         }                 mysqli_close($con);      }      } else{             echo json_encode(array( "statusr" => "false","message" => "Errore") );     }    ?>     thank you.

If user input is inserted without modification into an SQL query, then the application becomes vulnerable to , like in the following example:  $unsafe_variable = $_POST['user_input'];   mysql_query("INSERT INTO `table` (`column`) VALUES ('$unsafe_variable')");   That's because the user can input something like value'); DROP TABLE table;--, and the query becomes:  INSERT INTO `table` (`column`) VALUES('value'); DROP TABLE table;--')   What can be done to prevent this from happening?


Find all integers n having the property that $\frac{2^n+1}{n^2}$ is an integer. Just by playing around with the problem and trying possibilities, I was able to find 1 and 3 as solutions, but I'm not sure how to prove that these are the only cases that work. Thank you so much for the help!

Find all $n>1$ such that $\dfrac{2^n+1}{n^2}$ is an integer.   I know that $n$ must be odd, then I don't know how to carry on. Please help. Thank you.


I am using the below code to print a specific part from a Page.
  THIS PART WILL NOT BE PRINTED

    THIS PART WILL BE PRINTED
   Problem is still page no , web address date shows in the print . I want to remove these . Check the attached image . I want to remove yellow parts     Any idea ?

I want to remove the URL that gets printed on the bottom of the page.   like:  yomari.com/.../main.php?sen_n   How can it be omitted or prevent from getting printed?  To be more specific, is there any way I can prevent the page URL, date and the page title being printed along, while printing the web page?


My friend is saying  $$8(\arctan(\sqrt2-1)) = \pi$$ I know $4\arctan(1) = \pi$  I thought of $4\arctan(\sqrt2-1) + 4\arctan(\sqrt2-1)$  But I got stuck somewhere  How to solve?

Show that  $\tan {\pi  \over 8} = \sqrt 2  - 1$, using the identity $\tan 2\theta  = {{2\tan \theta } \over {1 - {{\tan }^2}\theta }}$    Using $\tan 2\theta  = {{2\tan \theta } \over {1 - {{\tan }^2}\theta }}$ with $\theta  = {\pi  \over {16}}$:  $\eqalign{   & \tan {\pi  \over 8} = {{2\tan {\pi  \over {16}}} \over {1 - {{\tan }^2}{\pi  \over {16}}}}  \cr    & \tan {\pi  \over 8} = 0.41421.... \cr} $  I essentially get an answer equivalent to $\sqrt 2  - 1$ but not an "exact" answer, how do I go about this question to get a result in "exact" form?  Thank you.


Why does friction does not depend upon area of contact ? Now we know that friction=(coefficient of friction)*Normal.So also is, why does friction arise.Is it because of the irregularities of a surface or because of the electrostatic forces in between the surfaces?

Is  really independent of area? The friction force, $f_s = \mu_s N$. The equation says that friction only depends on the normal force, which is $ N = W = mg$, and nature of sliding surface, due to $\mu_S$.   Now, less inflated tires experiences more friction compared to well inflated tire. Can someone give clear explanation, why friction does not depend on area, as the textbooks says?


Let $(a_n)$ be a non-zero real sequence with $\left (\frac{a_{n+1}}{a_n} \right)$ bounded. How might we prove that $$\liminf_{n\to\infty} \, \frac{|a_{n+1}|}{|a_n|} \leq \liminf_{n\to\infty} \, |a_n|^{\frac{1}{n}}$$ I've tried a number of approaches, including stuff with the AM-GM inequality, but haven't quite been able to get it out. Thanks for the help.

This may have been asked before, however I was unable to find any duplicate. This comes from  of "Mathematical Analysis: An Introduction" by Browder. Problem 14:     If $(a_n)$ is a sequence in $\mathbb R$ and $a_n > 0$ for every $n$. Then show:   $$ \liminf(a_{n+1}/a_n) \le \liminf((a_n)^{(1/n)}) \le \limsup((a_n)^{(1/n)}) \le \limsup(a_{n+1}/a_n)$$   The middle inequality is clear. However I am having a hard time showing the ones on the left and right. (It seems like the approach should be similar for each). This is homework, so it'd be great if someone could give me a hint to get started on at least one of the inequalities.  Thanks.


I can't seem to use \includepdf simultaneously with \tikzexternalize. main.tex: \documentclass{article} \usepackage{pdfpages} \usepackage{tikz} \usetikzlibrary{external} \tikzexternalize  \begin{document} \includepdf[pages=-]{test.pdf} \begin{tikzpicture}   \node at (0, 0) {Yay for TikZ}; \end{tikzpicture} \end{document}  Command: latexmk -pdf -outdir=out --shell-escape  Log output: ===== 'mode=convert with system call': Invoking 'pdflatex -shell-escape -halt-o n-error -interaction=batchmode -jobname "main-figure0" "\def\tikzexternalrealjo b{main}\input{main}"' ======== runsystem(pdflatex -shell-escape -halt-on-error -interaction=batchmode -jobname  "main-figure0" "\def\tikzexternalrealjob{main}\input{main}")...executed.   ! Package tikz Error: Sorry, the system call 'pdflatex -shell-escape -halt-on-e rror -interaction=batchmode -jobname "main-figure0" "\def\tikzexternalrealjob{m ain}\input{main}"' did NOT result in a usable output file 'main-figure0' (expec ted one of .pdf:.jpg:.jpeg:.png:). Please verify that you have enabled system c alls. For pdflatex, this is 'pdflatex -shell-escape'. Sometimes it is also name d 'write 18' or something like that. Or maybe the command simply failed? Error  messages can be found in 'main-figure0.log'. If you continue now, I'll try to t ypeset the picture.  See the tikz package documentation for explanation. Type  H <return>  for immediate help.  ...                                                                                l.11 \end{tikzpicture}                        ?

I have a file test.pdf which I include in a document containing also an externalized pgfplots picture.  When I compile the following code, I get the error message Sorry, the system call pdflatex ... did NOT result in a usable file.  In order to make my code work, I first need to remove the includepdf statement, compile (to create the externalized figures) and then compile again with the includepdf statement.  I suppose that it is a bug, or is there any possibility to solve it ?  Of course, the file test.pdf is totally independent from the externalized pictures from pgfplots.  \documentclass{scrbook}   \usepackage{pgfplots}  \pgfplotsset{compat=1.8}  \usepgfplotslibrary[external]  \tikzexternalize[shell escape=-enable-write18]  \usepackage{pdfpages}   \begin{document} \includepdf{report_test-figure44}   \begin{tikzpicture}  \begin{axis}[  xlabel=Cost, ylabel=Error]  \addplot[color=red,mark=x] coordinates {  (2,-2.8559703) (3,-3.5301677) }; \end{axis}  \end{tikzpicture}   \end{document}


When I began learning about optical interference, I came to know about destructive interference in which light waves cancel each other.  How the energy is still conserved ?  I found that the conservation is not disturbed and the photon emission is stopped instantaneously. How can the electron know what to do, whether to return to ground state giving back energy in the form of photons or to undergo other phenomenon like electron scattering...  Consider two laser sources emitting laser undergo perfect destructive interference after a distance d by means of a mirror. Then the light from both the laser goes uninterfered up to distance d. How can the energy be conserved?

What happens to the energy when waves perfectly cancel each other (destructive interference)? It appears that the energy "disappear" but the law of conservation of energy states that it can't be destructed. My guess is that the kinetic energy is transformed into potential energy. Or maybe it depends on the context of the waves where do the energy goes? Can someone elaborate on that or correct me if I'm wrong?


As many other answers have elucidated, the correct way to typeset SI units is with the SI command from siunitx. However, if the value being described is a variable (for example, x metres), doing  $\SI[parse-numbers=false]{x}{\m}$   in math mode will produce "x m" rather than the correct "x m", with an italicized x.   I've attempted to rectify this through toying with the settings of sisetup as per the CTAN documentation for siunitx, but so far I can't find anything to enable this behavior.  Any help in this regard would be appreciated.

I understand that something like \SI{5}{\meter\per\second} defines a certain space between the number (5) and units (m/s). What should I use if instead of a numerical quantity I want a variable: R m/s? \SI{R}{\meter\per\second} fails because it expect a number in first parameter, and R \si{\meter\per\second} or $R$ \si{\meter\per\second} show different space.  Which is the correct use?  \documentclass{standalone} \usepackage{siunitx} \sisetup{per-mode=symbol} \begin{document} \begin{tabular}{r} \SI{5}{\meter\per\second}\\ $R$ \si{\meter\per\second}\\ R \si{\meter\per\second}\\ \end{tabular} \end{document}


I am reading the book    I have some problems with the the first article: "Number".   The author has confined the concept of number of things to the groups which have all distinct elements, that is the number of letters in a group having elements A,B,C is $3$ iff $A,B,C$ all are distinct.           What is the definition and explanation, that is what is the meaning of the term number of things in general English.      Why Professor Fine has confined  this term only for those groups which have all the distinct things.     How the modern Mathematics defines the term Number of things$^{2}$.            My personal understanding is as:    "Thing" refers to both "abstract object" and "concrete object". The "group" of Fine's book is not the "Set" of our modern language. When I say I have 3 coins in my pocket I mean that I have three different "concrete objects" in my pocket. I understand that in real life we do count multiple "abstract objects" of same type as a single one. I am still doubtful on my understanding. It  appears to me that the modern mathematics does not explain the term Number of things when the things under consideration are concrete objects. Read my comment  for my confused mind. I do not have enough knowledge of modern math(especially set theory). There might be some explanation of the term Number of things given by the modern set theory.    ${}^2$ Things may refer to both "abstract objects" and "concrete objects".

I am reading the book    I have some problems with the the first article: "Number".   The author has confined the concept of number of things to the groups which have all distinct elements, that is the number of letters in a group having elements A,B,C is 3 iff A,B,C all are distinct.        What is the definitions of the term number of things in general English?    My understanding about the term number of things is that when we talking of some concrete things then we are interested in knowing how many concrete things(tokens) are there. We do not bother whether the concrete things under consideration have similar properties or not.      When the things under consideration are "abstract objects" then we are only interested in knowing how many different types of "abstract things" are there. For example consider a child learning English alphabets. The student writes the letter "A" 10 times, the letter "B" 3 times and the letter "C" 2 times. the teacher asks the student: "How many alphabets you have learnt to write?" The child will reply: "I have learnt to write three English letters, namely "A","B" and "C"." The child has actually written 10+3+2=15 letters but it is understood that the teacher meant to ask "how many types of letters".     Mr.Fines book is quite old. I want to read some latest literature for understanding the term The Number of things.         Which field of study deals with this term(Number of things)? Dose Modern Math or Modern Philosophy deals with this term? Which subject I should read for the formal study of this term. Does modern set theory deals with this term?   Could you guys tell me about some modern book which formalizes this term. I have downloaded the book "Recursive number theory (1957)" but this seems to be old.


Examples:  There's six seasons, dude.  Wouldn't it be:  There're six seasons, dude.  We are talking about multiple items; six seasons. If we refer to multiple items, we should use "Are" in most cases, no?  There's cats everywhere! There's vans chasing us!  People often use the contraction "There is", plural or not. Wrong?

Q: "Do you have any juice?"   A: "Yes, there's some in the fridge."   Sounds perfectly fine to me, but:     Q: "Do you have any towels?"   A: "Yes, there's some in the closet."   Does not.  I asked for towels - plural - so wouldn't "Yes, there're some in the closet," in which there are is turned into a contraction be the correct way to say it?  Spellcheck, however, doesn't like "there're", and I think I'm the only person I've ever heard use the word "there're".  Even folks who I know say "there are" shorten it to "there's" when possible.  Am I saying it wrong, or are both forms acceptable?


So I wanted to test ArrayList vs LinkedList remove() method times just for fun.  I wrote code below to do it - everything is pretty self-explanatory: deleteEachNth runs through my list and deletes every nth element it sees.  I was expecting to see LinkedList winning by a huge margin, as its remove times are constant-time operations, but my code produces opposite results: for 10000 elements ArrayList is twice as fast.  Naturally, I thought I'd written something wrong, perhaps used a get(), which would slow LinkedList down somewhere, but it isn't the case.  Whats wrong  here?  EDIT: When replacing System.currentTimeInMillis() with System.nanoTime() LinkedList still performs worse for my code.   import java.util.ArrayList; import java.util.LinkedList; import java.util.List; import java.util.stream.IntStream;  public class Test{     List<String> myList;     Test(List<String> someList){         myList = someList;     }     void eliminateEachNth(int n){         for (int i = 1; i < myList.size(); i++) {             if(i%(n-1)==0){                 myList.remove(i);             }         }     }     public static void main(String[] args){         List<String> someList = new ArrayList<>();         IntStream.range(1, 10000).forEach(i->someList.add(Integer.toString(i)));         Test testArray = new Test(someList);         long cur = System.currentTimeMillis();         testArray.eliminateEachNth(3);         System.out.println("array list took " + (System.currentTimeMillis() - cur) + "millis");         System.out.println(someList);         List<String> anotherList = new LinkedList<>();         IntStream.range(1, 10000).forEach(i->anotherList.add(Integer.toString(i)));         Test testLinked = new Test(anotherList);         cur = System.currentTimeMillis();         testLinked.eliminateEachNth(3);         System.out.println("linked list took " + (System.currentTimeMillis() - cur) + "millis");         System.out.println(anotherList);      } }

How do you write (and run) a correct micro-benchmark in Java?  I'm looking for some code samples and comments illustrating various things to think about.  Example: Should the benchmark measure time/iteration or iterations/time, and why?  Related:


Does each droid have a unique name or does that designation refer to an entire class of droid? To put it another way, is R2-D2 specifically the droid we see in the films, or are there hundreds if not thousands of R2-D2s across the galaxy? If not, it would seem that they would run out of names fairly quickly.

We know that most Star Wars droids were designated using 4 letters of  (which is basically Latin so base 36 including numbers).  Then, the upper bounds on named  would seem to be be 36^2=1296 even assuming random 2 letters at the end, and 26*10=260 assuming the typical naming scheme of Letter+Digit.  Is there any notion in canon of just how many R2- units were ever produced?  Wikia (unsourced) says:     he R2-series astromech droid was a model of astromech droid produced by Industrial Automaton, boasting a level of success that was never equaled in Industrial Automaton's long history. A combination of excellent design, high-quality marketing, and good timing made this astromech droid one of the most sought after droids in history, and one of the few vintage astromech series still in active production decades after it was first designed, including the prototype R2-0. The line was so successful that the Galactic Empire took credit for the design.   Given the size of the Galaxy (millions? of inhabited planets, gazillions of beings), a production run of 260 - or even 1296 - seems to square very poorly with "one of the most popular astromeh droids in history with multi-decade production run".  Is there ever a canon explanation (ANY canon) for this?   Were there tons of non-designated R2 units?  Were later models designated differently, perhaps not limited to R2-$L$D scheme?  Were there really only 260 or 1296 R2 units in the entire galaxy? Some other explanation? Was the assumption that  - implied by the use of ArtooDeetoo as a proper name in the movie as well as similar references to all other droids - wrong and such designations were in fact reused for multiple droid units?


I have tried using firefox, chromium, chrome, epiphany, but nothing seem to work. Few days back, youtube was working like a charm and suddenly it stopped working. I had ubuntu-restricted-extras installed in my system. I have tried uninstalling previous flash package and installing other flash packages like adobe-flashplugin, flashplugin-installer, libflashplayer.so (which came in some package from adobe.com), gnash (one at a time). gnash is even unable to stream the videos from youtube. Although, flash seem to be installed correctly (confirmed by about:plugins in firefox). Do not suggest me to purge remove flash again as i did it like 10 times.  In case my system's configuration is relevant, here it is:  RUNNING IN: Vmware Workstation 10 CPU: AMD A8-4500M (given 2 cores) GPU: AMD 7640G+7670M RAM: 4 GB (given 2 GB)   (PS: I experience a lot of problems in linux for having AMD machine)

Even though I have the latest Adobe Flash player 11.2 for Linux in Firefox -   - a particular online flash game still requests that I update to the latest flash player.  I've tried this online game on my laptop (Windows 8 with Flash Player 11.8) and it has no problems.  Is there a way to trick Ubuntu or this game into thinking Flash Player 11.8 is "installed"?


I was reviewing past exams and I found a question where I could give no satisfactory answer. The core of the question is the following: If there are boundary conditions, does this necessarily imply, that the solutions to the time-independent Schrödinger equation are quantized, i.e. there are only countably many solutions? By the expression "has a boundary conditions" I want to specifically exclude the free particle i.e. $V=0$. Is there a rigid mathematical proof for this?

Given some potential $V$, we have the eigenvalue problem   $$ -\frac{\hbar^2}{2m}\Delta \psi + V\psi = E\psi $$   with the boundary condition   $$ \lim_{|x|\rightarrow \infty} \psi(x) = 0 $$   If we wish to seek solutions for   $$ E < \lim_{|x|\rightarrow \infty}V(x), $$   I find textbooks like Sakurai and others assert that (without proof) set of all such eigenvalues $E$ that admits nontivial solutions is discrete, which gives us liberty to index them with natural numbers (principal quantum numbers). Can anyone help me with a little elaboration of this mathematical fact ? As a student of mathematics, I know that compact operators have discrete spectrums, so for the operator $ T : L^2 \rightarrow L^2 $given as  $$ T(\psi) = -\frac{\hbar^2}{2m}\Delta \psi + V\psi. $$   Are there methods to show that $T$ is compact? Or possibly other ways to establish discreteness of its eigenspectrum?


Or the lack of them. If DM is much more abundant of common baryonic matter, why its gravitational effect becomes evident only if the dynamic of huge systems such as galactic rotation is considered?  I do not understand why DM should not contribute to our weight (assuming that it permeates Earth or it is concentrated in its nucleus) or should not be considered when describing the motion of the solar system.  What I do not understand here? I am ok with all instances that brought DM into consideration but I do not see why its gravitational effects do not take places here on Earth . Shall I take it as homogeneously distributed (at the scales I mentioned) so that I and the Earth are basically "within a DM spherical shell" and, thus, basically facing each others as if DM was absent?   Edit. Likely the moderators will add this. My question is about a duplicate of

If the universe is made up of ~95% dark matter, and it interacts only gravitationally then why didn't Newton and Kepler discover it before ? Why does it show itself only in the radial velocity profile of stars in galaxies and not in that of planets around the Sun ?


Why we use Map reference type but HashMap constructor like in example:    Map<String,String> map = new HashMap<String,String>();

I have seen this mentioned a few times and I am not clear on what it means. When and why would you do this?   I know what interfaces do, but the fact I am not clear on this makes me think I am missing out on using them correctly.   Is it just so if you were to do:  IInterface classRef = new ObjectWhatever()   You could use any class that implements IInterface? When would you need to do that? The only thing I can think of is if you have a method and you are unsure of what object will be passed except for it implementing IInterface. I cannot think how often you would need to do that.   Also, how could you write a method that takes in an object that implements an interface? Is that possible?


I have a directory with several hundred sub-directories. I want to tar and compress each sub-directory and name the resulting file <currentDirName>.tar.bz2.  I have done:  find ./dir -type f -print0 | xargs -0 -n1 -P100 bunzip2  to decompress 100 files at one time. (I do ocean modeling so my machine is quite powerful with many quad cores.) I do not know how to do something like the above while including information on naming the compressed archive file on the fly. I don't want to do tar cfj dir.tar.bz2 dir for each one.  Can I do it with each directory name being used automatically as the tar file name - via either find or parallel so that 100 or more can be done at a time as in the bunzip command above?  Thank you for input.  ....Peter

An Oceanographer friend at work needs to back up many months worth of data.  She is overwhelmed so I volunteered to do it.  There are hundreds of directories to be backed up and we want to tar/bzip them into files with the same name as the directory.  I can do this easy enough serially - but - I wanted to take advantage of the several hundred cores on my work station.  Question:  using find with the -n -P args or GNU Parallel, how do I tar/bzip the directories, using as many cores as possible while naming the end product:  origonalDirName.tar.bz2?  I have used find to bunzip 100 files simultaneously and it was VERY fast - so this is the way to approach the problem though I do not know how to get each filename to be that of each directory.


I am trying to automate ubuntu installation from a network repository. I am now succesfully able to configure the iso image and it does the installation automatically.  My requirement:  I would like to know if there is a method in the initial installation stage of ubuntu, where I can know if the OS being installed on virtualbox or a physical desktop. I want this check to be performed as I want to automate the installation of virtualbox guest addition if the installation is being performed on a virtualbox.  If any one here have any experience with the same, please share your answers.

Is there a command or tool that can be used to determine whether Ubuntu is running as a guest within a virtualization program such as VirtualBox or Qemu or whether it is running on the bare metal?


I am trying to make a simple list using JavaScript and jQuery. I am using oops concept of JavaScript. I am able to add new element in list. I am facing one problem, I have two buttons to update and delete the row. I created an array in which I have all the objects. I wanted if user click on delete button it deletes from array, as well as from the list. Same if user update the item it should also get updated in the array and list   I tried doing like this     function Phonebook(){     this.phoneBookArray=[];     var defaultvalue= [{name:"abc",phonenumber:989123},{name:"pqr",phonenumber:9891462}]     this.phoneBookArray=defaultvalue;     console.log(this.phoneBookArray)    } Phonebook.prototype.addItem=function(username,phoneNumber){     this.phoneBookArray.push({name:username,phonenumber:phoneNumber})     this.displayItem(); }  Phonebook.prototype.displayItem=function(){     $("#phonelist").html('');     for(var i=0;i<this.phoneBookArray.length;i++){         $("#phonelist").append('
'+this.phoneBookArray[i].name+''+       this.phoneBookArray[i].phonenumber+'<button class="del">delete</button><button class="update">update</button>
')     } }  var phonedir=new Phonebook(); phonedir.displayItem(); $('#addItem').click(function(){      var name=$('#nameEdit').val();      var phone=$('#numberEdit').val();      if(name!=''&& phone!=""){        phonedir.addItem(name,phone);         $('#nameEdit').val('');         $('#numberEdit').val('');     }else{      alert('please enter number and name')        }  })   $('.del').click(function(){     //try to delete item from list as well as from phoneBookArray    console.log($(this).parent('li'))  })  $('.update').click(function(){     //try to update item from list as well as from phoneBookArray      // try to get selected item and fill on text field and update the list    //console.log($(this).parent('li'))  })

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.


How to prove that $\{ a+b\sqrt2 \mid a,b \in \Bbb N \}$ is discrete in $\Bbb R$?  If I sum over $\Bbb Z$ instead of over $\Bbb N$, it becomes dense, which is quite confusing to me.  Also, when I plot the points, they appear to become denser as I go to the right, which leads me to wonder if the set is really discrete.

Possible Duplicate:          Let $(\mathbb{R},+)$ be the group of Real Numbers under addition. Let $H$ be a proper subgroup of $\mathbb{R}$. Prove that either $H$ is dense in $\mathbb{R}$ or there is an $a \in \mathbb{R}$ such that $H=\{ na : n=0, \pm{1},\pm{2},\dots\}$.  I am not able to proceed.


how can we really say that space is expanding when we cannot see the distant galaxies forming nor are the planets nearby newly formed, nor is anything expanding in size nor are we going far away? (sorry if it's unclear)

How do we know for certain that space is expanding?  Let's say that in the year 1950, we observe that galaxy 1 is 5 billion light years away from us and galaxy 2 is 10 billion light years away from us, putting both galaxies at a distance of 5 billion light years from each other. Then in 2013, we observe that they are now 7 billion light years away from each other so we conclude space is expanding.  We see that galaxies are move away from each other but how does that prove that space is expanding? Could this illusion of expanding space simply be due to something larger in mass pulling the farther galaxy 2 away from galaxy 1? This larger mass could be accelerating the velocity of galaxy 2 faster then it's accelerating the velocity of galaxy 1.


I have tried to download windows 10 onto my new PC that has come with ubuntu 16.4 software on it. However it is not working. Is it possible?

I'd like to create a Windows bootable USB stick, but I don't have a Windows machine with me at the moment to do so. How could I achieve the same using Ubuntu?


I'm trying to initialize an empty list as [[], []] and then append to it. However, I am getting unexpected results with the following method vs another. What is going on under the hood in this scenario? y = [[]] * 2 print(y) y[0].append(1) y[1].append(2) print(y)  output: [[],[]] [[1,2], [1,2]]  While this following code gives me the intended results that I want. x = [[], []] print(x) x[0].append(1) x[1].append(2) print(x)  output: [[],[]] [[1], [2]]

I needed to create a list of lists in Python, so I typed the following: my_list = [[1] * 4] * 3  The list looked like this: [[1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1]]    Then I changed one of the innermost values: my_list[0][0] = 5  Now my list looks like this: [[5, 1, 1, 1], [5, 1, 1, 1], [5, 1, 1, 1]]    which is not what I wanted or expected. Can someone please explain what's going on, and how to get around it?


I want to create a column in a table that will be a long text.  I have tried this  \begin{table}[H]  \centering     \setlength{\arrayrulewidth}{1mm}     \renewcommand{\arraystretch}{0.65}      \begin{threeparttable}     \begin{tabular}{*{7}{l}}      \toprule[1.2pt]     Variable & \multicolumn{6}{c}{Description} \\      \cmidrule[0.8pt](lr){1-7}         loan amnt & asfasfaf Descriptive statistics for some of the variables & \\         int rate & \\         credit grade &  \\       \midrule[1.2pt]     \end{tabular}     \caption{Dictionary of the variables}     \label{tab:my_label}     \end{threeparttable}  \end{table}     I know that it  must be smth super simple but I'm new to this.  Any suggestion?

I am creating table in LaTeX and I need to get the text to perform line break automaticaly when it's too long. And if possible, I'd like to get the text alignment to the left. Is it possible to handle this situation?


In Tolkien's stories, we know that the Elves went into the West, but where did the Dwarves go? Did they just die off like the petty Dwarves (Mim and his kin)?

From what I understand, The Lord of the Rings is written as the mythic past of our own world. We are constantly reminded that the race of man is becoming more and more prominent. At the end of The Return of the King the Elves leave Middle-earth to the humans. But what about the other mythical races, primarily the Hobbits and the Dwarves? Did they die out?


When scrolling a question page, the images, code blocks and other text elements get distorted or just simply disappear.    I'm using Android 4.0.4.

When scrolling in the Stack Exchange Android app, the text gets stretched vertically, code disappears, and sometimes the entire post content disappears.  This doesn't make the app completely useless, but it's pretty close.   Motorola Razr MAXX, Android 4.0.4.


While running the following script, I get the errors. How to solve this?    1 #!/bin/bash   2 # Show colored output if running interactively   3 if [ -t 1 ] ; then   4     export ANSIBLE_FORCE_COLOR=true   5 fi   6 # Log everything from this script into _quickstart.log   7 echo "$0 $@" > _quickstart.log   8 exec &> >(tee -i -a _quickstart.log )   9 # With LANG set to everything else than C completely undercipherable errors  10 # like "file not found" and decoding errors will start to appear during scripts  11 # or even ansible modules  12 LANG=C  [root@localhost quickstart_images]# sh quickstart.sh -u file:///usr/share/quickstart_images/undercloud-mitaka.qcow2 localhost quickstart.sh: line 8: syntax error near unexpected token `>' quickstart.sh: line 8: `exec &> >(tee -i -a _quickstart.log )' [root@localhost quickstart_images]#

This may be a silly question, but I ask it still. If I have declared a shebang  #!/bin/bash    in the beginning of my_shell_script.sh, so do I always have to invoke this script using bash  [my@comp]$bash my_shell_script.sh   or can I use e.g.  [my@comp]$sh my_shell_script.sh   and my script determines the running shell using the shebang? Is it the same happening with ksh shell? I'm using AIX.


Hello,  There was a question on SO() where the author linked us to his  of SO.  What is going to be done about that,is SO licensed?

of Stack Overflow, all content posted on Stack Exchange sites by their users (i.e. you wonderful people) has been provided to the whole universe under . For my fellow non-lawyers, that license basically means:   Anyone can use any Stack Exchange posts at any time without having to ask for permission Making money off of the copied content is permitted You don't even have to copy stuff from here verbatim; you can just use it as a starting point and make whatever edits you want There are just two rules you have to follow:   You have to provide . Simple links to the original post and author info are just fine. You have to  and allow other people to use your content, as long as they follow these very same rules. How meta!    (If you ever forget any of that, and want to refresh your memory, the license info is linked to in the footer of every page.)  There are, in fact, a lot of people who republish varying amounts of our content for assorted reasons. Unfortunately, there are some Stack Content Republishers Attributing Poorly and/or Excelling at Ranking (SCRAPERs, for short).  In this context, "attributing poorly" means any use that doesn't follow our attribution rules or make any other reasonable attempt at give credit. This can get pretty egregious; I've seen SCRAPERs that not only don't link back to SE originals, but also use fake author info and post dates to make it harder to find originals. By "excelling at ranking," I'm referring to copycat sites that end up higher in Google results than the original SE sites do for the same content. That's not necessarily wrong, but in some cases, it indicates inappropriate SEO hackery.  So, the question is: what can you do if you spot a SCRAPER?


I have a bunch of lists in the form of say [0,0,1,0,1...], and I want to take the XOR of 2 lists and give the output as a list. Like: [ 0, 0, 1 ] XOR [ 0, 1, 0 ] -> [ 0, 1, 1 ]  res = [] tmp = []  for i in Employee_Specific_Vocabulary_Dict['Binary Vector']:     for j in Course_Specific_Vocabulary_Dict['Binary Vector']:          tmp = [i[index] ^ j[index] for index in range(len(i))]         res.append(temp)   The size of each of my lists / vectors is around 3500 elements, so I need something to save time, since this piece of code is taking more than 20 mins to run.  I have 3085 lists, each of which need an XOR operation with 4089 other lists.  How do I do this without iterating through each list explicitly?

How do you get the  of two variables in Python?  For example, I have two variables that I expect to be strings. I want to test that only one of them contains a True value (is not None or the empty string):  str1 = raw_input("Enter string one:") str2 = raw_input("Enter string two:") if logical_xor(str1, str2):     print "ok" else:     print "bad"   The ^ operator seems to be bitwise, and not defined on all objects:  >>> 1 ^ 1 0 >>> 2 ^ 1 3 >>> "abc" ^ "" Traceback (most recent call last):   File "<stdin>", line 1, in <module> TypeError: unsupported operand type(s) for ^: 'str' and 'str'


I am reading . I already have some experience with linear algebraic groups and invariant theory, yet one of the first exercises of the book has already confused me. In the first chapter, the book defines a linear algebraic group as a closed subgroup of some $GL(V)$, for some vector space $V$. Here, $V$ is a finite dimensional vector space over an algebraically closed field, $k$. Moreover, the topology on $V$ is the Zariski topology, so closed subgroup means Zariski closed. Immediately after this definition, the book says the maps $g\mapsto g^{-1}$ and (for fixed $h\in G$) $g\mapsto hg$ or $g\mapsto gh$ are homeomorphisms and warns that:  But the product map $G\times G\rightarrow G$ need not be continuous.  which follows by the exercise  Prove that the product map $GL_1(k)\times GL_1(k)\rightarrow GL_1(k)$ is not continuous.  However, this product map is clearly continuous! $GL_1(k)=k\setminus\{0\}$ as a variety; thus, every proper closed subset is finite. For a point $x\in k\setminus\{0\}$, the inverse image of $x$ equals $\{ (\lambda,\mu)\in GL_1(k)\times GL_1(k)\mid \lambda\mu=x\}$ which is a closed set in $GL_1(k)\times GL_1(k)$. Therefore, the inverse image of every closed subset is also closed. What am I missing?

An algebraic group is not necessarily a topological group, since for an algebraic group, the product map $G \times G \to G$ is continuous when $G \times G$ is given the Zariski topology, which is finer than the product topology.   So does this tell you that the additive group $\mathbb{G}_a$ over an infinite field $k$ is not a topological group? The underlying variety of $\mathbb{G}_a \times \mathbb{G}_a$ is $\mathbb{A}_k^1 \times_k \mathbb{A}_k^1 = \mathbb{A}_k^2$, whose Zariski topology is the cofinite topology, where every open set is also open in the product topology (since $\mathbb{A}_k^1$ also has the Zariski topology).