I just messed up python. I'm not able to access Ubuntu GUI even after installing gdm3 again at tty after login. Now, dpkg is throwing errors as a huge list of python3. And sometimes also says python3 not configured. I tried everything on stackoverflow and related platform but nothing helped. I can agree with reinstallation of Ubuntu, but please help me do it  by securing my data. I'm being frustrated since 2 days seeing a long list of python packages thrown by Dpkg. When I was using GUI, I uninstalled python3 and did changes with symlinks because I was stuck at PYTHONPATH. Now, I've python installed already but no python interpreter pops up when I use "python" or "python3" at terminal. Please ignore the formatting, I can't use my laptop so using Phone. The main thing is dpkg throwing a huge list of python packages. Please take me out of this!


Can't choose the time for an appointment on visa4uk

I am trying to apply for a visa and the  doesn't let me pick the time for an appointment, although I can see the menu to pick the time just for a second, after then it disappears and shows me that there is no time available for an appointment whatsoever. I called the support and they are suggesting to use very old versions of Internet Explorer although Windows doesn't even allow me to download such an old version of the browser.


Do I need to consider airport transit visa for France?

I would be travelling to Santiago, Chile from New Delhi, India this weekend. I hold a valid visa for Chile only. I had booked a ticket to fly New Delhi - Paris - Santiago. I have a five hour layover at Charles de Gaulle Airport, Paris, France.


Get URL parameters from a string in .NET

I've got a string in .NET which is actually a URL.  I want an easy way to get the value from a particular parameter. Normally, I'd just use Request.Params["theThingIWant"], but this string isn't from the request.  I can create a new Uri item like so: Uri myUri = new Uri(TheStringUrlIWantMyValueFrom);  I can use myUri.Query to get the query string...but then I apparently have to find some regexy way of splitting it up. Am I missing something obvious, or is there no built in way to do this short of creating a regex of some kind, etc?


What is the origin of the phrase "from your lips to God’s ears?"

I used this phrase in a conversation with my wife yesterday and was surprised to learn that she had never heard of it.  This led me to wonder where it came from.


Time of a ball going up and down with air resistance

A ball is shot directly upward, and then it comes back to the place where it was shot. Suppose we have air resistance. Suppose $t_1$ is the time period from the moment that the ball was shot to the moment that it reached its highest altitude, and $t_2$ is the time period from the moment it reached its highest altitude to the moment it reached its original position. Is $t_1=t_2$? Why or why not?


Is it appropriate to copy a drawing from a book in my master thesis?

I would like to know if it is appropriate to copy a drawing from a book (specifically a directed graph) and develop my theory on that drawing? It is sure that I am going to make a reference for that drawing.  Note: The author of that book I intend to copy the drawing develops his theory based on that figure, but I am going to approach everything it matters more deeply.


Suppose $f(x)$ defines on the bounded interval $I$. Prove that $f(x)$ is uniformly continuous on $I$ if and only if the image of each Cauchy sequence under $f$ is also a Cauchy sequence.   The "only if" part is easy. For the "if" part I can prove that $f$ is continuous on $I$. But how to prove it's uniformly continuous? I try to prove by contradiction, but could not get a Cauchy sequence.


How to handle russian characters in mysql, while loading them from a sql file?

I'm trying to parse a big JSON file, which has all kinds of languages (russian, swedish etc). I read this JSON file using PHP, make queries out of the data, save the queries into a text file and load the data into a mysql database from this sql file.  It all seems to work, except for the special characters.  If I cat the sql file (on a mac terminal), I can see the characters correctly. If I open the file in vi, the characters are all jumbled up. And if I try to load the SQL file into mysql, I get errors.  My table is set to UTF8. What other steps do I need to take to fix this problem?


Some inequalities between 1- norm, 2- norm and infinity-norm: $\|x\|_2\leq\sqrt{\|x\|_1\| x\|_\infty}\leq\frac{1+\sqrt{n}}{2}\|x\|_2$

Let $x\in\mathbb{C}^n$. Do the following inequalities hold? $$\lVert x\lVert_2\leq\sqrt{\lVert x\lVert_1\lVert x\lVert_\infty}\leq\frac{1+\sqrt{n}}{2}\lVert x\lVert_2.$$ I think the first inequality is the Holder inequality with $p=1$ and $q=\infty$.


Buying itunes gift card for friend in NL

I have a friend's birthday who lives in the Netherlands (I live in the UK). Is there any way I can buy a gift card from the netherlands that will send to them? Googling seems to throw up a lot of sites - not many of which seem trustworthy. Many thanks!


How remove margin in a paragraph that continues in two pages with different margin?

I've created a document whose margins have different odd and even pages. I want to write a paragraph with no margin in two pages runs. If I use the command \newgeometry  new paragraph starts at the top of new page, that I want to start at the same place. And the command \begin{adjustwidth}{}{} such marginalized different odd and even pages are not useful. Please guide me in this regard.   I use this command for create margin:  \documentclass[11pt,fleqn]{book}  \usepackage[total={215mm,285mm},top=3cm,bottom=3cm,headsep=10pt,     vmargin=2cm,     outermargin=7cm,     innermargin=2.5cm,     marginparwidth=5cm,     marginparsep=10pt]{geometry}


How do I refill a fire extinguisher or should I just buy a new one?

My fire extinguisher is out of charge and I want to either refill it or buy a new one.  Is it better/cheaper to refill it or just buy a new one?  (Can I even refill this fire extinguisher?)     EDIT:


Is it a bad practice to use similar floating action buttons with different functionalities in different pages

According to Material Design Guidelines, Google states that on any page the primary action of the page can be promoted in the floating action button.  But what if on different pages, we use similar floating action buttons for different proposes?   Both actions on both pages are adding, but the item that is added is different so the functionality is kind of different, but yet it's adding and I can't think of a different icon like "plus icon" to be placed on the fab. Keeping in mind that the pages may be blow by blow, is it a bad practice to do so?


Are any of the alien languages in Star Wars real Earth languages?

Are any of the alien languages (other than English and binary) in Star Wars movies or TV shows real Earth languages?


Can people take advantage of the Stack Overflow bounty option?

I haven't used the bounty system before, but I understand that people place part of their rep points on to a question that has not been answered yet. But I believe that for the points to be given, the OP must give the answer the tick. If this is so, can people not just ask a question, place a bounty on to it and get the correct answer; but not give the answer the tick. Thus keeping their points. Isn't this a flaw in the system, or is this intentional?


Applications of low-dimensional topology to physics

As a mathematics graduate student whose research area lies in low-dimensional topology (more precisely, invariants of 3-dimensional topological manifolds), I heard that there exist multiple applications of this theory to theoretical physics, and moreover, that many mathematical problems in the field actually arise from physical ones.  I would appreciate any examples of such applications/motivation, and references to textbooks (or articles which don't require a deep knowledge of physics) where I could read more on the subject.


Fast way to come up with solutions to $x(x-1)(x-2)(x-3)=1$?

I can solve this equation $x(x-1)(x-2)(x-3)=1$ using the usual method but I am looking for a fast analytical method to solve this. Any hints ?


Conjugation of answer to "How much money is there?"

I'm using a website -  - to teach my child how to count American coins, amongst other activities. The site also has .  One thing that doesn't seem right - and perhaps I'm missing something here - is their conjugation of the response to "How much money is there?"  Here is an example of what I'm referring to:   I've never encountered the question where there's only a single penny (1¢) displayed. Thus there are always several cents. I would have thought that the answer should be conjugated with the plural conjugation.  Is the correct answer to "How much money is there?" (in the case of the three 1¢ coins and the 5¢ coin shown in the image) "There are eight cents."? Or am I missing something?  EDITED: There might be a previous question on this site whose answer would be applicable to this OP's question, but neither of those two threads cited to mark this OP's thread as a "duplicate" has an answer for the OP's question: the 1st "duplicate" thread discusses "A total of X" and its number when it is a subject, the 2nd thread involves a possible subject-dependent inversion with a measurement phrase with a sentence beginning with "Here". This OP's specific question deals with numerous topics, and its sentence also involves a leading "There", which ends up making the issue even more involved. Please get the duplicate mark off this thread so I can give the OP an answer. -- F.E.


Question deletion and no change in reputation

When a question with some upvotes or downvotes but no answer is deleted by the person who posted, the reputation of that person does not change. Why is that?  EDIT: I figured out the answer to a question I asked, and therefore, deleted the question (with no answers) but overall 3 upvotes. I do not remember whether it had any downvotes. But there is no change in my reputation.


Is there an idiom for people who boast too much?

I am looking for idioms or informal/slang/colloquial expression for some people that make you think that they are able of building a skyscraper, constructing a spaceship, playing the piano better than Mozart or something very fancy that requires remarkable skills, but when it comes to practice they prove to be completely inadequate.


What is wrong with this code i am having: causes java.lang.NullPointerException

Can you see the problem in my code? I get this exception:  java.lang.NullPointerException:   Attempt to invoke virtual method 'void android.support.v7.widget.RecyclerView.setLayoutManager(android.support.v7.widget.RecyclerView$LayoutManager)' on a null object reference   With this code:   RecyclerView recyclerView; RecyclerView.Adapter adapter;  @Nullable @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {     View view = inflater.inflate(R.layout.latest_events_fragment, container, false);      recyclerView = (RecyclerView)view.findViewById(R.id.events_recycler);     LinearLayoutManager linearLayoutManager = new LinearLayoutManager(getActivity());     recyclerView.setLayoutManager(linearLayoutManager );     list.add("A");     list.add("B");     list.add("C");;     // specify an adapter     adapter = new EventsRecyclerAdapter(list);     recyclerView.setAdapter(adapter);       return view; }   here is my .xml file it's called events_list.xml `   `


How to make a chapter heading like this in latex

How can I make a chapter heading like this in latex?


Why do we detect neutrinos from core collapse SNR 2 hours before we detect light?

I have heard in a talk given at the Fermilab (on Youtube) that we typically detect a neutrino burst from a core-collapse supernova CC SNR explosion 2 hours before we detect its electromagnetic radiation. When the question was raised about whether this violates the principle that nothing can travel faster than light, the answer given by the speaker was that when the collapse is happening, the neutrinos are expelled, whereas light from the supernova comes AFTER the explosion, not during the collapse. But doesn't it take about 1 second for the iron core to collapse completely? Why is there a 2 hours difference between our receiving the neutrino burst and light from the explosion?  Thank you  P.S. I read around and found that the reason is because light has to travel a lot of distance within the star which "slows" it down, however, as mentioned earlier, it takes only 1 second for the entire iron core to collapse, right?


I've seen it first while studying about dual spaces. A canonical isomorphism between a vector space and its double dual. I've been searching for a while in a little bit more advanced-topic books likes algebraic structures, category theory and representation theory for a formal definition. They are using a LOT the word "canonical", but I couldn't see any record of it in any of those books. How come it is so "hard" for the writer to define the word he used so much? I mean, you probably can find any definition you want in a book just by finding the first time it's been used - this will probably be the definition. Why is it so comfortable to use the word "canonical" so much without any formal definition?


Automatize spatial join when creating an new feature

I'm working with QGIS an I have a polygon and a line layer. The polygon layer defines a certain area and each polygon has its own specific ID (something like "ARC1" oder "GZT2"). I was wondering if its possible to join this ID to the line layer while creating new features within a polygon. But it doesn't stop here. While creating a line, the type of the line is chosen via dropdown menu (something like "OG" or "HSBV"). My final goal is to connect this information with the ID from the polygon layer. A final addition is a sequential number. In the end the ID for a line should look like this: "ARC1_OG_001". I think I could work my way around once the information from the polygon layer is contained in the line layer. My idea is using something like "concat" but I have no idea how to do this spatial join automatically. It would be nice to have a user friendly ID generation for those lines.


How to pass in a large amount of parameters into a method


Does pixel size make a difference in image quality?

I am thinking of purchasing the Nikon D3200 its a 24.2MP camera but the pixel size is 14.8 µm² compared to the D3100 which is 14MP and a pixel size of 25.1 µm².  Is this something that i should worry about, or is it somewhat irrelevant, as the eye cannot see such fine detail?  I am worried about the digital noise. I understand that at higher ISO's like 800, I will see more noise. But at 50/100 ISO, will I notice the difference between the pixel sizes, and ultimately does this constitute to better or worse image quality?  D3100 - £269  D3200 - £329   Last question: is it worth the extra money?


"What doesn't she know how to cook" vs. "What does not she know how to cook"

Which of the following is correct? If A is correct why is B incorrect?  I am stumped, This sentence has popped up in my Hong Kong English class, don't know how to sort it out. Why does the one sentence sound awful yet is essentially the same:     A) What doesn't she know how to cook?   B) What does not she know how to cook?   C) What does she not know how to cook?


