• AN AMAZING CODER (unregistered) in reply to Mason Wheeler
    Mason Wheeler:
    CodeCow:
    Ok... so the guy was fired not because he was a shitty coder, but because he smoked weed?

    Considering he's not a pilot or something like that, that seems pretty fucked up

    Not at all. Consider that programmers are knowledge workers. If I hired someone for their brains, I'd throw them out for using mind-altering substances too! If you owned a sports team, wouldn't you fire an athlete for deliberately screwing up his body?

    Where do you get your information, movies? Sure, it's true the marijuana has a chemical effect on the brain that can affect it's ability over time, but most marijuana users aren't the surfer dude pot heads you see in the movies. There are tons of functioning professionals that occasionally smoke pot. Would these people possibly be a little more effective if they didn't? Perhaps. But that doesn't mean that Developer A who smokes pot occasionally is automatically less capable than Developer B who never smokes. You're doing your business absolutely no good by firing someone based on anything other than their ability to achieve your companies goals effectively.

    As far as athletes go, Not many athletes get fired for drinking socially, chewing tobacco, or eating mcdonalds.

    I'd suggest you stay out of management for a while.

  • AN AMAZING CODER (unregistered) in reply to TheEgg
    TheEgg:
    Even if a collision is unlikely, never say never.

    Often collision doesn't matter (password hashes) or you can detect it and bucket it (instead of hash.file create dir hash, more hash.file to hash/1.file, put new file as hash/2.file).

    Where you really want to avoid it is where you determine that improbability aside, if it does occur, you are screwed or have big problems. Either way, improbable is not as good as impossible.

    Other solutions can be arrived at for this problem aside from hashes. Still, a hash would have probably been better than what's here.

    I'm sure someone already addressed this, but no.

    TL:DR; SHA256 hashing on data with enough entropy is good enough for anyone.

    First, making collisions impossible is.... impossible. The goal is in fact to minimize the probability at an acceptable cost. The cost of lowering probabilities is usually logarithmic on the same data. But, you can lower probabilities if you introduce more entropy (using file data instead of file name).

    The acceptable collision probability depends on the damage that can be done by a collision, but for most applications the most basic hashing algorithms (SHA, MD5) are good enough as long as there's enough ENTROPY.

    In the example above, an md5 hash on a filename has a higher probability for collision because file names don't have much entropy. In fact, hashing the filename itself is pointless unless your goal is just to hide it (or store it in a predictable number of characters). A hash of the file contents would have very high entropy -- the collision probability now rests on the contents of two files data (which will be different) returning the same hash.

    By using SHA, assuming that every file has different data (and that overwriting a file with the same data is acceptable), The probability of a collision is lower than the probability that no one would be alive to care about a collision:

    http://stackoverflow.com/questions/4014090/is-it-safe-to-ignore-the-possibility-of-sha-collisions-in-practice

  • Asimoff (unregistered) in reply to Tea

    You're the only one with any sense here.

  • (cs) in reply to AllGeneralizationsAreBad
    AllGeneralizationsAreBad:
    CodeCow:
    Ok... so the guy was fired not because he was a shitty coder, but because he smoked weed?

    Considering he's not a pilot or something like that, that seems pretty fucked up

    It mentions he had rolling papers in his desk. Circumstantial evidence, yes, but come on, why would you have the paraphernalia at work? So you could roll one when you get to the car where you have the actual weed? That guy's a disaster waiting to happen. Maybe he signed a drug-free workplace agreement, or more likely this was in a right-to-work state.

    Captcha: esse esse marlboro officer, I swear man. I love you man.

    I used to have rolling papers at work myself, although I usually had them in my pocket, along with my rolling tobacco. But then we're talking about the UK where only really stupid losers smoke tailor-mades; most people here with an ounce of sense (i.e. the ones who understand it's a bad habit and accept that now is not the time to fight it) roll their own straights. It's about 10x cheaper for a start, and you can roll them as small as you want.

    The real WTF is assuming that anyone with rolling papers smokes cannabis. It's a bit like finding a tyre iron in someone's trunk and arresting them for assault and battery because tyre irons are so often used for hitting people on the head with.

  • (cs) in reply to Zemm
    Zemm:
    Matt Westwood:
    ... no, the real WTF is cannabis a) being illegal, and b) being called marijuana, which is as insulting as calling alcoholic beverages "piss".

    I thought calling cannabis marijuana would be like calling beer cerveza?

    No, "marijuana" is not Spanish for cannabis, it's Spanish for "maryjane", which is the term used for users in the early C20 because it (supposedly) turned them into faggots. As I say, a despicably fucking insulting term which should be on a par with the notorious n word.

  • berd (unregistered)

    I've worked with a few terrible "developers", even if they were only graduates.... but are there any as blatantly as bad as Larry? Makes we want to give up tech support (not hard) and be a dev again, for humanity. captcha: dolor. N. Singular of 'Dolores'

  • urza9814 (unregistered) in reply to Mason Wheeler
    Mason Wheeler:
    CodeCow:
    Ok... so the guy was fired not because he was a shitty coder, but because he smoked weed?

    Considering he's not a pilot or something like that, that seems pretty fucked up

    Not at all. Consider that programmers are knowledge workers. If I hired someone for their brains, I'd throw them out for using mind-altering substances too! If you owned a sports team, wouldn't you fire an athlete for deliberately screwing up his body?

    That implies that the drugs are impairing his performance -- in which case, you're firing him for being a shitty coder. If the drugs AREN'T impairing his performance, why the hell do you care?

    And no, it's not the same as sports. For an athlete, if he's taking drugs and gets caught he could be stripped of medals/winnings and/or unable to compete. If a coder gets caught smoking weed, the cops aren't going to come force the company to delete all the code he's written. Granted, you could argue they lose training costs if he ends up in jail, but the guy already works there so firing him now just makes them get EVEN LESS benefit from those training costs.

  • Edmund (unregistered) in reply to Mike

    Of course, but you can add the system's username to the filename. Collisions are always possible of course but a simple check whether the old and new users are the same will prevent files being overwritten by someone else.

  • Luis Deleon (unregistered)

    which who knows why may also have collisions xD

  • Whatever (unregistered) in reply to Ken B
    Ken B:
    SHA:
    Tankster:
    ZoomST:
    Tankster:
    Better titles for this article:
    • Pass the Hash
    • Hash Table Collision
    • Smokin' Hash
    • 420 Error

    'Re-Inventing the Alphabet'? ... c'mon guys!

    As pointed by Davor at 407007, you missed TRWTF: the alphabet is incomplete.

    • Joint WTF?
    Come on, "Rolling your own Hash" would still have been good.
    You can't roll you own hash without the letter 'h'.

    Sure you can, but it smells like "as".

  • Whatever (unregistered) in reply to DaveK
    DaveK:
    foo:
    bjolling:
    jay:
    If someone tells me that the answer to an arithmetic problem is 37, it's impossible to say whether that answer is right or wrong without KNOWING WHAT THE QUESTION WAS!
    It's wrong since the correct answer is 42
    But what is the question? This is the question!
    This? No, we've tried it, didn't work. "This? 42". See?

    I read it more like: "But what is the question?" is the question.

  • Derekwaisy (unregistered)
    Comment held for moderation.
  • Jimmyanten (unregistered)
    Comment held for moderation.

Leave a comment on “Re-Inventing the Alphabet”

Log In or post as a guest

Replying to comment #:

« Return to Article