• (cs)

    Great, someone triggered the creationist bot. Looks at Bob

  • Bert Glanstron (unregistered) in reply to frits
    frits:
    Great, someone triggered the creationist bot. *Looks at Bob*
    You are an idiot and should be banned from your mommy and daddy's modem.
  • Athiests like you can GTH (unregistered) in reply to Anon
    Anon:
    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.

    When did Wikipedia become more legitimate than Britannica?

  • Anon (unregistered) in reply to Athiests like you can GTH
    Athiests like you can GTH:
    Anon:
    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.

    When did Wikipedia become more legitimate than Britannica?

    I never said it was. I don't have Britannica, but if something as big as outright fraud (which you allege) was true, it would surely have found it's way into Wikipedia. It hasn't because you're full of shit. Take your fairy tales somewhere else.

  • (cs) in reply to Bert Glanstron
    Bert Glanstron:
    frits:
    Great, someone triggered the creationist bot. *Looks at Bob*
    You are an idiot and should be banned from your mommy and daddy's modem.

    Hi Bob! :p

  • (cs) in reply to Anon

    http://www.creationtips.com/shroud.html

    Yup, akismet says that's spam. Let's try again!

  • Neil (unregistered)

    If you're writing your own version of RemoveCharacters to collapse up to N spaces, you probably want to replace SQRT(N) spaces with 1. For example, if your input is limited to 100 consecutive spaces, then replacement of 7 spaces or 14 spaces with 1 could still leave you with 19 spaces, but the worst case for between 8 to 13 spaces would only be 18. You then need to choose an appropriate replacement to deal with up to 18 consecutive spaces and so on.

  • Athiests like you can GTH (unregistered) in reply to Anon
    Anon:
    Athiests like you can GTH:
    Anon:
    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.

    When did Wikipedia become more legitimate than Britannica?

    I never said it was. I don't have Britannica, but if something as big as outright fraud (which you allege) was true, it would surely have found it's way into Wikipedia. It hasn't because you're full of shit. Take your fairy tales somewhere else.

    Yeah, or jackholes like you delete it when it does. Try looking at the history.

  • (cs)

    It's even in the php manual page at preg_replace:

    <?php $str = 'foo o'; $str = preg_replace('/\s\s+/', ' ', $str); // This will be 'foo o' now echo $str; ?>
  • Jack (unregistered) in reply to boog
    boog:
    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?

    It used to be that your program would know when it hit the end of a file because when you say "give me the next line" you would get an error: there is no next line. But MicroSoft, taking an early lead in reducing software errors, came up with the idea of putting a human-readable user-friendly control-Z* at the end of a file so you'd know it's really the end... unless, of course, some trickster wrote a control-Z somewhere in the middle of a file.

    But why would anyone want to do that?

    • It's intuitive! Z is the last letter of the alphabet! Get it?
  • Ralph (unregistered) in reply to Nome de Plume
    Nome de Plume:
    ; 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
    Dude, you used branch instructions! That's just the assembler way of saying "GOTO". Bad! Bad!! Bad!!! Try again please.
  • Capt. Cha (unregistered) in reply to Athiests like you can GTH
    Athiests like you can GTH:
    It's amazing how you athiests rely on science when it's convenient, but not when you don't want to believe the results.
    You mean, just like everyone else?

    I swear there's a line of code in the human brain that says something like "once you've decided what you want to think, seek evidence supporting it".

    If we can all agree that's a WTF, the next question is why did our Brainware Developer put it there?

  • (cs) in reply to Capt. Cha
    Capt. Cha:
    I swear there's a line of code in the human brain that says something like "once you've decided what you want to think, seek evidence supporting it".

    If we can all agree that's a WTF, the next question is why did our Brainware Developer put it there?

    Clearly this phenomenon is due to how our brains developed.

    duck

  • MG (unregistered) in reply to mariushm
    mariushm:
    It's even in the php manual page at preg_replace: <?php $str = 'foo o'; $str = preg_replace('/\s\s+/', ' ', $str); // This will be 'foo o' now echo $str; ?>

    That doesn't do what the original WTF does, which is replace multiple space characters (ASCII 32) with a single space.

    That regex replaces any sequence of white space characters (including tabs) with a single space.

  • David Allen (unregistered) in reply to David Allen
    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?

    I've extended this.

    For 6 Replace calls the sequence should be 232, 22, 7, 4, 3, 2. This will handle all cases up to 53,590 contiguous spaces.

    For 7 Replace calls the sequence should be 50426, 232, 22, 7, 4, 3, 2. This will handle all cases up to 199,790,977 contiguous spaces.

    For now I am unable to calculate the sequence for 8 Replace calls. I've roughly estimated the next size increment to be >35 billion, and that it would handle all cases up to at least ~250 trillion contiguous spaces.

  • Jack (unregistered) in reply to David Allen
    David Allen:
    I've roughly estimated the next size increment to be >35 billion, and that it would handle all cases up to at least ~250 trillion contiguous spaces.
    Yeah, yeah, but a loop can run forever. Top that!
  • ErikTheRed (unregistered)

    What's really sad is what a simple tiny little one-liner this is in Perl...

  • (cs) in reply to Cheng
    Cheng:
    // fixed?
    public boolean isBlank(String str) {
      String toCompare = "";
      if(str.equals(toCompare)) return true;
    

    for (int i=0;i<str.length();i++){ // check the entire string! toCompare+=" "; if(str.equals(toCompare)) return true; } else return false; }// end of that fix

    There, now it is more efficient and will work for strings bigger than 1000 whitespaces long!

  • jekbradbury (unregistered)

    my god, someone actually took the time to go through the math on this (in a visual basic context, too): http://www.tech-archive.net/Archive/VB/microsoft.public.vb.general.discussion/2004-04/1076.html

  • Onymous Coward (unregistered)

    Why do shopping sites insist on having the credit card number input as a long string of digits without hyphens or spaces? Why do developers find it so hard to strip such things out of the data?

    This is why.

    Captcha (is reporting them still en vogue?) = 𝅗𝅥

  • Gigasoft (unregistered) in reply to Herby
    /**
      * This method checks to see if any of the input fields are blank spaces.
      * Creation date: (28/10/2010 11:16:23 PM)
      * 
      * @return boolean
      * @param a strUnwanted, low part
      * @param x Character set, 0 for ASCII, 1 for EBCDIC
      * @param y strUnwanted, high part
      */
    sta 0
    sty 1
    ldy #0
    start:
    lda (0),y
    beq end
    iny
    bne nooverflow
    inc 1
    nooverflow:
    cmp spaces,x
    beq start
    lda #0
    rts
    end:
    lda #1
    rts
    spaces dc.b 32,64
    
  • (cs) in reply to buiatte
    buiatte:
    public boolean isBlank( String str ) {
    return org.apache.commons.lang.StringUtils.isBlank( str );
    

    }

    I am amazed by the fact that most Java developers dont know (or dont care) about commons-lang (or apache commons in general)

    That would have just resulted in a ClassNotFoundException. The code says it was written in '01, commons.lang version 1.0 was released in October of '02.

  • (cs) in reply to Anon

    First, no, the Wikipedia is not that definitive. Second, according to the National Geographic program I watched when I was bored some time ago, discrepancies were found in the area used for carbon dating. It wasn't necessarily fraud, but repairs to the shroud had been made on the area that was tested back in the 16th century, so its very possible the results were wrong. Third, the wikipedia does indeed mention this controversy: http://en.wikipedia.org/wiki/Radiocarbon_14_dating_of_the_Shroud_of_Turin#Chemical_properties_of_the_sample_site
    Its still not a definitive source. Fourth, something being old does not mean it is a genuine religious relic. Otherwise I could get people to worship the sandwich in my fridge.

    There, everyone now properly offended, or did I miss someone?

  • Athiests like you can GTH (unregistered) in reply to nwbrown
    nwbrown:
    First, no, the Wikipedia is not that definitive. Second, according to the National Geographic program I watched when I was bored some time ago, discrepancies were found in the area used for carbon dating. It wasn't necessarily fraud, but repairs to the shroud had been made on the area that was tested back in the 16th century, so its very possible the results were wrong. Third, the wikipedia does indeed mention this controversy: http://en.wikipedia.org/wiki/Radiocarbon_14_dating_of_the_Shroud_of_Turin#Chemical_properties_of_the_sample_site Its still not a definitive source. Fourth, something being old does not mean it is a genuine religious relic. Otherwise I could get people to worship the sandwich in my fridge.

    There, everyone now properly offended, or did I miss someone?

    Actually, what I was referring to was the Clairton Controversy where Daimon Clairton conspired with 32 other students at Oxford to discredit the authenticity of the Shroud of Turin once and for all. They put out a 287-page report detailing "research" that "proved" that the Shroud was a forgery. This was a front-page story in papers world-wide, as was the blatant censure of the Vatican. Eventually, one of the members admitted that most of the findings were falsified, and upon investigation it was discovered that most of Clairton's cohorts were involved in a "skull and daggers" athiest organization. Clairton lost his tenure, but most of this group walked scott-free. The scandal wasn't quite as popular as the original report, either.

  • David Allen (unregistered) in reply to jekbradbury
    jekbradbury:
    my god, someone actually took the time to go through the math on this (in a visual basic context, too): http://www.tech-archive.net/Archive/VB/microsoft.public.vb.general.discussion/2004-04/1076.html

    That's a nice find.

    Actually there are multiple solutions for each n-ary case. The math and code in the referenced article appears to produce just the first possibility. If you look you will notice similarities and differences from the sequence I provided. For example my sequence doesn't contain repeated values.

    The sequence that I gave 50426, 232, 22, 7, 4, 3, 2, optimizes first for handling all cases up to maximum possible 199,790,977 contiguous spaces, then optimizes for handling the maximum number of cases beyond that up to the largest possible string of 43,238,883,072 contiguous spaces. For those two constraints, this should be the optimal solution to the nested 7 Replace problem.

  • drusi (unregistered) in reply to nwbrown
    nwbrown:
    First, no, the Wikipedia is not that definitive. Second, according to the National Geographic program I watched when I was bored some time ago, discrepancies were found in the area used for carbon dating. It wasn't necessarily fraud, but repairs to the shroud had been made on the area that was tested back in the 16th century, so its very possible the results were wrong. Third, the wikipedia does indeed mention this controversy: http://en.wikipedia.org/wiki/Radiocarbon_14_dating_of_the_Shroud_of_Turin#Chemical_properties_of_the_sample_site Its still not a definitive source. Fourth, something being old does not mean it is a genuine religious relic. Otherwise I could get people to worship the sandwich in my fridge.

    There, everyone now properly offended, or did I miss someone?

    You've probably at least offended all of the everyone-must-share-my-views nutcases on both sides, and that's what really matters.

  • Ouch! (unregistered) in reply to David Allen
    David Allen:
    I've extended this.

    For 6 Replace calls the sequence should be 232, 22, 7, 4, 3, 2. This will handle all cases up to 53,590 contiguous spaces.

    For 7 Replace calls the sequence should be 50426, 232, 22, 7, 4, 3, 2. This will handle all cases up to 199,790,977 contiguous spaces.

    No, fails on 159,699,141:

    Prelude> 159699141 `quotRem` 50426
    (3166,50425)
    Prelude> uncurry (+) it `quotRem` 232
    (230,231)
    Prelude> uncurry (+) it `quotRem` 22
    (20,21)
    Prelude> uncurry (+) it `quotRem` 7
    (5,6)
    Prelude> uncurry (+) it `quotRem` 4
    (2,3)
    Prelude> uncurry (+) it `quotRem` 3
    (1,2)
    Prelude> uncurry (+) it `quotRem` 2
    (1,1)
    Prelude> uncurry (+) it
    2
    

    The best sequence is not unique, you always have two choices (except for the last, which has to be 2), for 6 iterations, {231,232}, {21,22}, {6,7}, {3,4}, {2,3}, 2. The first few:

    Prelude> mapM_ print $ take 10 $ iterate step (2,3)
    (2,3)
    (3,5)
    (4,11)
    (7,41)
    (22,461)
    (232,53591)
    (26797,718052411)
    (359026207,128899816953780641)
    (64449908476890322,4153790702679538920955222740373361)
    (2076895351339769460477611370186682,4313494300416744426870901874924164733839903365825579313972159982441)
    

    Second component is smallest number of contiguous spaces not reduced to a single space by the sequence.

    For now I am unable to calculate the sequence for 8 Replace calls. I've roughly estimated the next size increment to be >35 billion, and that it would handle all cases up to at least ~250 trillion contiguous spaces.
  • Pyrexkidd (unregistered) in reply to The Nerve
    The Nerve:
    Fixed?
     public boolean isBlank(String str) {
      try {
         return str.trim().length() == 0;
      }  
      try_harder{
         return str.trim().length() == "FileNotFound";
      }
      } catch (NullPointerException ex) {
      } 
      return true;
     }// end
    

    FTFY

    Captcha commoveo = What you do to whitespace.

  • Dylan (unregistered)

    The second one is almost a reasonable algorithm. The lack of a regular expression isn't making the code unweildy; it's still short and simple. The problem is that the replacement numbers were clearly not well thought out. If it replaced 3 twice it would be able to handle thousands of spaces in a row, but as it's set up it can barely handle 200 despite replacing up front 100:1. This was not thought through.

  • buiatte (unregistered) in reply to nwbrown
    nwbrown:
    buiatte:
    public boolean isBlank( String str ) {
    return org.apache.commons.lang.StringUtils.isBlank( str );
    

    }

    I am amazed by the fact that most Java developers dont know (or dont care) about commons-lang (or apache commons in general)

    That would have just resulted in a ClassNotFoundException. The code says it was written in '01, commons.lang version 1.0 was released in October of '02.

    You, sir, you got me there.

  • boog (unregistered) in reply to Athiests like you can GTH
    Athiests like you can GTH:
    nwbrown:
    First, no, the Wikipedia is not that definitive. Second, according to the National Geographic program I watched when I was bored some time ago, discrepancies were found in the area used for carbon dating. It wasn't necessarily fraud, but repairs to the shroud had been made on the area that was tested back in the 16th century, so its very possible the results were wrong. Third, the wikipedia does indeed mention this controversy: http://en.wikipedia.org/wiki/Radiocarbon_14_dating_of_the_Shroud_of_Turin#Chemical_properties_of_the_sample_site Its still not a definitive source. Fourth, something being old does not mean it is a genuine religious relic. Otherwise I could get people to worship the sandwich in my fridge.

    There, everyone now properly offended, or did I miss someone?

    Actually, what I was referring to was the Clairton Controversy where Daimon Clairton conspired with 32 other students at Oxford to discredit the authenticity of the Shroud of Turin once and for all. They put out a 287-page report detailing "research" that "proved" that the Shroud was a forgery. This was a front-page story in papers world-wide, as was the blatant censure of the Vatican. Eventually, one of the members admitted that most of the findings were falsified, and upon investigation it was discovered that most of Clairton's cohorts were involved in a "skull and daggers" athiest organization. Clairton lost his tenure, but most of this group walked scott-free. The scandal wasn't quite as popular as the original report, either.
    Unbelievable. No, quite lie-terally.

  • Avery Orwellian (unregistered) in reply to boog
    boog:
    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...

    A few years ago I read a simpler explanation: carbon dating has its flaws, and a major one is that things exposed to high heat while near silver would register as being much younger than they actually are. This would've been first noticed on objects found in Pompeii - there's no arguing that something coated in solidified lava is younger than the vulcan's eruption, regardless of what the carbon says.

    Also according to this source, during the middle ages the shroud's whereabouts are unknown but one major theory is that it was being kept in a monastery that was partially destroyed in a fire. It makes sense that the catholic church would keep one major relic locked in a "vault" with silver and other valuables.

    Note however that, while I do not endorse this source (since I didn't run tests on Pompeii's artifacts or even read this from any other source) and that I can't even remember where I read it, I do agree that this explanation seems plausible and scientifically possible, which is enough to shut up accusations of fraud by both groups.

    Gee, have we just jumped from code discussion to religious bigotry (including atheists, which can be fanatical zealots as much as any theist) in a couple of posts? I feel like I'm on slashdot.

  • boog (unregistered) in reply to Avery Orwellian
    Avery Orwellian:
    boog:
    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...

    A few years ago I read a simpler explanation: carbon dating has its flaws, and a major one is that things exposed to high heat while near silver would register as being much younger than they actually are. This would've been first noticed on objects found in Pompeii - there's no arguing that something coated in solidified lava is younger than the vulcan's eruption, regardless of what the carbon says.

    Also according to this source, during the middle ages the shroud's whereabouts are unknown but one major theory is that it was being kept in a monastery that was partially destroyed in a fire. It makes sense that the catholic church would keep one major relic locked in a "vault" with silver and other valuables.

    Note however that, while I do not endorse this source (since I didn't run tests on Pompeii's artifacts or even read this from any other source) and that I can't even remember where I read it, I do agree that this explanation seems plausible and scientifically possible, which is enough to shut up accusations of fraud by both groups.

    Gee, have we just jumped from code discussion to religious bigotry (including atheists, which can be fanatical zealots as much as any theist) in a couple of posts? I feel like I'm on slashdot.

    I guess that's what happens when people don't get their articles on time. However, I don't see how this counts a "bigotry". There is just a discussion on the authenticity of a piece of cloth. One person made an ignorant claim which was refuted, and then he held fast to his claim despite the fact that it was obviously invalid. It's just a classic case of "the fool who cannot be moved."

  • David Allen (unregistered) in reply to Ouch!
    Ouch!:
    No, fails on 159,699,141:

    Good catch, I made some assumptions in my code, it is very possible I missed that case.

    After my post I started thinking that 50426 handling 199,790,977 contiguous spaces looked hinky. Up to that point the sequence values had been very close to sqrt(first failing case ).

    Ouch!:
    The best sequence is not unique

    I point that out in a previous comment.

    I optimize for two constraints, the first is to maximize the first failing case, and the second is to maximize the total number of cases handled. There appears to be a single optimal answer for this ordered pair of constraints. This appears to be larger value of each of your pairs.

    Nice work.

  • (cs)

    It's always sad when so-called "developers" do not know how to solve a problem with recursion. Not that you even need it here:

    Do While MyString.Contains("  ")
    MyString.Replace("  ","")
    Loop

  • (cs) in reply to Avery Orwellian
    Avery Orwellian:
    A few years ago I read a simpler explanation: carbon dating has its flaws, and a major one is that things exposed to high heat while near silver would register as being much younger than they actually are. This would've been first noticed on objects found in Pompeii - there's no arguing that something coated in solidified lava is younger than the vulcan's eruption, regardless of what the carbon says.

    You meant older, not younger. An item cannot be packaged before it exists.

  • Ol' Bob (unregistered) in reply to Scott Douglas

    Spaces - the final frontier.

  • Ouch! (unregistered) in reply to David Allen
    David Allen:
    Ouch!:
    No, fails on 159,699,141:

    Good catch, I made some assumptions in my code, it is very possible I missed that case.

    After my post I started thinking that 50426 handling 199,790,977 contiguous spaces looked hinky. Up to that point the sequence values had been very close to sqrt(first failing case ).

    To be precise, we have

    rep(1) = 2
    fail(1) = 3
    rep(n+1) = rep(n)*(rep(n)-1)/2 + 1
    fail(n+1) = (fail(n)*(fail(n)+4)-1)/4
    fail(n) = rep(n)*(rep(n)-1) - 1
    rep(n+1) = (fail(n)+3)/2
    
    Ouch!:
    The best sequence is not unique

    I point that out in a previous comment.

    Overlooked that initially, saw it after posting.

    I optimize for two constraints, the first is to maximize the first failing case, and the second is to maximize the total number of cases handled.
    I only considered the first one. It seems likely that the larger choice maximising the first failing case handles more cases overall.
    There appears to be a single optimal answer for this ordered pair of constraints. This appears to be larger value of each of your pairs.

    Nice work.

    Thx.
  • Avery Orwellian (unregistered) in reply to hoodaticus
    hoodaticus:
    Avery Orwellian:
    A few years ago I read a simpler explanation: carbon dating has its flaws, and a major one is that things exposed to high heat while near silver would register as being much younger than they actually are. This would've been first noticed on objects found in Pompeii - there's no arguing that something coated in solidified lava is younger than the vulcan's eruption, regardless of what the carbon says.

    You meant older, not younger. An item cannot be packaged before it exists.

    Whoops, my bad.

  • (cs) in reply to Dirge
    Dirge:
    VB6 may not have built-in support for regular expressions, but VBScript does, and VB6 can reference the VBScript library to allow coders to use regular expressions - see http://www.regular-expressions.info/vb.html ...

    That is one of the most perverse statements I have ever read.

    Anyone still coding in VB6 should be shot, either for willingly using VB6, or to mercifully put them out of their misery.

    Anyone demanding new code in VB6 (instead of a port to something better) should be slowly tortured to death for the sake of poetic justice.

  • (cs) in reply to Avery Orwellian
    Avery Orwellian:
    hoodaticus:
    Avery Orwellian:
    A few years ago I read a simpler explanation: carbon dating has its flaws, and a major one is that things exposed to high heat while near silver would register as being much younger than they actually are. This would've been first noticed on objects found in Pompeii - there's no arguing that something coated in solidified lava is younger than the vulcan's eruption, regardless of what the carbon says.

    You meant older, not younger. An item cannot be packaged before it exists.

    Whoops, my bad.

    I loved the comment, though. Most people lack the curiosity to apply common sense in questioning "scientific" conclusions.

  • (cs) in reply to JSelf
    JSelf:
    Adam:
    Is string unwanted 1,2,3 or 10 char long? Im amazed how you an spend time and figure out something like that and Not start thinking that this might not be the right way doing it.

    CLEARLY the dev should have loaded them into an array...

    GOOD ONE! I do all my string processing with the whole string in memory, too. Nothing could possibly go wrong...

    [OUT OF MEMORY]

  • Avery Orwellian (unregistered) in reply to hoodaticus
    hoodaticus:
    I loved the comment, though. Most people lack the curiosity to apply common sense in questioning "scientific" conclusions.
    Thanks, man. Out of curiosity I looked at wikipedia's article and saw that at least part of my source's claims is undisputably true: the shroud was scorched due to contact with molten silver in 1532 in a chapel in Chambery, France. Still cannot issue a verdict whether this is a true/false/file_not_found claim until we know that silver really screws up carbon dating.
  • (cs) in reply to hoodaticus
    hoodaticus:
    It's always sad when so-called "developers" do not know how to solve a problem with recursion. Not that you even need it here:
    Do While MyString.Contains("  ")
         MyString.Replace("  ","")
    Loop
    It's always sad when so-called "developers" do not know how to solve a problem efficiently. Here is a quicker version of your easy algorithm.
    int currentLength;
    int previousLength;
    do
    {
      previousLength = myString.Length;
      myString.Replace("  ", " "); // Notice the space
      currentLength = myString.Length;
    }while(previousLength != currentLength);
    

    Of course the most efficient is something like this:

    bool lastCharIsSpace = false;
    StringBuilder sb = new StringBuilder(myString.Length);
    foreach(char c in myString)
    {
      if(c == ' ')
      {
        if(!lastCharIsSpace)
        {
          sb.Append(c);
          lastCharIsSpace = true;
        }
      }
      else
      {
        sb.Append(c);
        lastCharIsSpace = false;
      }
    }
    

    (use arrays to your liking)

  • Turin-Incomplete (unregistered) in reply to Athiests like you can GTH
    Athiests like you can GTHT:
    Actually, what I was referring to was the Clairton Controversy where Daimon Clairton conspired with 32 other students at Oxford to discredit the authenticity of the Shroud of Turin once and for all. They put out a 287-page report detailing "research" that "proved" that the Shroud was a forgery. This was a front-page story in papers world-wide, as was the blatant censure of the Vatican. Eventually, one of the members admitted that most of the findings were falsified, and upon investigation it was discovered that most of Clairton's cohorts were involved in a "skull and daggers" athiest organization. Clairton lost his tenure, but most of this group walked scott-free. The scandal wasn't quite as popular as the original report, either.
    Funny how Google turns up absolutely nothing about that, not even the name Daimon Clairton. I call shenanigans.
  • (cs) in reply to Turin-Incomplete
    Turin-Incomplete:
    Athiests like you can GTHT:
    Actually, what I was referring to was the Clairton Controversy where Daimon Clairton conspired with 32 other students at Oxford to discredit the authenticity of the Shroud of Turin once and for all. They put out a 287-page report detailing "research" that "proved" that the Shroud was a forgery. This was a front-page story in papers world-wide, as was the blatant censure of the Vatican. Eventually, one of the members admitted that most of the findings were falsified, and upon investigation it was discovered that most of Clairton's cohorts were involved in a "skull and daggers" athiest organization. Clairton lost his tenure, but most of this group walked scott-free. The scandal wasn't quite as popular as the original report, either.
    Funny how Google turns up absolutely nothing about that, not even the name Daimon Clairton. I call shenanigans.
    If there really were a conspiracy involving some guy named Daimon Clairton falsifying research on the Shroud of Turin (valid or otherwise), I would expect the net to be full of conspiracy theory websites. The only conclusion I can think think of to explain it is that he made the name up on the spot, indicating he doesn't believe a thing he is saying, which means he's nothing more than a troll who has successfully gotten us to waste time replying to him.
  • Athiests like you can GTHT (unregistered) in reply to nwbrown
    nwbrown:
    Turin-Incomplete:
    Athiests like you can GTHT:
    Actually, what I was referring to was the Clairton Controversy where Daimon Clairton conspired with 32 other students at Oxford to discredit the authenticity of the Shroud of Turin once and for all. They put out a 287-page report detailing "research" that "proved" that the Shroud was a forgery. This was a front-page story in papers world-wide, as was the blatant censure of the Vatican. Eventually, one of the members admitted that most of the findings were falsified, and upon investigation it was discovered that most of Clairton's cohorts were involved in a "skull and daggers" athiest organization. Clairton lost his tenure, but most of this group walked scott-free. The scandal wasn't quite as popular as the original report, either.
    Funny how Google turns up absolutely nothing about that, not even the name Daimon Clairton. I call shenanigans.
    If there really were a conspiracy involving some guy named Daimon Clairton falsifying research on the Shroud of Turin (valid or otherwise), I would expect the net to be full of conspiracy theory websites. The only conclusion I can think think of to explain it is that he made the name up on the spot, indicating he doesn't believe a thing he is saying, which means he's nothing more than a troll who has successfully gotten us to waste time replying to him.
    It sounds like "da web" is your almighty god, and I guess if you have faith in it, I will have no way to persuade you. Never mind that it's a full section in the 2009 edition of the Encyclopedia Britainica: the guys that wrote that were just hacks anyway.

    But since the Internet is your god, I will answer you on his terms. Go to snopes.com, and you will see no article refuting the Clairton Controversy. Barring that, I don't invite boors over to my house to view my Encyclopedias...you'll have to make a stop at your local library.

  • ysth (unregistered)

    I thought the replace logic was fairly straightforward.

  • Lee (unregistered) in reply to TGV

    StringUtils is a very common (pardon the pun) code lib to use, i've been using it for ages and i'm sure that I could probably find a large number of developers who use it on a routine basis :-)

  • (cs) in reply to Athiests like you can GTHT
    Athiests like you can GTHT:
    But since the Internet is your god, I will answer you on his terms. Go to snopes.com, and you will see no article refuting the Clairton Controversy.
    There it is again: there's no article on snopes.com refuting the controversy, therefore it must be true.

    Interesting logic, yessiree...

Leave a comment on “Double Spaced”

Log In or post as a guest

Replying to comment #:

« Return to Article