HNHacker News
TopNewBestAskShowJobs

dsfuoi

91 karma · joined April 14, 2016

submissionscomments
dsfuoi··on A bit of background on compilers exploiting signed overflow
programmers use int to index over arrays in for loops without writing asserts. That is in fact a problem with the language.

Ok let me get this clear, you're saying that the language is at fault because the programmers don't write correct code. I have no words.

dsfuoi··on A bit of background on compilers exploiting signed overflow
If the loops can be written and the programmers don't write them, the problem is with the language!?

No, it's pretty clear where the problem is with C, programmers.

dsfuoi··on A bit of background on compilers exploiting signed overflow
It looks easy but it isn't.

The second example causes unexpected behavior (and probably ub later) if: min + step > MIN_TYPE_MAX

The last example causes undefined behavior if: max - min < step - 1.

dsfuoi··on A bit of background on compilers exploiting signed overflow
It's just one line. Put this before the loop if the code logically shouldn't trigger this.

  assert( B < B_TYPE_MAX - 4 );
Or use an if statement if it could trigger at runtime.

Also the code is clearer on intent.

dsfuoi··on Facebook sued for storing biometric data mined from photographs
In terms of sociologic development the middle-eastern countries are considered backwards with their stone-age laws, ingrained religion, and treating women like lesser beings, and yet we may soon be wearing 'burka' like clothing to protects our identity. Of course apart from the physical look, there is no connection between the two.
dsfuoi··on Facebook sued for storing biometric data mined from photographs
For the scramble suit to work, publicly available 'mixing' stations would have to be available, which would work like a black box, you could only surveil input and output.

And exits from your house would have to somehow be connected to those stations, or have your house change locations randomly.

The latter could work if houses were mostly in form of larger modular worldwide-compatible shipping containers. Also no windows, we would have VR.

dsfuoi··on Facebook sued for storing biometric data mined from photographs
Maybe we are the primitive ones.
dsfuoi··on Inside the Gigafactory That Will Decide Tesla’s Fate
Correct me if I'm wrong, but in this scale model, I think the part of the building marked with a black rectangle (upper left) is what is currently being built.

https://www.bloomberg.com/features/2016-inside-tesla-gigafac...

dsfuoi··on Chernobyl Hints Radiation May Be Less Dangerous than Thought
It certainly could be, but I think most mistakes are made because of how the process is 'designed'; sometimes an incorrect molecule jiggles (literaly) into a place where it is improbable that it should.
dsfuoi··on SpaceX lands rocket at sea second time after satellite launch
So only about 4Gs? I somehow though it would be more and unsurvivable for humans.
dsfuoi··on Chernobyl Hints Radiation May Be Less Dangerous than Thought
I would say that ionizing radiation isn't the cause of most genetic mutations. It is just too rare and most of it doesn't penetrate the skin anyway, the rest has to be really lucky to hit the cell in the right place at the right time.

DNA copying not being perfect would be the main cause in my opinion.

There is one error on average for every billion pairs copied. The human DNA has 3 billion pairs. So every time a single(!) cell is copied, three mistakes are made.

You don't need any radiation for evolution.

dsfuoi··on Bitcoin 'creator' backs out of Satoshi coin move 'proof'
I still haven't seen anyone write what those fraudulent acts are exactly. Since Craig Wright (let's not call him what he isn't) apparently has several companies, these should be some clue about that?
dsfuoi··on Bitcoin 'creator' backs out of Satoshi coin move 'proof'
It feels like a rage quit. Completely frustrated when you simply cannot win, there is only one option remaining. Anger and self-pity.
dsfuoi··on Bitcoin 'creator' backs out of Satoshi coin move 'proof'
You don't know if he is a sad, broken man.

There is no evidence to believe the post reflects upon his real emotions, and since the man is untrustworthy[0], the post cannot be taken as evidence about his emotional state.

[0]:Whether he is willfully or maliciously deceptive is irrelevant. Even if he has the best of intentions, his behavior is still untrustworthy.

