How can I unrar files? And please I want a program with UI... WinRAR would be the best (I have a license, I know, I'm like a unicorn). Ubuntu is so confusing and not user friendly at all imho. I just want a program (again, WinRAR would be nice) that gives me a right click menu to extract, a UI to open the files... basically a windows like solution. And please tell me how to install it - noobfriendly please.

I just realized I can't unrar .rar files on my Ubuntu machine!  What's the easiest way to accomplish this fundamental task? If possible I'd love something like 7Zip that I can just right Click, and extract and have the program worry about how to do it regardless if it's a .zip, a .rar or a .foo compressed file.


Note: This question is NOT a duplicate of the above  I'm looking for a plugin or some TestRunner that will allow me to run JUnit suites in parallel in the same JVM process, without using Maven. (I'm unfortunately not able to use Maven for this project.) And, I need to re-use connections to the server and so am using a Singleton pattern. (I can't have that many simultaneous connections to the server.)  I've pretty much scoured the whole Internet, but no solution has worked. (I'm also using JUnit @Categories and @Parameterized, so it would be great if I could get those to work too, but at this point I'm kind of desperate.) Each solution I've tried makes a new JVM process for each test or suite.  Can anyone provide a library, some sample code, or point me in the right direction as to how I could go about this? I can use ant, but based on , I don't think it would work. Also, even if I have to switch to TestNG, I'll do it.  Also, I know that  question is related, but I really need to re-use those connections and use a Singleton pattern.  Any help would be appreciated, SO! Thanks.

I'm using JUnit 4.4 and Maven and I have a large number of long-running integration tests.  When it comes to parallelizing test suites there are a few solutions that allow me to run each test method in a single test-class in parallel. But all of these require that I change the tests in one way or another.  I really think it would be a much cleaner solution to run X different test classes in X threads in parallel. I have hundreds of tests so I don't really care about threading individual test-classes.  Is there any way to do this?


I am trying to centre a div but having difficulty. Beneath the chart in  I have a table which I want to centre under the chart.  I have tried the class below, I also set the width but it doesn't seem to work. It looks to me like the right hand side of the table is centred to the middle of the chart rather than the middle of the chart. I am not fully understanding the behaviour.  html

             <button class="ui-button ui-widget ui-corner-all">Paint</button>

         <button class="ui-button ui-widget ui-corner-all" data-range="5">5d</button>         <button class="ui-button ui-widget ui-corner-all" data-range="20">MTD</button>         <button class="ui-button ui-widget ui-corner-all" data-range="999">Max</button>

       css  .indexChart{     clear: both;     height: 500px; }  .centerDiv{     margin: auto; }  .content {     height: 1000px;   background-color: #F5CF8E;   overflow: hidden; }

How can I horizontally center a
 within another
 using CSS?

Foo foo


I've made  of  that haven't had any response from SE in a couple of months. Trivial things that would make working on the sites easier on a day-to-day basis.  Is there a way, and is it okay to, bump things that seem to have been overlooked after a couple of months?

I posted a question here on Meta Stack Exchange, or on a per-site meta, regarding a bug I found in the system. I got no comments, or a few comments stating that this is a legitimate bug (and not by design). However, it's been quite a long time, and no official response was ever posted there.  Or, I had an idea for a new feature, but realized it's already requested, either by searching or posting a request myself only to have it closed as a duplicate of the existing one. It's been a while since the original request was filed, but no official response has been made.   I'm aware that staff members are , but either my post isn't about one of the indicated topic areas for which they're accepting escalation requests for that month, or I already flagged to request escalation but it was declined, so the instructions there don't apply for my post.  What can I do to draw attention to meta questions for the SE team, so they can give an official response, and possibly implement the bug fix or feature?  Note: This is different from other general questions which ask for how to get attention for unanswered questions, since the procedures on meta sites are different, and getting an official response isn't necessarily the same as getting a good answer.


I was just wondering that in the html img tag  <img alt = "default image" src = "image"> is it possible to have a alternate image rather than just text. Or if is it possible to nest the img tag in the alt ""s.

I have a web page that includes a bunch of images. Sometimes the image isn't available, so a broken image is displayed in the client's browser.  How do I use jQuery to get the set of images, filter it to broken images then replace the src?    --I thought it would be easier to do this with jQuery, but it turned out much easier to just use a pure JavaScript solution, that is, the one provided by Prestaul.


By surjective comparability I mean the following principle:  "For any nonempty sets $A,B$: there exists a surjective function $f$ from $A$ to $B$ or there exists a surjective function $g$ from $B$ to $A$."   Is this statement provable in $ZF$? If not then what exactly that principle is equivalent to (over $ZF$)?

I'm doing the following exercise from Just/Weese:  Show in ZF that (WO) implies (IC) and that (IC) implies (SC).  where  (WO) Every set can be well-ordered.   (IC) For any two sets $X,Y$ either there is an injection $X \hookrightarrow Y$ or $Y \hookrightarrow X$.  (SC) For any two sets $X,Y$ either there is an surjection $X \twoheadrightarrow Y$ or $Y \twoheadrightarrow X$.    (WO) $\rightarrow$ (IC): Let $X,Y$ be two sets. Then by (WO) they can be well-ordered. Therefore each is in bijection with an ordinal $\alpha$ (and $\beta$, respectively):  Claim: Every well-ordered set is isomorphic to an ordinal.  Proof: Let $\langle, X,W \rangle$ be a well-ordered set. Let $\alpha$ be an ordinal with $|\alpha| \ge |X|$. Define an injective map $f: X \hookrightarrow \alpha$ as follows:   (i) Let $x_0$ be the $W$-minimal element. Then $x_0 \mapsto \varnothing$.  (ii) Assume $f$ has been defined for $x \in I_W (x')$. Define $x' \mapsto \sup^+ f(I_W (x'))$.   Let $\tilde{f} = f: X \to \mathrm{im}f$. Then $\tilde{f}$ is a bijection and $\mathrm{im}f$ is an initial segment of an ordinal hence also an ordinal.$\Box$  Either $\alpha \in \beta$ or $\beta \in \alpha$. Hence either $X \hookrightarrow Y$ or $Y \hookrightarrow X$.    (IC) $\rightarrow$  (SC): Let $X,Y$ be sets. Then either $X \hookrightarrow Y$ or $Y \hookrightarrow X$. Given $X \hookrightarrow Y$ it is easy to construct a surjection $Y \twoheadrightarrow X$, similarly for $Y \hookrightarrow X$.     Can you tell me if these proofs are correct? Thanks.  I also wanted to prove (IC) $\rightarrow$ (WO), but I'm stuck. I thought of something like if $X$ is a set and $\alpha$ is an ordinal then either $X \hookrightarrow \alpha$ or $\alpha \hookrightarrow X$ but the latter case seems to be a dead end.


