I know that  is primarily used going to or from a char*.  But I was surprised to find that  could do the same with a void*. For example:  auto foo "hello world"s; auto temp = static_cast&lt;void*&gt;(&amp;foo); auto bar = static_cast&lt;string*&gt;(temp);   What do we gain from using reinterpret_cast and char* over static_cast and void*? Is it something to do with the strict aliasing problem?
What are the proper uses of:   static_cast dynamic_cast const_cast reinterpret_cast C-style cast (type)value Function-style cast type(value)   How does one decide which to use in which specific cases?
Menu select item stuck on screen after context or command menu has closed Periodically when I select a menu command, the label or selected option gets "stuck" on screen and won't go away. I can close all open applications, including whichever one I was using when it got stuck, but it still won't go away.   In the screenshot below, I opened an new instance of IE just to show how the label stays on top. The label was not created by this instance of IE.    (I added the circle in MS Paint. That part isn't stuck.)  The label that gets stuck is the first menu command I select in IE. If a label is already stuck, a new one does not get stuck (regardless of which instance(s) of IE are involved). Based on this knowledge, I now just open IE on my secondary monitor, carefully open the context menu so the Properties command is in the bottom corner, and click it. This is not a solution.  The floating label never moves and is transparent to mouse input (if I click it, it's as if I clicked the item behind it).  The label does not go away if I close all running applications. I haven't tried stopping services or closing system tray items like Live Mesh.  The label does go away if I change the screen resolution and then change it back.  Any ideas how I can stop this from happening? It's happened a half dozen times and it's becoming quite disrupting to my work. Is wildcard search possible in Gmail? Prove that the interval $(0, 1)$ and the Cartesian product $(0, 1) \times (0, 1)$ have the same cardinality Prove that the interval $(0, 1)$ and the Cartesian product $(0, 1) \times (0, 1)$ have the same cardinality  using the SB theorem? Also how does one find a bijection on $f:(0, \infty) \to (0,1)$ such that they have the same cardiniality? I made changes to iptables config file in /etc/iptables/filter in Ubuntu and want to reload them. I read the man page and also googled but couldn't find the information. Any help will be appreciated. Hide and seek game $A$ and $B$ go to the Senate to play a game of Hide-and-Seek. There are $100$ rooms in the Senate, and $B$ picks one of them and hides there till the game ends.  $A$, at the beginning of every turn, picks one room and searches in it. Since he is human and thus fallible, he only has a $60\%$ chance of finding $B$ if she is in fact hiding in the room. If he fails to find her in the room, $B$'s score increases by one, and the next turn starts, whereupon $A$ must pick another room to check (he can also check the same room again). $B$ remains in the room she initially chose.  Given that $A$ and $B$ play with perfect strategies, what is the expected value of $B$'s score at the end of the game?  I tried with $1$ room. There is only one hiding place for $B$. So the expected score of $$B = \sum_{n=1}^{\infty}0.4^{n-1}0.6(n-1)=\frac{2}{3}.$$ Install MySQLdb (for python) as non-compressed egg The install instructions are:  $ python setup.py build $ sudo python setup.py install # or su first   This gives me an .egg file. How do I tell the install to dump the files as a normal, uncompressed library?  Thanks! Alignment of equals sign in multiple align environments I can't seem to get this hat on straight! I carefully positioned my hat to fit my head just right:     But it seems to be shifted to the left a few pixels elsewhere (same in Firefox and Chrome):   Stack Overfow   Skeptics   The top bar is also affected on some sites:   Stack Overfow   Meta SE   InfoSec   However, it is in the correct position in the top bar on some sites somehow:   Skeptics   Bricks   It's not a huge deal of course, it just bothers perfectionists like me. How do you use unlocked rewards after each mission in Splinter Cell: Double Agent? In the PC version of Splinter Cell: Double Agent, how can you use the rewards that you receive after each mission? For example, the shotgun attachment, or the colored night vision?  My list shows that the rewards are there, but I can not figure out how to use them. Is there a way to achieve the equivalent of a  in javascript regular expressions?  I need to match a string that does not start with a specific set of characters.  It seems I am unable to find a regex that does this without failing if the matched part is found at the beginning of the string.  Negative lookbehinds seem to be the only answer, but javascript doesn't have one.  EDIT: This is the regex that I would like to work, but it doesn't:  (?&lt;!([abcdefg]))m  So it would match the 'm' in 'jim' or 'm', but not 'jam' Spacial curvature and expanding space If we take the analogy that in an empty space the space is just a flat sheet then if there is a single planet or a star then the flat sheet will curve below the planet leaving a curvature shaped like a hemisphere below the object, my question is, Does this curvature change as space expands? What is the meaning of equation of a circle or equation of a cube? We have an equation of a Circle $$x^2 + y^2 = 1$$ and equation of a Cube $${||x-y|+|x+y|-2z|+||x-y|+|x+y|+2z|=1}$$  When I substitute x,y in first equation or x,y,z in the second equation then the equations are said to be satisfied when LHS and RHS are equal.  I have a quick question. If the first equation or second equation get satisfied, because LHS becomes equal to RHS, then those values of x and y of first equation are said to be lying on the circumference of the circle and not inside or outside of the circle and x,y,z of the second equation are said to be lying on the surface of the cube and not on the inside and not on the circle of the cube. Correct? How do I use the Tooling API to create a new Apex Trigger? How do I use the Tooling API to create a new Apex Trigger (rather than update an existing one)?  According to the  I need to specify the ContentEntityId as an existing Trigger Id. But in my case I don't have an Id because I've trying to create a new sObject.  If I omit the ContentEntityId I get an error back in the SaveResult:     Status Code: INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY   Message: "insufficient access rights on cross-reference id"   The following is more or less a test case in C# that attempts to use the SOAP tooling API to create the new trigger.  SforceService toolingService = //... Get instance of the Tooling API  MetadataContainer container = new MetadataContainer(); container.Name = "Test" + DateTime.Now.Ticks;  SaveResult[] saveResult = toolingService.create(new sObject[] { container }); string metaDataContainerId = saveResult[0].id;  ApexTriggerMember apexTriggerMember = new ApexTriggerMember(); apexTriggerMember.MetadataContainerId = metaDataContainerId; apexTriggerMember.Body = "trigger TestOpportunityBeforeUpdate on Opportunity (before update) {\n//Horray\n}";     // Adding this will successfuly update the existing trigger //apexTriggerMember.ContentEntityId = "01q70000000GuzP";  SaveResult[] triggerSaveResults = toolingService.create(new sObject[] { apexTriggerMember }); Assert.AreEqual(1, triggerSaveResults.Length); SaveResult triggerSaveResult = triggerSaveResults[0]; if (!triggerSaveResult.success) {     Assert.Fail(triggerSaveResult.errors[0].message); } Assert.IsTrue(triggerSaveResult.success);  ContainerAsyncRequest containerRequest = new ContainerAsyncRequest(); containerRequest.MetadataContainerId = metaDataContainerId; containerRequest.IsCheckOnly = false;  SaveResult[] containerResults = toolingService.create(new sObject[] { containerRequest }); Why is there an extra plastic container in my toilet tank? How do I spell the possessive form of children? In the sentence below, are the usages of apostrophes correct?     In research about parent stereotypes, the correlation between parents’ beliefs about their early elementary age children’s’ mathematics abilities and the children’s actual abilities increased as children aged. Detailed Bathymetric/Bathymetry contour data (0-200M) Maya is sister of dhara who is doctor. Maya is sister of dhara, who is doctor.   In both statements who is used for which person??? Variation of the metric with respect to the metric For a variation of the metric $g^{\mu\nu}$ with respect to $g^{\alpha\beta}$ you might expect the result (at least I did):  \begin{equation} \frac{\delta g^{\mu\nu}}{\delta g^{\alpha\beta}}= \delta^\mu_\alpha\delta^\nu_\beta. \end{equation}  but then to preserve the fact that $g^{\mu\nu}$ is symmetric under interchange of $\mu$ and $\nu$ we should probably symmetrise the right hand side like this:  \begin{equation}\frac{\delta g^{\mu\nu}}{\delta g^{\alpha\beta}}= \delta^\mu_\alpha\delta^\nu_\beta + \delta^\mu_\beta\delta^\nu_\alpha.\end{equation}  Is this reasonable/correct? If not, why not?  It seems that I can derive some weird results if this is right (or maybe I'm just making other mistakes). I am looking for system monitoring tools which are GUI and CLI or web-based which include basic functions such as:   CPU Usage Ram Usage Swap Usage Disk Usage ( Space / I/O ) Heat Monitoring   I know there are many tools I can use, but I am looking for a single tool that has these basic functions. Is cancer caused by vitamin B17 deficiency?