dsfuoi··on SpaceX announces a mission to land on Mars by 2018
Replay at 16x speed if you're busy: https://youtu.be/89AIsPTCJLs?t=10m35s
dsfuoi··on SpaceX announces a mission to land on Mars by 2018
That is a promo.

Here is an actual simulation: https://www.youtube.com/watch?v=89AIsPTCJLs

dsfuoi··on Introducing docs.microsoft.com
So, will I have to login into something to read the docs now?
dsfuoi··on Putting the Tesla HEPA Filter and Bioweapon Defense Mode to the Test
Running an ICE car in a garage will harm you (and kill you pretty quickly), running an electric car will heal you.

It sounds cheesy but it true.

dsfuoi··on Status of F-35 – Senate Armed Services Committee Statement [pdf]
Choose carefully, one of those deploys the ejection seat.
dsfuoi··on To become a good C programmer (2011)
I agree. The problem is that those single character names get abused and you end up with code that consists only of them, including the function arguments, which is the worst.
dsfuoi··on To become a good C programmer (2011)
The 'style' even leaked out to file naming: a.c, ab.c, af.c, am.c, c.c, ca.c, cc.c, cd.c, cf.c, ...

Brilliant!

I doubt that this is either serious (unobfuscated) or handwritten code though.

dsfuoi··on To become a good C programmer (2011)
I agree, and I have calculated this a while ago this based on average number of lines a programmer writes in 8 hours. I don't have the actual numbers but unless you type slower than ~30 words per minute, speed it isn't a bottleneck.

I have been using index instead of i in while loops lately. It's surprisingly concise.

dsfuoi··on To become a good C programmer (2011)
Why are you learning it?
dsfuoi··on To become a good C programmer (2011)
Fabien is hinting at the confusion: sizeof(&array[0]) != sizeof(array)

&array[0] and array decay to the same thing, the pointer to the first element if they are used in an expression. But sizeof gives a different result, because array+0 'decays' to a pointer, and array doesn't.

dsfuoi··on To become a good C programmer (2011)
I think the style should be avoided; code shouldn't be compact and variable names should be descriptive.

Artificial example:

    for( int i = 0 ; i < c+j ; i += b )
should be:

    for( int count = 0 ; count < sum+extra ; count += skip )
It may be allowed to use i in place of count here, but this is the only place where single name variables should be permitted and only if i is really just a simple array index iterator.
dsfuoi··on To become a good C programmer (2011)
This is the first time I have seen sizeof used like this:

  sizeof( &array[0] )
This looks equal to:

  sizeof( array )
at first glance, which would give the size of the entire array in bytes, but of course the &array[0] expression is really:

  &*( array + 0 )
which simplifies to:

  array + 0 
which is a pointer. And using sizeof on it gives the size of a pointer to int.

Edit: (&* array) will also give a pointer.

---

This is just a really convoluted way to write 2:

   &array[2] - &array[0]

   &*(array+2) - &*(array+0)

   (array+2) - (array+0)

   2 - 0
Again I have never seen this written in such fashion.
dsfuoi··on 1984 v. Brave New World
Yay, renewal!
dsfuoi··on Lavabit code open sourced
The key was printed using a font that was too small to be readable by any means.
dsfuoi··on 1984 v. Brave New World
Some of the examples on the comic page starting with: Huxley feared we would become a trivial culture, preoccupied with some equivalent of the feelies..., are not chosen well.

I think the opposite of a trivial culture is a culture of self improvement, and at least four of those six examples are ostensibly doing something to improve themselves. One is a competitor in online gaming, one is debating online, the two are watching and debating current politics, one is improving his body. Those are all meaningful activities. I understand that they are not intended to be in the context of the comic, and the visual space is limited.

Great comic by the way. Our society seems to be going the way of pleasure, but I don't think it will ruin us.

dsfuoi··on Snowden’s Rubik’s Cube
Actor's forced Snowden deep voice is hilarious. He's trying so hard, and yet it sounds like a 12 year old trying to sound older.

Also expect at least two forced action/drama scenes that never happened.

They are staging the Hong Kong hotel meeting, of which real footage exists, as if it were an action scene.

Page 1 of 2Next →