i receive this error building this table in Latex:  Extra alignment tab has been changed to \cr. Error& 11280.9 & 251 & 44.94& &&   This is my document:  ]{MastersDoctoralThesis} % The class file specifying the document structure \usepackage[utf8]{inputenc} % Required for inputting international characters \usepackage[T1]{fontenc} % Output font encoding for international characters \usepackage[dvips]{epsfig,psfrag} \usepackage{mathpazo} % Use the Palatino font by default \usepackage{amsmath} \usepackage{graphicx} \usepackage{floatrow} \usepackage[none]{hyphenat} % suppress hyphenation *globally* \sloppy  \newcommand{\HY}{\hyphenpenalty=25\exhyphenpenalty=25}  % re-enable hyphenation locally inside "Z" columns \newcolumntype{Z}{>{\HY\RaggedRight\arraybackslash\hspace{0pt}}X}   %\usepackage[backend=bibtex,style=authoryear,natbib=true]{biblatex} % Use the bibtex backend with the authoryear citation style (which resembles APA) \usepackage{biblatex} \addbibresource{bibliography} % The filename of the bibliography \usepackage[autostyle=true]{csquotes} % Required to generate language-dependent quotes in the bibliography \usepackage{float} \usepackage{lipsum} \usepackage{subfig} \usepackage{adjustbox} \usepackage{tabularx,booktabs} \usepackage{mathtools} \usepackage{array} \newcolumntype{P}{>{\raggedright\arraybackslash}X} \setlength\tabcolsep{2pt} \captionsetup{     justification = centering } \usepackage{amsmath} \DeclareMathOperator{\Pa}{Pa} \newcolumntype{d}[1]{D{.}{.}{#1}} \setlength\tabcolsep{2pt}  \begin{document}      \begin{table}[!htbp]             \centering             \begin{tabular}{ l c c c c c}                 \toprule                 Source& Ss&  df& MF& F& $Prob>F$&\\                 \hline                 Groups &6254.4  &2  &3127.22 & 69.58 & $9.07728e^-25$& \\                 Error& 11280.9 & 251 & 44.94& &&\\                 Total& 17535.4& 253& &&\\                 \hline                 \bottomrule             \end{tabular}             \caption{ANOVA results.}         \end{table} \end{document}   Where is the problem? Is it in the number of columns?

I am using the  and trying to create a table of 4 columns.   I get the error mentioned in the title of the question. I know the standard reasons why this error can occur.   But my question is: Is it possible that the template or .cls file is controlling the maximum number of columns in a table ? If it were, would I get a different error than this?


Suppose $k>1$ is an integer, and k is not a square number, then $\sqrt{k}$ is not a rational number.  Proof:  Let $\sqrt{k}=\frac{p}{q}$, and $(p,q)=1$,So $q^2|p^2$, $p\neq 1$, $k$ is not an integer.When $q=p=1$, and $k>1$.  And $q=1$, then $\sqrt{k}=p$, and $k$ is a square number.  I do think it's so easy...Where is wrong?  How to do it.

It is well known that $\sqrt{2}$ is irrational, and by modifying the proof (replacing 'even' with 'divisible by $3$'), one can prove that $\sqrt{3}$ is irrational, as well.  On the other hand, clearly $\sqrt{n^2} = n$ for any positive integer $n$.  It seems that any positive integer has a square root that is either an integer or irrational number.        How do we prove that if $a \in  \mathbb N$, then $\sqrt a$ is an integer or an irrational number?      I also notice that I can modify the proof that $\sqrt{2}$ is irrational to prove that $\sqrt[3]{2}, \sqrt[4]{2}, \cdots$ are all irrational.  This suggests we can extend the previous result to other radicals.        Can we extend 1? That is, can we show that for any $a, b \in \mathbb{N}$, $a^{1/b}$ is either an integer or irrational?


Hibernation on my Ubuntu 18.04 did not work out of the box (I mean sudo systemctl hibernate). So I made several attempts to fix that some time ago and unfortunately can not remember exactly what I did.   But now:  sudo hibernate   successfully hibernates the system and on the next boot the system state successfully restores, except for the login screen does not appear, which is not good. And if I have many applications running than after such a resume the system might be frozen for up to 20 minutes (I see applications' windows, can move mouse pointer, but the system does not respond to clicks) but after that works normally.   sudo systemctl hibernate   does something, shuts down the system, but on the next boot I see several messages delete orphaned node and finally clean boot, as if there were no hibernation.  Please help me clear it up and enable hibernation in the gui interface.  At the same time suspend to memory and resume from memory works fine without a problem, including the login screen on resume.  The primary question I have is: Which of the two mechanisms hibernate or systemctl hibernate should I use with 18.04?  Details  The system has swap partition  $ lsblk | grep SWAP └─sda5   8:5    0  16,8G  0 part [SWAP] $ free -m               total        used        free      shared  buff/cache   available Mem:          15894        3386        9945        1311        2561       11848 Swap:         17163        2150       15013   and in /etc/default/grub it has  GRUB_CMDLINE_LINUX_DEFAULT="quiet splash resume=/dev/sda5" GRUB_CMDLINE_LINUX=""  and  $ cat /sys/power/state freeze mem disk $ cat /sys/power/disk [platform] shutdown reboot suspend test_resume   [SOLVED] :-)  Finally I managed to bring hibernation to work. As long as I do not have deep understanding of the subject, I'd rather describe what I did. So   Completely removed pm-utils and uswsusp, then sudo update-initramfs -c -k all and reboot   After this hibernation attempt ended up in clean boot instead of resume. So then   Reinstalled systemd then changed device names to UUIDs so as    in /etc/default/grub  GRUB_CMDLINE_LINUX_DEFAULT="quiet splash resume=UUID=2c8ec945-6967-4538-93ef-49eb4df6f2a1"  in /etc/initramfs-tools/conf.d/resume  RESUME=UUID=2c8ec945-6967-4538-93ef-49eb4df6f2a1  then   $ sudo update-initramfs -c -k all $ sudo update-grub $ reboot   After this sudo systemctl hibernate and resume succeeded but without login screen, so   In Settings (gui) for power button action I assigned "Hibernate"   Now when I press power button the system hibernates and then restores through login screen.  Many thanks to everyone involved     UPD: Now I have found an even better solution - use swap file  I verified this on fresh Ubuntu 18.10 desktop install and suppose it to work with fresh 18.04 desktop install too as they both use swap file by default i.e. they do not allocate swap partition by default. But the default swap file is 2Gb regardless of the system memory size, so it should be increased.  The complete description is for example .

I've been using Ubuntu for about five years now, and I still can't make it suspend when I want to. It's quite irritating that I can program up a storm, hack the machine in numerous other ways, and yet, and yet when I try to make it suspend or debug suspend, I fail miserably.  I need help.   Where do I begin to find the problem? What do I do to fix it? I'm placing a bounty on this, because I've literally lost hours of my life to this problem, and leaving my computer on ALL the time is terrible.  The symptoms:   Pressing suspend brings my computer to a state where it has a blinking cursor, the fans are running, it seems that the HD has turned off (I think), and I can't do anything to bring it back from this state (short of a hard reboot). Possibly related: My fans stay on even after a shutdown, and even then, I have to press the power button for five seconds before I can start it up again. I don't know what logs to look at to debug the problem, and I imagine they'd get nuked on reboot anyway.   Please, please help. This drives me completely nuts, and I've been living with it for over a year.


I am travelling to UK on Business Visa with 2 laptops, 1 work laptop and other is my personal laptop from India. Is it allowed to take 2 laptops to UK and vice versa or do I need to pay any customs duty?

I am planning to travel to India (COK airport, Kerala) from United States. I want to take my laptop as well as my tablet (iPad). Am I allowed to take both in my backpack with my documents related my work. I think I am allowed to take only one computer as per the rule. Will the customs consider my iPad as a computer?  What all I can take?   One of my friends took 2 laptops (1 work and 1 personal) and had trouble at the airport.  Also I am planning to take some wristwatches (7 of them, each avg price is 45 $). I read in a website that I can take stuff up to max 35000 INR. Is that true? In that case, how will I manage my stuff?


I am using Blender with the AMD 12 with Radeon R7. Blender renders using OpenCL but I would not call the performance fast.  I have only recently moved to this AMD 12 ideapad which I purchase on the understand that it was strong on graphics and it was my intention to use this laptop to work up scaled plans.  I have started to use blender to create the plans/models which is working well with the exception of the rendering process.  I understand that there are other rendering engines other than cycles that may work better with the AMD R7.  The trouble is that whilst various posts allude to this none so far have stated where they can be downloaded nor how to incorporate the render engine into blender.  If anyone has any ideas on this I would be very grateful if they would share.  Many Thanks.  I note that this has been marked as a duplicate. I am sure that it is I imagine that it is a common question. However the title of the question that this question is flagged as being a duplicate for is not something that I would have searched for as a newbie to blender. Hence this edit.

Since asking for tutorials, videos, resources, links to other content or downloads is considered off topic here, this is a specifically created Community Wiki which gathers resources for Blender and it has been approved by the .  Just write in the appropriate answer/section. If you have concerns, questions, post a  question, so we don't clutter the comments, but you can link your meta question from the comments.  Questions regarding such resources are not allowed anymore, except for very specific and on topic requests (ask on  if you're unsure about your question). Follow the instructions made in the question about how to post, what can be posted, etc.  Learning             Assets    (also see: )   Reference Images/Blueprints (also see: )    Tools    (also see: )      Other   Special Interest ()     Also see the .


I read the domain of a logarithmic function can not be negative, but why?  I mean, a logarithmic function with base $-2$ and parameter $-1/8$ should result in the exponent $-3$ shouldn't it?

Given a logarithm is true, if and only if, $y = \log_b{x}$ and $b^y = x$ (and $x$ and $b$ are positive, and $b$ is not equal to $1$), are true, why aren't logarithms defined for negative numbers?  Why can't $b$ be negative? Take $(-2)^3 = -8$ for example. Turning that into a logarithm, we get $3 = \log_{(-2)}{(-8)}$ which is an invalid equation as $b$ and $x$ are not positive! Why is this?


I know how to create a view as a page or block and etc.  But The Displays seems meaning I can create lots of views?  This following is my guess:   Is it will group all kind of views to a single page? Does Displays just easily use the previous view configuration and just Put similar view together to manager easily?

I've just made a Views for a content type.  In one views, I need a page for the content type and a preview of 4 newest posts on the front page.  Page is not the problem. For front page preview, I just confused about the purpose of "Attachment", "Content pane" & "Context". I don't know which one to use for front page preview.  "Context" does not have more link, and "Content pane" is not for Panels pane since Panels module is disabled.


I feel like this has been beaten around the bush in a couple other topics, but I am hoping to find something a bit more definitive. I am looking to control a Peltier thermoelectric cooler.  I've got a 24VDC PLC with a couple tools at my disposal:   Analog thermocouple inputs Analog outputs 0-10VDC, 4-20mA, 12 bit Digital outputs 500 mA, 24VDC PID ladder block in PLC software   I would like to use the PID in conjunction with one of the output types to drive the Peltier at full power (12VDC, 5A). I need some way to convert either of these outputs to a 0-12V controllable constant signal (As pointed out in other threads, the Peltier will wear out if cycled/supplied PWM input).  Some thoughts...    PWM controlled buck converter (haven't found one, but maybe I'm searching for the wrong things??, everything I have found is trimmer controlled) w/ 12V power supply Use RC circuit to change PWM to analog (or analog output) and combine with MOSFET to control a 12V power supply DC motor controller to step to required voltage, then RC circuit to smooth   Ideally, I'd love a box that takes 12V 5A in, and a 24V PWM duty cycle dictates the voltage % to an output. It seems like this should exist, but I don't know what to look for.  Also, lest it be too obvious, but unsaid, I am not super experienced with electronics design, nor am I seeking to be an expert. My intention is only to move what I have to move, heat what I have to heat, or in this case, cool what I have to cool. Therefore, I'm not looking to tinker too much, the most direct, robust solution is definitely the best here even if it's not the cheapest.  Thank you all!

Maybe the underlying question is what the Voltage-Current curve looks like. Can I drive it from a voltage source (like you drive a heater) or from a current source (like you drive an LED)? Or even different than those two options?  ADDITIONAL1: Say (hypothetically) I have two commercially available identical Peltier's, they are spec'd 6V/3A. Can I connect these in series to a 12Vdc power supply without any worries?  CONCLUSION1: Current/Voltage load curve is reasonably linear, both driving from current or voltage source will do fine as long as the device is operated within its spec. (Olin Lathrop, Russell McMahon)  CONCLUSION2: Don't drive a Peltier from PWM, power loss due to current increase, grows more rapidly than cooling power. (Olin Lathrop)  CONCLUSION3: Beware the mechanical wear of the device with continues cycling. Eg. don't use a thermostat on/off controller. (Russell McMahon)


When is it appropriate to allow/disallow players to re-roll skill checks?  For instance, a player walks into a room in a dungeon and rolls a 2 on perception.  Do I allow them to re-roll?  If so what's the point in rolling and not just telling them everything the moment they walk into the room.  The players I have always try to roll again and again, I have no problem with them checking around again, but at what point do I have them take a 10 or a 20, and how do I do that organically?  My question isn't about things that are actively in action, but more about those rolls when nothing is happening.  Like if the group is wandering around a dungeon, and stumbles into a room.  How do I handle the perception check for a secret door?  Or a rogue hiding?  Things that don't have an obvious repercussion, unlike failing to pick a lock.

Picking a lock typically requires a DC 15 Dexterity check (Basic rules, p. 49). Likewise for manacles (p. 50), which can alternately be escaped with a DC 20 Dexterity check or broken with a DC 20 Strength check. But what happens if you fail?  The general rules for ability checks state (p. 58):     If the total equals or exceeds the DC, the ability check is a success—the creature overcomes the challenge at hand. Otherwise, it’s a failure, which means the character or monster makes no progress toward the objective or makes progress combined with a setback determined by the DM.   As a DM, how can I handle this in practice? In our last session, the players wanted to get inside a locked building to rescue people trapped inside. Picking the lock seemed like an easy enough task for the rogue, but unluckily he failed the check, and I wasn’t prepared for the consequences. There wasn’t much time pressure and no obvious reason why he couldn’t try again, so I allowed another attempt, but it just didn’t feel right.  I’m sure that similar situations will come up again, so I’d like some advice on how to deal with checks so that they don’t just turn into a tedious exercise of rolling until you succeed. I presume that  was left out of the game for good reason, but I’m not sure what to do instead. I suspect that this was a good occasion to use “progress with a setback” but that’s a fairly new thing for D&D and I’m not sure how to go about it. I’m unsure when I should use setbacks versus lack of progress, and in the latter case I’m unsure when I should allow players to try again versus requiring a different approach.  For example, suppose that a manacled player tries to pick the lock and fails the DC 15 Dexterity check. Now, the player could try to pick it again, or he could try one of the other escape methods, or he could wait for somebody else to rescue him, or he could simply succeed with some setback like a minor injury. How do I choose how to proceed? Or do I let the players choose?


We know that in Harry Potter and the Sorcerer's Stone, Hogwarts was able to locate Harry at all of his different addresses in order to deliver him his letter. So, my question is, couldn't they have done the same with Voldemort to find him? Is it possible that Voldemort put protective spells around him that stop him from being located?    We also know that in Harry Potter and the Deathly Hallows, Hermione puts some protective spells around their campsites. However, none of them (after a bit of research) actually prevent someone from locating them. Couldn't Voldemort, in turn, have done this?

Harry, before the Triwizard Tournament, was able to send owls to Sirius when he was in hiding (not at Grimmauld Place) just by telling them "just find him, will you?", and the owl would come back a few days later with an answer. This doesn't happen with Hedwig only, because, if I recall correctly, he uses school owls as well.  If finding Sirius was as easy as telling an owl "find him", and a 13-year-old wizard could do it, how come the Ministry had no clue as to where he was? They could've sent an owl with a summons and followed it from a distance.  Two theories, neither mentioned in the book, and both a bit unlikely:   He was living as a dog and -hopefully- the Ministry would not be able to recognize him. Unlikely because the owl would have got there anyway, so they would have guessed the dog was Sirius in disguise, not necessarily as an animagus, but maybe he could perform human-animal transfiguration (remember he was brilliant at school).. Kingsley Shacklebolt was already in charge of the hunt and Dumbledore told him Sirius was innocent and all that. Then, Kingsley would have prevented the Ministry from using any method that could've actually worked. Unlikely because they could've used owls before Dumbledore's tip, when Kingsley didn't know Sirius was innocent, and also because Kingsley was quite powerful and had the support of Crouch and others at the Ministry, so if he was in charge, they would probably have succeeded.   Your thoughts?


When I tap spacebar on a .markdown file in the finder, Quick Look shows me a very nicely formatted view of that file. But the view doesn't act like a normal window, I can't select text from it, etc. All the apps I have that can open Markdown files show them in edit mode, without the pretty formatting.  Short of buying an app like , is there some way to open Markdown files with pretty formatting?

Is there an application to preview markdown files (.md files) on OSX (for instance on Maverick)?


def method(n, i=1):     yield [n]     for i in range(i, n//5):         for j in method(n-i, i):             yield [i]+j   for this function, Can please anyone explain what is this doing? yield [n]

What is the use of the yield keyword in Python? What does it do? For example, I'm trying to understand this code1: def _get_child_candidates(self, distance, min_dist, max_dist):     if self._leftchild and distance - max_dist < self._median:         yield self._leftchild     if self._rightchild and distance + max_dist >= self._median:         yield self._rightchild    And this is the caller: result, candidates = [], [self] while candidates:     node = candidates.pop()     distance = node._get_dist(obj)     if distance <= max_dist and distance >= min_dist:         result.extend(node._values)     candidates.extend(node._get_child_candidates(distance, min_dist, max_dist)) return result  What happens when the method _get_child_candidates is called? Is a list returned? A single element? Is it called again? When will subsequent calls stop?   1. This piece of code was written by Jochen Schulz (jrschulz), who made a great Python library for metric spaces. This is the link to the complete source: [Module mspace][1].


What do you call it when somebody repeats part of a sentence?  For example:  'I like walking I do'

Just as we have tail-questions (or question tags), affirmative additions to affirmative remarks ("so do I", "so did he") and negative additions to negative remarks ("neither do I", "neither would I", etc), is there a term for this kind of addition to a sentence?    "Despite all the corruption, he was re-elected. He is a masterpiece, he is." "She is a fly customer, she is." "He is a genius, he is.


Hi i'm getting this advert while surfing the internet. It's very iritating please help me  http://facebook.com-important-finance-news.ninja/?z9ps5pq2l3

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.


First off, I'd like to say that my rendered view is working but when I try to view it from the camera perspective (by pressing 0) then only a small square gets rendered and the rest is still in solid view.  As you can see, it works as it should when not viewing from camera view   But when viewing from camera view, it looks like this:    As you can see, only a tiny square gets rendered and the rest is still in solid view.  I suspect that the camera setting is wrong and needs to get adjusted but I can't figure out which one it is. I tried deleting the camera and adding a new one but I still get the same problem.  I would appreciate any help.

In the 3d viewport I am using a border region to only render things inside the selected region. I did this with CtrlB. I cannot get rid of the region. How can I make the border disappear?


Is there a way to get smaller icons in Unity that are less than 32 pixels? I would like to set it at something like 24 or 26, because 32 is too big on a 1366x786 screen.

Why can't the "Launcher" Icons be made smaller? At the smallest setting, they are still 4 times bigger than they need to be on a 10" Netbook. The Icons in the "Top Panel" are much smaller and we users don't have a problem selecting them.


Recently I found out from Webmaster Tools, one of my blogs has 154 duplicate title and 156 duplicate meta description. On closer look, both URLs lead to the same blog post. One is with the date followed by the blog title and the other begins with the blog title. Example:  /2011/06/blog title.html  /blog title/   Is it something to do with the permalink settings? What should I do now?

In Google Webmaster Tools under Search Appearance --> HTML Improvements it's showing:  Duplicate Meta Titles - 166 Duplicate Meta Descriptions - 275  For example:  Duplicate title tags  Offer prices on Guitars, Pianos, Drums, Saxophones & Violins - Offers in Bangalore, Chennai, Hyderab     /musical-instruments-2      /musical-instruments-2?manufactureid=103&pagesize=40      /musical-instruments-2?manufactureid=103&pagesize=800&orderby=15      /musical-instruments-2?manufactureid=56&pagesize=320      /musical-instruments-2?manufactureid=60&pagesize=160      /musical-instruments-2?manufactureid=86&pagesize=400      /musical-instruments-2?pagesize=12&manufactureid=76&orderby=10      /musical-instruments-2?pagesize=240      /musical-instruments-2?pagesize=600      /musical-instruments-2?pagesize=80&manufactureid=104   Duplicate meta descriptions  Springwel Mattress Bangalore with 5 Guaranteed Benefits | Best Price, Quick Door Step Service, Free     /springwel?orderby=11      /springwel?orderby=15      /springwel?pagesize=160      /springwel?pagesize=350      /springwel?pagesize=40   Why is it showing this and how can I remove these duplicate titles and descriptions?


Do the rules on counterspells essentially make it possible to always have your spells succeed?   (i.e...thus making high level one-on-one “cage match” wizarding duels simply a race to be first?)  In 5e, casting Counterspell requires a Reaction. Additionally, each character only gets one reaction.  Theoretically, that would mean that a wizard duel between two 20th level wizards could proceed like this:   Mage A casts a spell (Power Word Kill) using their Action Mage B casts Counterspell using their Reaction Mage A casts Counterspell using their Reaction Mage B has no Reactions left so the original spell is cast.  Mage B dies because the average wizard has less than 100hp.   Does this mean in mage-versus-mage combat, that a character casting a spell can essentially always ensure their spell gets cast as long as they have slots to cast counterspell at a level equal to their opponent’s?

My party went up against two wizards. Wizard NPC 1 cast a spell, and Wizard PC used their reaction to Counterspell to try to block it. Wizard NPC 2 counterspelled Wizard PC. I have two questions about this:   Is there any defence against this? If it was just one NPC Wizard, could they use their reaction, during their turn, to counterspell the PC Wizard's counterspell?


There seems to be two common definitions of neighborhoods of a point- an open set containing the point, or an set containing an open set which itself contains that point. Why don't we just use the former definition, it seems so much simpler? What do we gain from the latter?

I am a Physics undergrad, and just started studying Topology. How do you define neighborhood and open set in Topology.Wikipedia gives a circular definition.   An  is defined as follows.      In topology, a set  is called an open set if it is a neighborhood of every point    While a  is defined as follows:     If $X$ is a topological space and $p$ is a point in $X$, a neighbourhood of $p$ is a subset $V$ of $X$, which includes an open set $U$ containing $p$   which itself contains the term open set.  How do you define it exactly?


How is this type of medieval drawing form is called? Can this be praticed today with contemporary tools?  EDIT: hand-tools, not computer programs

What is the best way and process someone does to go about making a logo like that? I have seen people draw a logo and then use “image trace” but is that what people typically do? If they don’t use “image trace” but use the pen tool for example, how do you make it look like someone drew it? How do you get the lines to look like that? Any help would be appreciated! Thanks!


Is 'come' in the following sentence the base form or the past participle?  “And Royce seemed to be everything I’d dreamed of. The fairy tale prince, come to make me a princess. Everything I wanted...”  If it's a past participle then is it a similar usage of come as in This is my dream come true?

I am a Japanese teacher of English who is making a teaching material for my students. I would like to know whether the following usage would be totally accepted in school grammar. To put my question in other words, would a very grammar-sensitive person allow the following usage (in bold font)?  A: What is your favorite movie? B: It is Titanic created in 1997 by James Cameron.  So, the point here is whether you can grammatically modify a proper noun with a participle. I know it's totally okay to write something like "a movie created in 1997 by James Cameron," where participle modifies a common noun, but I'm not sure if the same is allowed for proper nouns.  Thank you, Tom


If I were to forget to run nohup as described , would it be possible to keep a process alive after executing it. For example, I am running python program.py for the last 3 hours and forget to run the initial nohup command, could that process stay alive, or would I have to take the hit and start again?

I sometimes have long running processes that I want to kick off before going home, so I create a SSH session to the server to start the process, but then I want to close my laptop and go home and later, after dinner, I want to check on the process that I started before leaving work. How can I do that with SSH? My understanding is that if you break your SSH connection you will also break your login session on the server, therefore killing the long running process.


If $v$ is an $m$-vector and $X$ is an $m \times n$ full rank matrix, how can I find the value for $n$-vector $s$ that satisfies the following?  $$ \frac{\partial}{\partial s} \|Xs - v\|^2 = 0 $$

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


Since I was told my post is a re-post, which it is not, let me re-explain:  I have a div 'box'. In this 'box', there is a 'contentbox' div. In that 'contentbox' there is, by default, a form and a button 'button1'.  When 'button1' is clicked, a new form 'questions' and a new button 'button2' is loaded into 'contentbox'.  'button2' will not click and load more html.   When trying to follow the link that I was apparently "reposting" I changed my JQuery to...  $("#button2").on('click', "#contentholder, loadQuestions());   I want my dynamically loaded button to be able to dynamically create other dynamic content. That way, all processes can occur within my 'contentbox'.  If you still believe I need to go back and look at that post, please be more specific on what I am actually doing wrong. It takes a long time to create these posts, and to simply tell me "repost" does not get me anywhere.   Thank you  JFiddle Demo(With html):           $(document).ready(function () {         $("#button1").click(loadUserNameTable);         $("#button2").click(loadQuestions);         $("#button3").click(loadPasswordChange);         $("button4").click(submit);     });      function loadUserNameTable() {         $("#contentholder").load("nametable.html");     }     function loadQuestions() {         $("#contentholder").load("questions.html");     }     function loadPasswordChanger() {                     $("#contentholder").load("passwordchange.html");     }

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.


I have an Attribute table with 151823 rows. I want to cut off the upper and lower 5% of the data so I sorted the Value field ascendingly but now I am not able to select the first and the last 7591 entries which would be the 5%, as the FID is not in the right order anymore. I tried it with a new field (NewID) with the intention to just have a new sequential numbering but this did not work. I used the script presented here     Does anyone know a simple solution?

Is there a way to calculate a sorted field with sequential numbers?  I have seen  that outlines how to calculate sequential numbers, but this is always calculated on FID order, not on sorted order.  #Pre-logic Script Code: rec=0 def autoIncrement():      global rec      pStart = 1       pInterval = 1      if (rec == 0):           rec = pStart       else:           rec += pInterval       return rec  #Expression: autoIncrement()   An example of what I'm trying to do.  I've used an advanced sort to sort by year, month, day, and now want to have sequential numbers in the Seq field.  You'll see that my OBJECTID field is not in order, so the above code won't work.    Can this be done either in the Field Calculator or using an Update Cursor in arcpy?


Let $a,b,c$ be the lenghts of the sides of a triangle. Suppose that $ab+bc+ca=1$. Show that $(a+1)(b+1)(c+1)<4$.    My attempt:    I tried multiplying the whole thing but that didn't help at all. So, I tried to manipulate the triangle inequality and bring out the given form but that didn't help too. I am out of ideas now. Please help. Thank you.

Let $ a, b, c $ be sides of a triangle and $ ab+bc+ca=1 $. Show $$(a+1)(b+1)(c+1)<4 $$  I tried Ravi substitution and got a close bound, but don't know how to make it all the way to $4 $. I am looking for a non-calculus solution (no Lagrange multipliers).  Do you know how to do it?


Can anyone help proving that a function f:(a,b)->R that is differentiable on (a,b) not just a point, is also continuous on (a,b).  I was looking into taking an arbitrary point in (a,b) and using left and right limits somehow.

I have a question, to aid my understanding, about the proof that differentiability implies continutity.$\mathstrut$    Differentiability Definition  When we say a function is differentiable at $x_0$, we mean that the limit:  $$f^{\prime} (x) = \lim_{x\to x_0} \frac{f(x) - f(x_0)}{x-x_0}$$ exists.  Continuity Definition  When we say a function is continuous at $x_0$, we mean that: $$\lim_{x\to x_0} f(x) - f(x_0) = 0$$  Theorem: Differentiability implies Continuity: If $f$ is a differentiable function at $x_0$, then it is continuous at $x_0$.  Proof:  Let us suppose that $f$ is differentiable at $x_0$. Then $$ \lim_{x\to x_0} \frac{f(x) - f(x_0)}{x-x_0} =  f^{\prime} (x) $$  and hence  $$ \lim_{x\to x_0} f(x) - f(x_0) = \lim_{x\to x_0} \left[ \frac{f(x) - f(x_0)}{x-x_0} \right] \cdot \lim_{x\to x_0} (x-x_0) = 0$$  We have therefore shown that, using the definition of continuous, if the function is differentiable at $x_0$, it must also be continuous.  My Question  The proof seems to execute the following steps:   Assume the function is continuous at $x_0$ Show that, with little algebra, we can change this into an equivalent question about differentiability at $x_0$. With this little bit of algebra, we can show that if a function is differentiable at $x_0$ it is also continuous.   What I am slightly unsure about is the apparent circularity. In my mind it seems to say, if a function is continuous, we can show that if it is also differentiable, then it is continuous. Rather than what I was expecting, namely, if a function is differentiable, we can show it must be continuous.  Hopefully my confusion is clear. Any help will be greatly appreciated.


My wife and I are recently married and we applied successfully for a tourist visa to the UK. This visa has been issued on her passport that is under her maiden name.  We still have some time left before travel so we thought we might like to change my wife's passport to her married surname. This would of course result in cancellation of the passport in the maiden name with the visa inside it.  If she now attempts to travel to the UK with both passports and originals of the pertinent documentszwill it be legitimately explainable and accepted by the immigration officers en route i.e. Philippines and UK?

I am a Chinese citizen married to a US citizen last year. I am going to apply for a UK tourist visa. The name shows on my passport is my maiden name, while any other documents the UK visa needed, such as bank statement, is with my married name. I can provide my marriage license to prove the link between my maiden name and married mane.   Can I apply for this UK visa with my situation?


I have a list of 2-item tuples and I'd like to convert them to 2 lists where the first contains the first item in each tuple and the second list holds the second item.  For example:  original = [('a', 1), ('b', 2), ('c', 3), ('d', 4)] # and I want to become... result = (['a', 'b', 'c', 'd'], [1, 2, 3, 4])   Is there a builtin function that does that?


I have a script tmp.sh  #!/bin/bash  echo hello sleep 3 echo 3   I want to log the script running time (as well as script stdout) to a log file.   user$ time ./tmp.sh >& log.tmp  real    0m3.003s user    0m0.000s sys     0m0.003s   does not work.  user$ time ./tmp.sh 2>&1 log.tmp hello 3  real    0m3.003s user    0m0.002s sys     0m0.001s   this also does not work.   What is the correct way to log the output of time command to log file?

Can I write the output of the time difference command to a file?  For example, I tried:  $ time foo.sh > bar.txt   But it only gives the output of foo.sh to bar.txt.


I'm an aspiring LaTeX user and have so far managed the first steps and created my first few documents. Coming from a programming background I've been wondering how you could use \newcommand to create a command that formats numbers or strings in a hard-coded way.  For example, let's say I have the string AB1234567890. Now what I'd like to do is create a command, that used like this  \applyformat{AB1234567890}   should create the output  AB12 3456 7890   I realize something like that can be done with \,  AB12\,3456\,7890   but I would like to define a fixed "layout" in the command to make sure that every string gets formated the same way as I use that command with each string later.  In a programming language I could split strings and such but I'm unaware how to solve that with LaTeX.

I have a block of text that I would like to automatically break in blocks of equal length. Something like what \num does with numbers.  What I need is a definition for what I called \makeBlocks. The MWE below should output: aaaaa bbbbb ccccc ddddd followed by abc def ghi  \documentclass{article}  \newcommand{\makeBlocks}[1]{???}  \begin{document} \makeBlocks{5}{aaaaabbbbbcccccddddd}  followed by \makeBlocks{3}{abcdefghi} \end{document}


First, the statement of the question:  Let A,B be two non-empty sets. Show that there exists an injective map of A into B, or there exists a bijective map of a subset of A onto B.  My idea is to use Zorn's Lemna (which is covered in the chapter this question is in, next chapter is on cardinality) on the family of injective maps of subsets of A into B, thus determining that there is a maximal element, but I'm not quite sure how this would imply the existence of a bijection. If S is the set of injective maps of subsets of A into B, my idea would be to define a partial ordering $f<g$ iff $f(A')\subset{g(A'')}$, where A' and A'' are the subsets for f and g respectively. It is clear that S is thus inductively ordered so there must therefore exists a maximal element of S by Zorn's Lemna however Im not sure as stated above what this would mean in this context. All help and feedback appreciated. Thank you

For any pair of sets $A$ and $B$, we can define $A\le B$ iff there exists injection $f\colon A\rightarrow B$. I am trying prove that  $$(A\le B)\vee (B\le A).$$  I have tried assuming  $\neg (A\le B)$, then proving $B\le A$ by constructing the required injection, but I haven't been able to make any progress. Any hints, etc. would be appreciated.  EDIT  Assuming  $\neg (A\le B)$, can you prove there exists a surjection $f: A\rightarrow B$? Then it would be easy, by applying AC, to construct an injection $g: B\rightarrow A$


I want to run sudo ifconfig lo0 alias someIp every time I open my mac, what would be the best way to achieve this?

How do I get this ifconfig loopback alias change to persist after a restart?  $ sudo ifconfig lo0 alias 172.16.222.111 $ ifconfig lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384     options=1203<RXCSUM,TXCSUM,TXSTATUS,SW_TIMESTAMP>     inet 127.0.0.1 netmask 0xff000000      inet6 ::1 prefixlen 128      inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1      inet 172.16.222.111 netmask 0xffff0000          ### <-- WANTED!!!     nd6 options=201<PERFORMNUD,DAD>   The only similar instructions I've found are for nonexistent OSX files on other *nix systems for files like /etc/network/interfaces or /etc/sysconfig/networking-scripts/ifcfg-eth0.


When a plane takes off from the equator at a specific longitude and flies due north and attempts to land at $43 N$ latitude, why doesn't it crash due to the difference in earth's velocity at the equator and $43 N$ ?  Isn't the energy conserved to obey Newton's laws ?

First imagine a pilot takes off from a North South runway situated on a specific northern latitude, the circumference of which is 888 miles, where the angular spin velocity of the earth (and the plane) would naturally be calculated at approximately 37 miles per hour in an Easterly direction.  Then imagine that he attempts to land on a North South runway at the equator where the angular Easterly spin velocity is 1037 mph.    Explain how this 1000 mph difference of angular spin velocity is gained with enough exactitude that his plane will not flip over upon touchdown?   For extra points explain how such a plane under these conditions could lose the greater angular spin velocity if the trip were reversed and started out at the equator and landed at the northern runway?


My reputation is suddenly decreased by 10. There are neither downvotes nor the user is deleted in my reputation tab on Stack Overflow.  I already read  post.

When I visit the reputation tab of my profile, I see a lot of stuff. I can make out some of it, but not all.   What do all the event types mean? Why do some events show an odd reputation gain or not show any reputation change at all? Why are some events sometimes highlighted in yellow? My reputation suddenly dropped, but I don't see anything. What happened? Why do some events disappear from my reputation history?


I currently got the following piece of code:  captureFile = theCaptureFile;     // If there is only 1 currency it gets the total right away     if (captureFile.getTotalMoney().size() == 1) {         Money totalMoney = captureFile.getTotalMoney().values().iterator().next();         totalAmount  = totalMoney.getAmount();         currencyCode = totalMoney.getCurrencyCode();     }     // If there is more than one currency, goes through every one, converts it to GBP and adds it to the total amount     else if (captureFile.getTotalMoney().size() > 1) {         Map<String, Money> totals = captureFile.getTotalMoney();          for (Entry<String, Money> money : totals.entrySet()) {             try {                 totalAmount = totalAmount + money.getValue().getEquivalent(BASE_CURRENCY).getAmount();             }              catch (CurrencyNotFoundException e) {                 LOG.error("Getting ExchangeRate:", e);                 totalAmount = null;                 break;             }              catch (ExchangeRateNotFoundException e) {                 LOG.error("Getting ExchangeRate:", e);                 totalAmount = null;                 break;             }         }     }   When the code gets called, the first IF works just fine but, in case there are more than 2 currencies, I get a NullPointerException on the TRY bit. None of those methods have a return null so I'm guessing it is something wrong that I am doing on the mapping part to pull the values out.  Here are the other 2 methods that are pulled off:  public Money getEquivalent(String targetCurrencyCode) throws CurrencyNotFoundException,ExchangeRateNotFoundException {     if (this.currencyCode.equals(targetCurrencyCode))   {         return this;     }     return getEquivalent(CurrencyCache.get().getCurrency(targetCurrencyCode)); }   and:  public long getAmount() {     return amount; }   Any help would be greatly appreciated, any more info you might need just let me know.  Many thanks in advance.

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


I have two X200 Thinkpads.  They both have the rather annoying problem that, unless the display backlight is set to its maximal value, it emits an unbearable noise.  The odd thing is that one of them boots with the max. value and the other does not.  It is also impossible to set the second computer's display to the max. brightness value by using the brightness-up button (it will only reach 779942 of 846600).  I have to  cat /sys/class/backlight/intel_backlight/max_brightness >/sys/class/backlight/intel_backlight/brightness   Now the sound goes away but only until the next reboot.  Is there anything I can do to make the brightness value persistent across reboots?  PS.  I understand that I can run a script on startup, but something is making my first comptuer different and I would like to know what.  I have tried this using the exact same OS (the same live USB), and both computers have the same BIOS version (from 2012; 7.22?) and settings. The difference is also there in the BIOS setup, before loading any OS.  (PS II.  I might add that the problem does not exist in Windows, even with the screen dimmed.)

I am running Linux 4.9.11-1.0.0 on my iMX7 dual development board. I have a test.sh file that I would like to run at startup. It currently only has a bunch of echo statements in it (just for testing purposes).   When I flick the switch on the board to turn it on, I see a bunch of initialization stuff come up. I would like the echo statements in my test.sh file to also be displayed in this initialization sequence on startup. Eventually once this is working, the plan is to do real stuff in place of the simple echo statements. I just want to make sure the script is running on startup at this point.  So far I have created the test.sh file and I am able to run it manually after the board has booted up. I have added the following to my /etc/rc.local file before the exit statement at the end:  sh '/home/root/test.sh'   I have verified that this rc.local file has #!/bin/sh -e at the top. I have also done:  $ chown root /etc/rc.local $ chmod 777 /etc/rc.local   Once this was all done, I verified that it should be working properly by typing:  $ /etc/init.d/rc.local start   Everything is working as expected up until this point and I am seeing the echo statements when I do that last step. However, when I go and try to reboot the board, I do not see the echo statements at all in the printed initialization stuff.  What am I missing? Maybe it is actually running on startup but I just don't see the output for some reason?


I have a .bst file which I would like to use to customise my bibliography - I am passing the backend=biber in my preamble and I can currently only choose from the in-built styles. Where should I save this .bst file and how can I load it into my package so I can use it? I am using TeXshop on Mac.

I have a llncs document (Springer Lecture Notes in Computer Science) which requires a bibliography style splncs04. However, I get the error message "Style 'splncs04' not found". I have read and tried to implement these questions    and    but although I tried putting the bst file both in the tex file folder and in ~/Library/texmf/bibtex/bst it gave the same message. Here is my MWE (tex document)  \documentclass[runningheads]{llncs}  \usepackage[backend=bibtex, style=splncs04]{biblatex}  \addbibresource{Birkhoff}  \begin{document}  ~\cite{TarskiGeometryAFP}   \printbibliography   \end{document}   and bib file  @article{Tarskis_Geometry-AFP,   author  = {T. J. M. Makarios},   title   = {The independence of Tarski's Euclidean axiom},   journal = {Archive of Formal Proofs},   month   = oct,   year    = 2012,   note    = {Formal proof development: \url{http://isa-    afp.org/entries/Tarskis_Geometry.shtml}. Thesis:    \url{http://hdl.handle.net/10063/2315}},   ISSN    = {2150-914x}, }


Per the title, where is the logout button?  All the existing questions I can find refer to the previous design of the site, where hovering over your name in the top bar brought up a menu.


This might be the tiniest bug ever but there seems to be an extra space between follow or close and flag on questions.  This shot is from this site.        This one is from a site where I have close too.        You can see, there are three spaces, not two between the last two options.  A bit of looking around seems to show that this occurs when the delete button is not present and questions with the delete option show fine.

In the 'menu' under the post, some extra space has been added (I presume accidentally) between the 'flag' link and the other options:    It looks like the separators are always shown, even though their corresponding options might be hidden. Here's how a full menu looks, and it's still evenly spaced:


Every time I login to ssh terminal to edit files I execute the command  export EDITOR=nano   How Could I set nano as default editor so I shouldn't execute this command anymore

Questions about    setting environment variables the PATH   are very common here, and in most cases the answers are very similar to each other. In the future it would be nice to have a good Q/A for this.  So the question is: What are environment variables, like the executable PATH, and how can I change and use them on major operating systems?  A good answer would include a simple explanation of what environment variables and especially PATH mean to the OS, as well as simple guidelines on how to set and read them accordingly.


UPDATE  It's so simple...  When I try to convert the value $ 1.50 from a textbox to a decimal variable, like this:    decimal value = Convert.ToDecimal(textbox1.text.SubString(1));  OR  decimal value = Decimal.Parse(textbox1.text.SubString(1));   I get this result: 1.5. I know that 1.5 and 1,50 worth the same. But I want to know if it's possible to have two digits after the dot on a decimal variable.    I want to have this as result: 1.50 instead of 1.5 even if these two values worth the same...

When displaying the value of a decimal currently with .ToString(), it's accurate to like 15 decimal places, and since I'm using it to represent dollars and cents, I only want the output to be 2 decimal places.   Do I use a variation of .ToString() for this?


To start this one, my idea is dividing both side by $a^p$, then the question will become $(1+x)^p+(1-x)^p\geq 2+p(p-1)x^2$. So we need to check $f(x)=(1+x)^p+(1-x)^p- 2-p(p-1)x^2\geq 0$ on $x\in(0,1)$ for all $p\in[1,2]$. It's clear that it's true as $p=1,2$. And for $p\in(0,1)$, I try to take first and second derivative, but the case becomes very complicate.

I've been having a look at how Lieb and Loss (in their textbook on Analysis) prove Hanner's inequalities and have been trying to get a handle of the geometric intuition involved. In doing so I've been trying to prove that:  $(a+b)^p + (a-b)^p \geq 2a^p +p(p-1)a^{p-2}b^2$  For any $1\leq p\leq 2$ and $0<b<a$.  This is exercise 4 in chapter two of the aforementioned book. Can anyone give me any tips (or some geometric intuition)?  Also can anyone give me any explanation of why uniform convexity is important, and what it might mean geometrically?  Edit: for the latter question the following is useful but I would appreciate any more comments.


I have the following data:        road        |  ID  | other column  | other column |  ------------------+------+---------------+--------------+           MAIN ST           |  1   |     ...       |     ...      | MAIN ST           |  2   |     ...       |     ...      |         MAIN ST           |  3   |     ...       |     ...      | BERRY LN          |  4   |     ...       |     ...      | BERRY LN          |  5   |     ...       |     ...      | BERRY LN          |  6   |     ...       |     ...      | JOHN RD           |  7   |     ...       |     ...      | JOHN RD           |  8   |     ...       |     ...      |   I want all rows with duplicates in the road column removed. It does not matter to me which duplicates are removed. The end result can look something like this:        road        |  ID  | other column  | other column |  ------------------+------+---------------+--------------+           MAIN ST           |  3   |     ...       |     ...      | BERRY LN          |  4   |     ...       |     ...      | JOHN RD           |  8   |     ...       |     ...      |   where the id's are any value, as long as the road column is unique.   Is there a simple way to do this in SQL or T/SQL? I followed the guide , but it only applies to duplicate keys with non-unique rows.


So, as part of rooting my Nvidia Shield Tablet K1, I wanted to set some things up before running the initial setup, things like configuring the adoptive storage, that seemed to make sense before downloading all my old apps. I was able to skip the setup and do what I needed but then couldn't find a way to run the setup after the fact. Can I force the device to run the setup again?

I am looking for a way to use ADB to trigger Setup Wizard at next boot. I know I can run the following command and get it to pop up. However, I can't figure out what triggers it to start at boot.  adb shell am start -a android.intent.action.MAIN -n com.google.android.setupwizard/.SetupWizardTestActivity   The phone I am currently using is stock and I would like to keep it that way.   I've read the  question:


How does one solve the congruence $$x^{3}+x^{2}+1 \equiv 0\pmod{27}$$ First reducing the congurence $\pmod{3}$ i get $x=1$ as one solution. But not sure how to go from here.

I got $x^2 + x + 10 \equiv 0\pmod {11}$  I am confused about using the Hensel lifting method. Can someone just help me out with that please.


What does the following notation mean: $n< < m$ , where $n$ and $m$ are numbers?

I was perusing  and saw the following at the end: Nicholas proved that there exists a constant $c_2>0$ such that $Q(x) \ll (\ln x)^{c_2}$.   What does the $\ll$ mean in this context? (fyi, $Q(x)$ is the number of highly composite numbers less than or equal to $x$)


I would like to make my laptop dual-boot and install Windows and Lubuntu on it.  My primary concern is: Does Lubuntu have software compatibility issues? I mean does the software that work on Ubuntu work on Lubuntu too?

I understand that Lubuntu utilizes LXDE over Ubuntu's Unity(Gnome?); But being new to Linux I'm not sure if that change is going to be simply cosmetic, or if there will be functional differences I need to be aware of. The Ubuntu wiki says no, but it is also seems to be a very superficial discussion. I am comfortable(ish) with the command line and I suppose my question is more directed in that direction, but any information would be great.


I want to be able to set up downloads of weekly TV shows so the .torrent is automatically downloaded to my computer, ie. I just tell the program that I want (for example) Adventure Time to download as soon as it is available, and it takes care of the rest.  A quick google search showed me that  was an option for Ubuntu, but the website seems to have disappeared.  Does anybody know of a way to do this?

In Windows I used an RSS feed to download a tv series, but Deluge doesnt have that option. Is there a plugin to add that fuction? How do I install and configure it?   If there isn't a plugin which client do you recomend?


Source of my doubt is the section 2.7 of , an screenshot of the book is attached below. Much of my confusion is clarified by .   If mean of GP is not estimated and it is taken as zero or any constant, then outside the range of the observations the estimate would converge to 0/constant. But suppose if I am interested in prediction within the domain of training data.  What would happen if I vary the mean of GP? Would the parameters of covariance function tune themselves accordingly?

I have just started reading about GPs and analogous to the regular Gaussian distribution it is characterized by a mean function and the covariance function or the kernel. I was at a talk and the speaker said that the mean function is usually quite uninteresting and all the inference effort is spent on estimating the correct covariance function.   Can someone explain to me why that should be the case?


Prove the following inequalities,$$ (n!)^2 ≤ n^n(n)! <(2n)!$$   My attempt  I proved one of the inequality using mathematical induction.  To prove -   $ (n!)^2 ≤ n^n(n)!$  For $ n = 1 $,  LHS $≤$ RHS.  Let us assume that for $ n = k$ the inequality is true.  $\therefore$ $(k!)^2 ≤ k^k(k)!$ –––––> [1]  Now let us prove that $ ((k+1)!)^2 ≤ (k+1)^{(k+1)}(k+1)!$ for $ n = k+1$.  Taking LHS,  $=>(k+1)^2(k!)^2 $  $≤(k+1)^2k^k(k)!$     –––––>             [From [1]]  $≤(k+1)(k)^k(k+1)!$  From above we can deduce that,  $LHS≤RHS$.  How to prove the second inequality given in the question?

How can we prove the inequality $(n!)^2 \leq n^n\cdot n!\leq (2n!)$, where $n\in \mathbb{N}$  $\bf{My \; Try}$::  $1\leq n$  $2\leq n$  $3\leq n$  ....  ....  $n\leq n$  So $1\cdot 2 \cdot 3 ..n \leq n^n$  So $n!\leq n^n\Rightarrow (n!)^2 \leq n^n\cdot n!$  But  did not understand how can we prove $n^n\cdot n! \leq (2n!)$  Help me  Thanks


This is a question I saw as an interview question, that I cannot figure out.  Devise a method for betting on the individual games of a basketball series so that if your team wins the series, you win \$100, and if they lose the series, you lose \$100.  Series' are 7 games, and the first team to win 4 games wins the series (so a team could win after 4,5,6, or 7 games). The problem is, how do we devise a strategy for individual games, so that no matter the sequence of games, you get a predictable amount at the end? I cannot think of anything...

Here is a question that came up during class discussions on Friday:  Your favorite baseball team is playing against your uncle's favorite team in the  World Series. At the beginning of each game, you and your uncle bet on the game's outcome. Your uncle, being wealthy and carefree, always lets you choose the amount of the bet. If you bet b dollars and your team wins the game, your uncle gives you an IOU for b dollars. But if they lose the game, you give him an IOU for b dollars. When the series is over, all outstanding IOUs are settled in cash. You would like to walk away with 100 in cash if your team wins the series, and lose 100 if your team loses the series. How much should you bet on the opening game? (For non-baseball fans, the first team to win a total of four games  wins the series).  I am thinking to apply probability. For example, knowing 100 is the result, moving backward but not exactly sure how to proceed.


Please find below code. I am facing the problem at Line: dataTransformationsPanel.applyModelListFirstElement();  but it works fine if I do it in public static void main(String args[]) method itself. Please suggest me.  package test.dataPage;  import helper.DataTransformationsPanel; import helper.Driver; import helper.First;  import java.util.concurrent.TimeUnit;  import org.junit.Test; import org.testng.Assert;  import pageObjects.DataPage;  public class ApplyModel extends Driver {      First first;     DataTransformationsPanel dataTransformationsPanel;     DataPage dataPage;      String columnNameExpected;      public ApplyModel() {         super();         columnNameExpected = "New Predicted Column";         first = new First();         dataTransformationsPanel = new DataTransformationsPanel();         dataPage = new DataPage();     }      @Test     public void applyModel() {         first.login();         first.openDataPage();         dataTransformationsPanel.applyModelListFirstElement();         dataTransformationsPanel.applyModelNewColumnName(columnNameExpected);         dataTransformationsPanel.applyModelOkButton();          /*          * try { Thread.sleep(5000); }          *           * catch (InterruptedException e) { e.printStackTrace(); }          */         webDriver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);          String columnNameActual = dataPage.lastColumnInTable();         Assert.assertEquals(columnNameActual, columnNameExpected);          first.removeDataSet();         first.logOut();     } }   Thanks in advance!

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


I am trying to select all possible sub-arrays of an array of length n which have k elements. I have just started with Python and not sure how to start with it.   I know there will be nCk (n choose k)  but don't know how to start. Could anyone please give me a hint or a method I could use?  $$\frac{n!}{(n-k)!k!$$

I am writing a program in Python, and I realized that a problem I need to solve requires me, given a set S with n elements (|S|=n), to test a function on all possible subsets of a certain order m (i.e. with m number of elements). To use the answer to produce a partial solution, and then try again with the next order m=m+1, until m=n.  I am on my way to write a solution of the form:  def findsubsets(S, m):     subsets = set([])     ...     return subsets   But knowing Python I expected a solution to be already there.  What is the best way to accomplish this?


Why do different wavelength get impeded more or less when in different materials? Moving with the same speed, but a longer physical distance would imply that the fields oscillate less times in the material, but I don't know why a difference in the number of oscillations would impede the wave- I don't even know why things slow down in general. Why some electromagnetic wave would slow down just because it's entering other electromagnetic fields... It would seem to me that the only factor would be time taken to physically move some electron or something in the direction of the fields... But that seems to simple of an explanation to me.

It is well known that a  can "split light" by separating different frequencies of light:    Many sources state that the reason this happens is that the  is different for different frequencies.  This is known as .  My question is about why dispersion exists.  Is frequency dependence for refraction a property fundamental to all waves?  Is the effect the result of some sort of non-linearity in response by the refracting material to electromagnetic fields?  Are there (theoretically) any materials that have an essentially constant, non-unity index of refraction (at least for the visible spectrum)?


Images of stars are not very good with a full moon.  But what if the moon has not risen?  A 3/4 moon rises at 11:00pm tonight.  If I travel to a dark spot and take images before 11:00pm will the star's images be affected by the moon's light since the moon will not haverisen?

Is it possible to photograph the milky way (or just any stars or stellar objects) when a full moon is out?


I am a beginner of programming, and am writing a Java method to remove vowel in Strings, but I do not know how to fix this error: ";" expected :  public String disemvowel(String s) {      boolean isVowel(char c);     if (c == 'a') {         return true;     } else if if (c == 'e') {         return true;     } else if if (c == 'i') {         return true;     } else if if (c == 'o') {         return true;     } else if if (c == 'u') {         return true;     }     String notVowel = "";     int l = s.length();     for (int z = 0; z <= l; z++) {           if (isVowel == "false") {             char x = s.charAt(z);             notVowel = notVowel + x;         }     }     return notVowel; }

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


I am designing a circuit board using proteus 8.1 , does anyone know how to calculate trace widths for the PCB tracks , it may need to handle a high current so it’s important this is all calculated , is there a simple calculation to find the width a track needs too be, for example I need to be able to send 12V with up too 9A through part of the PCB, how wide will the PCB trace width need to be ? Any ideas , Thanks

Is there a standard for the sizes of PCB traces?  That is are some 25 mil and others 10 mil or is can you choose your own?  I plan to run 400mA through some thicker traces, but less than 30mA for all other traces. About what size would I need?


Using Debian 8.7 I have VPS server with allocated ipv6 range: 2a01:xxxx:xxxx:xxxx::2/64  ifconfig looks like this     Link encap:Ethernet  HWaddr 52:54:a2:01:9a:8c    inet addr:172.31.1.100  Bcast:172.31.1.255  Mask:255.255.255.0    inet6 addr: 2a01:xxxx:xxxx:xxxx::2/64 Scope:Global    inet6 addr: fe80::5054:a2ff:fe01:9a8c/64 Scope:Link      I can ping the server using primary IPv6 2a01:xxxx:xxxx:xxxx::2/64    ping6 2a01:xxxx:xxxx:xxxx::2   PING 2a01:xxxx:xxxx:xxxx::2(2a01:xxxx:xxxx:xxxx::2) 56 data bytes   64 bytes from 2a01:xxxx:xxxx:xxxx::2: icmp_seq=1 ttl=59 time=1.20 ms   64 bytes from 2a01:xxxx:xxxx:xxxx::2: icmp_seq=2 ttl=59 time=0.466 ms     However, when I try to use other IPs assigned I get no response. e.g. ping6 2a01:xxxx:xxxx:xxxx::3 ping6 2a01:xxxx:xxxx:xxxx::4 ping6 2a01:xxxx:xxxx:xxxx::5 ping6 2a01:xxxx:xxxx:xxxx::6    This is not limited to ping but also to any other request.  I would like to serve apache from multiple IPv6 addresses (not whole range). Where/ how should I change configuration to listen on more than 1 IPv6 address? Both HTTP and ping should work (Ping is used for uptime checks for specific services).

I know that the ip tool lets you bind multiple addresses to an interface (eg, ). Right now, though, I'm trying to build something on top of IPv6, and it would be really useful to have an entire block of addresses (say, a /64) available, so that programs could pick any address from the range and bind to that. Needless to say, attaching every IP from this range to an interface would take a while.  Does Linux support binding a whole block of addresses to an interface?


If you have an unpaired backtick  file = $` raise unless file == "my_file.rb"   You get the next line treated as a comment string.  It seems to be a pairing problem, based on   file = $` raise unless file == "my_file.rb" file2 = $` raise unless file2 == "my_other_file.rb"   having the last line highlighted correctly.  This is observed in the current version of .  Edit: Correction based on Michael's answer.

I noticed that sometimes my code gets highlighted in different colors when rendered.   What is syntax highlighting? How does it work? Why isn't my code being highlighted correctly? How do I report a bug or request a new language? How do I use syntax highlighting? What languages are currently available on Stack Exchange?


Okay so i rooted my Samsung Galaxy Express to jelly bean 4.2.2 using the method below.  but i cant access Samsung kies because it doesn't recognize rooted phones. So i was wondering if there was any way to keep the rooted features but go back to the stock rom? And if there is how do i do it and where do i get the file from?  Here are the steps I took to upgrade my phone:     Flash Clockwork Recovery         Download Express OUDHS CWM.exe.   Turn off the phone   Press and hold volume down and power to enter download mode (if this doesn’t work, press and hold volume down, power and home key)   Connect your phone to your computer via USB   Window ID: COM should be highlighted in yellow, this means your phone was properly detected   Press start and wait for installation   Disconnect your phone, recovery is now installed         Install SuperSU         Download SuperSU v1.25   Connect your phone to your computer via USB   Copy the SuperSU v1.25 file to the root of your SD card (make sure you have an SD card in your phone)   Turn off your phone   Hold volume up, power and home key to enter recovery (as soon as you see blue text on the top of the screen that read entering or   booting recovery, immediately release all the buttons)   Click on install zip from SD card and locate SuperSU file   Select the SuperSU file and install   After installation is complete, reboot your phone         You will now have both custom recovery and SuperSU installed on your   phone, which allows you to install custom ROM’s, which is the next   step. (Make sure USB debugging is still enabled). Please note that   these versions of CM10.1 and CM10.2 are unofficial builds, however are   stable enough as daily drivers.         Download CM10.1(Android 4.2.2) or CM10.2(Android 4.3)   Download Gapps (Google Apps) for CM10.1 or Gapps for CM10.2   Connect your phone to your computer via USB and place ROM and Gapps files in root of SD card (make sure they are on SD card)   Download ROM Manager and reboot into recovery. You can also manually reboot into recovery by powering off your phone, pressing and   holding volume up, power and home key.   Create a backup.   Wipe data/factory reset, wipe cache partition and dalvik cache (found in advanced)   Install the ROM from the SDCard   Install Gapps from the SDCard   Reboot phone and let it sit for a few minutes while it boots for the first time. It may take a few minutes, and this is only evident   upon initial boot.         You will likely run into issues with non functional WiFi. To resolve   this, after flashing the ROM, follow these simple steps:         Download this file.   Power off the phone.   Hold volume down, power and home button to enter download mode.   Press volume up to enter download mode.   Connect phone to your computer   Open Odin and flash the downloaded file as Bootloader (You should see a green box that indicates that the method passed and worked)   Reboot the phone and test WiFI

There are several reasons to be looking for a ROM:   Upgrading or downgrading your stock ROM Looking for firmware from a different region/language Flashing a custom ROM for different features, removing bloat, etc.   But where can one find ROMs in the first place?  What sites are likely to have the ROM I need?  ; please add to the wiki answer instead of posting separate answers.  See also:


I have a lookup field X and I want to make a workflow rule to fire when that lookup field is updated or the record is created. How can I do this because I keep getting an error like "Function ischanged cannot be used in this type of field."

I would like to define a workflow whose rule criteria is that a Lookup field changed, but ISCHANGED and PRIORVALUE generate syntax errors. Both generate the message     Error: Function (PRIORVALUE|ISCHANGED) may not be used in this type of formula   Is it possible for a workflow to determine when a Lookup has changed or is the Trigger territory?


I recently asked a question on Stack Overflow which was primarily about UICollectionViewController, a frequently used class in UIKit on iOS 7.  I wanted to tag the post with the tag , but could not do this because it exceeded the limit of 25 characters.  Please will you raise the limit on tag length? We frequently deal with long/descriptive class names in iOS and this hard and seemingly arbitrary limit reduces the usefulness of the tagging system.

I just tried to add a tag for "implementation-defined-behavior" on SO but I couldn't because of the 25 char limit. I had to resort to an abbreviation (), which is rather ugly and to some extent thwarts the purpose of tags, i.e. easy indexing.   Although I acknowledge that too long tag names could be unwieldy, sometimes there are technical terms that cannot be abbreviated in any useful way (especially when there is no widespread acronym).    Could an increase of that limit be considered?     EDIT  This is to respond to all the comments addressed at me that were triggered by the recent news brought up by @Shog9 in .  Shog9 announced that the limit was raised to 35 chars network-wide, thus some people asked me to accept his answer instead of .  TL;DR:  Sorry but, no, I won't accept Shog9's answer. Although I find the change very welcome, I think it is still somehow a sort of a patch for the SE network as it has evolved. A complex system such as SE network is now could well afford another mechanism vetted by high rep users/mods on per-site basis.  More explanation:  I really welcome the change, but this solution would have satisfied me at the time I originally posted my question. After all, 35 chars is probably a reasonable limit for a site like SO, or  where I'm currently active and committed.   At that time, IRRC, the SE network was still very young and there were very few sites on the network that rivaled SO in quality and traffic.  But time has changed since then, and there are sites that have greatly improved and that have the potential of outperforming SO in traffic (after all, there are more people watching TV or practicing mountain walking than programmers out there!).  Given how SE network has evolved, I still think that the right, long term, solution is option #5 in hildred's answer: in short, allow much longer names under the supervision of mods and as a new privilege for high rep users.   Abuse is always a possibility, even with shorter tag names or for other facilities of the sites. I don't see why, apart from some technical reason related to the structure of the system, hildred's solution (or kind of) could not be implemented with the same level of safety/security as other facilities.   There are sites, as it was shown by others, that desperately need a much higher tag length limit, if tags are to be useful for them.   As the name of something increases in length, meaningful abbreviations start to become unintuitive and not unique, hence you cannot expect people to gain any convenience when searching for an abbreviation they don't know about or that they must guess.   In the end, as on of those sites grows, the problem becomes ever worse, because funny abbreviations, with lots of still funnier synonyms, increase, rendering the tag system unreliable and inconvenient.


At what speed is our solar system expanding, and if it is, why don't the positions of the sun and planets change, or grow farther apart? Why is the Big Dipper still where it is?

The Hubble constant, which roughly gauges the extent to which space is being stretched, can be determined from astronomical measurements of galactic velocities (via redshifts) and positions (via standard candles) relative to us. Recently a value of 67.80 ± 0.77 (km/s)/Mpc was published. On the scale of 1 A.U. the value is small, but not infinitesimal by any means (I did the calculation a few months ago, and I think it came out to about 10 meters / year / A.U.). So, can you conceive of a measurement of the Hubble constant that does not rely on any extra-galactic observations?  I ask because, whatever the nature of the expansion described by the Hubble constant, it seems to be completely absent from sub-galactic scales. It is as though the energy of gravitational binding (planets), or for that matter electromagnetic binding (atoms) makes matter completely immune from the expansion of space. The basis for this claim is that if space were also pulling atoms apart, I would naively assume we should be able to measure this effect through modern spectroscopy. Given that we are told the majority of the universe is dark energy, responsible for accelerating the expansion, I wonder, how does this expansion manifest itself locally?   Any thoughts would be appreciated.


I think there are, but I haven't been able to prove this. I tried to make two injections, but I get stuck on trying to map all functions f from $\mathbb N$ to $\mathbb N$ onto the injective ones. How do you make sure f becomes injective, while making sure that the bigger injection stays injective? Or am I wrong and there are not even uncountably many functions?

The set of permutations of the natural numbers has the cardinality of the continuum. I've got injections in both directions, no problem. The Schröder–Bernstein theorem tells us that this implies the existence of a bijection. I'm wondering if it's possible to construct one explicitly.  (In what follows, I'm using the convention that $0\not\in\Bbb N$. This obviously doesn't change anything, cardinality-wise.)    For $\Bbb R\to S_\Bbb N$, we note that every real number is the limit of some rearrangement of the alternating harmonic series. If $\alpha\in\Bbb R$, we start with positive terms: $1+\frac13+\frac15+\cdots$, until we obtain a partial sum greater than $\alpha$. We then add negative terms until our partial sum is less than $\alpha$, then we switch back to the positive terms, starting with the first unused one, etc.  In this way, we construct a series, and if we take the absolute values of the reciprocals of the terms of it, we have a permutation of $\Bbb N$. This mapping is not onto, because many permutations of the series converge to $\alpha$ - all we have to do is "overshoot" at some point, and then continue converging to $\alpha$ as usual. (More trivially, we only get permutations with $\sigma(1)=1$ using this particular construction.)    In the other direction, if we have a permutation $\sigma\in S_\Bbb N$, we can write the continued fraction $[\sigma(1);\sigma(2),\sigma(3),\ldots]$. This actually injects $S_\Bbb N$ into $\Bbb R\setminus\Bbb Q$, because non-terminating continued fractions represent irrational numbers. Thus, this mapping is not onto; it is not even onto the irrationals.For example, no permutation of $\Bbb N$ maps in this way to any quadratic irrational, or to $e$, or to any other irrational whose c.f. expansion has repeated terms.    So, those injections are fun and all, but finding an explicit bijection seems hard. Clearly, a bijection between $S_\Bbb N$ and any interval would suffice, because there are standard, elementary ways to construct bijections between $\Bbb R$ and any interval.  I have Googled in vain for a solution, and I don't believe this question is a duplicate. I will be happy for a hint or a full solution, or an explanation of why such an explicit construction is impossible.  Full disclosure: someone online claimed that this is "not hard", but refused to explain how, other than mentioning the Cauchy sequence construction of the reals. I don't see how that's useful, and I think he's mistaken or bluffing. I'm not too proud to admit I'm stumped. :/


I am writing a handwritten recursive descent parser as a self exercise. I'd like to see if an iterative approach is possible. Generally speaking, I'd like to know what mindset I should have in order to transform interdependent recursive functions into an iterative solution.  In my current minimal example, I have a list of Tokens (which is simply a type with a lexeme) and they are consumed via recursive descent to build an abstract syntax tree represented by a unique_ptr to an expression:  #include <string> #include <memory> #include <vector>  enum Type { Num, Add, Mul, LParen, RParen };  struct Token {   Type type;   std::string lexeme; };  struct Expr {   Token token; };  using AST = std::unique_ptr<Expr>;  struct Literal : public Expr {   double value; };  struct Grouping : public Expr {   AST inner; };  struct Binary : public Expr {   AST lhs, rhs; };  using CIT = std::vector<Token>::const_iterator;  auto expression(CIT& it, CIT end) -> AST;  auto literal(CIT &it, CIT end) -> AST {   if (it != end and it->type == Type::Num) {     auto value = std::stod(it->lexeme);     auto token = *it++;     return std::make_unique<Literal>(Literal{ token, value });   }   else if (it != end and it->type == Type::LParen) {     auto token = *it++;     auto ast = std::make_unique<Grouping>(Grouping{ token, expression(it, end) });;     if (it != end and it->type == Type::RParen)       return ast;     else       throw "Mismatched parenthesis";   }    throw "Unable to parse literal"; }  auto multiplication(CIT &it, CIT end) -> AST {   auto ast = literal(it, end);    while (it != end and it->type == Type::Mul) {     auto token = *it++;     ast = std::make_unique<Binary>(Binary{ token, std::move(ast), literal(it, end) });   }    return ast; }  auto addition(CIT &it, CIT end) -> AST {   auto ast = multiplication(it, end);    while (it != end and it->type == Type::Add) {     auto token = *it++;     ast = std::make_unique<Binary>(Binary{ token, std::move(ast), multiplication(it, end) });   }    return ast; }  auto expression(CIT &it, CIT end) -> AST {   return addition(it, end); }  int main() {   std::vector<Token> tokens = {     { Type::Num, "5"},     { Type::Add, "+"},     { Type::LParen, "("},     { Type::Num, "4"},     { Type::Mul, "*"},     { Type::Num, "3"},     { Type::RParen, ")"},   };    auto it = tokens.begin();   auto ast = expression(it, tokens.end()); }   Here there is a circular dependency of recursive calls: addition depends on multiplication, multiplication depends on literal, and literal 'depends on' addition.  I'd like to see if there is a way to flatten these calls into a singular iterative call. My first thoughts were to loop through the tokens and do a switch case between the precedence of operators; however, I am unsure where to go come there.  Non-complete attempt:   auto parse(const std::vector<Token>& tokens) -> AST {   AST current;    enum class Precedent {     Addition, Multiplication, Literal   };    for (const auto& token : tokens) {     switch (precedent) {       case Precedent::Addition: {         ???       } break;       case Precedent::Multiplication: {         ???       } break;       case Precedent::Literal: {         ???       } break;     }   }    return current; }   I feel that I am missing some kind of stack as a lot of iterative solutions from recursive solutions appear to maintain a manual call-like stack.  Any hints would be appreciated.  Edit: I've reviewed the post referring to the duplicate, though I believe my question is different that the one linked. I am not trying to make a single recursive function into an iterative one, I am trying to make multiple recursive functions into a single iterative function. I hope that explains why I asked this question.

I've used recursion quite a lot on my many years of programming to solve simple problems, but I'm fully aware that sometimes you need iteration due to memory/speed problems.  So, sometime in the very far past I went to try and find if there existed any "pattern" or text-book way of transforming a common recursion approach to iteration and found nothing. Or at least nothing that I can remember it would help.   Are there general rules? Is there a "pattern"?


I want to be able to pull the undefined elements out of the array, so that my table can correctly display the values. Currently I have this problem, where the following table shows the data corresponding to those tables, but it seems that the arrays occupy positions with the data that cannot be displayed, and I would like to remove them from the array:  this is the code:       team.playerHasTeams.map((player) => {         playersInTeamData.push({           idTeam: team.id,           playerName: player.bookings.full_form_data.name,           lastName: player.bookings.full_form_data.lastname,           location: player.bookings.full_form_data.location,           dateBirth: player.bookings.full_form_data.birth_date,           gender: player.bookings.full_form_data.gender,           position: player.bookings.full_form_data.position         })        })       let formatedData = playersInTeamData.map((player, index) => {         if (player.idTeam === team.id) {           return {             key: index,             assingTeam: (               <Form.Item>                 <Select placeholder="Assign">                   {searchResponse.map((team, index) => (                     <Select.Option key={index} value={team.id}>                       {team.official_name}                     </Select.Option>                   ))}                 </Select>               </Form.Item>             ),             playerName: player.playerName,             lastName: player.lastName,             location: player.location,             dateBirth: player.dateBirth,             gender: player.gender,             position: player.position           }         }       })

How do I remove empty elements from an array in JavaScript?   Is there a straightforward way, or do I need to loop through it and remove them manually?


"Summing" the series $\sin(x)+\dfrac{1}{2}\sin(2x)+\dfrac{1}{3}\sin(3x)+\dfrac{1}{4}\sin(4x)+...$ Pose $$S=\sin(x)+\dfrac{1}{2}\sin(2x)+\dfrac{1}{3}\sin(3x)+\dfrac{1}{4}\sin(4x)+...$$ $$C=\cos(x)+\dfrac{1}{2}\cos(2x)+\dfrac{1}{3}\cos(3x)+\dfrac{1}{4}\cos(4x)+...$$ $$C+iS = e^{ix}+\dfrac{1}{2}(e^{ix})^2+\dfrac{1}{3}(e^{ix})^3+\dfrac{1}{4}(e^{ix})^4+...$$ Let $t$ = $e^{ix}$ Then we have a series of $t+\dfrac{t}{2}+\dfrac{t}{3}+\dfrac{t}{4}+...=\log(1+t)$ Which is $-\log(1-e^{ix})=\log(1-\cos(x)-i\sin(x))$, use the formula $\log(A+iB)=\dfrac{1}{2}\log(A^2+B^2)+\arctan\left(\dfrac{B}{A}\right)$ $-\log([1-\cos(x)]-i\sin(x))=-\dfrac{1}{2}\log([1-\cos(x)]^2-i\sin^2(x))-i\arctan\left(-\dfrac{\sin(x)}{1-\cos(x)}\right))$. Since we are interested only in the imaginary part, we have the sum for $S$ is: $$-\arctan\left(-\dfrac{\sin(x)}{1-\cos(x)}\right)$$ Which is $-\arctan\left(-\cot(\dfrac{x}{2})\right)$ I don't know what to do next. The "sum" of this series should be $\dfrac{\pi-x}{2}$, according to Euler.

$\sum\limits_{k=1}^{n}sin(kx)=\frac{sin(\frac{n+1}{2}x)sin\frac{nx}{2}}{sin\frac{x}{2}}$  Base case: For $n=1$  $sinx=\frac{sinx\cdot sin\frac{x}{2}}{sin\frac{x}{2}}=sinx$  Induction hypothesis: For $n=m$  $\sum\limits_{k=1}^{m}sin(kx)=\frac{sin(\frac{m+1}{2}x)sin\frac{mx}{2}}{sin\frac{x}{2}}$  Induction step: $n=m+1$  $\sum\limits_{k=1}^{m+1}sin(kx)=\frac{sin(\frac{m+2}{2}x)sin\frac{(m+1)x}{2}}{sin\frac{x}{2}}$  Prove: $\frac{sin(\frac{m+1}{2}x)sin\frac{mx}{2}}{sin\frac{x}{2}}+sin(m+1)x=\frac{sin(\frac{m+2}{2}x)sin\frac{(m+1)x}{2}}{sin\frac{x}{2}}$  Left side: $\frac{sin(\frac{m+1}{2}x)sin\frac{mx}{2}+sin\frac{x}{2}sin(m+1)x} {sin\frac{x}{2}}$  How to prove this equality? I used $sin(u)sin(v)$ identity but that didn't help.


I wonder if there's a way to combine a JS selector with jQuery functions methods like that:  document.getElementsByClassName("example").on("click", function() {   ... });

I am creating an element with document.createElement(). Now how can I pass it to a function that only takes a Jquery object?  $("#id")    I can not use it, as the element has not been rendered in the page yet.


Which one of the following is correct regarding the possessive forms?         "The effects of music therapy on students’ depression"   "The effects of music therapy on student depression"      (Note: 100 students are recruited into the study)

I am firmly convinced he is innocent and his accusation is the result of the police conspiracy.     I am firmly convinced he is innocent and his accusation is the result of the police's conspiracy.    Which sentence do you think is a better choice?


I saw a couple screenshots showing some characters displayed as graphics, like this:     While in my terminal I get this:    How can I configure my terminal to display those images???

OS X has emoji support inside terminal, and I'm a little jelly.   brings emoji support to Ubuntu, but at the moment the terminal will only render monochrome emojis.  Is there a way to get these color beauties in gnome terminal?


I have written an old app long time ago on another computer. This one does not exist anymore - and with it all the source is gone - but I still have the app in form of jar files.  Now I need to check my old code what I have done in a particular place in code. I know I can create a java from it - but I need to check it while it's running...  I have tried javasnoop - but it can not attach. It keeps trying but forever - other apps I can attach to and debug.  is there any other way/tool that can attach to a running jar and debug it?  If that makes a difference: the application is being started with an EXE file and then uses the jar libs...  Thanks

Normally to attach a debuger to a running jvm you would need start the jvm with arguments such as the following:  > java -Xdebug -Xrunjdwp:transport=dt_socket,address=1000,server=y,suspend=n   Now if I want to debug a process that wasn't started in debug mode, what can I do?  This situation arrises when a production system (i.e. started without debug args) exhibits a 'random' (I use the term loosely) bug. So I can't restart the jvm with the appropriate arguments, because nobody knows how to reproduce the bug again. Is it impossible to attach to the JVM in this situation?  Just to clarify it is not possible to use tools like jdb to attach to already running JVMs unless they were started in debug mode  from the JVM man page     Another way to use jdb is by attaching it to a Java VM that is   already running. A VM that is to be   debugged with jdb must be started with   the following options:


In Carrom, if both players have one one coin and the queen and one player pocketed their coin before the queen, what is the result?

This is intended to be a canonical question regarding possible endings of the game.  For each question, assume a single proper strike was made, and note where an improper strike would change the game outcome (beyond an additional point for the opponent).  If the Queen has been covered:     What happens if I pocket my last C/m and the Striker? What happens if I pocket my opponent's last C/m? What happens if I pocket my opponent's last C/m and the Striker? What happens if I pocket both players' last C/m? What happens if I pocket both players' last C/m and the Striker?     If the shot covers the Queen:     What happens if I pocket my last C/m and the Queen? What happens if I pocket my last C/m, the Queen and the Striker? What happens if I pocket my opponents' last C/m and the Queen? What happens if I pocket my opponents' last C/m, the Queen and the Striker? What happens if I pocket both players' last C/m and the Queen? What happens if I pocket both players' last C/m, the Queen and the Striker?     If the Queen is left on the board:     What happens if I pocket my last C/m, leaving the Queen? What happens if I pocket my last C/m and the Striker, leaving the Queen? What happens if I pocket my opponent's last C/m, leaving the Queen? What happens if I pocket my opponent's last C/m and the Striker, leaving the Queen? What happens if I pocket both players' last C/m, leaving the Queen? What happens if I pocket both players' last C/m and the Striker, leaving the Queen?