Kolkata to Guangzhou, China. Ticket Transit to Bangkok suvarnabhumi airport

I am a Bangladeshi citizen.  will be traveling from Kolkata to Guangzhou, China.  Ticket Transit to Bangkok Bangkok suvarnabhumi airport transit ticket.  Do I need a Bangkok visa?


I have an assembly call it A.dll that is xcopied deployed with A.exe.  Updates to A.dll are not appearing on the server where I deploy.  It turns out an old version of A.dll has been installed to the GAC.  Indeed when I delete A.dll from my local run path A.exe still runs as it is finding the version in the GAC.  So my understanding was the .NET runtime would look in the local folder where an EXE is run for referenced assemblies.  If not found there look in the GAC.  Is this not the case?  Thanks, John


I'm upgrading to 3.0 and ran into some issues with the upgrade. Specifically, I got an error when trying to start up mongod via ssh, it tried to use the default dbpath instead of the one I specified in my new YAML config file. I went ahead and rebooted the machine and now mongod is up and running again. I'm a bit paranoid at this point and would like to know if there's a way to make sure the storage engine is wiredtiger from the shell.


How can I edit the Menu entries in the taskbar?

I am running Lubuntu 18.04LTS and have a taskbar at the bottom of the screen.  The leftmost button opens a menu of themed options, such as "Graphics" with subfolders of applications (GIMP, Inkscape, Krita, Digicam, and so on).  I've got an entry for Digikam that currently points to an older version than the one I recently downloaded.  I know I can make a shortcut on the desktop to that but I'd really like to just edit the file that tells the entries which to open.  Can I do that somehow?  Thank you!


Can a Ring of Spell Storing make it possible to apply multiple Metamagic options to one spell?

The Ring of Spell Storing is a unique item in that it allows one spell to be cast two times. The first time is when the spell is cast into the ring:     Ring of Spell Storing, DMG 192      This ring stores spells cast into it, holding them until the attuned wearer uses them. [...] Any creature can cast a spell of 1st through 5th level into the ring by touching the ring as the spell is cast.   The second time, when the spell is cast from the ring:     Ring of Spell Storing, DMG 192      [...] While wearing this ring, you can cast any spell stored in it. [...]   Metamagic works on a per-cast basis:     Metamagic, PHB 101      You can use only one Metamagic option on a spell when you cast it, unless otherwise noted.   Furthermore, it's possible for two Sorcerers to share one RoSS. The first one can cast, for example, one Heightened and Empowered fireball into the ring, and then give it to the second. The second would then be able to cast the previously-Metamagicked fireball from the ring, but also apply Careful Spell on top of another Empowered Spell.  This seems to make it possible, albeit with some difficulty/resources/planning, to cast one spell with four applications of Metamagic. Is this possible, or am I missing a rule that forbids this?


What is the word for someone calling something bad, but then that person does the same thing?

I really want to know because it occurs a lot with the people I hang out with. I would do something "bad" and get in trouble, or get called out for it, but then the people who had a negative response to what I did would do the same thing as if they forgot it was bad.


Problem with click event on button change class

I try to understand what it is wrong with my code when I click on my button I change his class but I click again on the changed button class nothing happend I try to use on() function but the same things nothing happend   here my sample code:  $('#my-btn').click(function(){   $(this).removeClass('btn-success');   $(this).addClass('btn-danger');   $(this).html('Close'); });  $('.btn-danger').click(function(){     alert('hello world');   $(this).removeClass('btn-danger');   $(this).addClass('btn-success');   $(this).html('Open'); });   And my jfiddle for testing :


Let $\{K_i\}_{i=1}^{\infty}$ a decreasing sequence of compact and non-empty sets on $\mathbb{R}^n.$ Then $\cap_{i = 1}^{\infty} K_i \neq \emptyset.$  I heard about a proof that take $x_i \in K_i.$ Then I have constructed a sequence. It is bounded because for every $i$, $x_i \in K_1$ that is bounded. Then there is a subsequence that converges. That is where I stopped. What indeed means that a subsequence converges? And why does the limit of such subsequence is in every $K_i,$ showing that such intersection is not empty.  Thank you!


