I'm looking through some c++ wrapper code that provides a c api, and I'm finding lots of reinterpret_cast where a static_cast would suffice, e.g.:  struct cpp_object{ void foo(){ /* do something */ } };  /* begin: c api */ typedef void c_object;  void foo(c_object *o) {     // why this:     reinterpret_cast&lt;cpp_object *&gt;(o)-&gt;foo();     // instead of just:     static_cast&lt;cpp_object *&gt;(o)-&gt;foo(); } /* end: c api */   Generally I use reinterpret_cast in rare situations, mostly related to forced bit coersion of buffer contents to a type of know layout and size, known to lie inside buffer contents.  So I ask whether that practice makes sense or sticking to static_cast would be a better one.
Both static_cast and reinterpret_cast seem to work fine for casting void* to another pointer type. Is there a good reason to favor one over the other?
On what site can I ask questions related to copyright? I want to make a summary of a book and use it to earn money. However, I don't know whether it's legal or not.  Which Stack Exchange site can I ask this question on? Determinant of circulant matrix Find the determinant of the following matrix in the terms of $a_1,a_2,\cdots,a_n$ explicitly, $$ \begin{bmatrix} a_1 &amp; a_2 &amp; a_3 &amp; \cdots &amp; a_n\\ a_2 &amp; a_3 &amp; a_4 &amp; \cdots &amp; a_1\\ a_3 &amp; a_4 &amp; a_5 &amp; \cdots &amp; a_2\\ \vdots &amp; \vdots &amp; \vdots &amp; \ddots &amp; \vdots\\ a_n &amp; a_1 &amp; a_2 &amp; \cdots &amp; a_{n-1}\\ \end{bmatrix} $$ When the determinant is zero? Code for looping through all excel files in a specified folder, and pulling data from specific cells Let $a&gt;0$, show that for $x&gt;0$, $1&lt;f(x)&lt;2$, where $$f(x)=\frac{1}{\sqrt{1+x}}+\frac{1}{\sqrt{1+a}}+\sqrt{\frac{ax}{ax+8}}$$  I could take the derivative, find the maximum of the function and conclude. But that involves heady algebra and you have to solve a high degree polynomial. Is there an easier way simply using inequalities? Thanks, much appreciated Calculate the sum of the infinite series $\sum_{n=0}^{\infty} \frac{n}{4^n}$ A previous problem had us solving $\sum_{n=0}^{\infty} \frac{1}{4^n}$ which I calculated to be $\frac{4}{3}$ using a bit of mathematical manipulation.   Wonderful. Thank you for all the prompt responses.  Could anyone suggest an alternate technique that does not involve differentiation? How can I optimise a Minecraft-esque voxel world? I found Minecraft's marvelous large worlds extremely slow to navigate, even with a quad core and meaty graphics card.  I assume Minecraft's slowness comes from:   Java, as spatial partitioning and memory management are faster in native C++. Weak world partitioning.   I could be wrong on both assumptions. However, this got me thinking about the best way to manage large voxel worlds. As it is a true 3D world, where a block can exist in any part of the world, it is basically a big 3D array [x][y][z], where each block in the world has a type (i.e BlockType.Empty = 0, BlockType.Dirt = 1, etc.)  I assume that to make this sort of world perform well, you would need to:   Use a tree of some variety (//) to split all the cubes out; it seems like an oct/kd would be the better option, as you can just partition on a per cube level not a per triangle level. Use some algorithm to work out which blocks can currently be seen, as blocks closer to the user could obfuscate the blocks behind, making it pointless to render them. Keep the block object themselves lightweight, so it is quick to add and remove them from the trees.   I guess there is no right answer to this, but I would be interested to see peoples' opinions on the subject.  How would you improve performance in a large voxel-based world? Trajectory of a photon around a Schwarzschild black hole? Consider a photon coming from the infinity in a unbounded orbit to a Schwarzschild black hole (Schwarzschild radius $r_{s}$) (see  for illustration). Its impact parameter is $b$ and its distance of closest approach is $r_{0}$ with $$b^2=\frac{r_{0}^{3}}{r_{0}-r_{s}}$$.  Then its trajectory in polar coordinates is defined by :  $$\frac{d\varphi}{dr} = \frac{1}{r^2\sqrt{\frac{1}{b^2}-\left(1-\frac{r_s}{r}\right)\frac{1}{r^2}}}$$  Consequently : $$\varphi\left(r\right) = \int_{r_{0}}^{r} \frac{dp}{p^2\sqrt{\frac{1}{b^2}-\left(1-\frac{r_s}{p}\right)\frac{1}{p^2}}}$$  and one can compute the total deviation using :  $\Delta\varphi = 2\times\left(\lim_{r\to+\infty}\varphi\left(r\right)-\frac{\pi}{2}\right)$  But my question is : how can I plot/draw the trajectory using the integral expression of $\varphi\left(r\right)$ ?    Because if I compute : $$f\left(r\right) = 2\times\left(\int_{r_{0}}^{r} \frac{dp}{p^2\sqrt{\frac{1}{b^2}-\left(1-\frac{r_s}{p}\right)\frac{1}{p^2}}}-\frac{\pi}{2}\right)$$ I obtain $f\left(r_{0}\right) = -\pi$, and then $f$ increases up to zero, crosses zero, and tends to its positive value at infinity $\Delta\varphi$. It does not make sense for me and I do not understand how to compute the trajectory from that.    If I compute : $$g\left(r\right) = \int_{r_{0}}^{r} \frac{dp}{p^2\sqrt{\frac{1}{b^2}-\left(1-\frac{r_s}{p}\right)\frac{1}{p^2}}}$$ it starts from $0$, and increase up to $\frac{\pi}{2}+\frac{\Delta\varphi}{2}$.    I would like to compute the trajectory in the $\left(x, y\right)$ plane, so how to use the values of $f\left(r\right)$ or $g\left(r\right)$ to compute the function $y\left(x\right)$ ? I have this HW where I have to calculate the $74$th derivative of $f(x)=\ln(1+x)\arctan(x)$ at $x=0$. And it made me think, maybe I can say (about $\arctan(x)$ at $x=0$) that there is no limit for the second derivative, therefore, there are no derivatives of degree grater then $2$. Am I right? What counts as "observation" in Schrödinger's Cat, and why are superpositions possible? So if I understood correctly, Schrödinger's Cat is a thought experiment that puts a cat inside a box, and there's a mechanism that kills the cat with 50% probability based on a quantum process. The argument is that the cat now must be in a superposition of dead and alive.  This makes sense at first, but the state of the cat inside the box will affect the outside world in an observable way, right? For example if the cat dies, it might meow loudly which would be audible. If it didn't meow, it would produce a thud on the ground when it dies. And even if the ground was very solid, the redistribution of mass inside the box will affects its gravity field which means the whole universe theoretically immediately observe's the cat's death.  So extending this argument to all superpositions, the different states would cause different effects on the rest of the universe, usually a slight change in the gravity field is the minimum. This gravity perturbation would propagate throughout the universe, and even all the experimenters go to sleep with thick, thick earplugs, somebody or something in the universe is going to inadvertently observe the event and the superposition immediately collapses. Thus superpositions cannot exist beyond an extremely short amount of time.  What's wrong with my reasoning? Is the universe really "fine-tuned for life"? I understand what is meant when we say , but I've seen it claimed it's is fine tuned "for life". Is it?  When I look at known or even speculated life in our universe, I see life clinging to a tiny crumbs separated by vast voids. Our life needs baryonic matter, only 5% of the universe. Its density is $10^{-30}  g/cm^3$, but it clumps together leaving vast voids between the clumps. 99% is in stars and black holes and nebula utterly inhospitable to known life.  That leaves the parts "fine tuned for life" to be 0.05% of the universe. The planets, asteroids, and comets seem like just debris separated by  than the life-sustaining clumps preventing life from spreading.  Even that seems to be used very inefficiently. Life requires the energy of a star, but it's spewed out in all directions. We only receive a tiny fraction of it. Similarly, life requires heavier elements created in supernova, but these are also spewed out in all directions. And it took billions of years to develop a being capable of asking "is the universe fine tuned for life?"  It seems like we live on the crumbs of creation warmed by a rounding error of the heat from our star. Taking this view, the universe appears extremely inhospitable to life. It could be a lot better tuned.  Is it that the universe is fine-tuned for life? Or is it that the universe is so large and life requires such an infinitesimal fraction of the universe that it's a near guarantee were we to roll the dice again that some crumb, maybe not even baryonic matter, could develop something complex enough to ask "why is the universe fine tuned for life"? Am I just restating the weak anthropic principle?  I understand this is straying into philosophy. If that's off topic, are my  physical assumptions correct? Do small title edits constitute trivial edits? Being a fairly new user something I don't seem to be able to locate is information on whether small edits to the title are considered as trivial edits. I see the usual recommendation when suggesting an edit is:     Avoid trivial, tiny one-letter edits unless absolutely necessary.   I can see the logic in that for most cases, but for example I just read a question with a title containing "Andriod" which would be trivial in one way but also affect the ability of users to locate the question using both the site and external search engines. Would it be frowned upon to suggest an edit for those cases? How to mount read-write an ext4 partition on Windows? Neatest proof that set of finite subsets is countable? How do I remap the keys on my keyboard? I broke my laptop and had to buy a new one with a new keyboard that I am struggling to get familiar with, especially with the keys like home, page-up, page-down and end, which aren't standardized at all.  I found myself doing this for like the 5th time in the last several years, and I think it is really annoying.   Is there an app that can reliably map one key to another?  By reliably I mean that key mapping works with Shift, Alt, and other modifiers.  UPDATE  Windows 7, Samsung Chronos 7 US citizens travelling to Cuba are restricted to a set of "reasons" for travel, of which tourism is not one. I have US-Philippines dual citizenship, and both passports. Would I just buy the ticket using my Filipino passport? What kind of documentation/proof would I need to return back to the US? And as a US citizen travelling with a foreign passport, where would I go for US customs?  Thanks. Prove that two distinct numbers of the form $a^{2^{n}} + 1$ and $a^{2^{m}} + 1$ are relatively prime if $a$ is even and have $\gcd=2$ if $a$ is odd.   My attempt: If $a$ is even, let $a = 2^{s}k$ for some integers $k, s$ Then, $$a^{2^{n}} + 1 = 2^{2^{n}s}\cdot k^{2^n} + 1$$ and $$a^{2^{m}}  + 1 = 2^{2^{m}s}\cdot k^{2^m} + 1$$ To prove that they're relatively prime, we need to show that their gcd = 1. And I was stuck here, how could I prove that gcd of two numbers is $1$?     A hint would be sufficient. Thanks. The probability of two dice summing to k is simple enough, make a diagram of the throws,  $$ \begin{array}{c}  &amp;|&amp;1&amp;2&amp;3&amp;4&amp;5&amp;6\\\hline 1&amp;|&amp;2&amp;3&amp;4&amp;5&amp;6&amp;7\\ 2&amp;|&amp;3&amp;4&amp;5&amp;6&amp;7&amp;8\\ 3&amp;|&amp;4&amp;5&amp;6&amp;7&amp;8&amp;9\\ 4&amp;|&amp;5&amp;6&amp;7&amp;8&amp;9&amp;\color{green}{10}\\ 5&amp;|&amp;6&amp;7&amp;8&amp;9&amp;\color{green}{10}&amp;11\\ 6&amp;|&amp;7&amp;8&amp;9&amp;\color{green}{10}&amp;11&amp;12\\ \end{array} $$  and the probability of a sum is just the length of the corresponding diagonal divided by $36$. For instance, $\mathrm{P}(\mathrm{sum} = 10) = \frac{3}{36} = \frac{1}{12}$. However, it's not as easy to draw a diagram for three dice or more, so how would a general formula look? My USB drive used to be originally 8GB when I bought it.  I'm trying to reformatted in Windows 7 by right clicking on the drive and selecting Format.... But the capacity only shows 250MB.  Is there something I can do to get the original size back? Maybe it got partitioned in a weird way?   The  flash drive is a SanDisk Cruzer Micro 8GB. I got it from Wal-Mart but this is the same drive. What type of differential equation is $f'(x) = f(x/2)$ and how do you solve it? I have the following different equation $$f'(x) = f(x/2)$$ with $f(0)=10$. What type of DE is this, and how would you solve it? It seems $f(x)$ is likely to be some relative of $e^x$, since $f'(x) = f(x)$, which is close, but I don't even know what that type of DE is called with that $f(x/2)$ feature, so I'm not having any luck searching for a tutorial. The best candidate I've found was a &quot;delay differential equation&quot;, but that seems more suited to $f(x-3)$ than $f(x/2)$. OneDrive isn't uploading all my photos from my phone I've got an Office 365 (Microsoft 365) Family license. I've set up OneDrive on my Samsung Galaxy S10 phone. I've verified that it is set up by following the . I've got it set up to upload photos using either Wi-Fi or mobile. And I see photos I've taken with my phone, uploaded to OneDrive from as recently as a few days ago. So, it works. But not all the time or for all my photos. I've scrolled through my photos on my phone's Gallery app. I see some photos from as recently as 4 days ago to several months ago, are not uploaded to OneDrive. Why is that?