Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

Perl sucks

Name: Anonymous 2011-05-26 17:53

Writing code from scratch is for idiots.  ALWAYS look for pre-existing code and ALWAYS try and improve up on it, but doing a project from scratch is stupid and will only lead to headaches. 

That is why perl is a bad language because perl programmers can't read each others codee

Name: Anonymous 2011-05-26 18:01

Being a dog sucks

Chasing cars is for idiots.  ALWAYS look for pre-existing cars and ALWAYS try and improve up on them, but starting a race from inertia is stupid and will only lead to headaches.

That is why woofs are a bad language because dogs can't sniff each others anuss

Name: Anonymous 2011-05-26 18:08

I like Perl.

Name: Anonymous 2011-05-26 18:10

I like dog anus.

Name: Anonymous 2011-05-26 18:37

OP is jelly he doesn't know perl.

Name: Anonymous 2011-05-26 19:00

What kind of idiot can't read perl code?

Name: Anonymous 2011-05-26 19:30

>>6
Bravo, and well played my Goodly Sir. The truth is always apropos.

Name: Anonymous 2011-05-26 19:37

That is why Haskell is a bad language because Haskell programmers can't read each others codee

Name: Anonymous 2011-05-26 19:43

That is why Lisp is a bad language because Lisp programmers can't read, eval, print or loop each others codee

Name: Anonymous 2011-05-26 19:52

That is why Lisp is a good language because Lisp programmers can read, macroexpand and eval each others codee

Name: Anonymous 2011-05-26 19:53

>>10
That is why Lisp is a bad language because Lisp programmers can read, macroexpand and eval each others codee

Name: Anonymous 2011-05-26 19:54

>>10
That is why C is a bad language because C programmers caSegmentation fault.

Name: Anonymous 2011-05-26 20:10

Lisp:

isInfixOf f [@_ Xs:_:@f @_] -> Xs


Haskell:

isInfixOf :: ByteString -> ByteString -> Bool
isInfixOf p s = isJust (findSubstring p s)

findSubstring :: ByteString -> ByteString -> Maybe Int
findSubstring f i = listToMaybe (findSubstrings f i)

findSubstrings :: ByteString -> ByteString -> [Int]
findSubstrings pat str
    | null pat         = [0 .. length str]
    | otherwise        = search 0 str
  where
    STRICT2(search)
    search n s
        | null s             = []
        | pat `isPrefixOf` s = n : search (n+1) (unsafeTail s)
        | otherwise          =     search (n+1) (unsafeTail s)

Name: The Postyawner 2011-05-26 20:32

>>13
I am taking a yawn at your post. Mwwoooaaaaaaaahh.

Name: Anonymous 2011-05-26 20:59

>>14
C/C++

isInfixOf(char *p, char *s) {char *q = p, *t = s;
                             if(!*s) return 0;
                             while(*q && *q == *t) q++, t++;
                             if(!*q) return 1;
                             return isInfixOf(p, s+1);}


Haskell

isInfixOf :: ByteString -> ByteString -> Bool
isInfixOf p s = isJust (findSubstring p s)

findSubstring :: ByteString -> ByteString -> Maybe Int
findSubstring f i = listToMaybe (findSubstrings f i)

findSubstrings :: ByteString -> ByteString -> [Int]
findSubstrings pat str
    | null pat         = [0 .. length str]
    | otherwise        = search 0 str
  where
    STRICT2(search)
    search n s
        | null s             = []
        | pat `isPrefixOf` s = n : search (n+1) (unsafeTail s)
        | otherwise          =     search (n+1) (unsafeTail s)

Name: Anonymous 2011-05-27 7:18

>>15
Okay, that was slightly more interesting. But you left out the case where both arguments are null strings in the C++ version.

Name: Anonymous 2011-05-27 7:46

>>16
if(!*s) return 0;
while(*q

Don't change these.
Name: Email:
Entire Thread Thread List