• Ken B. (unregistered) in reply to Boris Vladamir
    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.

    http://www.cafepress.com/strk3/1992652

    [image]
  • C-Octothorpe (unregistered) in reply to hoodaticus
    hoodaticus:
    C-Octothorpe:
    Good god, please don't make that a meme...

    Do a bert glanstron, or a paula bean, but for the love of all that is good, don't let that be a meme on this site...

    It's so completely retarded, I felt I just had to make fun of it through repetition. But I agree - it sucks too much to continue repeating.

    I figured as much, but I just know that other people will see that and OMFG LOL ROTFL, that is soooooo kewl! That is so going to be my new handle!

    kthxbai

    ... I feel so, dirty...

    vomits uncontrollably for 15 minutes and has a shower

  • Ken B. (unregistered) in reply to Nagesh
    Nagesh:
    boog:
    mroot (10:03 AM): Got a problem for ya... mroot (10:03 AM): Any idea how I can parse a string of email addresses like this: [email protected]@[email protected]? mroot (10:04 AM): I need them separated in an array. I was thining of looking for .net, .com, etc. boog (10:05 AM): Sure, that might work. mroot (10:05 AM): Is there a web service to do that? boog (10:06 AM): There might be. See if you can find one, and let me know if you do. mroot (11:18 AM): Okay. What if there was a comma between the addresses? For example, [email protected],[email protected],[email protected]. mroot (11:19 AM): That should be easy to put in an array? boog (11:22 AM): Couldn't find a web service? Hmm... wait, where did those commas come from? mroot (11:24 AM): I just copy/pasted them from debug console. That's what my string has. boog (11:25 AM): Oh, I see, they make it easier to read. Good thinking! So if there's no web service already, you should write your own. It can start out by removing the commas, then search on .net, .com, etc.! Think you can pull it off? mroot (11:25 AM): Sure, no problem... boog: (11:25 AM): Excellent.

    On the plus side, he'd never ask for my help again.

    booger, That will never work. Mister Oot will simply ask you to write the webservice. <smiles>

    Here you go...

    s/,//g
    Now that the commas are removed, you can finish it up.
  • (cs) in reply to Phong
    Phong:
    Ken B.:
    tehR:
    Derp:
    It just dawned on me that the only things that make these "WTFs" is the level of impatience or frustration the "victim" gains in each story.

    Most of us can probably laugh and live with little derpy moments like this.

    Apparently, though, folks like jbanic need to "regain their cool" frist. Maybe the short fuse is the difference between a good job and a bad one.

    Agreed. From a technical perspective nothing in the supplied code was particularly WTFy. Story reduces to a guy who has existing code but wants it to do a bit more, yet doesn't know right off the bat (the horror!) how to get it done.

    Junior dbag, in his infinite wisdom, feels time spent helping a colleague learn something new is an absolute waste of his own life and so has to sign off of AIM in order to cool off and a void a heart attack.

    Classy.

    What you're forgetting is that this is not a "one off" thing. "jbanic" is dealing with stuff like this day in and day out. "mroot" already he knows he wants the list as an array. And, rather than simply putting things into the array, he decides to go the "let's mangle the list into one big mess, and then try to unmangle it later" route. And, of course, when asking for help, tells the person who can help him that all he has is the mangled set of things in a single string.

    Yeah, well, adding the fact that it's the end of his world is completely unnecessary and should be left out unless you want to add the entire context every time. It detracts from the actual story, especially when the story isn't noteworthy to begin with.

    It's called flavor. If you don't like the flavors in your meal, go to a different restaurant. Because this complaint has been made for years, and they are not changing the recipe.

  • (cs) in reply to random internet wanker
    random internet wanker:
    The person's job is programming. As in, understanding the basic structures of the language they are working with to make stuff that does other useful stuff and possibly occasionally solves problems, instead of introducing more.

    The fact that they are using a loop to create a string out of individual email addresses, and cannot figure out how to parse individual emails out of their newly-created string, qualifies as a major WTF regardless of the language in question or anyone's individual level of patience.

    Or do yu beleeve that an editer doesn't need to no grammer, speling, and vocabalery well, as qualifikations to doing there job and properly ern their paychek?

    Seriously. Your comment is the real WTF.

    +1

  • shane (unregistered) in reply to gallier2
    gallier2:
    The WTF is probably that he wants to split the string to find a specific one when he could have used an appropriate WHERE clause in his SQL request.

    +1 for being pure genius...

  • BentFranklin (unregistered)

    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().

  • OldPeter (unregistered)

    The approach of that mroot guy resembles to me very much the "wooden table" meme, you see, like

    • print email addresses to paper
    • place paper on wooden table
    • take photo of list
    • apply OCR
    • evaluate addresses

    Or some such...

  • Ken B. (unregistered) in reply to Colin
    Colin:
    Interestingly enough, Mozilla maintains a text file of TLDs here. There's even an atom feed of updates to it.
    Please split this into two e-mail addresses:
    [email protected]@example.com
  • Ken B. (unregistered) in reply to hoodaticus
    hoodaticus:
    Phong:
    Ken B.:
    What you're forgetting is that this is not a "one off" thing. "jbanic" is dealing with stuff like this day in and day out. "mroot" already he knows he wants the list as an array. And, rather than simply putting things into the array, he decides to go the "let's mangle the list into one big mess, and then try to unmangle it later" route. And, of course, when asking for help, tells the person who can help him that all he has is the mangled set of things in a single string.
    Yeah, well, adding the fact that it's the end of his world is completely unnecessary and should be left out unless you want to add the entire context every time. It detracts from the actual story, especially when the story isn't noteworthy to begin with.
    It's called flavor. If you don't like the flavors in your meal, go to a different restaurant. Because this complaint has been made for years, and they are not changing the recipe.
    It's been a while since I've looked, but there is a website with something like "retelling movie X in 30 seconds" videos.

    I came up with the following, after someone "complained" about all the "unnecessary" story lines in Harry Potter:

    My name is Harry Potter. You killed my father. Prepare to die.
    Same story, no "flavor".
  • (cs) in reply to Power Troll
    Power Troll:
    boog:
    <snip> mroot (11:25 AM): Sure, no problem... boog: (11:25 AM): Excellent.

    On the plus side, he'd never ask for my help again.

    You messed up your name in the last line of the instant message. The extra : ruined it.
    By the power of Greyskull you are right. I blame the original article, which was littered with these filthy characters.

  • (cs) in reply to C-Octothorpe
    C-Octothorpe:
    Honestly, who the hell notices something like that, and furthermore, who the hell pays such close attention to boogs comments!? :)
    Clearly I don't.
  • Stinky mc teats (unregistered)

    Why do people let N00bs do things?

    Kill the n00bs!

  • (cs) in reply to Ken B.
    Ken B.:
    s/,//g
    Now that the commas are removed, you can finish it up.
    Say, that's a pretty neat shortcut!
  • Toc the elder (unregistered) in reply to Ken B.
    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".

    Yep, good old "Frank Oo". Hasn't been the same since he got back from Afghanistan. Bastards shot off the rest of his last name!

    I can't believe the filter thinks this is spam! After all Frank has done for us. What is wrong with you Akismet you insensitive clod!

  • (cs) in reply to Ken B.
    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?

  • (cs) in reply to Ken B.
    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.
  • yo (unregistered) in reply to Gary

    He probably copied/pasted from some example on the interwebs

  • Design Pattern (unregistered) in reply to Ken B.
    Ken B.:
    Haero:
           PreparedStatement ps  = connection.prepareStatement("SELECT * FROM email_contact");
           ResultSet rs = ps.executeQuery();
           System.out.print("<email_list>\n");
           while (rs.next()) {
                String email = rs.getString("email");
                System.out.print("<email>"+email+"</email>\n");
           }
           System.out.print("</email_list>\n");
    
    I like this one better, many interfaces can already grab this as an array.
    FTFY.

    Not so many interfaces, once you realise that "&" is a valid character in an email-adress but is a reserved character in XML which must be encoded specially.

  • blarg (unregistered) in reply to tehR
    tehR:
    Agreed. From a technical perspective nothing in the supplied code was particularly WTFy. Story reduces to a guy who has existing code but wants it to do a bit more, yet doesn't know right off the bat (the horror!) how to get it done.

    Actually, the supplied code showed that the question in itself was completely wrong, and the suggested solution was unnecessary.

    When you have a collection of objects and you want a collection of objects, you do not recursively loop through it, print out a string and then parse the string into a collection.

  • Take a chill pill ... (unregistered)

    Sorry I totally don't believe this ... it just seems too far fetched, who should care if it's an array or a list? They both conform to the Iterable interface ... hence sending and email is as easy as

    for (String emailAddress : addresses) ...

    As for the guy having to cool down, seriously dude, you need to learn to roll with the punches ... I have worked with idiots who blow their cool all the time, bruised and overinflated egos are just as detrimental to IT as idiots with no idea ... if something so little makes you annoyed, just wait until you start getting more senior and having to deal with management!

  • (cs) in reply to Nagesh
    Nagesh:
    boog:
    mroot (10:03 AM): Got a problem for ya... mroot (10:03 AM): Any idea how I can parse a string of email addresses like this: [email protected]@[email protected]? mroot (10:04 AM): I need them separated in an array. I was thining of looking for .net, .com, etc. boog (10:05 AM): Sure, that might work. mroot (10:05 AM): Is there a web service to do that? boog (10:06 AM): There might be. See if you can find one, and let me know if you do. mroot (11:18 AM): Okay. What if there was a comma between the addresses? For example, [email protected],[email protected],[email protected]. mroot (11:19 AM): That should be easy to put in an array? boog (11:22 AM): Couldn't find a web service? Hmm... wait, where did those commas come from? mroot (11:24 AM): I just copy/pasted them from debug console. That's what my string has. boog (11:25 AM): Oh, I see, they make it easier to read. Good thinking! So if there's no web service already, you should write your own. It can start out by removing the commas, then search on .net, .com, etc.! Think you can pull it off? mroot (11:25 AM): Sure, no problem... boog: (11:25 AM): Excellent.

    On the plus side, he'd never ask for my help again.

    booger, That will never work. Mister Oot will simply ask you to write the webservice. <smiles>

    Zone transfer against a root DNS server . . .

  • Take a chill pill ... (unregistered) in reply to Take a chill pill ...

    Also as a side note ... just use the LinkedList collection class as you wouldn't have the issue of the resizing the array in the while(rs.next()) loop such that:

    Collection<String> addresses = new LinkedList<String>(); while (rs.next()) { addresses.add(rs.getString("email")); } return addresses;

    see really not hard!

  • (cs) in reply to Boris Vladamir
    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.

  • C-Octothorpe (unregistered) in reply to Matt Westwood
    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?

  • the cleaner (unregistered) in reply to Take a chill pill ...
    Collection<String> addresses = new LinkedList<String>(); while (rs.next()) { addresses.add(rs.getString("email")); } return addresses;

    see really not hard!

    ... to leave a connection open for a certain time
  • pgill (unregistered) in reply to the cleaner
    the cleaner:
    Collection<String> addresses = new LinkedList<String>(); while (rs.next()) { addresses.add(rs.getString("email")); } return addresses;

    see really not hard!

    ... to leave a connection open for a certain time

    lol i think that was a snippet ... so many ways to skin a cat ... according to a well known book there is a 101 ways ...

  • pgill (unregistered) in reply to pgill
    pgill:
    the cleaner:
    Collection<String> addresses = new LinkedList<String>(); while (rs.next()) { addresses.add(rs.getString("email")); } return addresses;

    see really not hard!

    ... to leave a connection open for a certain time

    lol i think that was a snippet ... so many ways to skin a cat ... according to a well known book there is a 101 ways ...

    Also that's a ResultSet not a connection ... ;)

  • mroot (unregistered) in reply to Colin
    tldsText = execAndGetOutputOf("wget http://mxr.mozilla.org/mozilla-central/source/netwerk/dns/effective_tld_names.dat?raw=1");
    tldsText = stripComments(tldsText);
    tldsText = stripEmptyLines(tldsText);
    tlds = tldsText.split("\\r?\\n");
    effedUpEmailList = getGlommedTogetherStringOfEmailAddresses().split("@");
    lastUsername = effedUpEmailList[0];
    for( i = 1; i < effedUpEmailList.length; i++ ) {
      for( j = 0; j < tlds; j++ ) {
        index = effedUpEmailList[i].locationOf(tlds[j]);
        // TODO : What about addresses like [email protected]?
        // Meh.  Leave it for jbanic.
        if( index > 0 ) {
          listOfActualEmailAddresses.add(lastUsername + "@" + effedUpEmailList[i].subset(0, index));
          lastUsername = effedUpEmailList[i].subset(index, effedUpEmailList[i].length);
        }
      }
    }
    return listOfActualEmailAddresses;
    
  • Me (unregistered)

    Probaly been posted already but what about using In-Line SQL with a wildcard SELECT. The table could be huge and returning all fields is very bad form...

  • Naresh Kookaburra (unregistered) in reply to Nagesh
    Nagesh:
    public class StringSplit {
      public static void main(String args[]) throws Exception{
        String testString = "Real-How-To";
        System.out.println(
            java.util.Arrays.toString(
            testString.split("-")
        ));
    
    // output : [Real, How, To]
    }
    

    }

    mroot really needs to attend one short course in java. java is most user friendly REAL PROGRAMMING language. of course everyone think VB6 is most user friendly but keep in mind I use term "REAL" here. there are sevreal java course available online. i think he can contact me if he cannot google.

    RoseIndia is good site for programming tutorials.

  • Leader of the Troll Army (unregistered) in reply to C-Octothorpe
    C-Octothorpe:
    hoodaticus:
    YHBT. YHL. HAND.

    Good god, please don't make that a meme...

    Do a bert glanstron, or a paula bean, but for the love of all that is good, don't let that be a meme on this site...

    You know what to do, men.

  • C-Octothorpe (unregistered) in reply to Leader of the Troll Army
    Leader of the Troll Army:
    C-Octothorpe:
    hoodaticus:
    YHBT. YHL. HAND.

    Good god, please don't make that a meme...

    Do a bert glanstron, or a paula bean, but for the love of all that is good, don't let that be a meme on this site...

    You know what to do, men.

    HAHAHAHAHAHAHHAHAHAHHAHAHHAHHAHAHAHHAHAH....

    sorry, I'm don.. no wait..

    HAHAHAHAHAHAHHAHAHAHHAHAHHAHHAHAHAHHAHAHhahahahaAhahAHAHahAHA

  • (cs) in reply to frits
    frits:
    I see a lot of Harry Potter references on this site. Forgive my naiveté, but do adults actually like that stuff?
    Just Emma Watson. [image]
  • (cs) in reply to Gern Blaanston
    Gern Blaanston:
    frits:
    I see a lot of Harry Potter references on this site. Forgive my naiveté, but do adults actually like that stuff?
    Just Emma Watson.

    [image]

    Erecticus! Onanius! Ejaculaticus!

  • (cs) 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... 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.

  • (cs) in reply to C-Octothorpe
    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?

  • (cs)

    jbanic (11:26 AM): You can just put it in a List and then convert it to an array. mroot: (11:26 AM): Duhhh: What'll they think of next?

  • Not Liking (unregistered)

    I like interesting stories, not stupid or boring ones. This site needs better stories.

  • (cs)

    So the question is how to take a list of things and turn it into a list of things?

  • North American Guy (unregistered) in reply to Nagesh
    Nagesh:
    I doubt bogus boris has killed anything bigger than a fly or moskito. BTW, do you have moskitoes in North America?

    Dear God, yes. Mosquitoes so big you need to brace yourself if they land on you. You need to hit them twice, once to stun, then again, better aimed, to kill. They fly off, guts so huge and full of blood, will turn the river red when they go to lay eggs.

  • McLovin (unregistered) in reply to smxlong
    smxlong:
    So the question is how to take a list of things and turn it into a list of things?

    Yeah, kind of a lame story. Don't mind the Emma T nipslip though.

  • Brian White (unregistered) in reply to shortcut for the shortcut
    shortcut for the shortcut:
    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"); }

    yeah, that's what i would have done. The list approach seems like a bit of a detour actually, not a shortcut

    Given the context of this story.... my automatic assumption is that this list of emails really do not belong in an array at all. The list (or heck maybe just the datareader?) is most likely the final solution, not a stop along the way. The array requirement was a mis-specification the same as the string splitting was. What do you think the programmer will do with the array of email addresses once he has it? Most likely just iterate over it sending one email at a time

  • (cs) in reply to North American Guy
    North American Guy:
    Nagesh:
    I doubt bogus boris has killed anything bigger than a fly or moskito. BTW, do you have moskitoes in North America?

    Dear God, yes. Mosquitoes so big you need to brace yourself if they land on you. You need to hit them twice, once to stun, then again, better aimed, to kill. They fly off, guts so huge and full of blood, will turn the river red when they go to lay eggs.

    This was in one Phantom or Mandrake comic. I read Indrajal comics when I grow up in India.

  • Gunslinger (unregistered)

    What is this? I don't even...

  • dignissim (unregistered) in reply to The Real Corrector

    Nagesh, you dumn fuck.

  • Sudo (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 trolling people calling shenanigans trolling people who insist upon slightly different solutions trolling people who argue about the slightly different solutions trolling people who say it would all be easier in another language / OS / etc. FTFYs

    FTFY

  • (cs)

    It has come to point where if I make any single comment, everybody want to jump and say "Troll".

  • (cs) in reply to frist?
    arricle:
    mroot (10:04 AM): I need them separated in an array. I was thining of looking for .net, .com, etc. jbanic (10:05 AM): That's not really feasible... you'd have to know *all* existing domains. mroot: (10:05 AM): Is there a web service to do that?
    mroot (12:03 AM): Got a problem for ya... mroot (12:03 AM): Any idea how I can parse a string of domains like this: comnetgovedumxukmilau?
  • ÐÃ (unregistered) in reply to Nagesh
    Nagesh:
    It has come to point where if I make any single comment, everybody want to jump and say "Troll".

    You finally got it, Troll.

Leave a comment on “The Shortcut Guy”

Log In or post as a guest

Replying to comment #:

« Return to Article