• Anon (unregistered) in reply to Alex
    Alex:
    Anon:
    Alex:
    You're all ripping on the first example, which is fair. But the second one may actually be kind of clever:

    You must be using a different definition of "clever" than the rest of us.

    So you tell me, how do you replace all occurrences of 2 or more spaces with only 1 space, in VB6, with no regular expressions?

    I even googled it, and the suggested solutions include "copy the string char-by-char, skipping space chars that come after other space chars"; "while string contains ' ' replace ' '->' '".. this solution is probably faster than those, at least.

    The first one (copy char-by-char). That has to be faster than several nested replace calls. How do you think replace works anyway? Just because it's a built-in function, doesn't make it magic.

  • The Nerve (unregistered) in reply to What do you expect from a Agile company
    What do you expect from a Agile company:
    Severity One:
    The Nerve:
    Fixed?
     public boolean isBlank(String str) {
      try {
         return str.trim().length() == 0;
      } catch (NullPointerException ex)
      {
      }
      return true;
     }// end
    
    Ugh... well, at least you posted your code on the right site.
    public boolean isBlank( String str ) {
        return str == null || str.trim().isEmpty();
    }

    FTFY

    Yes, but this function discounts all whitespace. You changed the spec.

    Wrong! I changed the implementation. Read the spec:

    TFA:
    /** * This method checks to see if any of the input fields are blank spaces. *
  • RandomUser423699 (unregistered) in reply to EngleBart
    EngleBart:
    Alex:
    So with that second example, TRWTF is older versions of VB which lacked regular expressions, forcing this kind of solution. But the solution itself is valid.
    It is probably faster to allocate a StringBuilder as large as the current string and then copy every character from source to dest, omitting blanks if the last character was blank. Less scanning of characters (each character read exactly once) and less intermediate String object creation.
    Based on his later comment:
    Alex:
    So you tell me, how do you replace all occurrences of 2 or more spaces with only 1 space, in VB6, with no regular expressions?
    I presume he also meant VB6 when referring to "older versions of VB" in the first comment. VB6 did not have StringBuilders, and most internal string operations were implemented using an allocate-and-copy approach, returning a new string instance. Your strategy might work, using a Mid() assignment statement (not to be confused with the Mid() substring-ing function), assuming it also didn't just allocate/copy.
  • (cs)

    The real WTF is the comments.

  • Brent (unregistered) in reply to Dirge
    Dirge:
    Alex:
    I even googled it, and the suggested solutions include "copy the string char-by-char, skipping space chars that come after other space chars"; "while string contains ' ' replace ' '->' '".. this solution is probably faster than those, at least.

    Doing a while-string-contains loop may be marginally slower (most likely a tiny fraction of a second slower) than the method in today's post,

    That seems very unlikely. In the best case the string has no spaces at all, so the replace method would not have to do any replaces and would be able to skip as much as possible. The most it can skip is the length of the string its searching for, so if it's looking for a ten space string, it only needs to look at every tenth character... and in general for an X length string, it will iterate over at least 1/Xth of the characters. So the number of characters the replace method will look at is 1/10 + 1/10 + 1/3 + 1/2 + 1/2, or 153.333% as many as the length of the original string. Meaning that a single pass method should easily beat it (unless it manages to be extremely less efficient on the replaces).

  • ‎‎‎‎ ‎‎‎‎ ‎‎‎‎ ‎‎‎‎ ‎‎‎‎ ‎‎‎‎ (unregistered)

    I don't see the problem guys.

  • delenit (unregistered) in reply to ‎‎‎‎ ‎‎‎‎ ‎‎‎‎ ‎‎‎‎ ‎‎‎‎ ‎‎‎‎
    ‎‎‎‎ ‎‎‎‎ ‎‎‎‎ ‎‎‎‎ ‎‎‎‎ ‎‎‎‎:
    I don't see the problem guys.
    The problem is not declaring constants: public static final String " " = BLANK_ONE_SPACE; public static final String " " = BLANK_TWO_SPACES; public static final String " " = BLANK_THREE_SPACES; public static final String " " = BLANK_TEN_SPACES;
  • (cs)

    Here's my WTF python solution:

    def isSpace(st):
    	try:
    		[c == ' ' for c in st].index(False)
    		return False
    	except ValueError:
    		return True
    
  • (cs) in reply to ShatteredArm
    ShatteredArm:
    Here's my WTF python solution:
    def isSpace(st):
    	try:
    		[c == ' ' for c in st].index(False)
    		return False
    	except ValueError:
    		return True
    

    Oooh, even better.... one line:

    isEmpty = lambda st: len(st) == 0 or reduce(lambda x, y: x and y, [c == ' ' for c in st])
  • (cs) in reply to Anon
    Anon:
    Alex:
    Anon:
    Alex:
    You're all ripping on the first example, which is fair. But the second one may actually be kind of clever:

    You must be using a different definition of "clever" than the rest of us.

    So you tell me, how do you replace all occurrences of 2 or more spaces with only 1 space, in VB6, with no regular expressions?

    I even googled it, and the suggested solutions include "copy the string char-by-char, skipping space chars that come after other space chars"; "while string contains ' ' replace ' '->' '".. this solution is probably faster than those, at least.

    The first one (copy char-by-char). That has to be faster than several nested replace calls. How do you think replace works anyway? Just because it's a built-in function, doesn't make it magic.

    In theory running over the string once rather than the 5 times that the original code snippet does would be more efficient, however (it's been a while since I've done VB6) isn't VB6 runtime interpreted? And are the builtin functions interpreted or written in C in some DLL? If that's the case you'd have to run tests on the 2 to find out.

    But if the original dev had really gone to all that trouble they should have left a comment explaining why they chose the method that they did...

  • Ken B. (unregistered)

    Why is no one thinking "enterprisey" here?

    SELECT GoodValue FROM FixBadValuesTable WHERE BadValue = '%1' OR GoodValue = '%1';

  • Ken B. (unregistered) in reply to Alex
    Alex:
    Anon:
    Alex:
    You're all ripping on the first example, which is fair. But the second one may actually be kind of clever:
    You must be using a different definition of "clever" than the rest of us.
    So you tell me, how do you replace all occurrences of 2 or more spaces with only 1 space, in VB6, with no regular expressions?

    I even googled it, and the suggested solutions include "copy the string char-by-char, skipping space chars that come after other space chars"; "while string contains ' ' replace ' '->' '".. this solution is probably faster than those, at least.

    Use replace() to replace all occurrences of two spaces with one space. Loop until the returned value equals the input value.

  • (cs)

    they forgot the case

    if( string == null ) return fileNotFound;

  • (cs) in reply to Brent
    Brent:
    Dirge:
    Alex:
    I even googled it, and the suggested solutions include "copy the string char-by-char, skipping space chars that come after other space chars"; "while string contains ' ' replace ' '->' '".. this solution is probably faster than those, at least.

    Doing a while-string-contains loop may be marginally slower (most likely a tiny fraction of a second slower) than the method in today's post,

    That seems very unlikely. In the best case the string has no spaces at all, so the replace method would not have to do any replaces and would be able to skip as much as possible. The most it can skip is the length of the string its searching for, so if it's looking for a ten space string, it only needs to look at every tenth character... and in general for an X length string, it will iterate over at least 1/Xth of the characters. So the number of characters the replace method will look at is 1/10 + 1/10 + 1/3 + 1/2 + 1/2, or 153.333% as many as the length of the original string. Meaning that a single pass method should easily beat it (unless it manages to be extremely less efficient on the replaces).

    In addition to the inefficiency mentioned we have yet to account for the additional array copies that are being made. The best case would be to make one array copy after finding each replace location. So for each replace you have an additional full iteration after you perform some efficient iteration to find the replaceable locations. In other words even if you do a single replace with the 10 length you will iterate over 110% of the length.

  • Anon (unregistered) in reply to the real wtf fool
    the real wtf fool:
    Anon:
    Alex:
    Anon:
    Alex:
    You're all ripping on the first example, which is fair. But the second one may actually be kind of clever:

    You must be using a different definition of "clever" than the rest of us.

    So you tell me, how do you replace all occurrences of 2 or more spaces with only 1 space, in VB6, with no regular expressions?

    I even googled it, and the suggested solutions include "copy the string char-by-char, skipping space chars that come after other space chars"; "while string contains ' ' replace ' '->' '".. this solution is probably faster than those, at least.

    The first one (copy char-by-char). That has to be faster than several nested replace calls. How do you think replace works anyway? Just because it's a built-in function, doesn't make it magic.

    In theory running over the string once rather than the 5 times that the original code snippet does would be more efficient, however (it's been a while since I've done VB6) isn't VB6 runtime interpreted? And are the builtin functions interpreted or written in C in some DLL? If that's the case you'd have to run tests on the 2 to find out.

    But if the original dev had really gone to all that trouble they should have left a comment explaining why they chose the method that they did...

    I'm pretty sure VB6 compiled to native code, but I might be wrong and you make a fair point. You'd have to try it to be absolutely sure, but I'm not going to pollute my machine by installing VB6 on it. My general feeling is that a single pass method (iterating over all the characters of the string) has to be faster than multiple calls to replace (assuming the single pass method is sanely written, of course) because replace can't take advantage of the fact that it's being called nested. So why it could be faster (as per your point), I'd be very surprised if it turned out that it was.

  • (cs) in reply to The Nerve
    The Nerve:
    Fixed?
     public boolean isBlank(String str) {
      try {
         return str.trim().length() == 0;
      } catch (NullPointerException ex)
      {
      }
      return true;
     }// end
    
     public boolean isBlank(String str) {
        if (str == null)
           return true;
        else {
           return str.trim().length()==0;
        }
     }
    
    ... though the NullPointerException is an excellent WTF opportunity to return FileNotFound...
  • (cs)

    Calling trim() reduces the lines of code but forces a string copy which may be inefficient.

    Looping through the elements might be the better solution: I don't know Java well enough though.

  • (cs) in reply to Cbuttius
    Cbuttius:
    Calling trim() reduces the lines of code but forces a string copy which may be inefficient.

    Looping through the elements might be the better solution: I don't know Java well enough though.

    Java has, like C, C++, and C#, a function to get the first position of a character in a string (indexOf, it's called). Easy, short, fast, and understandable...
  • (cs) in reply to TGV
    TGV:
    Cbuttius:
    Calling trim() reduces the lines of code but forces a string copy which may be inefficient.

    Looping through the elements might be the better solution: I don't know Java well enough though.

    Java has, like C, C++, and C#, a function to get the first position of a character in a string (indexOf, it's called). Easy, short, fast, and understandable...
    Good idea! Here's the new function:
    boolean isEmpty (string str)
    {
      return str.indexOf('a') != 0 
          || str.indexOf('b') != 0 
          || str.indexOf('c') != 0 
          || str.indexOf('d') != 0 
          || str.indexOf('e') != 0 
          || str.indexOf('f') != 0 
          || str.indexOf('g') != 0 
          || str.indexOf('h') != 0 
          || str.indexOf('i') != 0 
          || str.indexOf('j') != 0 
          || str.indexOf('k') != 0 
          || str.indexOf('l') != 0 
          || str.indexOf('m') != 0 
          || str.indexOf('n') != 0 
          || str.indexOf('o') != 0 
          || str.indexOf('p') != 0 
          || str.indexOf('q') != 0 
          || str.indexOf('r') != 0 
          || str.indexOf('s') != 0 
          || str.indexOf('t') != 0 
          || str.indexOf('u') != 0 
          || str.indexOf('v') != 0 
          || str.indexOf('w') != 0 
          || str.indexOf('x') != 0 
          || str.indexOf('y') != 0 
          || str.indexOf('z') != 0 
          || str.indexOf('A') != 0 
          || str.indexOf('B') != 0 
          || str.indexOf('C') != 0 
    [...]
          || str.indexOf('7') != 0 
          || str.indexOf('8') != 0 
          || str.indexOf('9') != 0 
          || str.indexOf('0') != 0 ;
    
    }
    
  • wtf (unregistered) in reply to Sutherlands
    Sutherlands:
    TGV:
    Cbuttius:
    Calling trim() reduces the lines of code but forces a string copy which may be inefficient.

    Looping through the elements might be the better solution: I don't know Java well enough though.

    Java has, like C, C++, and C#, a function to get the first position of a character in a string (indexOf, it's called). Easy, short, fast, and understandable...
    Good idea! Here's the new function:
    boolean isEmpty (string str)
    {
      return str.indexOf('a') != 0 
          || str.indexOf('b') != 0 
          || str.indexOf('c') != 0 
          || str.indexOf('d') != 0 
          || str.indexOf('e') != 0 
          || str.indexOf('f') != 0 
          || str.indexOf('g') != 0 
          || str.indexOf('h') != 0 
          || str.indexOf('i') != 0 
          || str.indexOf('j') != 0 
          || str.indexOf('k') != 0 
          || str.indexOf('l') != 0 
          || str.indexOf('m') != 0 
          || str.indexOf('n') != 0 
          || str.indexOf('o') != 0 
          || str.indexOf('p') != 0 
          || str.indexOf('q') != 0 
          || str.indexOf('r') != 0 
          || str.indexOf('s') != 0 
          || str.indexOf('t') != 0 
          || str.indexOf('u') != 0 
          || str.indexOf('v') != 0 
          || str.indexOf('w') != 0 
          || str.indexOf('x') != 0 
          || str.indexOf('y') != 0 
          || str.indexOf('z') != 0 
          || str.indexOf('A') != 0 
          || str.indexOf('B') != 0 
          || str.indexOf('C') != 0 
    [...]
          || str.indexOf('7') != 0 
          || str.indexOf('8') != 0 
          || str.indexOf('9') != 0 
          || str.indexOf('0') != 0 ;
    
    }
    

    Brillant!

  • obvious (unregistered) in reply to TGV

    The "fix" was sarcastic, c'mon now.

  • Patrick (unregistered)

    I think the comments are funnier than the article. You're fighting over the accuracy of a parody. It runs through the string and sets blank to false every time it hits a character that isn't a space.

    p.s. use Trim()==""

    As for the second one, that's nothing Replace(/\s+/," ") won't fix.

  • Anon (unregistered)

    Remember folks, as we learnt yesterday, people who write code this bad aren't just bad programmers, they're probably paedophiles too.

  • (cs) in reply to Sutherlands
    Sutherlands:
    TGV:
    Cbuttius:
    Calling trim() reduces the lines of code but forces a string copy which may be inefficient.

    Looping through the elements might be the better solution: I don't know Java well enough though.

    Java has, like C, C++, and C#, a function to get the first position of a character in a string (indexOf, it's called). Easy, short, fast, and understandable...
    Good idea! Here's the new function:
    boolean isEmpty (string str)
    {
      return str.indexOf('a') != 0 
          || str.indexOf('b') != 0 
          || str.indexOf('c') != 0 
          || str.indexOf('d') != 0 
          || str.indexOf('e') != 0 
          || str.indexOf('f') != 0 
          || str.indexOf('g') != 0 
          || str.indexOf('h') != 0 
          || str.indexOf('i') != 0 
          || str.indexOf('j') != 0 
          || str.indexOf('k') != 0 
          || str.indexOf('l') != 0 
          || str.indexOf('m') != 0 
          || str.indexOf('n') != 0 
          || str.indexOf('o') != 0 
          || str.indexOf('p') != 0 
          || str.indexOf('q') != 0 
          || str.indexOf('r') != 0 
          || str.indexOf('s') != 0 
          || str.indexOf('t') != 0 
          || str.indexOf('u') != 0 
          || str.indexOf('v') != 0 
          || str.indexOf('w') != 0 
          || str.indexOf('x') != 0 
          || str.indexOf('y') != 0 
          || str.indexOf('z') != 0 
          || str.indexOf('A') != 0 
          || str.indexOf('B') != 0 
          || str.indexOf('C') != 0 
    [...]
          || str.indexOf('7') != 0 
          || str.indexOf('8') != 0 
          || str.indexOf('9') != 0 
          || str.indexOf('0') != 0 ;
    
    }
    

    First of all, the comparison needs to be made with -1, not 0. Also, what about special characters, such as '&' and 'ˬ'?

  • (cs) in reply to ShatteredArm
    ShatteredArm:
    First of all, the comparison needs to be made with -1, not 0. Also, what about special characters, such as '&' and 'ˬ'?
    You're absolutely right! Let's try it again!
    boolean isEmpty (string str)
    {
      return str.indexOf('a') != -1 
          || str.indexOf('b') != -1
          || str.indexOf('c') != -1
          || str.indexOf('d') != -1
          || str.indexOf('e') != -1 
          || str.indexOf('f') != -1 
          || str.indexOf('g') != -1 
          || str.indexOf('h') != -1 
          || str.indexOf('i') != -1 
          || str.indexOf('j') != -1 
          || str.indexOf('k') != -1 
          || str.indexOf('l') != -1 
          || str.indexOf('m') != -1 
          || str.indexOf('n') != -1 
          || str.indexOf('o') != -1 
          || str.indexOf('p') != -1 
          || str.indexOf('q') != -1 
          || str.indexOf('r') != -1 
          || str.indexOf('s') != -1 
          || str.indexOf('t') != -1 
          || str.indexOf('u') != -1 
          || str.indexOf('v') != -1 
          || str.indexOf('w') != -1 
          || str.indexOf('x') != -1 
          || str.indexOf('y') != -1 
          || str.indexOf('z') != -1 
          || str.indexOf('A') != -1 
          || str.indexOf('B') != -1 
          || str.indexOf('C') != -1 
    [...]
          || str.indexOf('7') != -1 
          || str.indexOf('8') != -1 
          || str.indexOf('9') != -1 
          || str.indexOf('0') != -1
          || str.indexOf('~') != -1
          || str.indexOf('!') != -1
          || str.indexOf('@') != -1
          || str.indexOf('#') != -1
          || str.indexOf('$') != -1
          || str.indexOf('%') != -1
          || str.indexOf('^') != -1
          || str.indexOf('&') != -1
          || str.indexOf('*') != -1
          || str.indexOf('(') != -1
          || str.indexOf(')') != -1
          || (str.indexOf('_') != -1 && str.indexOf('_') == -1) // because sometimes _ is used as whitespace
          || str.indexOf('+') != -1
          || str.indexOf('`') != -1
          || str.indexOf('-') != -1
          || str.indexOf('=') != -1
          || str.indexOf(',') != -1
          || str.indexOf('<') != -1
          || str.indexOf('>') != -1
    [...]
    

    }

  • Jay (unregistered) in reply to frits
    frits:
    I've actually used/seen C code with //eof on the last line of every file in a project.

    In fairness, I used to work for a company that had a rule that all reports must end with the line "*** END OF REPORT ***". Their reasoning was that this made it easy for someone to verify that he indeed had the entire report and that the last one or more pages had not failed to print or been lost or whatever.

  • David Allen (unregistered) in reply to David Allen

    The RemoveCharacters function uses 5 calls to Replace, the sequence replacing 10, 10, 3, 2, 2 spaces with 1.

    Keeping the 5 calls to Replace, the performance of this function can be improved by using the sequence 22, 7, 4, 3, 2.

    This new sequence will handle all cases up to 460 contiguous spaces, compared to the original 208.

    The largest number of contiguous spaces that can be handled is 3696, vs. 1200 for the original, and the total number of cases it handles is 2078, vs. the original 704.

    Can anybody else do better using 5 calls to Replace?

  • Larry (unregistered) in reply to Jay
    Jay:
    In fairness, I used to work for a company that had a rule that all reports must end with the line "*** END OF REPORT ***". Their reasoning was that this made it easy for someone to verify that he indeed had the entire report and that the last one or more pages had not failed to print or been lost or whatever.
    One of my first "data processing" teachers told us to print "nothing" on reports anywhere the entry would have been zero "so people know the computer didn't malfunction, or stop before completing this calculation".

    Yeah, some of his other advice was similarly founded. It was from another student in this class that I first heard the truism "Those who can't do, teach." And it must have circulated widely enough that it got back around to him, because he felt it necessary at the beginning of one class to spend ten minutes telling us about his illustrious pre-academia career and his decision to take a huge pay cut out of a selfless commitment to public service. Ummm hmmm.

  • Fred (unregistered) in reply to David Allen
    David Allen:
    This new sequence will handle all cases up to 460 contiguous spaces, compared to the original 208.
    Your and idiot. The database limits strings to 99 characters.
  • (cs) in reply to The Enterpriser
    The Enterpriser:
    Almost, you forgot the all important
    //end 
    

    which is required in order to prevent people from attempting to read past the end of the text. Think of it as an EOF for humans.

    Some humans need this. Have you ever wondered why stories always finish with "THE END"? Having no more pages left to read isn't enough to signify that they have reached the end of the story, so the end must always be explicitly labeled for them.

    Surely reading code is exactly like reading books, amirite?

  • Nome de Plume (unregistered)

    Sometimes, high-level OOP languages over-complicate things. We don't need a String class to test for a blank string.

    Here is a (nearly-right) 6502 Assembler implementation. It reads a char-string at address #2000 with 20 characters. It starts at the last character and counts down to the first. Each trip through the loop it compares the current character to a SPACE (ASCII 32).

    ; INIT LOOP INDEXES 4000 LDA #32; SPACE 4004 LDX #20; LENGTH OF CHAR-STRING ; START LOOP 4008 CMP 2000, X; CHAR-STR AT ADDR 2000 INDEXED WITH X 4012 BEQ 4024 4016 DEX 4020 BNE 4008 4024 ; LOOP TERMINAL ADDR

  • The Corrector (unregistered) in reply to obvious
    obvious:
    The "fix" was ironic, c'mon now.
    FTFY
  • Herby (unregistered) in reply to Nome de Plume
    Nome de Plume:
    Sometimes, high-level OOP languages over-complicate things. We don't need a String class to test for a blank string.

    Here is a (nearly-right) 6502 Assembler implementation. It reads a char-string at address #2000 with 20 characters. It starts at the last character and counts down to the first. Each trip through the loop it compares the current character to a SPACE (ASCII 32).

    ; INIT LOOP INDEXES
    4000 LDA #32; SPACE
    4004 LDX #20; LENGTH OF CHAR-STRING
    ; START LOOP
    4008 CMP 2000, X; CHAR-STR AT ADDR 2000 INDEXED WITH X
    4012 BEQ 4024
    4016 DEX
    4020 BNE 4008
    4024 ; LOOP TERMINAL ADDR
    

    Might work, but what if the strings are more than 256 bytes? EBCDIC?? Some things DO have limitations. We should understand ALL of them.

  • jmora (unregistered) in reply to Alex
    Alex:
    You're all ripping on the first example, which is fair. But the second one may actually be kind of clever:

    Suppose your requirement is you need to remove extra spaces, but not all spaces; you can't just do " "->"", and if you don't have regular expressions handy, this solution is not that bad.

    It first replaces spaces 10-for-1, twice. So unless the original string had more than 900 spaces in a row, it now has at most 9 in a row in any one place. Next it replaces 3-for-1, so any 9-space chunks become 3-space chunks. Next it does 2-for-1 twice, so those 3-space chunks become 2 and then 1-space. And now there are no extra spaces anywhere, but there are also still single spaces everywhere there should be.

    So with that second example, TRWTF is older versions of VB which lacked regular expressions, forcing this kind of solution. But the solution itself is valid.

    You and those replying to you, as far as I've seen, have failed to see that in fact this only works up to 209.

    You can run this if you feel like that:

    from functools import reduce
    f = lambda x,n: x//n+x%n
    with open('output.txt', 'w') as out:
        for i in range(1410):
            his = reduce(f,[10,10,3,2,2],i)
            out.write('%d\t%d\n'%(i, his))

    If I had some spare time I'd try to find out the properties that the sequence of numbers has to meet to get good results up to the maximum possible number with the shortest length. The most obvious correct sequence is {A(n+1) = A(n)*2-1; A(1) = 2} but [2,2,3] gets better results for that length (9 vs 11).

    BTW: VB really had to be a crappy language not to have RE nor loops, not even Turin complete in that case, if I'm not mistaken. I don't know how the replace function works without loops but using them it's fairly easy. I tried to make it efficient, anyone interested can post another solution and compare.

    char* trim(char* s){
      int i, j;
      char pre = ' ';
      for(i=0, j=0; s[i] != '\0'; i++)
        if(s[i] != ' ' || s[i] != pre){
          pre = s[i];
          s[j++] = s[i];
        }
      s[s[j-1]==' '? j-1 : j] = '\0';
      return s;
    }
  • wtf-mate (unregistered) in reply to jmora
    jmora:
    ...not even Turin complete...
    What does an ancient religious relic have to do with this?
  • Bob (unregistered) in reply to wtf-mate
    wtf-mate:
    jmora:
    ...not even Turin complete...
    What does an ancient religious relic have to do with this?
    You sir, are an idiot. Turin-compete is a measure of a computer-system's ability to perform certain functions: namely conditional and branching operations.
  • JJ (unregistered) in reply to Bob
    Bob:
    wtf-mate:
    jmora:
    ...not even Turin complete...
    What does an ancient religious relic have to do with this?
    You sir, are an idiot. Turin-compete is a measure of a computer-system's ability to perform certain functions: namely conditional and branching operations.
    I thought it was the ability of a process to restart itself after being killed.
  • (cs) in reply to JJ
    JJ:
    Bob:
    wtf-mate:
    jmora:
    ...not even Turin complete...
    What does an ancient religious relic have to do with this?
    You sir, are an idiot. Turin-compete is a measure of a computer-system's ability to perform certain functions: namely conditional and branching operations.
    I thought it was the ability of a process to restart itself after being killed.

    ZINGER!!!

  • (cs) in reply to Bob
    Bob:
    wtf-mate:
    jmora:
    ...not even Turin complete...
    What does an ancient religious relic have to do with this?
    You sir, are an idiot. Turin-compete is a measure of a computer-system's ability to perform certain functions: namely conditional and branching operations.
    I can't tell if you didn't notice that it was misspelled (because you didn't spell it correctly, either), or if you are trying to be funny (because I've never heard of Turing completeness being referred to in that way). I'm going to go with the former.
  • David Allen (unregistered) in reply to jmora
    jmora:
    You and those replying to you, as far as I've seen, have failed to see that in fact this only works up to 209.

    See my comments above. I give a sequence that works better, 22, 7, 4, 3, 2.

  • (cs) in reply to David Allen
    Function stripSpaces(baz As String) As String
        Dim bizzle As String
    
        bizzle = Replace(baz, "  ", " ")
        If InStr(1, bizzle, "  ") <> 0 Then bizzle = stripSpaces(bizzle)
        
        stripSpaces = bizzle
    End Function
    
  • (cs) in reply to Anonymous
    Anonymous:
    This is easy to fix:
    public boolean isBlank(String str) {
     bool blank = true;
     for (int i = 0; i < str.Length; i++) {
      if (str.charAt(i) != ' ') {
       blank = false;
      }
     }
     return blank;
    }
    public boolean isBlank(String str) {
     for (int i = 0; i < str.Length; i++) {
      if (str.charAt(i) != ' ') {
       return false;
      }
     }
     return true;
    }

    FTFY

  • FuBar (unregistered) in reply to wtf-mate
    wtf-mate:
    jmora:
    ...not even Turin complete...
    What does a medieval religious relic have to do with this?
    FTFY. It's been carbon dated.
  • Athiests like you can GTH (unregistered) in reply to FuBar
    FuBar:
    wtf-mate:
    jmora:
    ...not even Turin complete...
    What does a genuine religious relic have to do with this?
    FTFY. It's been carbon dated.
    FTFY - it's well known those results were fabricated. It's amazing how you athiests rely on science when it's convenient, but not when you don't want to believe the results.
  • (cs) in reply to jmora
    jmora:
    BTW: VB really had to be a crappy language not to have RE nor loops,
    What?
  • Anon (unregistered) in reply to Athiests like you can GTH
    Athiests like you can GTH:
    FuBar:
    wtf-mate:
    jmora:
    ...not even Turin complete...
    What does a genuine religious relic have to do with this?
    FTFY. It's been carbon dated.
    FTFY - it's well known those results were fabricated. It's amazing how you athiests rely on science when it's convenient, but not when you don't want to believe the results.

    A fabulous trolling, or else citation needed.

  • wtf^infinity (unregistered)

    TRWTF is that none of these handles the example of a true whitespace character, which is sometimes "\n", "\t", "w". The bigger WTF is that this is the third time I've pointed it out, but the idiot mods keep deleting it.

  • Athiests like you can GTH (unregistered) in reply to Anon
    Anon:
    Athiests like you can GTH:
    FuBar:
    wtf-mate:
    jmora:
    ...not even Turin complete...
    What does a genuine religious relic have to do with this?
    FTFY. It's been carbon dated.
    FTFY - it's well known those results were fabricated. It's amazing how you athiests rely on science when it's convenient, but not when you don't want to believe the results.

    A fabulous trolling, or else citation needed.

    Smith, Preston. "The Shroud of Turin." Encyclopedia Britannica. 2009

  • Anon (unregistered) in reply to Athiests like you can GTH
    Athiests like you can GTH:
    Anon:
    Athiests like you can GTH:
    FuBar:
    wtf-mate:
    jmora:
    ...not even Turin complete...
    What does a genuine religious relic have to do with this?
    FTFY. It's been carbon dated.
    FTFY - it's well known those results were fabricated. It's amazing how you athiests rely on science when it's convenient, but not when you don't want to believe the results.

    A fabulous trolling, or else citation needed.

    Smith, Preston. "The Shroud of Turin." Encyclopedia Britannica. 2009

    Peer-reviewed primary sources?

    I don't have access to Britannica, but, for what it's worth, Wikipedia's article says nothing of the sort.

  • (cs) in reply to Athiests like you can GTH
    Athiests like you can GTH:
    FuBar:
    wtf-mate:
    jmora:
    ...not even Turin complete...
    What does a genuine religious relic have to do with this?
    FTFY. It's been carbon dated.
    FTFY - it's well known those results were fabricated. It's amazing how you athiests rely on science when it's convenient, but not when you don't want to believe the results.
    So you're saying that the carbon dating was apparently falsified, therefore the artifact must be genuine?

    Interesting logic...

Leave a comment on “Double Spaced”

Log In or post as a guest

Replying to comment #326962:

« Return to Article