How can i make my code threadsafe in this Scenario?
What is a NullReferenceException, and how do I fix it?
Should spam posts be edited? I noticed that the posts of the recent spam surge on Ask Ubuntu were all edited by community members into something like     EDITED - REMOVED SPAM ANSWER   or similar.  While I understand why the users have done this and I too don't want to leave the spam content visible for longer than absolutely necessary, it made flagging more time consuming for me.  I had to check the revision for every of those possible spam posts to check if it is actually spam, instead of being able to flag directly from the review site. Spam flags carry a serious penalty, I'm not willing to add my spam flag without checking that it's really spam.  I see the benefit of editing spam, but it also causes some more effort for the later flaggers. Should we as a general policy edit out the content of spam posts, or should we deal with them solely by flagging? How and why do normalization and feature scaling work? I see that lots of machine learning algorithms work better with mean cancellation and covariance equalization. For example, Neural Networks tend to converge faster, and K-Means generally gives better clustering with pre-processed features. I do not see the intuition behind these pre-processing steps lead to improved performance. Can someone explain this me? prominently sports purple hair.    Is this her natural hair color?  Natural extensions in the answer depending on the correct answer: Is she wholly human and humans in the Galaxy Far Far Away can have this hair color?   Or is she partly human or not human?   Or does she dye her hair?   Or is there another hair color changing technology? Screensaver with active desktop I am running XP and im looking for a screensaver that does not change the desktop. I.e when the screensaver is active, i want to be able to see my desktop as it is and any changes on the desktop to be visible. Only if i touch the mouse should the login prompt be displayed to inactive the screensave.   For example, i am usually either working on my desktop or laptop. On my desktop i have an applicaiotn running that is showing me stock quotes from the stock exchange. Everytime the screensaver activates i have to touch the mouse to bring the screen back.   What i want to be able to do, is to be working on my laptop and at any time look at the numbers on my desktop without the screensaver interfering. I want the screensaver to be active but its only job is to ask me to enter the password to unlock the screen. I should still be able to see teh stock prices as tehy are changing even while the screensaver is active.   Basicly is it possible to see the desktop while the screensaver is active?   Thanks $\int_{\frac{1}{3}\pi}^{\frac{2}{3}\pi} {\sin(x)\;dx}$ using Riemann sums? Why are the even and odd Regge trajectories degenerate? This is an old classic which I don't think ever got a clear answer. The Gribov-Froissart projection that gives the relativistic version of Regge trajectories treats even angular momentum differently from odd angular momentum. The trajectory functions in general are separate for even and odd angular momentum.  But in QCD, the odd trajectories interpolate the even trajectories in every case--- the two trajectories are degenerate. Is there a way of understanding why the even-odd trajectories are degenerate? Is is a symmetry argument? Can you find a natural system where they are not degenerate?  A quick google search revealed this reference, which doesn't answer the question, but gives an experimental signature for the degeneracy:  , There is probably excellent data by now on this. How to properly handle collision in a component-based game? Trying to wrap my head around the ways to properly handle collision in a game designed around components.  I see many examples have some sort of PhysicsComponent that gets added to the entity's list of components but the actual implementation is confusing me.  For this to work, the PhysicsComponent would need access to the world around it. This doesn't make intuitive sense to me. Shouldn't a component be unaware of not only its container (the entity), but its container's container (the world)?  To me, it sounds like the level or scene should maintain a list of these entities and every game update, loop through the entities to determine which collide.  My question is firstly, whether or not this is good design, and secondly, how to determine which entities can collide. I suppose solid entities could implement an empty IRigidBody interface so the level could determine which entities in the list support collision. But is this breaking the component design?  Instead, should they contain an empty RigidBody component? This may actually be better because it may not always be empty and this approach is more future-proof. The only problem with this is the complexity. The scene would have to loop through not only every entity, but also every entity's components to determine if it had this RigidBody component.  Thirdly, when they do collide both entities should be informed somehow and I am unsure on how to accomplish this either.  Let's say that both entities contained a HealthComponent and when they collided both their healths would be decreased by some arbitrary value, 5. I suppose it would be the scene's responsibility to handle this when it detects a collision between two entities?  But then is the scene responsible for too much? I could see this possibly getting out of hand and becoming unwieldy when the scene is responsible for many things entities should not (?) have access to.  Edit: Question updated with more details. Pivot in sql server A bit of background, I am doing research in atmospheric physics and detection systems  Recently, I received a paper submission back with revisions suggested by a couple of reviewers.  For the most part, the revisions were definitely constructive, justified and most importantly, helpful.    That is, except on one particular crucial aspect of the paper where both reviewers made suggestions, that they labelled as critical for the paper's success.  However, the suggestions were directly opposite.  i.e. Both suggestions are mutually exclusive, but equally feasible.    What is an effective means to address this conflict?  I have spoken to my academic supervisor and he is not sure how to proceed either and we have double checked and both suggested paths are feasible. Is it possible to get old suggestion system back in Firefox 43.0? With the new update, the first suggested link is just domain. In older versions, the first suggested link was the page I visited the most and I got used to this great feature.  Is it possible to remove the new domain suggestion, for example "Visit ebay.co.uk"?  See image attached Local anchor for group master (move/translate/offset of group master moves group instances)? Let's say I start with the default Blender (2.64) file, except I set the cube to be 1 for all dimensions. At that point, the cube is at xyz location (0,0,0).  Then, let's say I select the cube with right mouse button, and go to Object / Group / Create New Group, and confirm the name "Group" in the "Create New Menu" bar with [Enter]. The selection outline turns green, meaning it's a group "master" (as far as I can see).  Now, let's say I press Shift-A; and choose "Group Instance" > "Group", and set the new instance to Z=2.3; with all selected, the view looks something like this:    Now, let's say I deselect all with A, then select the group master with right-click; and let's say I move it to Y=-2; then the result is:    ... that is, it is noticeable that the group instance/clone also moved in respect to its center (note the group instance axes, which remain in the set position)! Which means, I guess, that groups are defined in respect to the global coordinate center (0,0,0) as anchor.   My question is: is it possible to define a group, but in respect to the, say, bounding box center of the group as anchor - such that when I move/translate the group master, the group instances would remain anchored at their set position (basically, at the center of the group instance axes)? Also, is this documented anywhere in Blender documentation (I had problems finding this info)? Proving if $d_0$ is the smallest positive integer in $S$ then $d_0 = \gcd(a,b)$ I have tried to dig around for this, but I can't find a way (other than stepping one by one through past reviews) to see what proportion of my review decisions match the eventual outcome of the review.  This stat would give me confidence that I'm in line with the review guidance and not becoming too lenient in my old age. If it gets too low, I can then double check individual reviews to find out why I'm missing the mark. If it is given that component of acceleration perpendicular to the velocity of a body has a constant, non-zero magnitude, how can we mathematically prove that the trajectory of the body will be circular?   I have basic knowledge of calculus, vectors and co-ordinate geometry. I can prove that the trajectory of a body in projectile motion is parabolic. I tried to follow a similar method to get an equation of circle but couldn't succeed. I tried forming parametric equations of x and y in terms of time t (the way we proceed when proving the parabolic path of a projectile) but could not reach the conclusion.  Edit: I have edited the question in order to improve it. However I still can not share my work on this question as I had asked the question almost 6 months ago and now I can not find where I tried solving it. Sincerely sorry for that. Fortunately, I can still login with this email address that I have lost access to.  I have been searching around here for a way to update it to the current one I use.  I have found many answers.  But they all give instructions to click on something not displayed or in one case, a page that prompts me to login via another email I no longer have the password for. I need current up to date instructions on how to change my email address or add another email-based login for this same user name that I am posting this with. How to Truncate a string in PHP to the word closest to a certain number of characters? I have a code snippet written in PHP that pulls a block of text from a database and sends it out to a widget on a webpage.  The original block of text can be a lengthy article or a short sentence or two; but for this widget I can't display more than, say, 200 characters.  I could use substr() to chop off the text at 200 chars, but the result would be cutting off in the middle of words-- what I really want is to chop the text at the end of the last word before 200 chars. Here’s something that sucks:   Plug in external monitor to laptop (Mac OS X Leopard in my case). Arrange your windows to have the IDE on one screen and browser on another. (Etc etc.  Resize, rearrange, fuss, fuss, fuss.) Unplug monitor to run to a meeting, or whatever. Goto 1.   I’d like to replace step 2 with “computer remembers exactly how I had it and just puts it back that way”.  (I personally only need a solution for Mac but collecting solutions for other systems here might be useful to others.  I’m sure it’s a common problem.) Capistrano for Django Blender build for Raspberry Pi3? I understand we cannot state with arbitrary precision the position and momentum of a micro-particle as we superpose infinite waves to create a wave packet at the exact position of the particle and hence cannot say which wave is corresponding to its momentum. This is theoretically said. Also some people say that measurement of one disturbs the other and some say it's reality.  Firstly, the theoretical explanation: why should I consider that a wave out of many superposed will give us the momentum or position? We might use another single wave which is not sine in nature and might get the results. Or why won't a single sine wave suffice? This all considers the micro-particle as wave because of de Broglie.  Secondly, the practical thing seems legit.  Thirdly, the electron must have some kinetic energy and position. It is who we are measuring and can't get it exact so why blame the electron as in theoretical concept. How we quantify the uncertainty, it must depend on the measuring device and various other factors.  I might need to edit this post based on your answer so that I can explain more clearly my thinking.  Edit: From here is what gets the measurement problem:        Text: Imagine that you're blind and over time you've developed a technique for determining how far away an object is by throwing a medicine ball at it. If you throw your medicine ball at a nearby stool, the ball will return quickly, and you'll know that it's close. If you throw the ball at something across the street from you, it'll take longer to return, and you'll know that the object is far away.   The problem i­s that when you throw a ball -- especially a heavy one like a medicine ball -- at something like a stool, the ball will knock the stool across the room and may even have enough momentum to bounce back. You can say where the stool was, but not where it is now. What's more, you could calculate the velocity of the stool after you hit it with the ball, but you have no idea what its velocity was before you hit it.   This is the problem revealed by Heisenberg's Uncertainty Principle. To know the velocity of a quark we must measure it, and to measure it, we are forced to affect it. The same goes for observing an object's position. Uncertainty about an object's position and velocity makes it difficult for a physicist to determine much about the object.   Edit: After seeing this answer one of my doubts is very well cleared, the other answers are also written and helpful:        Text: There is a definine velocity and momentum, we just don't know it.   Nope. There is no definite velocity--this was the older interpretation. The particle has all (possible) velocities at once;it is in a wavefunction, a superposition of all of these states. This can actually be verified by stuff like the double-slit experiment with one photon--we cannot explain single-photon-fringes unless we accept the fact that the photon is in "both slits at once".So, it's not a knowledge limit. The particle really has no definite position/whatever.