I am trying to return an integer if particular string is true. (For this I do not want to use an array).     public String calcNextDay()   {      if (day == "Sunday"){       return 0; // If day is Sunday return 0      }else if (day == "Monday"){       return 1; // If Day is Monday return 1      }else if (day == "Tuesday"){        return 2; // If day is tuesday return 2      }else if(day == "Wednesday"){        return 3; // If day is Wednesday return 3      }else if(day == "Thursday"){         return 4;// If day is Thursday return 4      }else if (day == "Friday"){          return 5;// If day is Friday return 5      }else if(day == "Saturday"){         return 6;// if day is Saturday return 6           }           }   I have also tried this, but am getting an error with the return dayValue stating it can not be converted to String (even though I do not want to turn it to a string)     public String calcNextDay()   {      int dayValue = 0;      if (day == "Sunday"){      dayValue = 0; // If day is Sunday return 0      }else if (day == "Monday"){      dayValue =1; // If Day is Monday return 1      }      return dayValue;      }   What am I doing wrong?   Based on the comments I changed some code to   Public String calcNextDay()   {      int dayValue = 0;      if (day.equals("Sunday")){         dayValue = 0;      }else if (day.equals("Monday")){         dayValue = 1;      }else if (day.equals("Tuesday")){         dayValue = 2;       }return dayValue;           }   error: incompatible types: int cannot be converted to String                     }return dayValue;  Thank you, I got passed that problem and then I get to the error Day.java:178: error: non-static variable dayValue cannot be referenced from a static context          System.out.println("Your day is stored as " + testday.setDay() + dayValue);                                                                           ^ 1 error  My main() is a static, but my dayValue is not


AMS align / Align multiple “=”, too much space

I asked this question at stackoverflow and have been kindly redirected here.  I'd like to align some equations in Latex using the AMS packages. Each equation has two equal signs that need to be aligned. So something in the line of  A = B = C D = E = F   I've tried using the align-environment like this  \begin{align} A &= B &= C \\ D &= E &= F \end{align}   This works in principle (it aligns), however it adds ridiculously large spaces before the second equal sign in each line. But I just want the line to runs as if there was no additional alignment tab. Only when I replace for example "B" by "BBB" I want the equal sign before "F" to shift to right the exact amount of space.  Could anyone help me out on that one? It's kind of driving me crazy since I don't get the idea of that strange behavior and I just can't find any solution. Maybe alignat could help, but I don't really get how that environment works.  Cheers, Oliver


How can I make copy/paste in the Ubuntu 16.04 Shell? For example, pasting a string from my browser to the cli and execute it as a command (Ctrl+V not working by default)


Can I use a 12VDC 300mA power supply to run a small 12VDC motor which draws 400mA? Will anything be damaged? Can it start a fire?


Give a combinatorial proof: $ n(n+1)2^{n-2} = \sum_{k=1}^{n}k^2\binom{n}{k} $

Find a combinatorial argument for the following binomial identity:   $$n(n+1)2^{n-2} = \sum_{k=1}^{n}k^2\binom{n}{k} .$$   Algebraic proofs can be found at  , and a related identity at  .


CSS file works offline but not when uploaded to webserver

I just completed my portfolio website and uploaded it to a subdomain of my parent website.  Now the website works fine except that my main styling CSS doesn't work, no errors in the console, nothing. It just doesn't work. I verified it by placing the CSS in <style> tags in the head of my index.html and it worked but then it messed up with my paroller.js plugin, no errors in the console but paroller.js stopped working.  If I include the CSS like I've included it offline (in a separate file, like I always do and it always works on the same web server) it just doens't work. If I include it in the index.html my paroller.js plugin stops working.  Everything works fine offline.  I'm importing the CSS like this - <link rel="stylesheet" href="folername/filename.css"> Please note that I am loading multiple CSSs and this one is the first to be loaded. All other CSSs seem to be working.  The webpage is located at -


Fast Prime Wide lens for Landscape Photography and focal distance

I was evaluating the  and saw few videos where it was mentioned that it is excellent for landscape photography. However this lens has normal focal distance of about 0.5 feet for a subject which is fixed then how is it able to focus on things which are far away? My understanding is that all far away mountain landscape should stay out of focus but that doesn't happen. Can someone please explain how the focal length will play a role here. If it can focus on far away objects then why we say focal distance to be 0.5 feet?


I am doing a problem on Bayesian regression but I'm having a lot of trouble with it. Here is the question:   Consider $f=w^Tx$, $p(w)\sim N(w|0,\Sigma)$. Show that $p(f|x)$ is Gaussian. Find the mean and covariance of $f$. Consider $t=f+\epsilon$ where $\epsilon\sim N(0,0.001)$. What is $p(f|t,x)$?   I'm just really confused about the notation. Since we are doing Bayesian regression, shouldn't we really be trying to compute $p(w|f)$? Why are we conditioning on $x$, which doesn't have a prior on it? What does $p(f|x)$ and $p(f|t,x)$ even mean?


How much effect does the Bernoulli effect have on lift?

I understand that the Bernoulli effect is a flawed explanation for the cause of lift, and does not cause much at all, but how much?   Is there any experimental data on the force caused by the Bernoulli effect? Maybe implicitly through data of the pressure difference between the top and underside of an aeroplane's wings. After that, I assume I could (crudely approximating the pressure to be acting perpendicularly to the flight direction) use $\Delta P A$ to work out the net force on the plane.    Perhaps there is another way to quantitatively analyse the extent to which the Bernoulli effect causes lift.  Edit: see  short cartoon (content similar to Mike Dunlavey's answer).


What should we do with old, very popular closed questions?

Motivated by the deletion of     On one hand, I disagree with these closures, because:  These questions were (and still are) very popular They have some good information in them (or at least the first one does) and it feels like bad sportsmanship to remove good information from the internet, particularly when it was contributed by your fellow users  Number 2 in particular bothers me. A lot. On the other hand, I do agree that:  The community of 10k users should be able to decide which closed questions they wish to delete on their own without me intervening These questions should definitely remain closed, because they either have an absurd # of answers, or are duplicates (though some duplicates ). Which means they are eligible for deletion … forever. These questions wouldn't survive more than 10 minutes if asked today on Stack Overflow, so in some ways they are artifacts from the past, like dinosaurs in an era of mammals.  There is some related discussion in:   While I normally favor code solutions here, I am not sure I like the idea that once a question gets 400 upvotes it should become extremely difficult to delete. It feels like mob rule. Official policy on the blog:


Condensed matter physics for mathematicians

What is a good way for me to learn the basics of condensed matter physics? I'd like to get a better understanding of the fundamentals behind recent technological developments like OLEDs, applications of graphene, or get a grip on what the fractional hall effect is about. I don't expect to do research in these areas, but I would like to be able to have meaningful conversations with people working in these areas.  My background is this: I have a PhD in pure mathematics, I even studied a little solid state physics (eg. Bloch waves), QFT and a first course in String Theory, but a long time ago now. My mathematics is much stronger than my physics intuition so I'm looking for a more mathematical treatment. My lab experience is precisely zero. I'm more interested in the theoretical ideas than precise details.  Are there any books or downloadable lecture notes that might be recommended for someone in my position?


We had a theorem that the means of a sequence also converges:     Let $(a_n)_{n\in\mathbb N}$ be a convergent sequence. Then $\displaystyle \overline a_n=\sum_{k=1}^n \frac{a_k}n$ also converges.   I've tried to prove it:  $|\overline a_n-a|=\frac1n|\sum_{k=1}^n(a_k-a)|\leq\sum_{k=1}^{M-1}|a_k-a|+\sum_{k=M}^n|a_k-a|$  The second sum is $<\frac{\varepsilon}2$, because there is an $M\in\mathbb N$ so that $(a_n)_{n\in\mathbb N}$ converges. Now you can consider all $n\geq\max\{M,\frac2{\varepsilon}\sum_{k=1}^{M-1}|a_k-a|\}$ and so $|\overline a_n-a|<\varepsilon$.  But can you also say that there is a $K\in\mathbb N$ such that $\frac1n\sum_{k=1}^{M-1}|a_k-a|<\frac{\varepsilon}2$ for all $n\geq K$? And do I have to take the first sum from $k=1$ to $M$ or can you do it as above?  Thanks for helping.


Is there an optimal setting for the number of CPU cores exposed to a VM?

VirtualBox, and possibly other VM software, allows the user to specify the number of CPUs exposed to the VM. In my particular case, I have a dual core CPU, with Windows 7 64-bit running natively, and Ubuntu 9.04 64-bit as the VM.  The help file suggests not setting this above the number of physical cores available. This makes sense. So, is it best allocating 1 or 2 CPU cores? Does this depend entirely on the native CPU load?


Good way to compute the force of a hammer blow?

What is a good and easy way to compute and/or measure the force of a hammer blow, not using any fancy or specialized equipment?  If the hammer is swung by hand through an arc, it is not obvious to me how to measure the speed the hammer will be when it strikes the metal.  Also, when the hammer strikes the metal, the heavier it is, the more force there will be persistent and the less rebound. Also, the smith may use what is called a "dead blow" hammer to reduce the rebound. Thus, measuring the force is not just a question of the instantaneous force of the hammer, but how much it "presses" after that first instant, its impetus so to speak.  Now, one idea I had was to use a teeter-totter. You could place a heavy weight on one end of the teeter-totter and then hit the other other with the hammer and see how far it moved. Of course, what will happen is that when the hammer hits the pad, the teeter totter will accelerate, reach a peak, then decelerate, and the profile of this curve of acceleration will be the measurement of the instantaneous force of the hammer over time. Perhaps this could be measured by an accelerometer, but it is hard to see how to make the measurement with no special instrument.


How to check disks at startup (alternative to chkdsk c: /f on Windows)

How to check my two disks at startup (they're in BIOS RAID 1)?  I am on Linux Mint 17.2.  computer user # blkid /dev/sda1: UUID="6042-870C" TYPE="vfat"  /dev/sda2: UUID="2ef42e6f-4987-46e5-aca9-872fd70a9f9e" TYPE="ext2"  /dev/sda3: UUID="Oz0elc-zUuh-BAK1-i19b-RZZU-YREm-DxVaNi" TYPE="LVM2_member"  /dev/sdb1: UUID="6042-870C" TYPE="vfat"  /dev/sdb2: UUID="2ef42e6f-4987-46e5-aca9-872fd70a9f9e" TYPE="ext2"  /dev/sdb3: UUID="Oz0elc-zUuh-BAK1-i19b-RZZU-YREm-DxVaNi" TYPE="LVM2_member"  /dev/mapper/mint--vg-root: UUID="98a7a4a2-6e71-4aa9-ab48-5c4fc619c321" TYPE="ext4"  /dev/mapper/mint--vg-swap_1: UUID="b62721cf-7b54-4400-92f0-f8f776566c99" TYPE="swap"


I'm in Junior High and I still have some confusion towards speed and velocity. They sound like the same thing, where some object moves in a given direction, but there is a difference from both topics. So where does speed and velocity differ from their characteristics?


How to stop syslog or auditd/ audisp from adding host information to forwarded log files?

I have forwarded the auditd log files to central log server but the log received at the central log server have extra information added to it which I dont want. Note (auditd and syslog are on same server where the auditd forwards auditd log event to its local syslog(local6 facility) and the local syslog will send local6.* to central Log server)  here is the log received at central log server where this "<182>Nov 29 14:04:16 ubuntu audispd: node=ubuntu" is appended by either syslog(at log source) or audisp (at log source)   (auditd-->syslog-->) --> centralSyslog  <182>Nov 29 14:04:16 ubuntu audispd: node=ubuntu type=SYSCALL msg=audit(1511943556.347:424): arch=c000003e syscall=2 success=yes exit=3 a0=2647ca8 a1=90800 a2=2648317 a3=20 items=1 ppid=2726 pid=2727 auid=1000 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=pts1 ses=4 comm="bash" exe="/bin/bash" key="log_sec" <182>Nov 29 14:04:16 ubuntu audispd: node=ubuntu type=CWD msg=audit(1511943556.347:424):  cwd="/tmp" <182>Nov 29 14:04:16 ubuntu audispd: node=ubuntu type=PATH msg=audit(1511943556.347:424): item=0 name="/opt/secret_dir/" inode=918715 dev=fc:00 mode=040755 ouid=0 ogid=0 rdev=00:00 nametype=NORMAL <182>Nov 29 14:04:16 ubuntu audispd: node=ubuntu type=PROCTITLE msg=audit(1511943556.347:424): proctitle="bash"   The actual log file looks like below:-  type=SYSCALL msg=audit(1511943489.078:423): arch=c000003e syscall=263 success=yes exit=0 a0=ffffff9c a1=12480c0 a2=0 a3=15e items=2 ppid=2727 pid=19367 auid=1000 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=pts1 ses=4 comm="rm" exe="/bin/rm" key="log_sec" type=CWD msg=audit(1511943489.078:423):  cwd="/tmp" type=PATH msg=audit(1511943489.078:423): item=0 name="/opt/secret_dir/" inode=918715 dev=fc:00 mode=040755 ouid=0 ogid=0 rdev=00:00 nametype=PARENT type=PATH msg=audit(1511943489.078:423): item=1 name="/opt/secret_dir/password.txt" inode=918727 dev=fc:00 mode=0100644 ouid=0 ogid=0 rdev=00:00 nametype=DELETE type=PROCTITLE msg=audit(1511943489.078:423): proctitle=726D002D7266002F6F70742F7365637265745F6469722F70617373776F72642E747874 type=SYSCALL msg=audit(1511943556.347:424): arch=c000003e syscall=2 success=yes exit=3 a0=2647ca8 a1=90800 a2=2648317 a3=20 items=1 ppid=2726 pid=2727 auid=1000 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=pts1 ses=4 comm="bash" exe="/bin/bash" key="log_sec" type=CWD msg=audit(1511943556.347:424):  cwd="/tmp" type=PATH msg=audit(1511943556.347:424): item=0 name="/opt/secret_dir/" inode=918715 dev=fc:00 mode=040755 ouid=0 ogid=0 rdev=00:00 nametype=NORMAL type=PROCTITLE msg=audit(1511943556.347:424): proctitle="bash"   my audisp config file looks like below(at LogSource server1)  cat /etc/audisp/plugins.d/syslog.conf | grep -v "#"  active = yes direction = out path = builtin_syslog type = builtin  args = LOG_LOCAL6 format = string   The rsyslog config file looks like below (at source Log server1)  cat /etc/rsyslog.d/50-default.conf   .. local6.*     @@192.168.8.147:6161


Can I legally drive a motorcycle in California with a New Zealand motorcycle license?

A friend of mine is travelling to the states and wants to tour around SoCal on a motorbike. He has his motorcycle license in New Zealand. Is it legal for him to ride in California? Are there any states in which it's not legal for him to ride? Will he have to buy special insurance?


Solve $(\alpha,\beta)$ for $\lim_{n\to\infty} \frac{\sqrt[n^2]{1!2!\cdots n!}}{n^\alpha} = \beta$

Find the ordered pair $(\alpha,\beta)$ with non-infinite $\beta \ne 0$ such that $$\lim_{n\to\infty} \frac{\sqrt[n^2]{1!2!\cdots n!}}{n^\alpha} = \beta$$  My approach:   $$\ln (1!2!\cdots n!) = (n)\ln 1 + (n-1)\ln 2 + \cdots + (2)\ln (n-1) + \ln(n) \\ \begin{align} = n\ln\left(\frac{1}{n}\right) + (n-1)\ln\left(\frac{2}{n}\right) + \cdots + \ln\left(\frac{n}{n}\right) + \frac{(n)(n+1)}{2} \ln (n)\end{align}$$  Then $$\ln(\sqrt[n^2]{1!2!\cdots n!}) = \frac{1}{n^2} \ln(1!2!\cdots n!) = \frac{n+1}{n} \cdot \ln n + \frac{1}{n} \left[\sum_{m=1}^n \left(\frac{n+1-m}{n} \cdot \ln \frac{m}{n}\right)\right]$$  And that's about as far as I got. Any ideas about proceeding with this method or perhaps even with a different method?  Thanks  A


GitHub and GitLab running in one directory

So I have a directory with file A and file B. I need to push file A to directory dirA and file B do directory dirB. The problem is that dirA should be hosted on GitLab and dirB on GitHub. Is there any way to do so?  This should work all time, so when I make some changes I can push them to proper repositories.


When reading a proof I came across the following step:  $$\operatorname{Var}(x^Ty) = x^T\operatorname{Var}(y)x$$ $x$ and $y$ are column vectors. How can you derive this?


At my company we are upgrading our hardware and I need to reinstall Ubuntu on ~15 laptops. Do you have any clues how to approach it? Do I need to sit in front of every machine and manually click through installation process? They are exactly the same machines and they need to be configured exactly the same way.


How to calculate angle in a circle. Please see the diagram to get the idea what I want to calculate? I have origin of circle that is $(x_1,x_2)$. I have a point on circumstance of circle that is $(x_2,y_2)$. Also I know the radius of circle that is R.  How to calculate the angle between these two lines -- line starting from origin and ending on circumstance at 0 degree -- line starting from origin and ending on $(x_2,y_2)$.


please could someone tell me why Ohmic losses are always referred to as $I^2 R$ losses? Here is my problem. If the power coming from a power station is fixed then you can either deliver this power as high voltage, low current or high current, low voltage. But isn't $I^2R$ equal to $V^2 / R$, therefore if R is constant doesn't the power depend on the square of the voltage so surely it doesn't matter whether it is high voltage or high current. The only way I can reconcile this is that a high current must cause a greater heating effect than a high voltage. I can't figure why though. If this is the case then is there a reason why a high current causes more heating than a high voltage?


Im new in using Ubuntu and I cant seem to make any partitions for a new dual boot OS and the swap file or for any other matter i would want to use the partition because the drive is locked.  I have already tried running the Live CD or in my case a Live USB and then ran Gparted but the status is still the same. Could anyone please shed some light in this matter?


"The fact of it being ..." vs "the fact of its being ..."

Which one of the following is correct/preferred?     This process is devised in such a way that it works automatically   while always revealing to the user the fact of it/its being   intact.   Both "the fact of it being ..." and "the fact of its being ..." can be frequently found on the web. But perhaps one should be correct/preferred.


Does the crop factor affect the field of view (FOV)?

I'm working on smartphone cameras. I want calculate Field Of View of different smartphone cameras  using the formula : FOV = 2 arctan(SensorSize/2f) where:    f is the focal length  sensor size is the Height or Width or Diagonal of the sensor (in mm)   In doing some research, I've found that there is another parameter to take in consideration, which is the crop factor. When using the formula for FOV, should I apply the given f (focal length), or should I apply the effective focal length which is (focal length x crop factor)?


"Name and I" or "name and me" when they are neither the object nor subject?

There have been many questions on this exchange about when to use phrases such as "John and I" vs. "John and me". The answer seems to be you that you use "John and I" when they are the subject of the verb and "John and me" when they are the object of the verb. However, sometimes it isn't so clear. For example, consider the following sentence     "A collaboration, between John and I, would lead to   close friendship"   In this sentence, I think the subject is the actual collaboration (not John and I) and the object is the friendship. So what is the proper usage in this case, where "John and I" is neither the subject nor the object?  Obviously this question is not a duplicate of any question asking about the use of "you" and "I" that doesn't contain rules for special prepositions such as "between".


How to pronounce the "s" at the end of pupils. What is the phonetic of this  word.


Factorizing a polynomial $f$ in $A[x]$ (with $A$ commutative), where $f$ has a zero in its field of fractions

Let $A$ be a commutative ring and $S$ a multiplicative subset of $A$ generated by $s\in A$ which is not a zero-divisor. Consider the polynomial ring $A[x]$.      Given a polynomial $f\in A[x]$, suppose that $f(1/s)=0$ for $s\in S$. Does it follow by some application of the first isomorphism theorem that $f(x)=(sx-1)g(x)$, with $g(x)\in A[x]$?   On the one hand I think this can be proven by constructing an isomorphism from $A[x]$ modulo the relation $x=1/s$ (really the replacement of $x$ with $1/s$). This is evidently an isomorphism from $A[x]/(x=1/s)$ into $S^{-1}A$. It is tempting to conclude (though I'm not certain that this should work), that there must be some surjective homomorphism $\phi: A[X]\to S^{-1}A$ such that $\ker(\phi)=(sx-1)$. [Since generally $(A/B\cong A/C) \nRightarrow (B\cong C)$, it is not sufficient to conclude that, say, the kernel of $\psi: f\to f(1/s)$ is $(sx-1)$.]  I am especially interested in answers as to whether, say, $\psi$ has kernel $(sx-1)$. But for anyone who can follow my own attempt at a proof, I'm also interested in whether my argument breaks down or can be made to work rigorously.


Proving that if $f(x) \le g(x)$ then $f(x_0) \le g(x_0)$

Suppose $f: D \to \mathbb R$ and $g:D \to \mathbb R$, $x_0$ is an accumulation point of $D$, and $f$ and $g$ have limits at $x_0$. If $f(x) \le g(x)$ for all $x \in D$, then   $\lim \limits_{x \to x_0}f(x) \le \lim \limits_{x \to x_0}g(x)$  Assume that $\forall x \in D$,   $f(x)$ and $g(x)$ both have limits at some point $x_0$ and $f(x) \le g(x)$    We know that $\lim \limits_{x \to x_0}f(x) = f(x_0)$ and $\lim \limits_{x \to x_0}g(x)=g(x_0)$  $\therefore f(x_0) \le g(x_0)$ because $f(x) \le g(x) $  $\forall x \in D$


What caused the apocalypse in the Hunger Games?

So the stories of the Hunger Games are set in , a post-apocalyptic society situated in North America. Is there anything to explain what caused the Apocalypse? Whether from the main books, any extra material or interviews? (No fanfic please.)  As well as the cause, is there any indication of when the apocalypse happened? And how long after the apocalypse are the events of the Hunger Games?


I'm have some fields on a form that was cloned with the plugin .  But when I clone them the function doesn't work. My code below:
                 {!! Form::label('valor', 'Valor:') !!}

                     {!! Form::text('valor[]', null, ['class' => 'form-control','id' => 'valor']) !!}

                 {!! Form::label('desconto', 'Desconto:') !!}

                     {!! Form::text('desconto[]', null, ['class' => 'form-control','id' => 'desconto']) !!}

                 {!! Form::label('valor_total', 'Valor Total:') !!}

                     {!! Form::text('valor_total[]', null, ['class' => 'form-control','id' => 'valor_total', 'readonly']) !!}

   The javascript function:


\newcommand*{\name}[1][C]{%   I have come very familiar with \newcommand however, I came across this line of code and i do not know what the [C] is for.


Can two Pythagorean triples have the same product?

I'm writing a program to search for Pythagorean triples, and I want to decrease the search-time as much as possible (obviously).  There's a method that will decrease the search-time drastically, if only it could be proven that no two Pythagorean triples will have the exact product of multiplying their terms.  For example, [3, 4, 5] and [15, 20, 25]. Indeed, 3 x 4 x 5 is not equal to 15 x 20 x 25. But could this be proven for all Pythagorean triples?


Which is correct — period, semicolon, or colon?

Each day, difficult choices have to be made. Who will live, and who will die?   Each day, difficult choices have to be made; Who will live, and who will die?    Each day, difficult choices have to be made: Who will live, and who will die?


How to fix "en_DE.UTF-8" (locales) warnings?

On my system I am getting errors(?) like this:  bash: warning: setlocale: LC_CTYPE: cannot change locale (en_DE.UTF-8)   or    weemonger@awesomeLinuxSystem:~$ dpkg-reconfigure locales perl: warning: Setting locale failed. perl: warning: Please check that your locale settings:         LANGUAGE = "en:de:en",         LC_ALL = (unset),         LC_PAPER = "en_DE.UTF-8",         LC_ADDRESS = "en_DE.UTF-8",         LC_MONETARY = "en_DE.UTF-8",         LC_NUMERIC = "en_DE.UTF-8",         LC_TELEPHONE = "en_DE.UTF-8",         LC_IDENTIFICATION = "en_DE.UTF-8",         LC_MEASUREMENT = "en_DE.UTF-8",         LC_TIME = "en_DE.UTF-8",         LC_NAME = "en_DE.UTF-8",         LANG = "en_DE.UTF-8"     are supported and installed on your system. perl: warning: Falling back to the standard locale ("C").   How do I fix my system an get rid of the locale warnings/errors?  I have to say, that I living in Germany and use the english (en) language for my system, but also I have configured my system to use the german (DE) formats/norms for Numbers, Money, Measurements, Page size, etc. I did this using the KDE Control Module Country/Region & Language.    I think I got rid of the warnings by myself, so I will post an answer myself, but wait some time before I accept it, as I didn't fully grok/understand it.


Replacing characters in C++ Pointer Character string?

Suppose I have this in C++:  char *p = "Apple";   I can't do this:  p[1] = 'w';   But why can I do this?  p = "OrangeTorange";


I'm trying to have some users able to sftp but not ssh. I've looked at  and   Inside of sshd_config I have the lines    Subsystem sftp internal-sftp  AllowUsers <a bunch of users>   Match group sftponly       ChrootDirectory /home/%u       X11Forwarding no       AllowTcpForwarding no       ForceCommand internal-sftp   Filezilla gives me    Error: Network error: Software caused connection abort  Error: Could not connect to server   When I comment out the ChrootDirectory /home/%u I am able to connect fine.   How can I chroot?


Is it possible to change the place, where TexStudio (I use last version of TEXStudio) on Windows 8) puts generated PDF file? By default all files (.tex and related .pdf, .aux etc.) are in the same folder. I would like to make a separate folder for  PDf's, and make all PDF's be stored in it.


$E[e_te_s\Delta B_t\Delta B_s]$ for $\Delta B_t$ Brownian motion increments and $e_t(\omega)$ a measurable function.

Let $\Delta B_j=B_{t_{j+1}}-B_{t_j}$ where $B_t$ is Brownian motion, and $e_i(\omega)$ measurable with respect to $\sigma(B_{t_i})$. In Oksendal's 'Stochastic Differential Equations' he states:  $$ E[e_ie_j\Delta B_i\Delta B_j]= \begin{cases} 0 & i\ne j \\ E[e_j^2] & i=j \end{cases} $$  Justifying this because '$e_ie_j\Delta B_i$ and $\Delta B_j$ are independent if $i<j$'. I am trying to understand this.  I understand that Brownian motion is normally distributed with independent increments, so: $$E[\Delta B_i\Delta B_j]=0$$ However, how can we justify $e_ie_j\Delta B_i$ being independent to $\Delta B_j$? Even if they are, how can we treat $E[e_ie_j\Delta B_i]$? Basically I believe my confusion stems from how to treat products of measurable functions.


Escape velocity from a rotating black hole

Under Newton, the escape velocity is  $$v_{esc} = \rm c \ \sqrt{r_s/r}$$  where $\rm r_s=2 \ GM/c^2$. In the nonrotating relativistic case (the Schwarzschild case) the radial escape velocity is the same:  $$v^{\parallel}_{esc} = \rm c \ \sqrt{r_s/r}$$  which is the speed of light, $v={\rm c}$, at the event horizon at $\rm r=r_s$. Since the photon sphere, where an object with $v={\rm c}$ would not escape, but be captured into orbit, is at $r=3 \ {\rm GM/c^2}$, the transverse escape velocity is  $$v^{\perp}_{esc} = \rm c \ \sqrt{r_s/r}\div \sqrt{1-r_s/r}$$  and for the observed (shapiro delayed) velocity ${\rm v}$ the transformation is  $${\rm v}^{\perp}=v^{\perp} \ \sqrt{\rm 1-r_s/r} \ , \ \ {\rm v}^{\parallel}=v^{\parallel} \ (\rm 1-r_s/r)$$  so the observed angular motion is the same as with Newton, yet locally higher, while the observed radial motion is slowed down because of the radial length contraction and time dilation.  But what about the Kerr case where the rotation is significant and the event horizon is at $\rm r=(1+\sqrt{1-a^2}) \ {\rm GM/c^2}$ instead of $\rm r=r_s$?  A testparticle which is locally at rest and therefore corotating with the angular velocity of the frame dragging  $${\Omega = \rm d \phi/ {\rm d t} = {\rm 2 \ a \ r/((a^2+r^2)^2-a^2 (a^2+(r-2) \ r) \sin ^2(\theta ))}}$$  should experience the time dilation factor  $$\rm \dot t = {\rm d t}/ {\rm d}\tau = \sqrt{{\rm ((a^2+(r-2) \ r) (a^2 \cos ^2(\theta )+r^2))/((a^2+r^2)^2-a^2 (a^2+(r-2) \ r) \sin ^2(\theta ))}}$$  relatively to the far away observer, so multiplying $\Omega$ with $\rm \dot t$ should give the local frame dragging angular velocity, which, multiplied with the $\rm \sqrt{x^2+y^2}$ value of the Boyer-Lindquist to cartesian transformation should give the transverse velocity - this is slightly below $\rm c$ for a maximaly rotating black hole (with $\rm a = 1$ - at the edge of the outer equatorial ergosphere where $\rm r=1$ and $\rm R=\sqrt{r^2+a^2}$).  But how do I find the radial and total escape velocity, and what are the rules to convert the shapiro-delayed coordinate velocities $\rm d r/d t \ , \ d \phi/d t \ , d \theta/d t$ to the local 3-velocity components $v^{\parallel}$ and $v^{\perp}$ of a test particle (local meaning relatively to a frame dragged probe with contant $\rm r$)? The radial length contraction seems a bit different than in the Schwarzschild-case, where it is the same as the gravitational time dilation factor...


Moved bin and other folders! How to get them back?

I accidentally moved all folders from root to a subfolder. (/bin, /etc, /home, /lib, /usr... all moved) The only ones that were not moved, since they were in use, are  /bak, /boot, /dev, /proc, /sys.  Now, any command that I try to execute will simply not happen. I constantly get "No such file or directory".  I am connected through ssh and through ftp, but I cannot move files through ftp, as direct SU login is disabled. I also have access to the actual server if I need to do something directly from there.  I'm assuming I would need to edit a configuration file in order to tell it where to find the /bin folder and that would help me get access again, but I don't know which file that would be or how to do it (since I can't even run chmod to change permissions).  Is there any way out of this other than re-installing?  I am working on an old version of CentOS.  I'm extremely new to the world of Linux, hence this action and the question...


Create UEFI bootable USB stick to install Windows AND Ubuntu from it

I know how to make a UEFI bootable stick to install Ubuntu (explained ) and I know how to make one to install Windows 7 (, sorry). I guess for Win 8 the procedure would be similar, but I haven't looked into it.  I also know how to make a legacy bootable stick from which I can install Windows and Ubuntu using YUMI. I have failed so far though at creating a UEFI bootable stick that can do this. When I do a UEFI boot from my YUMI multiboot stick it gives me no option to choose between Ubuntu and Windows (hardly surprising I guess) and instead simply UEFI boots Windows (which I find kind of surprising to be honest but maybe this is due to the fact that I added the Windows image after the Ubuntu image and this simply replaced Ubuntu's EFI boot files).  So how would I proceed to create such a bootable stick?


What Yongnuo flash and trigger works with the Panasonic GH4

I am so confused - I'm fairly new to the whole camera trigger thing, as well as new to Yongnuo and the GH4, but here's my thing:  All I want to do is figure out what I need if I want to control 2 or 3 Yongnuo flashes remotely (none on camera) in manual mode. Which Yongnuo flashes work and which triggers and how many do I need?  I've read up so much on this and it's so tough. People have opened up and rewired certain Canon-friendly Yongnuo triggers to make them work with the GH3, which I have NO intention of doing, and I'm just lost. I just want to go to Amazon, order the right flashes and triggers and sort it out at home, with the confidence that whatever I buy WILL work with the Panasonic GH4


How to remove duplicate lines inside a text file?

A huge (up to 2 GiB) text file of mine contains about 100 exact duplicates of every line in it (useless in my case, as the file is a CSV-like data table).  What I need is to remove all the repetitions while (preferably, but this can be sacrificed for a significant performance boost) maintaining the original sequence order. In the result each line is to be unique. If there were 100 equal lines (usually the duplicates are spread across the file and won't be neighbours) there is to be only one of the kind left.  I have written a program in Scala (consider it Java if you don't know about Scala) to implement this. But maybe there are faster C-written native tools able to do this faster?  UPDATE: the awk '!seen[$0]++' filename solution seemed working just fine for me as long as the files were near 2 GiB or smaller but now as I am to clean-up a 8 GiB file it doesn't work any more. It seems taking infinity on a Mac with 4 GiB RAM and a 64-bit Windows 7 PC with 4 GiB RAM and 6 GiB swap just runs out of memory. And I don't feel enthusiastic about trying it on Linux with 4 GiB RAM given this experience.


I am trying to upsert a dynamic list of objects into Salesforce using Apex, before point of upsert I have casted a new list to explicitly describe which object this is but I still receive the following error:     DML on generic List only allowed for insert, update or delete   Code:      String objectName = 'Account'; // this will be dyanmic      // parse lines     String csvToParse = attachment.Body.toString();      List<sObject> dynList = CSVReader.readCSVFile(csvToParse, objectName);      List<SObject> toUpsert = (List<SObject>)Type.ForName('List<' + objectName  + '>').newInstance();     toUpsert = dynList;      // upsert records     SObjectField extField = Account.Fields.ExtID__c;     Database.UpsertResult[] up = Database.upsert(toUpsert, extField);


How random search converges to find optimum of a function?

Good morning, Suppose that we have a set: $ L = \{ x_{1} ,..., x_{N} \} $ and a given function $ f(x) $ we need to find it's minimum $  x^{*}  $. The set $ L $ is belonging to an interval $ [a , b ] $ and represents a the first drawn sample in random search algorithm for a 1-dimensional function . My question is about the random search algorithm. Is there any rigorous proves of how this algorithm works? For example, why everyone say:  Random search has a probability of 95% of finding a combination of parameters within the 5% optima with only 60 iterations. I need some proofs/principles analyses for a work! Thank you a lot in advance for help !


Uniform convergence of a equicontinuous sequence of functions

Let $X$ be a compact metric space, and $(C(X),d_{\infty})$ the space of continuous functions. Let $D\subset{X}$ be a dense subset, and $\{{f_n\}}_{n \in N}$ a equicontinuous sequence of functions from $C(X)$. Show that if $\exists f\in C(x)$ such that $f_n(x)\rightarrow f(x)$ pointwise $\forall x\in D$, then $f_n(x) \rightarrow f(x)$ uniformly.  As $X$ is compact, $f$ is a uniform continous function. Then for $\varepsilon/3$ the exist a $\delta_1$ such that if $d(x,y)<\delta_1$ then $d(f(x),f(y))<\varepsilon/3$ for all $x,y \in X$.  For the same reason, and using the equicontinuity of $\{{f_n\}}_{n \in N}$, there exist a $\delta_2$ such that if $d(x,y)<\delta_2$ then $d(f_n(x),f_n(y))<\varepsilon/3$ for all $x,y \in X$ and for all $n$.  Taking $\delta=min\{{\delta_1,\delta_2}\}$ then, considering compactness $X$ can be written as a finite union of $B(x_i,\delta)$ with $i=1,2,...,m$ and for each $x_i$ we can choose a $q_i \in D$.  Then, using pointwise convergence for each $q_i$ we can find $n_i$ such that for all $n>n_i$ $d(f_n(q_i),f(q_i))<\varepsilon/3$    Finally taking $n_0=max\{n_1,n_2,...,n_m\}$ for all $n>n_0$, $d(f_n(x),f(x))<\varepsilon$ for all $x\in X$.  I am not sure if its right or clear :S. I know that pointwise convergence, equicontinuity and a compact set implies uniform convergence. But I am not sure how to deal whit point wise continuity over a dense subset. Thanks!


How can edge rings be selected in a predictable way?

When trying to select multiple edge-rings Shift-Alt-RMB sometimes loops get selected in the one (green) way or the other (red) way.  I couldn't derive a general rule.   How can two or more face-rings following one direction be selected ?  (Easy to reproduce with a default torus mesh.)


Force as gradient of scalar potential energy

My text book reads      If a particle is acted upon by the forces which are conservative; that is, if the forces are derivable from a scalar potential energy function in manner $ F=-\nabla V $.   I was just wondering what may be the criteria for force to be expressed as negative gradient of scalar potential energy and HOW DO WE PROVE IT?


I am having a plot with legend entries. The entries are not really long, it would be nice to have them in a single row. The default behavior adds a line break after each entry. Furthermore, the are all centered, I would prefer left flushed.  I did not find the correct parameter for changing that. Anyone any suggestions or pointers fore me?


Short story about alien feline beast that kills spacemen, leaches vital substances from their bodies?

Plot Summary/Details  A human spacecraft lands on an alien world.  I'm not sure if they are exploring, or touched down for repairs. The world is a foreboding place, and home to a vicious predator that somewhat resembles a panther, or other big terrestrial cat. The creature is quite cunning, and ambushes several crewmen when they are scouting the planet or doing some other activity that would have them isolated and away from the ship. It sticks in my mind the creature is very strong, and able to bite through the heavy spacesuits the men wear with ease.  The creature has an unusual nutritional requirement of some sort. As such, it doesn't eat its victims, but somehow drains them of a particular element or chemical substance. I can't remember what it is, though I think it had something to do with the skeletal structure of the men. Calcium, maybe?  I have only very general recollections of how the story ends/is resolved. The humans become aware of the threat, and I believe they ultimately slay the beast. I can't recall anything more specific than that, unfortunately.  Timeframe of Publication  This one is old, I'm sure of that. I can remember the writing style and some of the descriptions being very "old school" - spacemen, rocketship, that sort of thing. Almost like something you'd see in an old sci-fi movie serial, to use a film analogy. If I had to guess, I'd say 1950's at the latest.


I have a questionnaire data that consist of composite Likert scale and discrete Likert items.  Likert scales or variables are the sum of few Likert items while the one-item variables are represented by one Likert questions.  Could I run normal distribution tests on both composite and individual Likert variables in order to determine if i have to use parametric or non parametric tests?  Thanks


Looking definition of \setminus to call with \DeclareMathSymbol

I'm using Mnsymbol package but I don't like how looks \setminus. Because that I want use the default \setminux making   \documentclass{memoir} \DeclareSymbolFont{Symbols}{OMS}{cmsy}{m}{n} \DeclareMathSymbol{\Setminus}{\mathbin}{Symbols}{}  \usepackage{Mnsymbol} \begin{document} $\setminus$ $\Setminus$ \end{document}   but, as you can see, I miss something. How I get that?


How to define a macro which does not read the next token after itself?

In LaTeX, I would like to define  \newcommand{\ACROeg}{e.\,g.} This is a sample sentence, \ACROeg it does not make much sense.   but this yields     This is a sample sentence, e.\,g.it does not make much sense.   i.e. the space between \ACROeg and it was gobbled.  I do not want to use \ACROeg{} or \ARCOeg\. Can I define the macro in a way so it does not read into the next token?


Creating rectangle on centroid point by map click event ol5

I am trying to develop a web portal using ol5 API where user click on map and then it takes map click event coordinates as centroid of rectangle and create a rectangle of particular height and width.  Here is the code to create square  image: new ol.style.RegularShape({         fill: fill,         points: 4,         radius: 30,         angle: Math.PI / 4     })   But I want to create rectangle with center point, height and width. How to achieve this?


The use of "who has" or "who have" in a sentence

Consider the following example:   It is you who has taken the garbage out.  It is you who have taken the garbage out.    Does one use "has" or "have" in this sentence construction? Which of the two best fits? Which is grammatically correct?


I have a Spanish character not working in 'listings' package.  In the code example below, the first occurrence of the word 'ignorará' works. The second generates the error:  ! Package inputenc Error: Unicode char \u8:├\expandafter not set up for use with LaTeX.  I believe it is because I'm in the lstlisting block. How do I fix this?  \documentclass[paper=8in:10in,pagesize=pdftex,                headinclude=on,footinclude=on,12pt]{scrbook} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage[spanish,english]{babel} \usepackage{listings}  \lstset{ language=Python }  \lstloadlanguages{ Python }  \begin{document}  y el compilador lo ignorará.  \begin{lstlisting}[language=python] # Esto es un comentario, comienza con el signo # # y el compilador lo ignorará.  print("Esto no es un comentario, el ordenador") print("ejecutará esto y lo imprimirá.") \end{lstlisting}  \end{document}


What makes the world so oblivious to Clark Kent's secret?

Superman's alter ego is Clark Kent. Unlike many other superheroes, Superman dresses up as a human to fit in.  What makes the world so oblivious to Clark Kent's secret; Superman? (In regards his poor disguise).


Experiment ID and Variant - Multiple experiments

In Google Optimize I have multiple experiments running on a single website.  I want to create a segment for a specific experiment and a specific variation. Like this:    Does it include only the sessions for that specific experiment and the variant 1 from that specific experiment? E.g how does it make sure that the users from this experiment (some other variant) and another experiment's variant 1 are not included?  EXP1 - VAR1 & EXP2 - VAR2 = MATCH EXP1 - VAR2 & EXP2 - VAR1 = ?     PS! This is not the same question as this one:   That other one is about browsers, and clearly, you can't use multiple browsers at once BUT you can be part of multiple experiments at the same time!


How do you convert Hex codes to it's Char representation

In my code I am dealing with a situation whereby I have some html code that contains a list of actors are saved into a string. Some of the actor's names such as  José Ferrer are appearing in the string as José Ferrer. With &#xE9 being the hexa-decimal representation of é. Does anyone have any idea of how to convert the Hex code to the character code symbol representation in C#.    Update:  I have a function that checks the names, in some cases; character such as é and presented in the string like this: "José Ferrer".  I have a function called RemovedUnicode Characters. Which aims to convert the hed code into it respective character equivalent, however I can't seem to get the function to work, this is what I have so far. The Variable Neartest just returns "&#xE9"; it does not return é.  In the code below, I isolated the unicode character reprsentation into the string called entity. By using the for loop o filter through all of the chars in the string input.      public static string RemoveUnicodeCharacterAndProduceLetter(string input)            {           StringBuilder output = new StringBuilder(input.Length);         int endIndex;         int startIndex;         int length;         string entity;          for (int i = 0; i < input.Length; i++)         {             if ( input[i] == '&')             {                  string startElement = "&";                 string endElement = ";";                  startIndex = input.IndexOf(startElement);                 endIndex = input.IndexOf(endElement, startIndex);                  length = endIndex - startIndex;                  entity = input.Substring(startIndex, length);                 //  int tempResult = Convert.ToInt16(entity);                 //  char chesse = (char)Int16.Parse(entity, NumberStyles.AllowHexSpecifier);                 string nearTest = HttpUtility.HtmlDecode(entity).ToString();                //   string str = char.ConvertFromUtf32(Convert.ToInt32(entity));                    //


Restrict pan and zoom in ArcGIS Javascript API?

I'm creating a web map of a university campus.   I have the map functioning, but I don't want to be able to pan off of the basemap, into whitespace.   Do you know of a function that will auto-pan the extent back to the basemap?


Couder's walking droplets - what are issues of using its intuitions to interpret quantum analogoues?

There are these popular experiments with droplets having wave-particle duality, e.g. here is , , .  Among others, they claim to recreate:   Interference in particle statistics of double-slit experiment () - corpuscle travels one path, but its "" travels all paths - affecting trajectory of corpuscle (measured by detectors). Unpredictable tunneling () due to complicated state of the field ("memory"), depending on the history - they observe exponential drop of probability to cross a barrier with its width. Landau orbit quantization () - using rotation and Coriolis force as analog of magnetic field and Lorentz force (). The intuition is that the clock has to find a resonance with the field to make it a standing wave (e.g. described by Schrödinger's equation). Zeeman-like level splitting () - quantized orbits split proportionally to applied rotation speed (with sign). Double quantization in harmonic potential () - of separately both radius (instead of standard: energy) and angular momentum. E.g. n=2 state switches between m=2 oval and m=0 lemniscate of 0 angular momentum. Recreating eigenstate form statistics of a walker's trajectories ().   They connect these experiments with , e.g. supported by measurement of average trajectories in double-slit experiment ().  While in Couder's experiments oscillations are due to external periodic force, for quantum physics they would need e.g. intrinsic oscillations of particles - called  or  - .  I wanted to ask about the issues of using its intuitions to understand quantum mechanical analogous?


What's going on with this 5-line proof of Fermat's Last Theorem?

I'm reading a book on the , and the author gave a "5-line proof" of Fermat's Last Theorem as a way to introduce the topic of inconsistency in set theory and logic. The author acknowledges that this is not a real proof of the theorem, but the way it was presented implies that it was supposed to look somewhat convincing. I, however, have absolutely no idea how the proof given even remotely relates to FLT, and would greatly appreciate it if someone could make the connection for me. Below is an almost verbatim excerpt from the book.   Theorem: There are no positive integers $x$, $y$, and $z$, and integer $n>2$, such that $x^n + y^n = z^n$.  Proof. Let $R$ stand for the Russell set, the set of all things that are not members of themselves: $R= \{x : x \notin x\}$. It is straightforward to show that this set is both a member of itself and not a member of itself: $R \in R$ and $R \notin R$. So since $R \in R$, it follows that $R \in R$ or FLT. But since $R \notin R$, by disjunctive syllogism, FLT. End.


Two  have been announced in LoL.  They have an ability that makes them be able to recall together.                                  What are the limits to this ability? Can the 'non-recaller' jump in at the last second and get some kind of instant recall?  Can somebody with the setup to get on PBE test it and tell us what are the limitations of this ability?


Uses of MCMC samplers outside of Bayesian Inference?

I'm curious if there are applications of MCMC outside of Bayesian Inference? this conversation started when discussing Monte Carlo methods vs Markov Chain Monte Carlo methods with a coworker. He asked what the difference was, and the best I could summarize was (A) MCMC is a subset of MC, and (B) MCMC has stricter assumptions about what is or isn't allowed. I used the example of Casino-style games. Consider a game where a player rolls a die 1-3 times and keeps winnings equal to the final throw. We can price the "fair value" of the game through monte carlo simulations. However, this requires definition of strategy. For example, one simple but effective strategy is to only take a subsequent throw if the previous value is less than the expectation of a given roll (3.5). Once you throw >= 4 you quit. Otherwise, you throw again. This works well, but makes no assumptions of priors, likelihoods, etc. Conversely, if you want to use an MCMC, the best example that comes to mind is posterior inference. For example, if you're modeling linear regression of weights on heights of men, you supply a prior and likelihood and the sampler is able to return the posterior. In the discrete case, a markov chain can be represented as a matrix of transitions from one state to another. If you let a bot bounce around according to this matrix, it would converge on the "stable distribution" over time. (A simpler method is simply the leading eigenvector of the transition matrix.) Anyway, in the continuous case, we don't have a transition matrix, and so we use a transition kernel to make movement decisions (which generally means comparing the previous/subsequent likelihoods and making a probabilistic decision.) All that to say, MCMC methods appear to require a transition kernel, which means it requires likelihoods for movements, and this info will converge on the stable distribution given enough movements. By contrast, vanilla MC methods make less assumptions about what the end result should look like. This sounds like a bad working definition and so I'm curious if there are other use cases of MCMC methods? This might help expand my idea of how MCMC and vanilla MC are different.


I have a problem with the GM of the d&d game we're playing. To give you an idea of whats going on our group consists of me (gnoll paladin/cleric/fist of raziel) luka (monk/barbarian) doug (wizard) ashley (bard/ranger) and the GM. we're playing an undead heavy campaign and everything was going well until recently when I confided in the dm (who is my close friend) something about myself since i ws going through some hard times and now lately it seems like every session has been more focused on trying to kill off my character than anything else.  Just an example: we were in a sand crypt looking to recover a lost ring that the high priestess of the jade had lost while on an emissary mission and the cave was full of vampires. I led the way and we stumbled across a chamber where they were all sleeping. we backed out of the room and I had the party put enhancement spells on me so I could deal with the vampires, but for some reason when I went in the room the dm started making me roll move silent checks. I rolled a 6 and all the vampires suddenly woke up and started attacking me while I was in the middle of the room before the others could get in. All of them were swarming me and I was getting lucky that they couldn't hit through my AC (most were rolling on average 16) but then suddenly one hits me with a critical hit and I take a negative level. Okay thats fine. We kill the vampires and I drink a healing potion, but the DM tells me that the negative level didn't go away. I wind up having to back track all the way to the temple just to get it removed, and by the time we got back, THE VAMPIRES HAD ALREADY REFORMED IN THEIR COFFINS AND WERE PERFECTLY FINE.  Proof 2: Going into a desert temple where signs of a battle had taken place, there's a strange old man coming out of it dressed completely different from everyone we'd met so far. I detect evil on him and the DM tells me that I'm overwhelmed by his evil aura, so much so that I'm stunned for a round and get a nose bleed. I don't even get a save against this, he just gets to freely attack me for no reason whatsoever. Then to add insult to injury the old man turns out to be a dry lich who just laughs at me, tells me that I'd be best to leave this place, then strolls off without even fighting us. I go look up the stat block later that evening for the Dry Lich and it turns out it's a really powerful monster! How the hell am I supposed to deal with a monster that can literally cheat and stun me for no reason whatsoever?  The final straw: Game night comes and I get separated from the party when we're raiding a tomb, and fall down a trapdoor. Lo and behold I land in a chamber with a giant armored undead spider thing that starts kicking my ass. I try to turn tail and run and get out of there but the thing is faster than me (somehow, which doesn't make sense I'm a gnoll running fast is something I should be able to do well) and I get webbed and strung from the ceiling. Now I'm probably going to die next session from whatever insane crap the DM is cooking up while the rest of the party is upstairs looting and whatnot.   All of this seems to have started because I was feeling bad and wanted someone to talk to so I talked to my dm (who is my friend) and told him that I wasn't feeling too good and I was unhappy with my character because it's not as strong as everyone else's. Just because I want to be stronger doesn't mean the DM should be going out of his way to kill me for no reason. That's why I'm here, does anyone have any advice on how I could beat the DM at his own game? Ways I could do really tricky things to just one-up whatever garbage he throws at me? He's a good friend but as a DM this is just insane that he's trying to kill me off just because I'm playing a gnoll that happens to be similar to my avatar/persona. I don't appreciate him doing this and I just want to show him that what he's doing is not right and if I can beat him at his own game it will probably be the best thing to do.


Can you travel to the US 6 days before your H1B visa expires?

I'm currently working in US, with VISA valid uptil end of Sept. I've applied for extension, and the petition is under review atm.  There is a requirement that may need me to go out of US and come back for a week in mid-Sept.  Would that be a problem while returning?


Array has duplicate values with different id, how to remove duplicates

My array is like this:   Array (   [0] => Array (     [0] => aaa-aaa     [SKU] => aaa-aaa     [1] => 12/1/1     [date] => 12/1/1     [2] => 1.15     [cost] => 1.15 )   [1] => Array (     [0] => bbb-bbb     [SKU] => bbb-bbb     [1] => 10/1/1     [date] => 10/1/1     [2] => 0.15     [cost] => 0.15 ) )   I'd like to merge the matching values to each other, or make a new array selecting the indexes, or use a php tool to print specified indexes to csv: aaa-aaa, 12/1/1, 1.15 \n bbb-bbb, 10/1/1, 0.15  It cannot be queried because this information is coming from 4 different tables, from 2 different sql providers. These arrays are the result of mapping previous arrays.   array_unique() doesn't work, array_diff() doesn't work, array_diff_key() doesn't work.  You direction is much appreciated!


I have Windows 7 and Ubuntu 14.04 on my machine.  It's an average home configuration, and I use it for web development too.    4GB DDR2  300 GB HDD 2,2Ghz Dual core Nvidia 8600GT GPU    Ubuntu boots very fast, much faster than Windows... and uses much less RAM than Windows, but damn man, Ubuntu is laggy as hell, it is nowhere near as smooth as Windows. Firefox is slow  as hell, it works but not nicely like on Windows. I know that Linux is made for servers, but UI is just awful. I don't want my Linux to look fancy like a brand new Mac, I just want it t run as smooth as Windows does. Any tips?  Edit:  Here is my output from terminal when run lspci -nnk | grep -A3 VGA  01:00.0 VGA compatible controller [0300]: NVIDIA Corporation G84 [GeForce 8600 GT] [10de:0402] (rev a1)     Subsystem: CardExpert Technology Device [10b0:1401]     Kernel driver in use: nouveau 03:00.0 Ethernet controller [0200]: Broadcom Corporation NetXtreme BCM5754 Gigabit Ethernet PCI Express [14e4:167a] (rev 02)


I seek help interpreting this qqplot.  Am I correct that data points near the mean are reasonably normal, but data points away from the mean tend to be too far off, therefore the data is fat-tailed?  Secondly the data appear to be symmetric (unskewed) ?  Thanks for your help! There is a very nice post about qq plot interpretation, but i would still like confirmation that i am comparing correctly with that post's templates.


I have been playing borderlands 2 recently for about 2 weeks. I am mainly sticking with my Zer0 build who is at level 40 (almost 41) but I have a level 10 Axton and Salvador. I have already played all of the DLCs except for commander Lillith’s, which I almost finished.  That being said, when I unlocked TVHM, I was excited to use it, then realized that it was tough. I wasn’t really about that. Sure I got more EXP for killing things but even then, that was about it.  I was wondering if there was any tips that anyone had for possibly getting levels faster and better guns (best is my 834x17 New and Improved Shotgun Surpreme) other than just doing TVHM.   If there is any way, please let me know. Thanks!


A red exclamation sign also errors in update

There is a red exclamation sign in the notification area. When I run sudo apt-get update the state of terminal is below:  Ign http: //bd.archive.ubuntu.com trusty/universe  Translation-en_US Fetched 3,826 kB in 54s (70.5 kB/s) N: Ignoring file 'getdeb.list.bck' in directory '/etc/apt/sources.list.d/' as it has an invalid filename extension<br> W: GPG error: http: //download.opensuse.org ./ Release: The following signatures were invalid: KEYEXPIRED 1436387333 W: Failed to fetch http: //ppa.launchpad.net/disper-dev/ppa/ubuntu/dists/trusty/main/source/Sources  404  Not Found W: Failed to fetch http: //ppa.launchpad.net/disper-dev/ppa/ubuntu/dists/trusty/main/binary-amd64/Packages  404  Not Found W: Failed to fetch http: //ppa.launchpad.net/disper-dev/ppa/ubuntu/dists/trusty/main/binary-i386/Packages  404  Not Found    E: Some index files failed to download. They have been ignored, or old ones used instead.   How should I proceed?


Generic string to enum extension method with default value

I'm still at my early beginning in C# and I'm trying to implement Enum/converter converters. All my enums has a NotDefined value equals to -1. I would like to implement a generic extension method to get an enum from a string base on the the enum description (which mostly differ in spaces and cases). public static T ToEnum<T>(this string value) where T : struct  {     foreach (T e in Enum.GetValues(typeof(T)))     {         if (e.GetDescription() ==value)         {             return e;         }     }          // Doesn't work..     // How can I return T.NotDefined? - I don't really want to throw something here     return (T)-1;  }  PS I initially found the GetDescription() implementation thanks to this thread :  which helps me a lot :-) . Does anyone have an insight about my issue? Many thanks!


Lets consider the following:  The book doesn't explain, "What's the wisdom behind education?"  Changing this to an indirect question becomes the following:  The book doesn't explain what the wisdom behind education is.  Now, I found many instances on Google where structures like this weren't really converted to indirect questions. For example:  The book doesn't explain what's the wisdom behind education. "[She] doesn't say what's really on her mind."  Edit: And consider the following:  What's the logic behind it. (a) I wonder what's the logic behind it vs. (b)I wonder what the logic behind it is.  (a) sounds better but why? And are these constructions acceptable?


Non-negative integer solution for $ax + by = c$

Show that if positive integers $a$ and $b$ are relatively prime, then every integer $c > ab$ has the form $ax + by = c$, where $x$ and $y$ are non-negative integers.  According to the common way of solving such a Diophantine equation $ax + by = c$, if $x_0$, $y_0$ is already a solution, then the pairs are also a solution: $$ x = x_0 + \frac{bn}{d}, y = y_0 - \frac{an}{d},\quad (n\in Z) $$ where $d$ is the greatest common divisor of $a$ and $b$.  However, although a pattern of periodicity is known, it is still not certain there are definite chances that $x$ and $y$ can be both positive.


As many of you know, the ♦ tag is for moderator use only (e.g. Moderator name ♦). However, suppose a user adds this to the end of their name. Is there a set consequence for this? Will they lose their reputation, or will their account be banned?  I do not want to add this diamond, I'm just wondering what would happen if I did.


Solutions for $2^x+2^y=2^z$ for integers x, y and z

I'm trying to prove/disprove that the equation  $2^x+2^y=2^z$  where $x$, $y$ and $z$ are positive integers, only have trivial solutions. The obvious case where this is true would be for $x=y$ but I'm not certain if any solutions exits for $x\ne y$  It feels like there are no other solutions but I'm not sure how one would formally prove it. Anyone have any tips on how to do this?   Sorry if this is a trivial question / known problem.


Unable to "flag" or "close" from mobile site

There have reports of issues with mobile site's ability to "flag" or "close" questions:       This seemed to have been fixed, however, when the new categories of close/flag votes were introduced the issue has reoccurred again.   As of now I am unable to "close" or "flag" from the mobile interface to the site.


jQuery Ajax error handling, show custom exception messages

Is there some way I can show custom exception messages as an alert in my jQuery AJAX error message?  For example, if I want to throw an exception on the server side via  by throw new ApplicationException("User name already exists");, I want to catch this message ('user name already exists') in the jQuery AJAX error message.  jQuery("#save").click(function () {   if (jQuery('#form').jVal()) {     jQuery.ajax({       type: "POST",       url: "saveuser.do",       dataType: "html",       data: "userId=" + encodeURIComponent(trim(document.forms[0].userId.value)),       success: function (response) {         jQuery("#usergrid").trigger("reloadGrid");         clear();         alert("Details saved successfully!!!");       },       error: function (xhr, ajaxOptions, thrownError) {         alert(xhr.status);         alert(thrownError);       }     });   } });   On the second alert, where I alert the thrown error, I am getting undefined and the status code is 500.  I am not sure where I am going wrong. What can I do to fix this problem?


How to make a photo background fully white?

I have photos of a product and I would like to create a white background behind it. Like it is done in this example:  I have tried playing with levels and the brightness but that also messes up the product itself. How do i do this?


macvim, mactex, and M1 MacBook Air (MBA)

I'm struggling with using macvim and mactex on M1 MBA. Here is what I've done.  Install macvim (via homebrew, probably). Install . Install TeXShop 4.58, Ghostscript-9.53.3-Full.pkg, and MacTeX-2020-Universal.pkg (see ).  However, on my macvim, the following errors occur.  Note: I tested x86_64 and arm64 support described at the bottom of . Note2: which latexmk gives latexmk not found. EDIT: I've installed latexmk via Tex Live Utility but still the command latexmk does not work.  EDIT2: I manually adding path in ~/.zshrc as export PATH="/usr/local/texlive/2020/bin/x86_64-darwin:$PATH", which solves the problem.


What does a just-in-time (JIT) compiler do?

What does a JIT compiler specifically do as opposed to a non-JIT compiler? Can someone give a succinct and easy to understand description?


How can I open a KML Network Link in QGIS? I have googled this question and searched for  on Stack Exchange. I am not asking how to open a KMZ in QGIS. I don't see any references to trying to open a KML Network Link in QGIS.


Split a List into different Lists based on chunk size (Number of lines)

Lets say that i have a big list of string called "lines" and it holds all lines from a text file (Its usually big numbers around 100k - 1mil lines)  List<string> lines = File.ReadAllLines("Lines.txt");   And my problem is that i would need to split the file (Or the list) based on what chunk size the user inputs. So lets say that we have 10k Lines in  Lines.txt and user imputs chunks of 4400 lines  File1 = 4400 Lines  File2 = 4400 Lines File3 = 1200 Lines   I tried using something like this that my colleague recommended but i dont understand it and it does not work.   public static class ListExtensions {     public static List<List<T>> ChunkBy<T>(this List<T> source, int chunkSize)      {         return source             .Select((x, i) => new { Index = i, Value = x })             .GroupBy(x => x.Index / chunkSize)             .Select(x => x.Select(v => v.Value).ToList())             .ToList();     } }   I would appreciate any recommendations or help on how i could solve this.


Parse JSON array of ids into payload using ssjs

I need to create a json payload to send data in this format {    "ids":[       "6375502",        "637550",       "6376391"    ],    "type":"MrnId",    "extId":"104DC758-25AE-47A8-931A-DD9DC1637049" }  How should I write the payload? One sample is below - var payload = '{"ids":arr,"type":"MrnId",    "extId":"104DC758-25AE-47A8-931A-DD9DC1637049"}';  here arr is the array of ids


My background and gameobjects are 2d sprites not UI images ,I want to know how to make my background scale with screen size and positions of 2d sprits on it don't change after building game (webGl) like scale canvas with screen size and anchor points in UI elements .  Before building the game   After building


Is there a way to know where a line in the .tex file will be whether in the top or the bottom of a page?

I wanted to automatically pass to a newpage when i'm near the end of one on special occasions and so i was wondering if they were anything that would tell where it should be based on what is above. Exactly i would like something giving either the distance to the upper border of the page or the purcentage of advencement in the page.  PS: If you have a way to pass to a new page when near the end of one page, i will gladly accept it even if it doesn't match the rest of my question  Thanks for your answers


Want to create pokemon fan-game, need advice on copyright

I want to create a pokemon text game. Obviously I will use various stuff that belongs to Nintendo, like pokemon, professor, region names and sprites from the games. Can Nintendo sue me or take down my game and for what? What are the possibilities? I think it's important to note that:  It is a text adventure game that lacks any mechanics of known official games It is going to be absolutely non-profit, I won't accept any money, including donations, for my creation It is going to be based on a website I'm not expecting more than 1000 users per day to visit it To sum up, the IP of Nintendo I want to use are pokemon sprites and various names, copyrighted by Nintendo There are a lot of pokemon web-games operating like neopets that weren't currently shut down  I would be very thankful for any advice or help! p.s. Sorry for my bad English, that's not my mother tongue. :^)


What kind of margin of error can I expect in figuring distance?

I have reviewed  and that does not equate to the specific question that I wish to ask because I'm looking for a simple answer about accuracy of multiple formulas.  While there is an answer there that discusses accuracy, it does it more as a comparison between two methods and depends on the reader understanding trigonometry to follow the answer.  I'm looking, mostly, for simple margins of error.  This is my first time trying to compute distance from two points on the ground.  I've been researching this and see that a lot of people use the Haversine Formula, but I also see comments, whenever I read about it, that there are accuracy issues.  Apparently, from what I see, Vincenty is more accurate, but I've also seen comments that the Law of Cosines is better.  What I don't see is any way to find out just how inaccurate I can expect a method to be.  Apparently there can be problems at extremely small distances in Haversine, but I'm not clear on that.  I'd like to just go on and use GeoPy in my program.  I'm basically working with distances of 100 miles or less.  Most of the time I'm comparing coordinates of two locations to see if they're close enough to be considered the same address.  If the accuracy is going to be within a few feet, that's close enough.  Can someone either point to a good resource or explain what kind of accuracy I can expect from the different methods I've mentioned and if there's a way to know what the conditions are that will give me more or less accurate answers?    I do see that GeoPy has a feature to tell me the confidence of a calculation, but I need to be able to know, in general, what kind of accuracy I can get from any one method overall, not for each individual calculation.  I see a lot about one method being better than another, but I don't see much on what kind of accuracy I can expect from any one method and what factors I can look at to tell me how accurate that method is.  That's what I'd like help finding.


I think I've read all posts concerning this issue and a solution might have been provided but I don't understand it. Here is the full story. I export my bibliography file from Zotero (I tried everything BibTex, BibLaTex, UTF-8 and Western, all possible combinations). I work in Texniccenter editor. I would like to use biblatex (the example is not full, it's a thesis normally, so too long). Here is my code: \documentclass{book} \usepackage[latin1]{inputenc} \usepackage[T1]{fontenc} \usepackage[french]{babel} \usepackage{csquotes} \usepackage[backend=biber]{biblatex} \addbibresource{bibli} \title{YYY} \author{\textsc{ZZZ}} \date{\today} \begin{document} \maketitle \frontmatter \tableofcontents \chapter{Introduction} \mainmatter \part{State of the art} \chapter{blabla} L'intérêt pour l'activité d'abattage a été étudié à plusieurs reprises en sciences sociales. Toutefois, la condition animale en elle-même y est très peu abordée, sans doute parce que les acteurs de terrain eux-mêmes la considère comme un non-sujet \cite{muller_a_2008}. \printbibliography \addcontentsline{toc}{chapter}{Bibliographie} \end{document}  Here is a part of my bibliography file: @book{muller_a_2008,     address = {Paris; Versailles},     title = {{\'A} l'abattoir: travail et relations professionnelles face au risque sanitaire},     isbn = {978-2-7351-1170-1 978-2-7592-0051-1},     shorttitle = {{\'A} l'abattoir},     language = {French},     publisher = {{\'E}ditions de la Maison des sciences de l'homme ; {\'E}ditions Quae},     author = {Muller, S{\'e}verin},     year = {2008},     note = {OCLC: 262718567} }  Probably the answer is simple, but I am quite new, and yes, I really read a lot of documentation, without finding anything useful. I also tried to change the settings of output profile (use biber instead of bibtex) but it did not work. Problem might come from Zotero? If so how to know where cause my file is super long?...


Please help I have this and I didn't get it well

How to solve $\lim_{x \rightarrow 2} \frac{1}{x-2}$?  I tried to solve it by dividing the both sides on $x$ but it doesn't work and I tried to get the dam $-2$ out but also didnt work so how to solve it I know that there is no limit for this but how to Remove the  indeterminacy


Named Credential : Pass username and password in url

I am new to using Named Credentials. I created a Named Credential with following details: Identity Type: Name Credential Authentication Protocol: Password Authentication and added username and password. Generate HTTP headers as true  I am using below code to access my named credential: (API_Login_Information is the name of my named credential)      Http h = new Http();     HttpRequest req = new HttpRequest();     req.setEndpoint('callout:API_Login_Information');     req.setMethod('GET');     HttpResponse res = h.send(req);   However, I am getting error when doing callout as the api documentation (to which I am trying to connect) says username and password are mandatory when calling the service: Ex: Lets say service name is https://www.google.com, I need to send username and password in url as below:  https://www.google.com/xml.php?_[action]=auth&login=***username****&password=****password*****   Can I achieve above requirement using named credential (when I try with out using named credential but using custom setting it is working from anonymous window and yes, they need the password in URL)  P.S: Referred to  question where sfdcfox answered we cannot use merge fields in url then is there any other way to achieve this.


My game-loop looks like this:          public void run() {             init();              final double amountOfTicks = 60.0;             double ns = 1000000000.0 / amountOfTicks;             long time = System.currentTimeMillis();             long lastTime = System.nanoTime();             long now = 0;             double delta = 0;             int tickCount = 0;             int renderCount = 0;              while(running) {                  now = System.nanoTime();                 delta += (now - lastTime) / ns;                 lastTime = now;                  if(delta >= 1) {                     tick();                     tickCount++;                     delta--;                     render();                     renderCount++;                 }                   if(System.currentTimeMillis() - time >= 1000) {                     time += 1000;                     System.out.println(tickCount + " Ticks, " + renderCount + " FPS");                     tickCount = 0;                     renderCount = 0;                 }               }             stop();          }   In the variable "amountOfTicks" i can set how many ticks i want per second. The amountOfTicks are here the same as the fps which i have. With this solution my console prints "60Ticks, 60 FPS", but the problem is, that the CPU-performance with this method is too low. I have only 60 Ticks and only 60 FPS, but the whole while-loop is still running through as fast as my pc can.  The only thing how i can improve the cpu-performance is, if i let the thread for 1ms or so sleeping. But is this solution not dirty? This solution will maybe work on my (relative good pc), but on a other with with less CPU-performance the 1ms sleep maybe are waste, because of this the game maybe can not reach the 60FPS of this?


int main(void) {   int a=0, b=20;   char x=1, y=10;   if(a,b,x,y)     printf("bye");   return 0; }   How does "if" condition in the above code work work? Would the value of "y" be only considered by "if"?


Pie Chart without labels in beamer using pgf-pie

EDIT The accepted answer completely solves my immediate problem, but for more detailed analysis of the underlying issue please refer to answer by cfr. Basically, pstricks and pdfTex don't mix well.  I have a beamer presentation with a lot of pie charts. I use pgf-pie package because it is easy and (mostly) does what I need. I have one particular pie-chart that should have no labels at all. I have tried adding  /tikz/nodes={text opacity=0,overlay}   to the code following advice found here.    \documentclass{standalone} \usepackage{pgf-pie} \begin{document}  \begin{tikzpicture} \pie [explode=0.1, color={blue!70, green!80, red, yellow} ,/tikz /nodes={text opacity=0,overlay}]{10/, 20/, 30/, 40/} \end{tikzpicture} \end{document}   Now, the strange thing is, the code works well in the example above (standalone class). However, it doesn't seem to do anything inside a beamer presentation, i.e. the labels still show. It seems that there is some sort of package conflict. How could I enable this to work in the beamer presentation? I know there are other ways to produce this but pgf-pie is quite handy otherwise.  \documentclass[12pt,compress]{beamer} \usetheme{Warsaw}  \setbeamertemplate{navigation symbols}{}%remove navigation symbols \setbeamercolor{alerted text}{fg=magenta}  %\usepackage[latin1]{inputenc} \usepackage[T1]{fontenc} \usepackage{wasysym} \usepackage{multicol} \usepackage{amsmath} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{graphicx} \usepackage{xcolor} %\usepackage{iwona} \usepackage{wrapfig} \input{FactorTree} \usepackage{pstricks} \usetikzlibrary{matrix} \usepackage{tkz-euclide} \usetkzobj[all] \usepackage{xlop} \usepackage{tcolorbox} \usepackage{pgfplots} \usepackage{pgf-pie} \usepackage[makeroom]{cancel} \input{longdiv}


Is the collapse of the wave function inherently time asymmetric?

Schroedinger's equation, as we all know, is time symmetric. In quantum field theory, we have to come up with a more sophisticated CPT reversal, but the essential point remains unchanged. However, the collapse of the wave function in the Copenhagen interpretation is manifestly time asymmetric. Correct me if I'm wrong, but can you uncollapse a wave function, converting it from an eigenfunction to a superposition of eigenfunctions?  Is this asymmetry connected with the thermodynamic arrow of time and the second law in statistical mechanics, or are they independent? How would an uncollapse look like, and can we experimentally arrange for an uncollapse? Why are there more collapses than uncollapses? If an observer unobserves a quantum thingie, does that thingey uncollapse?