• Sparkle (unregistered)

    I don't get it. I'm guessing his code could have been a lot simpler or something along those lines. No idea why Shortcut Guy had to calm down. What's to get stressed about?

  • Jay (unregistered) in reply to Warren
    Warren:
    I can shortcut the entire comments thread:

    brainless first-posts people who haven't got the joke or feel sorry for the wtf-creator people calling shenanigans people who insist upon slightly different solutions people who argue about the slightly different solutions people who say it would all be easier in another language / OS / etc.

    You forgot: People who declare that something is boring or pointless because it can be fit into some broad category. Like, "That programming technique isn't all that clever. It's just some parsing and a search." Or, "Why do people say Casablanca was such a great movie? It's just a story about a couple of people who fall in love during a war." Or, "Einstein wasn't all that smart. He's just some guy who made up a couple of equations."

  • Jay (unregistered) in reply to DrewE (no relation to Drew)
    DrewE (no relation to Drew):
    Drew:
    Couldn't you just instanciate an array with the rs.size() and put them in without having to deal with a list?

    String[] toBeReturned = new String[rs.size()]; for (int i = 0; rs.next(); i++) { toBeReturned[i] = rs.getString("email"); }

    That would work if ResultSet had a size() method. Alas, it doesn't (assuming this is Java, as it appears to be), presumably because there's no guarantee that the underlying database has determined how many results there are before it can start providing some to you.

    Great solutions always get shot down by some spoil-sport who points out that your made-up function doesn't actually exist.

    Oh, how many times I've said, Why don't we just call the "System.figureOutWhatUserReallyWanted()" function?

  • Anonymous (unregistered) in reply to Bob, A Father
    Bob:
    Anonymous:
    The comments are generally pretty retarded at the best of times but I love the way that they devolve into utter banality if a new article doesn't get posted on time. Everyone has completely run out of legitimate comments and just troll the trolls who are invariable trolling trolls or being trolled by trolls. I'm pretty sure this is somehow a metaphor for life in general.
    I'm going to re-iterate my request that you stop using that distasteful word. It brings up struggles and responsibilities that you can not even imagine.
    And I'm going to reiterate my utter indifference towards your incongruous opinion that certain words are inherently harmful or malicious. I don't care what it means to you Bob, because the world doesn't revolve around you. Besides, it's not exactly fair to single me out considering the following comment is one of the first that was made on this very article:
    trwtf:
    Wow, that's almost as retarded as Bob's son. If he can't even figure that much out, how the hell does he turn on his computer in the morning?
    Didn't you spot that? You're clearly getting a reputation round here which is bad news for you because it's 95% trolls. But I'm not the one who is attacking you personally, I consider it to be both unneccesary and distasteful, so why don't you direct your ire in a more deserving direction?
  • (cs) in reply to Maurits
    Maurits:
    hoodaticus:
    The count methods on recordset classes are only accurate once the entire set has been iterated.

    Depends on the cursor you choose. Firehose cursors, agreed. But there are other options.

    And I learned something. Thanks.

  • (cs) in reply to BentFranklin
    BentFranklin:
    Everybody who said split() is wrong. The data is already in memory, so why copy it to a string and then parse that? Just use it already. That's why this story is wtf-worthy, not because the guy couldn't split().
    LIKE!
  • (cs) in reply to frits
    frits:
    Ken B.:
    My name is Harry Potter. You killed my father. Prepare to die.
    Same story, no "flavor".

    I see a lot of Harry Potter references on this site. Forgive my naiveté, but do adults actually like that stuff?

    I'm guessing - hoping really - that they are parents.
  • Ken B. (unregistered) in reply to Toc the elder
    Toc the elder:
    Ken B.:
    Please split this into two e-mail addresses:
    [email protected]@example.com
    Could still be done pretty easily the super wrong way...
    And how "easy" is it to determine which of the 4 valid interpretations is the one that's correct?

    Does Frank Oo live in the Georgia, India, or Columbia, or is it "just a .com" address?

  • Ken B. (unregistered) in reply to hoodaticus
    hoodaticus:
    frits:
    Ken B.:
    My name is Harry Potter. You killed my father. Prepare to die.
    Same story, no "flavor".
    I see a lot of Harry Potter references on this site. Forgive my naiveté, but do adults actually like that stuff?
    I'm guessing - hoping really - that they are parents.
    Would you rather we let the kids watch SpongeBob?
  • Ken B. (unregistered) in reply to boog
    boog:
    Ken B.:
    My name is Harry Potter. You killed my father. Prepare to die.
    Same story, no "flavor".
    Hell, the original quote has more flavor. Something about the name "Inigo Montoya" just makes it more fun to say.
    More flavor than my version? Inconceivable!
  • Ken B. (unregistered) in reply to dkf
    dkf:
    Toc the elder:
    Ken B.:
    Please split this into two e-mail addresses:
    [email protected]@example.com
    Could still be done pretty easily the super wrong way... try splitting this!
    [email protected]@net.example.com
    and yes, that first one could be a valid IBM Canada employee... named "foo". Probably first name starts with an 'F' and a last name of "oo".
    You wait until you get a list with mixed “.com” and “.co” (Colombia!) addresses. It's totally ambiguous when the following address starts with an “m”. Or “.info” and “.in”. Plus mailbox names can contain periods. “Guess the address” is a difficult game to play.
    Yup. But you forgot the possible Georgia (.ge) domain in my example.
  • (cs) in reply to Nagesh
    Nagesh:
    C-Octothorpe:
    Matt Westwood:
    Boris Vladamir:
    Nagesh:
    What would you know of best vodka, drinker of horse-piss?
    Saying "best vodka" is like saying "best cut of beef." Sometime you want T-bone, sometime you want burger, sometime you want filet minon, sometime you want rump roast.

    My mouth watering now. Time to go out and murder cow.

    Had some of that the other day. Tasted like a cow's arse.

    What, the horses piss or the beef that bogus boris is speaking of killing?

    I doubt bogus boris has killed anything bigger than a fly or moskito. BTW, do you have moskitoes in North America?

    Yes, the State of Florida is actually one giant mosquito.

  • Ken B. (unregistered) in reply to R2D2
    R2D2:
    boog:
    Ken B.:
    My name is Harry Potter. You killed my father. Prepare to die.
    Same story, no "flavor".
    Hell, the original quote has more flavor. Something about the name "Inigo Montoya" just makes it more fun to say.
    Given how long ago the first Harry Pothead books were written, I think it's quite likely that many of the fans have now grown up. I guess it's like all the people before them who never grew out of "Star Wars".
    And what's wrong with liking both? I do. My kids do.

    That doesn't mean you'll catch me wearing costumes, however. (Well, except for the occasional T-shirt with the Gryffindor or Slytherin crest on it, that is. We made them for us and the kids for one of those midnight new-release parties.)

  • Steve (unregistered) in reply to Bob, A Father
    Bob:
    Anonymous:
    The comments are generally pretty retarded at the best of times but I love the way that they devolve into utter banality if a new article doesn't get posted on time. Everyone has completely run out of legitimate comments and just troll the trolls who are invariable trolling trolls or being trolled by trolls. I'm pretty sure this is somehow a metaphor for life in general.
    I'm going to re-iterate my request that you stop using that distasteful word. It brings up struggles and responsibilities that you can not even imagine.
    Wow, you clearly harbor a lot of resentment towards your disabled son. It's like you're not even trying to hide it. Honestly Bob, you need to do some serious soul-searching; your highly telling words suggest problems with your family that go far beyond a few off-hand remarks on an anonymous Internet forum.
  • Vacaloca (unregistered) in reply to The Nerve
    The Nerve:
    Personally, I don't like to do the list/array conversion because it's phenomenally slow in Java. It also creates a TON of extra references, which the garbage collector chokes on if you're doing any sort of time-sensitive operation. Here's what I would do instead:
    PreparedStatement ps  = connection.prepareStatement("SELECT * FROM email_contact");
    ResultSet rs = ps.executeQuery();
    String[] array = new String[0];
    if (rs.next()) {
         String email = rs.getString("email");
         tmpArray = new String[array.length + 1];
         for (int i = 0; i < array.length; i++) {
              tmpArray[i] = array[i];
         }
         array = tmpArray;
    }
    

    Congrats, you can dynamic length arrays better than Java Developers. Here's a cookie. Be sure to let the JDK devs know that Collections and ArrayLists were totally a worthless idea.

  • C-Octothorpe (unregistered) in reply to Vacaloca
    Vacaloca:
    The Nerve:
    Personally, I don't like to do the list/array conversion because it's phenomenally slow in Java. It also creates a TON of extra references, which the garbage collector chokes on if you're doing any sort of time-sensitive operation. Here's what I would do instead:
    PreparedStatement ps  = connection.prepareStatement("SELECT * FROM email_contact");
    ResultSet rs = ps.executeQuery();
    String[] array = new String[0];
    if (rs.next()) {
         String email = rs.getString("email");
         tmpArray = new String[array.length + 1];
         for (int i = 0; i < array.length; i++) {
              tmpArray[i] = array[i];
         }
         array = tmpArray;
    }
    

    Congrats, you can dynamic length arrays better than Java Developers. Here's a cookie. Be sure to let the JDK devs know that Collections and ArrayLists were totally a worthless idea.

    Me thinks you've been trolled... I hope...

  • John Want (unregistered) in reply to itsmo
    itsmo:
    Anonymous Coder:
    <QUOTE> If mroot expects jnr to do his work for him, he should be happy to surrender some of his salary (especially given jnr is presumably getting his own work done on top of these stupid requests). If you're too shit to do your own job, don't expect someone else to be happy about picking up the pieces. </QUOTE>

    Could have been worse.

    Imagine boss tells you to help with nitwit-expert's project. Nitwit gets argumentative about it. Discussion about why 2 plus 2 is 4 ensue. Lots of wasted time over it. Boss asks you to write some code to help this project. Which you do, test it, and including instructions (integration, use) hand it over to nitwit. About a days work for you, so far. Nitwit has no time. A week later he still has no time. Agues, he has no time to test it. (My thoughts at this point: "Do you suggest I hand over untested, non-functional code? Maybe that is what you would have done." - The code had been tested in a replica of nitwit's environment.) No matter, he still does not do anything with it. On the side, you overhear nitwit to talk to another colleague about implementing what you already did. Collegue seems to understand the issues at hand very well, nitwit apparently not. Now 3 weeks have passed since handover. Boss remembers the contribution you where asked to be doing 3 weeks ago. And he wants to see results. Next: you task switch, your memory has faded, E-mails have been lost, digging out some information is required, accusations fly, another day wasted. Weeks later colleague number 3 comes to you, asking for support about said code. (He now manages said nitwit, as boss has given up on him.) Doesn't help collegue #3 arrives during a crisis and want's support right now. At that point you wish, you had never ever helped anybody!

    wants . No aprostrophe. Not ever.

    This is John Want's comment.

  • (cs) in reply to hoodaticus
    hoodaticus:
    Nagesh:
    C-Octothorpe:
    Matt Westwood:
    Boris Vladamir:
    Nagesh:
    What would you know of best vodka, drinker of horse-piss?
    Saying "best vodka" is like saying "best cut of beef." Sometime you want T-bone, sometime you want burger, sometime you want filet minon, sometime you want rump roast.

    My mouth watering now. Time to go out and murder cow.

    Had some of that the other day. Tasted like a cow's arse.

    What, the horses piss or the beef that bogus boris is speaking of killing?

    I doubt bogus boris has killed anything bigger than a fly or moskito. BTW, do you have moskitoes in North America?

    Yes, the State of Florida is actually one giant mosquito.

    Actually, have you noticed, the map of the State of Florida looks like an immediately-post-orgasm penis, complete with strings and globules of semen dripping out of its end.

  • Anonymous Coder (unregistered) in reply to itsmo

    want's : stands for "wants his"

    <ducks>

    Must have been my keyboard been infected by that new virus. You know, the one that causes all these discussions about "your" and "you're".

    Good we could talk about this anyhow's. :p

  • Nickster (unregistered) in reply to Sparkle
    No idea why Shortcut Guy had to calm down. What's to get stressed about?

    It doesn't bother you when people waste your time, asking you how to fix a problem they're creating themselves?

  • Adabas (unregistered) in reply to EmperorOfCanada

    I didn't know adabas was still really in use. :)

  • Scott (unregistered) in reply to Derp

    we're sorry you were picked on, MRoot.

  • confused (unregistered)

    Maybe I am missing something here, but why is everyone trying to split the string?

    Doesn't the database query give back an array which the user is looping through?! Can't he just "push" the value into a new array? Why is everyone bothering to explain split here?

    Confused

  • Jeremy Foster (unregistered) in reply to Drew

    Perfect! You > J Balic > mroot == dirt

Leave a comment on “The Shortcut Guy”

Log In or post as a guest

Replying to comment #:

« Return to Article