I am trying to assign two teams out of 16 teams to 8 people out of 8 people,  Here is what I have:  import random     person = ['Ashton', 'Danny', 'Martin', 'Yves', 'Nick', 'Cormac', 'Thierry', 'Ciaran']     team = ['France', 'Switzerland', 'England', 'Slovakia', 'Germany', 'Ukraine', 'Spain', 'Czech Republic', 'Croatia', 'Italy', 'Republic of Ireland', 'Sweden', 'Russia', 'Wales', 'Belgium']     namesTeams = {}     for x in person:         teamName = team[random.randint(0, len(team) -1)]         namesTeams[x] = teamName         team.remove(teamName)     print(namesTeams)
Assume I have the following list:  foo = ['a', 'b', 'c', 'd', 'e']   What is the simplest way to retrieve an item at random from this list?
Finding a set of continuous functions with a certain property 2 I need help finding the set of continuous functions $f : \Bbb R \to \Bbb R$ such that for all $x \in \Bbb R$, the following integral converges:  $$\int_0^1 \frac {f(x+t) - f(x)} {t^2} \ \mathrm dt$$  I think it might be the set of constant functions but i havent been able to prove it :(   I was thinking that you can use the stone weiestrass theorem considering the set of continuous functions on a closed  interval(non trivial) ,and a subset which contains the set of continuous functions whose integral above diverges in some point in that interval along with  with the set of constant functions. So in order to solve the problem i need only to prove that if two functions do not meet the condition of the problem then their product does not as well .  I hope you can provide some insight and thank you . I'm brand new to jQuery and have some experience using Prototype. In Prototype, there is a method to "flash" an element &mdash; ie. briefly highlight it in another color and have it fade back to normal so that the user's eye is drawn to it. Is there such a method in jQuery? I see fadeIn, fadeOut, and animate, but I don't see anything like "flash". Perhaps one of these three can be used with appropriate inputs? How to permanently turn off online results I don't like getting online results when searching in my dashboard, so I went to System Settings &gt; Security &amp; Privacy &gt; Search, and I turned the setting off:    But when I restart my machine, the setting is always reset to:    So how can I permanently disable it without it turning on again after a restart?  Information Update:  I have had a look at the post that this has been marked as a possible duplicate of, and I don't think that my question really is a duplicate of it, as the other question is asking about how to set it globally, and I am not, I am only wanting to set it for one user, so the fact that it is not global is not the problem, the problem is that it is not sticking for that one user, and just resetting to its default state after a restart. In fact, I don't want it to be set globally, and the answers from the other question only really explain how to do that.    OS Information:  Description:    Ubuntu 15.04 Release:    15.04   Package Information:  unity:   Installed: 7.3.2+15.04.20150420-0ubuntu1   Candidate: 7.3.2+15.04.20150420-0ubuntu1   Version table:  *** 7.3.2+15.04.20150420-0ubuntu1 0         500 http://gb.archive.ubuntu.com/ubuntu/ vivid/main amd64 Packages         100 /var/lib/dpkg/status prime divisor of $3n+2$ proof I have to prove that any number of the form $3n+2$ has a prime factor of the form $3m+2$. Ive started the proof  I tried saying by the division algorithm the prime factor is either the form 3m,3m+1,3m+2.  Case 1: $3m$      suppose $3m$ does divide $3n+2$. That means $3mr=3n+2$ where $r$ is some integer. But we get $mr-n= 2/3$ and since $mr-n$ is an integer that's a contradiction. Thus $3m$ does not work.  Case 2: $3m+1$ Same argument here  Case 3: $3m+2$ By the fundamental theorem of arithmetic every integer is divisible by a prime. But not sure what to do from here. How to share files through the local network? How to revert uncommitted changes including files and folders? Graphics horribly corrupted on Ubuntu 16.04 in VirtualBox, showing random strips of pixelated colors Inside a VirtualBox VM, I have installed myself an Ubuntu 16.04.1 LTS Server installation. However, when I installed the ubuntu-desktop package and rebooted, this happened:    Exact command I used: sudo apt-get update; sudo apt-get install ubuntu-desktop ..and then a reboot command.  This just seems like a corrupted top-left portion of the screen, as my cursor can appear in view (but corrupted):    This is a purely graphical issue because I can use the keyboard to successfully progress to a desktop:    Note: On startup it shows correct graphics for a split-second then reverts to glitch.    Any help on this? Why do votes get locked? I downvoted  and now really can't say why, so I wanted to remove my downvote. However, I get the message:  You last voted on this question yesterday Your vote is now locked in unless this question is edited  Why is this? I don't think I voted on it multiple times, and even when I did, I can change my mind, can't I? I can't seem to find a story related to mine so here it is.  I am 25 and a German citizen. In 1998 when I was 7 years old my family moved to the states and we stayed until early 2002 and left voluntarily. Basically we overstayed. I am aware that my parents had the ten year ban and since I was a minor at the time of our overstay I did not receive such ban.  Ever since 2002 I have not attempted to go back to the USA for any reason. However now that I am older I would like to go back for vacation and stay for a short period of time (one month) during my christmas break.  I've lived in Germany since leaving, have a great job, enough money in the bank account. My whole life is here and I have no intention on moving anywhere else.  After reading a bunch of stories online I have decided to apply for a B2 visa to be on the safe side but I was curious about the ESTA approval. For the last question. 8) Have you ever stayed in the United States longer than the admission period granted to you by the U.S. government?   I should put yes but is it a no if I stayed when I was a minor? And what are my chances on getting the B2 Visa? Should I use "who" or "that" when referring to an organisation? I generally use the rule of thumb of using who when referring to a person and that when referring to an object. Example:  Jim is someone who makes me smile. I was nearly knocked out by the ball that hit me.  But what about when we're talking about an organisation?  I am forever indebted to the charities who helped me. I am forever indebted to the charities that helped me.  The former seems somewhat warmer, if that makes sense, although the latter feels more correct. What should I use? And how about this:  I'm really happy with the insurance company who helped me with my claim. I can't stand them, they're the insurance company that ripped me off.  To me the former evokes a team of helpful people while the latter evokes a cold heartless corporate entity. Is this just a matter of style and so should go with my instincts, or should I aim for what is 'correct?' Why does the compiler say "a constant value is required" for the first case...the second case works fine...    switch (definingGroup) {     case Properties.Settings.Default.OU_HomeOffice:           //do something           break;     case "OU=Home Office":           //do something         break;     default:         break;  }   also tried...  switch (definingGroup) {     case Properties.Settings.Default.OU_HomeOffice.ToString():           //do something         break;     case "OU=Home Office":         //do something         break;     default:         break;  }   ...same error  Here's the Properties.Setting code  [global::System.Configuration.ApplicationScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("OU=Home Office")] public string OU_HomeOffice {     get {         return ((string)(this["OU_HomeOffice"]));     } } Expected value of sums Suppose we draw cards out of a deck without replacement. How many cards do we expect to draw out before we get an ace? An acquaintance recently posted an image to FB from his recent trip to the JFK Historic Site asking for an explanation of a visible artifact he states was not visible to the naked eye but was visible through the EVF of his camera and in the final image.    The artifact is a series of bright, nearly-vertical bars and a longer, almost horizontal bar superimposed over the lower part of the door frame and the radiator.  I found a very similar artifact in another image of the same room from a blogger which isn't as compressed:    In both cases the artifact seems to be a vertically inverted image of the post and rail outside the saturated window.  From looking at other images of the room available online I know there is spherical glass ornament topping the table lamp whose shape is visible at the left of the photo.  One response to the OP's question is as follows:     RK: It is lens flare. So, even on an iPhone, the camera lens is made   up of multiple lenses. Each designed to focus the image and make sure   it isn't distorted. Remember a lens bends light.  Sometimes, based on   angle and intensity of the incoming light, some stray light bounces   back and forth while traveling through the various elements that make   up what we think of as a camera lens (some of mine have 16 elements   inside a single lens.) Even the best glass is capable of reflecting   some light instead of passing it through the lens elements to the   sensor.  This is what you are seeing. The railing is overexposed, and   some stray light is bouncing around a bit inside the lens.   My response:     DJ: I don't think it's lens flare or ghosting. Those usually form an   image of starbursts, rings, or circles in a row across the image or in   the shape of the aperture; or a veiling glare or haze. This is forming   an image of the light outside minus objects in its path. It is more   likely a direct reflection/projection off a mirror or the glass in a   picture frame elsewhere in the room onto the opposite wall and the   radiator. There are two other clues which seem to confirm this. First,   the image has a gradiated appearance, it is less distinct in the   relatively bright area on the door frame and brighter in the   relatively darker areas behind and on the radiator. You would expect   lens flare to be more evenly specular. Second, the image representing   the light from below the horizontal rail changes angle on the   different faces of the door frame. Unlike a projection, lens flare is   an image created within the lens, the physical shape of the objects it   superimposes do not change its shape.      OP: If that were the case, would I have been able to see said   reflection in the room without the camera? There was no image I could   see with the naked eye. I notice the image in my phone before I took   the pic and did a double, triple and quadruple take before I took it   so I'm sure.      DJ: It would have been visible at the moment the image was taken, but   it may not have appeared nearly as bright and distinct because your   eyes were accommodating for the bright light coming in the window. The   projection could have easily been obscured by you or anyone around you   changing position or moving through the path of the projected   reflection. Also, it's been caught by other people... (see Image 2)   Notice that, in the linked example, the projection is again distorted   by the surface it falls on.   Anyone else want to chime in with an explanation? Is it possible to get a list of most recently installed packages? Enumeration within self defined environment My self defined environment having a symbol at the beginning and at the end works fine for text without enumeration. When including enumerate the symbols are not there where desired. Is it possible to have the first symbol directly in front of &quot;1.&quot; i. e. in the same line and the ending symbol in the same line as the last line of the enumeration? With \ignorespacesafterend and \unskip I did not succeed. \documentclass{article} \usepackage{amssymb} \newenvironment{myenv}{$\blacktriangleright$}{\hfill$\blacktriangleleft$}  \begin{document} There is a text.  \begin{myenv} And an example \end{myenv}  Here is another text.  \begin{myenv} \begin{enumerate} \item A \item B \end{enumerate} \end{myenv}  \end{document} Order of keys in dictionary How do I set a static IP address in Windows? Bending of light - photon's inertia instead of mass Using classical mechanics, the formula for gravitational attraction is   $$F = G\frac{m_1m_2}{r^2}.$$   This formula does not work for photons, and we need to use Einstein's theory of gravity to account for that, as the photon is massless. What if, instead of using the mass of the photon, we rather used the inertia of it?  The momentum of a photon is     $$p=\frac{h}{\lambda}.$$  Thus, using that, we can calculate its supposed 'mass' (inertia) as momentum is also equal to mass times velocity. So 'mass' of a photon is     $$m=\frac{p}{v}=\frac{h}{\lambda  c}.$$   If we use this mass as the mass of a photon, can we use Newton's equation for gravitational attraction? I am wondering if the mass density profile $\rho(\vec{r})$ has been characterized for atomic particles such as quarks and electrons. I am currently taking an intro class in quantum mechanics, and I have run this question by several professors. It is my understanding from the viewpoint of quantum physics a particle's position is given by a probability density function $\Psi(\vec{r},t)$. I also understand that when books quote the "radius" of an electron they are typically referring to some approximate range into which an electron is "likely" to fall, say, one standard deviation from the expectation value of its position or maybe $10^{-15}$ meters.  However it is my impression that, in this viewpoint, wherever the particle "is" or even whether or not the particle "had" any position to begin with (via the Bell Inequalities), it is assumed that if it were (somehow) found, it would be a point mass. This has been verified by my professors and GSIs. I am wondering if its really true.  If the particle was truly a point mass then wherever it is, it would presumably have an infinite mass density. Wouldn't that make electrons and quarks indistinguishable from very tiny black holes? Is there any practical difference between saying that subatomic particles are black holes and that they are point masses? I am aware of such problems as Hawking Radiation although at the scales of the Schwarchild radius of an electron (back of the envelope calculation yields $\tilde{}10^{-57}$ meters), would it really make any more sense to use quantum mechanics as opposed to general relativity?  If anyone knows of an upper bound on the volume over which an electron/quark/gluon/anything else is distributed I would be interested to know. A quick Google Search has yielded nothing but the "classical" electron radius, which is not what I am referring to.  Thanks in advance; look forward to the responses. Cannot move std::unique_ptr with NULL deleter to std::shared_ptr?