News for hackers. Stuff that matters.

SidiousL

Re:Cdecl – Turns English phrases into C declarations on Monday January 07, 2019 @02:23AM (#18843419)
The actual principle behind the C type declarations is "declaration follows use". Let me explain what this means. Take this declaration

   int *pi;
Means that when I dereference the variable pi, I get an int. This also explains why

   int *pi, i;
declares `pi` as a pointer to `int` and `i` as an `int`. From this point of view it makes sense stylistically to put * near the variable.

Declaration of array types is similar. For example,

   int arr[10];
means that when I take an element of `arr`, I obtain an `int`. Hence, `arr` is an array of ints.

Pointers to functions work the same way. For example,

   int (*f)(char, double);
means that if I dereference the variable `f` and I evaluate it on a `char` and on a `double`, then I get an `int`. Hence, the type of `f` is "pointer to function which takes as arguments a char and a double and returns an int".
Re:Breakdown: on Borwein integrals on Friday September 07, 2018 @02:01PM (#17936334)
You can compute this integral as follows. First, you remember that sinc(x) = sin(x)/x is the Fourier transform of 1/2 * indicator function of [-1, 1]. In general you have:

  sinc(x/n) = n/2 \int_{-1/n}^{1/n} d t e^{i t x}.
Next, notice that

  \int_0^\infty sinc(x) \dots sinc(x/n) = 1/2 \int_{-\infty}^\infty sinc(x) \dots sinc(x/n).

Next, replace the sinc functions by their Fourier representation, change the order of integration and use the formula

  \int_{-\infty}^\infty d x e^{i a x} = 2 pi \delta(a),
where \delta(a) is the Dirac delta. You are left with an integral of a delta function over a product of intervals. What remains to be done is just some tedious computation.

\int_{-1}^1 d t_0 \dots \int_{-1/(2 k + 1)}^{1/(2 k + 1)} d t_k 1/2 \dots (2 k + 1)/2 2 \pi \delta(t_1 + \dots + t_k).

Next, the question is whether t_1 + \dots + t_k = 0 has a solution for t's in the integration domain. This holds until k = 7. To see this, compute

1/3 + 1/5 = 8/15 < 1

1/3 + 1/5 + 1/7 = 71/105 < 1

1/3 + 1/5 + 1/7 + 1/9 = 248/315 < 1

1/3 + 1/5 + 1/7 + 1/9 + 1/11 = 3043/3465 <1

1/3 + 1/5 + 1/7 + 1/9 + 1/11 + 1/13 = 43024/45045 < 1

but

1/3 + 1/5 + 1/7 + 1/9 + 1/11 + 1/13 + 1/15 = 46027/45045 > 1.

Re:David Bohm, Quantum Mechanics and Enlightenment on Monday July 30, 2018 @04:16AM (#17642883)
I didn't read the article but, in case you don't know quantum mechanics, I should tell you that the vast majority of people who study such things think that Bohm's theory is plain wrong.

I should also say that it is not taught in schools, papers about it are not published in serious journals and the field is just not an active field of research. It's quite likely that all the people trying to develop this idea are crackpots.

Re:Modern C++ for C Programmers: part 5 on Wednesday July 25, 2018 @12:38PM (#17610583)
I tried to find an example that contradicts what you said, but I can't find any. Here's an online example which can be compiled as both C and C++ and I obtain exactly the same assembly using both clang and gcc. Maybe somebody can tweak this example to force the C compiler not to perform the optimization.

https://godbolt.org/g/7Ewun7

No, she most certainly did not discover the DNA. The DNA (which was not named like that) had been around since Friedrich Miescher's work in the 19th century.

Your statement is at least[#] as ignorant as saying that J.J. Thompson discovered electricity since he discovered the electron. Of course, the electricity had been discovered long before that.

[#] What I have in mind here is that even the statement that she discovered the molecular structure of the DNA is not strictly speaking accurate.

Re:C for All on Friday March 23, 2018 @06:03PM (#16662970)
I see they are adding an analog of the C++ iostreams, but I don't see a discussion of how to disambiguate between `sin' as in stream-in and `sin' as in the mathematical function.

Really, they should introduce some kind of modules or namespaces. Of course, C++ already has namespaces and will have modules sooner or later...

Re:Sex and STEM: Stubborn Facts and Stubborn Ideologies on Thursday February 15, 2018 @10:30AM (#16384781)
I don't know if you're going to see this, but I feel the need to defend myself. Sorry about going on a tangent here, but I have no other way of doing this.

Here's what happened. Somebody posted a link to a PhD thesis in mathematics which was not at all written in the style in which math PhD these are written. Somebody else commented that this is great all math PhD these should be written like that. Then, I pointed out that the author of this thesis (a black woman), wrote a piece on a blog of the American Mathematical Society website saying that all the white male in the math departments in the USA are the problem, she wants them out and they should all resign.

Then various people started down-voting and attacking me. I replied to their attacks and defended myself. This amounted to "ideological war" according to some moderator. Also, since I did not use this account for making lots of comments, it appeared to the moderator that this account was created to primarily to start flamewars. The people who attacked me in a very nasty and personal way did not suffer any consequences since they had more comments hence their accounts looked more legitimate.

So yes, I feel like I've been the victim of an injustice.

Re:Sex and STEM: Stubborn Facts and Stubborn Ideologies on Thursday February 15, 2018 @04:54AM (#16382883)
> the fact that many sexist anti-STEM cues are given to children at a much earlier stage, way before careers are even on the horizon

It doesn't look like you read the article. It clearly stated that in countries like Finland and Sweden, where such cues are less likely to be given, there is a larger inequality in STEM. Meanwhile, in Iran there are more women in STEM. Do you think that in Iran young girls are more or less likely to be subjected to "harmful gender stereotypes" than in Sweden or Finland?

> Cues can be as subtle as a wide-eyed look while reacting ...

This was precisely addressed in the article. It goes by the name of micro-aggression. Go back and read about it.

Re:Rumours swell over new kind of gravitational-wave sighting on Saturday August 26, 2017 @02:13PM (#15106612)
Your intuition is correct and the question of the speed of gravitational waves is pretty complicated. The usual treatment of gravitational waves is done by linearization of some non-linear equations. This is a very good approximation for the propagation of gravitational waves since they disturb the space-time only very slightly (for example, the mirrors in the interferometry experiment at LIGO get displaced by a tenth of a nucleus of a hydrogen atom, during the passage of a gravitational wave).

In this linear approximation the gravitational waves are governed by the same wave equation as for electromagnetism (only the spin part is different since the spins of the gravitons and photons are different). Since in the linear approximation we recover the Lorentz symmetry, then the linearized wave equation has to be Lorentz invariant. Then, one can apply results from the representation theory of the Lorentz or Poincare groups; there are two major types of representations: massless and massive. They differ in striking ways when it comes to spin and when it comes to propagation, for example massless particles travel at the speed of light. If you want to have a massive graviton then you need to get the mass somehow from your theory. Einstein's theory predicts a massless graviton, which by the argument above has to travel at the speed of light. We still don't know experimentally if the graviton is massless (but last time I looked at the Particle Data Book there was an upper bound on the mass which was very small).

Now, coming back to why your question is complicated. Remember that in Einstein's theory space-time itself is dynamical. Now suppose you follow the propagation of a gravitational wave. Since this takes some time, we need to take into account the fact that the shape of the space-time itself has changed in the meantime. In such dynamical situations it becomes complicated to even define what the speed of propagation between two points is. One way this becomes important is in cosmological situations. For example, the expansion of the universe stretches the distances and this allows us for example to see further that the distance you obtain multiplying the speed of light by the age of the universe. This being said, you can define the speed locally by studying propagation for very short distances and times and this will be a constant. However, you need to remember that the global situation is more complicated.

Re:Structure and Interpretation of Classical Mechanics on Wednesday August 23, 2017 @01:27PM (#15083369)
I read this book and it is very interesting. Another book with a similar title and a common co-author is the famous SICP (Structure and Interpretation of Computer Programs). This book on classical mechanics is unique from several points of view. For one, it writes the Euler equations of a variational problem in a rigorous way (the notation in classical mechanics books can be quite confusing at first). Second, the treatment of chaos is very thorough, complete with computer programs (in Scheme) to produce plots. Highly recommended!
Please, please, please, don't take MathML away from us. Even though we are few in number, we want to be able to put mathematics on the Web. I'm sad Chrome and IE chose not to implement support for MathML.
Re:Outraged about the Google diversity memo? on Thursday August 10, 2017 @04:02AM (#14977433)
It's funny how some companies now literally enforce a "don't ask don't tell" policy when it comes to some points of view. In the academia it is probably even worse than in the industry. Except this time, it's the left that is "promoting" hiding your true self.

You may say that for the army it was the government doing it, which makes it worse. In a sense I agree. However, in the case of private employers it touches on a more consequential right for us as a society: the right to free speech.

Maybe people should be more accepting of somebody's views on controversial topics as diversity, gun rights and abortion, as they are to gay people in the military.

Re:The Kolmogorov option on Wednesday August 09, 2017 @05:19AM (#14966853)
If you find a rational person willing to defend any of the points you made, then yes, it is wrong to be against that discussion.
Re:The Kolmogorov option on Wednesday August 09, 2017 @05:00AM (#14966743)
I think using "deeply buried in identity politics" is overstating facts. And I'm sure you can find many people in academia and otherwise who will clearly identify as Marxists and who advance the points of view that he was against.

If being against a certain current of thought makes you "deeply buried in identity politics", then count me in.

Re:How I implemented my own crypto on Thursday August 03, 2017 @04:51AM (#14917984)
I think it might be a bit more than that. As far as I can see, all the primitive data types in Rust have sizes which are multiples of eight. However, there are still architectures out there with 9 bit bytes, or 36-bit words. Maybe it's good that all the primitive data types have an explicit size (encoded in their name), but this comes at a cost (in case a byte is 9 bits long, one of the bits will effectively not be used). On the other hand, C and C++ are less explicit about the sizes of their data types so they can accommodate these more weird architectures more easily (and, if you need an explicit size, you can explicitly ask for it).
I haven't heard of any instance where the Duma disagreed with any of Putin's ideas. I don't think the Duma is providing any checks and balances to the power that Putin has.

    If white men aren't responsible, then who is?
Maybe she is responsible for her own failures. What a radical idea is that?

    Who hurt you, buddy?
Please, I'm not your buddy.

    you can still be taking up unwarranted space
According to whom? A deranged feminist blogger? Maybe her opinion does not matter for a reason.
What's the damage? The damage is that racism is evil irrespective of who the racist is (and yes, black people can be racist too, as any reputable dictionary should be able to prove to you). And every instance of it should be denounced, especially the more egregious ones like this one.

You can say, there's no problem, she doesn't have any power. I would counter that it's not true. These people have large followings and many apologists (like yourself). And even if it were true that she had no power, her hate should be confronted. People should learn the limits of good behavior in civilized society.

You say this is not about instilling guilt, because the author said so. I will put it to you that even if it was not her intention (and I'm not so sure about that), it might still end up happening (if you want to understand the kind of effect such accusations, even when only implied, can have on people, read [http://www.scottaaronson.com/blog/?p=2119]). When I read "you are the problem" it sure sounds like an accusation to me (and a pretty serious one at that). And this accusation is surely bigoted when you apply it indiscriminately to a whole class of people.

    No, because Jews aren't an overwhelming majority of people taking up space in universities.
I think you'll find that they are overrepresented. How did that come about? And to turn your question back at you: if jews are not responsible for their over-representation in academia, then who is?

How about this? Should all the black NBA players (which is most of them) should resign too and make room for white people? Clearly they are responsible for keeping all the white men out. I could go on forever.

    Going back to her thesis, it's really odd to me how emotional you get over this and can't separate the thesis from the blog post.
Sorry, I can not separate work from the author.

    Did you read the post?
Yes. Remember, I linked to it. And, as painful as it was, I did read the whole thing.

    White men, on the other hand, have the power to not hire her, to fire her, and so forth.
So the implication is that a majority of these white men in position of power are bigoted? I think an alternative explanation for her not getting hired is that maybe she didn't meet their standards. I understand that this is maybe a difficult conclusion to accept if you're a female supremacist with a fragile ego.

    Why are you mounting an all-out attack against her because you were reminded of her thesis?
I think the attack is well-deserved for reasons that should be obvious by now.
And by the way, this commentary that you quoted is by Adriana Salerno, not by the original author. This commentary appeared after the negative reaction to the blog post; the initial version of the blog post did not contain it.

I think by labeling it "opinion piece" the American Mathematical Society was distancing themselves from the content (as well they should).

I notice now that this commentary was also edited, but some of the more egregious statements remain quoted in the comments of the blog. In other words, even the commentary used to be worse.

I don't think I was cynical at all. I just took the most straightforward literal interpretation of what she wrote. And I think she really meant it since otherwise she would have apologized for any misunderstanding by now.

About he idea that the author's intention was to provoke thinking. What kind of thinking was it suppose to provoke? Push people to self-hate for who they are? Make the ones in the other camp sharpen their pitchforks and attack math departments until they comply with her lunacy?

On the idea that if you write something racist then you are not a racist. Yes you are. What she wrote was not comedy and it wasn't funny at all to me so she does not get the comedy pass.

In what way is my summary terrible? I stand by it and I have the facts to back it up. When somebody says:

> If you are a white cis man (meaning you identify as male and you were assigned male at birth) you almost certainly should resign from your position of power. That’s right, please quit.

No reasonable person can make such a blatantly unfair demand and then accuse me of uncharitable interpretation of their opinion. In fact, I find it horrifying that someboy so unhinged as this woman was allowed to lecture in a university.

Re:Calc C++ on Wednesday March 15, 2017 @06:16AM (#13875073)
This is not standard C++, is it?

    private: System::Windows::Forms::TextBox^ txtDisplay;
Should "^" be "*" instead?