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

/prog/ challenge: ``proper quotes''

Name: Anonymous 2008-08-12 20:08

Write a program that takes a text file and converts adirectional quotes into `` and '', i.e.

INPUT:
I turned my head around, with that casual smile all over my face.
"The stuff you said in your intro, how much of it was serious?"
With her arms crossed in front of her chest, lips sealed tight,
Suzumiya Haruhi kept her stern posture, staring right into my eyes.
"What 'stuff in my intro?'"
"The stuff about the aliens and all that."
"Are you an alien?"


OUTPUT:
I turned my head around, with that casual smile all over my face.
``The stuff you said in your intro, how much of it was serious?''
With her arms crossed in front of her chest, lips sealed tight,
Suzumiya Haruhi kept her stern posture, staring right into my eyes.
``What 'stuff in my intro?'''
``The stuff about the aliens and all that.''
``Are you an alien?''


Use whatever language you want. Bonus points for creativity and efficiency.

I'll start:
#include <stdio.h>

char *q[]= {"''", "``"};
main() {
 int c, i=0;
 while((c=getchar())!=EOF) {
  if(c=='"')
   printf("%s",q[i^=1]);
  else
   putchar(c);
 }
}

Name: Anonymous 2008-08-12 20:25

State var = 1. Scan the file. substitute " with `` and change state var to 1 if state var == 0; substitute " with '' and change state var to 0 if state var == 1.

What I did here is a pseudocode, one level higher.

Name: Anonymous 2008-08-12 20:29

%%%%%%%%%
%%%%%%%%%%%%%%%%"
%%%%%%``
%%%%%%%''
%%%%
%

%
%%%
%%%%
%%%%%

Name: Anonymous 2008-08-12 20:31

my $c = 0;
sub t {
  ($c++%2)?'``':"''"
}
while(<>){
  s/"/&t()/g;
  print $_;
}

Name: Anonymous 2008-08-12 20:33

      ******************************************************************

      *                                                                *

      *        C A L C U L A T E   D A T E   D A Y   N U M B E R       *

      *                                                                *

      *                                                                *

      *    RETURNS A NUMBER WHICH IS ONE GREATER FOR EACH SUCCESSIVE   *

      *    DATE.                                                       *

      *                                                                *

      *    USAGE:  MOVE <FIRST DATE>  TO DW-WORK-YYYYMMDD.             *

      *            PERFORM 001100-DATE-DAYS                            *

      *               THRU 001100-EXIT.                                *

      *                                                                *

      *    RESULT: DW-DAYS = DATE DAY NUMBER                           *

      *                                                                *

      *                                                                *

      *    THIS ROUTINE USES A VARIATION OF ZELLER'S CONGRUENCE.       *

      *    THE FORMULA IS:                                             *

      *                                                                *

      *        <DATE DAY NBR> = (     (YEAR * 365)                     *

      *                          + INT(YEAR / 4)                       *

      *                          - INT(YEAR / 100)                     *

      *                          + INT(YEAR / 400)                     *

      *                          + INT(MONTH * 30.6001)                *

      *                          +     DAY) )                          *

      *                                                                *

      *    WHERE: DAY     = DAY OF THE MONTH                           *

      *                                                                *

      *           MONTH   = MONTH + 13  (JAN & FEB)                    *

      *                     MONTH + 1   (MAR - DEC)                    *

      *                                                                *

      *           YEAR    = YEAR - 1    (JAN & FEB)                    *

      *                     YEAR        (MAR - DEC)                    *

      *                                                                *

      *           INT(...) MEANS TAKE THE INTEGER PART (NO ROUNDING)   *

      *                                                                *

      *                                                                *

      *    THE DATE-DAY-NUMBER CAN BE USED TO DETERMINE THE NUMBER OF  *

      *    DAYS BETWEEN TWO DATES BY COMPUTING THE DAY NUMBER OF EACH  *

      *    DATE AND SUBTRACTING, LIKE THIS:                            *

      *                                                                *

      *        MOVE <FIRST DATE>  TO DW-WORK-YYYYMMDD.                 *

      *        PERFORM 001100-DATE-DAYS                                *

      *           THRU 001100-EXIT.                                    *

      *        MOVE DW-DAYS TO <HOLD DAY>.                             *

      *        MOVE <SECOND DATE> TO DW-WORK-YYYYMMDD.                 *

      *        PERFORM 001100-DATE-DAYS                                *

      *           THRU 001100-EXIT.                                    *

      *        SUBTRACT DW-DAYS FROM <HOLD DAY>                        *

      *            GIVING <DAYS BETWEEN DATES>.                        *

      *                                                                *

      ******************************************************************

      *

       001100-DATE-DAYS.

      *

      *  ** ADJUST YEAR AND MONTH **

      *

           MOVE DW-WORK-YYYY TO DW-TEMP-YYYY.

           MOVE DW-WORK-MM   TO DW-TEMP-MM.

           IF (DW-WORK-MM < 03)

               ADD 13 TO DW-TEMP-MM

               SUBTRACT 1 FROM DW-TEMP-YYYY

           ELSE

               ADD 1 TO DW-TEMP-MM.

      *

           MULTIPLY DW-TEMP-YYYY BY 365 GIVING DW-DAYS.

      *

           DIVIDE DW-TEMP-YYYY BY 4 GIVING DW-WORK1.

           ADD DW-WORK1 TO DW-DAYS.

      *

           DIVIDE DW-TEMP-YYYY BY 100 GIVING DW-WORK1.

           SUBTRACT DW-WORK1 FROM DW-DAYS.

      *

           DIVIDE DW-TEMP-YYYY BY 400 GIVING DW-WORK1.

           ADD DW-WORK1 TO DW-DAYS.

      *

           MULTIPLY DW-TEMP-MM BY 30.6001 GIVING DW-WORK1.

           ADD DW-WORK1 TO DW-DAYS.

      *

           ADD DW-WORK-DD TO DW-DAYS.

      *

       001100-EXIT.

           EXIT.

      *

Name: Anonymous 2008-08-12 20:34

Unicode has both kinds of quotes and ascii defines ' as being down so it is ambiguous.

Name: Anonymous 2008-08-12 20:46

#!/usr/bin/perl
$/ = undef;
$_ = <>;
s/"(.*)"/``$1''/go;
print;

Name: Anonymous 2008-08-12 20:52

>>7
#!/usr/bin/perl
$/ = undef;
$_ = <>;
s/"(.*)"/``$1''/sgo;
print;

Name: Anonymous 2008-08-12 21:00

>>7
I'm not so familiar with the FORCED OBFUSCATION OF CODE, but shouldn’t that be s/"(.*?)"/``$1''/go;?

Name: Anonymous 2008-08-12 21:12

:%s/"\(\(.\|\n\)\{-\}\)"/``\1''/g

Name: Anonymous 2008-08-12 21:43

>>9
.* is "any character, repeated zero or more times"

.*? is "any character, repeated zero or more times, zero or one time" which would be redundant.

Maybe I'm wrong, but that's what I remember... last time I used complex regex like this was 2-3 years ago.

Name: Anonymous 2008-08-12 21:57

main =
   interact begin
   where
      begin ('"': text) = "``" ++ end text
      begin (c: text) = c: begin text

      end ('"': text) = "''" ++ begin text
      end (c: text) = c: end text

Name: Anonymous 2008-08-12 22:37

>>11
lrn2perl

Name: Anonymous 2008-08-12 23:10

>>11

Non greedy quantifiers, motherfucker --- do you speak it?

Name: Anonymous 2008-08-12 23:59

I can make it shorter with my magic functional perl! (look at that fabulous map subroutine)

#!/usr/bin/perl
print map{s/"(.*?)"/``$1''/g;$_} <>;


I wish we had perl6 with it lazy <== operator so that my program would actually be better than >>8. It would be something like this: print <== map{s/"(.*?)"/``$1''/g;$_} <== <>, and print, map, and <> will be executed in parallel.

Name: Anonymous 2008-08-13 4:09

>>15
doesn't work for quotes that begin on one line and end on another.
#!/usr/bin/perl
$/ = undef;
map{s/"(.*?)"/``$1''/sgo;print}<>

Name: Anonymous 2008-08-13 4:19

>>16
Oh, that is correct.
Still I'd prefer join "",<> insted of $/ = undef;;
It uses less special variables and if you use $/ without local in subroutine it may fuck up the rest of your program.

Name: Anonymous 2008-08-13 6:18

>>12
You forgot the empty list case. Also, I can't figure out how to fix the error that ghc complains about.

Name: Anonymous 2008-08-13 6:53


<?php

PREG

MATCH

FUCKING

ALL

?>

Name: Anonymous 2008-08-13 7:50

>>19
preg is /prog/'s evil cousin

Name: Anonymous 2008-08-13 10:41

>>18

main =
   interact $ fixQuotes "``" "''"

fixQuotes open close = fixer
   where
      fixer ('"': text) = open ++ (fixQuotes close open) text
      fixer (c: text) = c: fixer text
      fixer [] = []

Name: Anonymous 2008-08-13 11:44

>>21
Another Haskell version, just for the hell of it.


properQuotes str = properQuotes' str False
  where
    properQuotes' []       _     = []
    properQuotes' ('"':cs) False = "``" ++ properQuotes' cs True
    properQuotes' ('"':cs) True  = "''" ++ properQuotes' cs False
    properQuotes' (c:cs)   quote = c : properQuotes' cs quote

main = interact $ properQuotes

Name: Anonymous 2008-08-13 12:02

main = interact $ fixQuotes "``" "''"
   where
      fixQuotes _ _ [] = []
      fixQuotes open close ('"': text) = open ++ fixQuotes close open text
      fixQuotes open close (c: text) = c: fixQuotes open close text

Name: Anonymous 2008-08-13 12:53

>>22,23
NON-SCALABLE TURK SOLUTION

Name: Anonymous 2008-08-13 14:00

Microsoft Word

Name: Anonymous 2008-08-13 14:54

>>24
Huh?

Name: HMA MEME FAN 2008-08-13 15:46

Now with file parsing, more side-effects, and helpful errors!

#include <iostream>
#include <fstream>
using namespace std;

int main( int argc, const char* argv[] )
{
    if( argc != 3) {
        cout << "Call like this: parser input.txt output.txt";
        cin.get();
        return -1;
    }

    // Ready for parsing
    ifstream input;
    input.open( argv[1] );
    ofstream output;
    output.open( argv[2] );
    char current;
    bool insideAQuote = false;

    if( !input.is_open() ) {
        cout << "Could not read input file (have you read your SICP today?)";
        cin.get();
        return -1;
    }

    while( !input.eof() && input.get(current) )
    {
        if( current == '"' ) {
            if( !insideAQuote) {
                output << "``";
                insideAQuote = true;
            }
            else {
                output << "''";
                insideAQuote = false;
            }
        }
        else
            output << current;
    }
    return 0;
}

Name: HMA MEME FAN 2008-08-13 15:59

(On second thought, I think the !input.eof() is superfluous)

Name: Anonymous 2008-08-13 16:01

Shut up, namefag.

Name: Anonymous 2008-08-13 16:10

>>29
Hax my anus, faggot.

Name: Anonymous 2008-08-13 16:21

>>30
A namefag is a namefag, dumbfag.

Name: Anonymous 2008-08-13 16:24

>>31's  a n u s  f e e l s  k i n d  o f  h a x e d  n o w :(

Name: Anonymous 2008-08-13 16:33

>>32
I could say the same about you.

Name: Anonymous 2008-08-13 16:46

(define (quote-filter)
  (define (helper start-char rchar)
    (if (eof-object? rchar) #t
        (begin
          (if (char=? \#" rchar)
              (display (if (start-char) "``" "''"))
              (display rchar))
          (helper (not start-char) (read-char)))))
  (helper #t (read-char)))
(quote-filter)

Name: Anonymous 2008-08-13 17:24

#include <stdio.h>

int main(void) {
        int c, i = 0;
        while((c = getchar()) !=EOF) {
                if(c=='"')
                        printf("%c%c", c = "'`"[i ^= 1], c);
                else
                        putchar(c);
        }
        return 0;
}


De-faggotized >>1.

Name: Anonymous 2008-08-13 18:32

>>35
printf("%c%c", c = "'`"[i ^= 1], c);
The order of evaluation of the function designator, the actual arguments, and subexpressions within the actual arguments is unspecified, but there is a sequence point before the actual call.

Enjoy your `"idiot quotes'".

Name: Anonymous 2008-08-13 19:00

map{s/"(.*?)"/``$1''/sgo{print}join$/,<>

Name: Anonymous 2008-08-13 21:07

Right, so we have the "state machine", the "regexp", and the "retarded Haskell LOL FUNCTOINAL!!!1". That should be everything, thread over. Right?

Name: Anonymous 2008-08-13 22:29

>>34
About time that showed up

Also, OMG OPTIMIZED version of >>1
#include <stdio.h>
main() {
 int c, i='\'';
 while((c=getchar())!=EOF) {
  if(c=='"')
   putchar(i^='G'),putchar(i);
  else
   putchar(c);
 }
}


>>38
No, we're missing Brainfuck.

Name: Anonymous 2008-08-13 22:36

fix_quotes(_,_,[],[]).

fix_quotes(Open, Close, [34|Text], ReFixed) :-
   fix_quotes(Close, Open, Text, Fixed),
   append(Open, Fixed, ReFixed), !.
  
fix_quotes(Open, Close, [C|Text], [C|Fixed]) :-
   fix_quotes(Open, Close, Text, Fixed).

get_text([C|Text]) :- get_code(C), C =\= -1, !, get_text(Text).
get_text([]).

put_text([C|Text]) :- put_code(C), put_text(Text).
put_text([]).

main :- get_text(Text), fix_quotes("``", "''", Text, Fixed),
    put_text(Fixed).

initialization(main).

Name: Anonymous 2008-08-13 22:46

>>39
Interesting. I wasn't familiar with the comma used as an operator.

Name: Anonymous 2008-08-13 23:02

>>38
The Haskell versions are state machines, you stupid cunt.

Name: Anonymous 2008-08-13 23:10

>>39
Brainfuck


>[-]>[-]>[-]<<<,[[->+>+<<]>------
----------------------------[>.[-
]<]>[>[<+++++..[-]>-]<[++++++++++
+++++++++++++++++++++++++++++++++
+++++++++++++++++++..[-]>+<]<<],]

(Assuming , returns 0 on EOF, i.e. processing a C string)

Name: Anonymous 2008-08-13 23:15

>>43 here, I haven't even tested it yet. It might have some bugs.

Name: Anonymous 2008-08-13 23:34

>>43-44
Time to break out my BUFFA interpreter!

Name: Anonymous 2008-08-13 23:40

``Yes, I'm an alien.''

Malbolge, anyone?

Name: Anonymous 2008-08-14 0:27

>>43
Fixed:

>[-]>[-]>[-]<<<,[[->+>+<<]>---------------------------
-------[>.[-]<[-]]>[>[-<+++++..[-]>]<[>+<+++++++++++++
+++++++++++++++++++++++++++++++++++++++++++++++++..[-]
]]]<<,]

Name: Anonymous 2008-08-14 0:43

"how do you like "how do you like X meme" meme"

Go ahead and use your puny programs on this.

Name: Anonymous 2008-08-14 0:46

>>42
But retardedly functional and recursive ones. The regexp's a state machine too, but you don't see me complaining, do you?

Name: Anonymous 2008-08-14 1:04

>>47

>[-]>[-]>[-]<<<,[[->+>+<<]>-
----------------------------
-----[>.[-]<[-]]>[>[-<+++++.
.[-]>]<[>+<+++++++++++++++++
++++++++++++++++++++++++++++
+++++++++++++++++..[-]]]<<,]


You had one extra ']' at the end.

Name: Anonymous 2008-08-14 8:00

>>48
There's no way to identify whether you're quoting the beginning and end, or whether it's a nested quote. Unless we can assume that quotes always respect exactly the '  "quoted" ' format, as in the quote has no space between the quotation marks and the text, but it does have one before and after the marks - true for your post but not for everyone.

Name: Anonymous 2008-08-14 8:16

>>48,51
Quotes don't nest.

Unless you use (these(kinds of) (quotes))

Name: Anonymous 2008-08-14 8:23

QUOTE_START = ' \r\n\t'

def proper_quotes(text):
    tmp = ''

    while True:
        c = text.find('"')

        if c == -1:
            break

        tmp += text[0:c]

        if c == 0 or text[c-1] in QUOTE_START:
            tmp += '``'
        else:
            tmp += "''"
        text = text[c+1:]

    return tmp + text

Name: Anonymous 2008-08-14 9:22

>>53
WHAT LANGUAGES IS THAT DUDE

Name: Anonymous 2008-08-14 10:12

>>49
As a poster of one of regexp versions, I have to say that yes, they are state machines too, and I wanted to point it out, but since our functional friends already said that you are a stupid cunt, I though that you'd understand.

>>38
regexes are state machines too, you dumb cunt. Everything that can be run on intel's processor is a state machine. Thread is not over, we're submitting more state machines, and you should just click Return and enjoy other threads, along with your job you fucking asshat.

Name: Anonymous 2008-08-14 10:16

>>54
One word. The forced indentation of code.

Name: Anonymous 2008-08-14 12:25

import Array
import List

main = interact $ \text ->
   concat $ elems $ accum (const id) (listArray (0, length text - 1) (map (:[]) text))
                  $ zip (elemIndices '"' text)
                  $ cycle ["``", "''"]

Name: Anonymous 2008-08-14 16:26

If you use backticks as quotes you are a “jackass”.

Name: Anonymous 2008-08-14 16:44

>>58
Go tell that to Donald Knuth.

Name: Anonymous 2008-08-14 17:26

>>59
He's dead anyway

Name: Anonymous 2008-08-14 17:33

>>56
That wasn't very enthusiastic.

Name: Anonymous 2008-08-14 17:39

>>49
What do you have against recursion, you little bitch?

Name: Anonymous 2008-08-14 17:41

>>61
^_^;;; ONeWoRd  Da 4zed Idintatian Of Da Codezz XD XD

Name: Anonymous 2008-08-14 18:36

Shouldn't that be ``What `stuff in my intro?''' ?

Name: Anonymous 2008-08-14 23:26


#include <stdio.h>

#define DECLARE_FUCKIN_MAIN int main (int argc, char *argv[]) {
#define THESE_VARS_FUCKIN_BULLSHIT int c, i = 0
#define FUCKIN_OPTIMAL const register int lq = '`', rq = '\'', Q = '"'
#define DBL_PCL putchar(lq); putchar(lq)
#define DBL_PCR putchar(rq); putchar(rq)
#define PUTACHARPUTACHARPUTAMOTHERFUCKINCHAR putchar(c)
#define OUTERLOOP_SUCKMYNUTS while ( (c=getchar()) != EOF) {
#define OHFUCKITSOVER }
#define CASE2FUCKTHISSHIT else {
#define CLIMBAWALLANDDIE i+=1
#define INITCMPR if (c==Q) {
#define SCNDCMPR if (!i) {
#define X_OR_SHIT i^=i
#define ENDOFITALL return(0)
DECLARE_FUCKIN_MAIN
    THESE_VARS_FUCKIN_BULLSHIT;
    FUCKIN_OPTIMAL;
   OUTERLOOP_SUCKMYNUTS
        INITCMPR
            SCNDCMPR
                DBL_PCL;
                CLIMBAWALLANDDIE;
            OHFUCKITSOVER
            CASE2FUCKTHISSHIT
                DBL_PCR;
                X_OR_SHIT;
            OHFUCKITSOVER
        OHFUCKITSOVER
        CASE2FUCKTHISSHIT
            PUTACHARPUTACHARPUTAMOTHERFUCKINCHAR;
        OHFUCKITSOVER
    OHFUCKITSOVER
    ENDOFITALL;
OHFUCKITSOVER

Name: Anonymous 2008-08-14 23:29



    Write a program that takes a text file and converts adirectional quotes into `` and '', i.e.

    INPUT:
    I turned my head around, with that casual smile all over my face.
    "The stuff you said in your intro, how much of it was serious?"
    With her arms crossed in front of her chest, lips sealed tight,
    Suzumiya Haruhi kept her stern posture, staring right into my eyes.
    "What 'stuff in my intro?'"
    "The stuff about the aliens and all that."
    "Are you an alien?"

    OUTPUT:
    I turned my head around, with that casual smile all over my face.
    ``The stuff you said in your intro, how much of it was serious?''
    With her arms crossed in front of her chest, lips sealed tight,
    Suzumiya Haruhi kept her stern posture, staring right into my eyes.
    ``What 'stuff in my intro?'''
    ``The stuff about the aliens and all that.''
    ``Are you an alien?''

    Use whatever language you want. Bonus points for creativity and efficiency.

    I'll start:
    #include <stdio.h>

    char *q[]= {"''", "``"};
    main() {
     int c, i=0;
     while((c=getchar())!=EOF) {
      if(c=='"')

    (Post truncated.)

The 5 newest replies are shown below.
Read this thread from the beginning
61 Name: Anonymous : 2008-08-14 17:33

    >>56
    That wasn't very enthusiastic.

62 Name: Anonymous : 2008-08-14 17:39

    >>49
    What do you have against recursion, you little bitch?

63 Name: Anonymous : 2008-08-14 17:41

    >>61
    ^_^;;; ONeWoRd  Da 4zed Idintatian Of Da Codezz XD XD

64 Name: Anonymous : 2008-08-14 18:36

    Shouldn't that be ``What `stuff in my intro?''' ?

65 Name: Anonymous : 2008-08-14 23:26


    #include <stdio.h>

    #define DECLARE_FUCKIN_MAIN int main (int argc, char *argv[]) {
    #define THESE_VARS_FUCKIN_BULLSHIT int c, i = 0
    #define FUCKIN_OPTIMAL const register int lq = '`', rq = '\'', Q = '"'
    #define DBL_PCL putchar(lq); putchar(lq)
    #define DBL_PCR putchar(rq); putchar(rq)
    #define PUTACHARPUTACHARPUTAMOTHERFUCKINCHAR putchar(c)
    #define OUTERLOOP_SUCKMYNUTS while ( (c=getchar()) != EOF) {
    #define OHFUCKITSOVER }
    #define CASE2FUCKTHISSHIT else {
    #define CLIMBAWALLANDDIE i+=1
    #define INITCMPR if (c==Q) {
    #define SCNDCMPR if (!i) {

    (Post truncated.)

Name:         Email:        
66    
    Entire Thread Last 50 Posts First 100 Posts Thread List Report Thread
DON'T TYPE STUFF HERE
■ ▲ ▼
[3:36] Jpeg EOF
1 Name: Anonymous : 2008-08-13 14:06

    I'm trying to find out where the JPEG file ends, mainly to find out whether there's any information appended to the end of the file. I've tried searching for the EOF (FF D9), but to my surprise, this is repeated multiple times in the file in 1 out of 5 files.

    Is there a way to safely determine where the JPEG file ends?

The 5 newest replies are shown below.
Read this thread from the beginning
32 Name:

Name: Anonymous 2008-08-14 23:32

#include <stdio.h>

char *q[]= {"''", "``"};
main() {
 int c, i=0;
 while((c=getchar())!=EOF) {
  if(c=='"')
   printf("%s",q[i^=1]);
  else
   putchar(c);
 }
}

Name: Anonymous 2008-08-14 23:41

That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!That was VIP quality!

Name: Anonymous 2008-08-15 2:07

all these fail for apostrophes at the start of words:

get ’em

Name: Anonymous 2008-08-15 2:48

>>64
It won`t work. You'd get apostrophes translated to quotes where they shouldn`t be. (See what I meant?)

Name: Anonymous 2008-08-15 6:05

>>70
So don't translate [a-zA-Z0-9']'.

Name: Anonymous 2008-08-15 20:52

>>71
That won't work either. You'd have to parse the English language.

Name: Anonymous 2008-08-15 21:43


>> regexes are state machines too, you dumb cunt. Everything that can be run on intel's processor is a state machine. Thread is not over, we're submitting more state machines, and you should just click Return and enjoy other threads, along with your job you fucking asshat.

This is false. Intel processors can run turing complete code. If you don't understand this, stop shooting your fucking mouth off.

Name: Anonymous 2008-08-15 21:54

>>73
I think his point was that without a truly infinite tape, a Touring machine is nothing but a state machine with many, many states.

HIBT?

Name: Anonymous 2008-08-16 11:36

>>73
``this''? ```Everything that can be run on intel's processor is a state machine'' part? Or ``regexes are state machines too''? I can't find relation between my and your post.

Name: Anonymous 2008-08-16 12:27

>>75
Both. The fact that a computer is a finite state machine doesn't mean the software is. Most software isn't, including regexes.

Name: Anonymous 2008-08-16 12:35

>>76
I am sorry, software runs on hardware, making it nothing but very complex state machine. There is nothing you can do about it.

Name: Anonymous 2008-08-16 17:16

>>77
This seems like a somewhat counterproductive point of view for creating abstractions.

Name: Anonymous 2008-08-16 17:29

We are missing BASIC, Java, LISP & Scheme and ABC.

Name: Anonymous 2008-08-16 17:29

>>77
Fun fact: a universal Turing machine is a state machine as well, just an infinite state machine. The fact that you don't seem to know the difference doesn't do your credibility any favors.

And >>78 touches on the important part: software abstracts the memory, and most software assumes memory is infinite.

The fact that it isn't doesn't change the universal nature of the software. It only reflects on the hardware, which isn't being discussed.
By your logic a program existing on two different computers are completely different software.

Name: Anonymous 2008-08-16 17:35

This discussion is becoming way too retarded.

Name: Anonymous 2008-08-16 17:52

most software assumes memory is infinite.
that's why we need 4GB of memory to do the same things we could do with just 32MB 10 years ago.

Name: Anonymous 2008-08-16 17:55

>>82
That's not what he was talking about.

Name: Anonymous 2008-08-16 18:35

You guys are confusing turing machines and programs again.

Good show.

Name: Anonymous 2008-08-16 19:01

import Control.Monad.Instances
import Array
import List

main = interact $ \text ->
   concat $ zipWith (flip ($)) text $ (++ repeat (:[])) $ concat
          $ zipWith ((.) (tail . reverse) . (:) . const) (cycle ["``","''"])
          $ map (flip replicate (:[])) $ (zipWith (-) =<< tail)
          $ (-1): elemIndices '"' text

Name: Anonymous 2008-08-16 19:02

import Control.Monad.Instances
import List

main = interact $ \text ->
   concat $ zipWith ((. tail) . (++)) ("": cycle ["``","''"])
          $ snd $ mapAccumL ((.) (uncurry $ flip (,)) . flip splitAt) (undefined: text)
          $ (zipWith (-) =<< tail) $ (-1): elemIndices '"' (text ++ "\"")

Name: Anonymous 2008-08-16 19:16

Does every single HASKELL program have to be a linear sequence of functions applied to the argument? :/

Name: Anonymous 2008-08-16 19:29

>>87
Fuck you. You don't know my nomads like I do.

Name: Anonymous 2008-08-16 19:33

>>88
I do not; this is why I wonder.

Name: Anonymous 2008-08-16 19:59

>>87
These don't: >>12,21-23

Name: 86 2008-08-16 20:06

>>87
They don't, I just write them like that because I don't like naming stuff.

Name: Anonymous 2008-08-16 20:11

>>88
I tried to rape my mom in bed, then realized I was giving my dad anal. Still came, though.

Name: Anonymous 2008-08-16 20:23

>>92
moar

Name: Anonymous 2008-08-16 20:33

>>90
Yeah, I like these and that is how I would do it.

Name: Anonymous 2008-08-16 22:17

I started writing a Python program, but I felt too gay about turning decent quotes into shit quotes.

Name: Anonymous 2008-08-16 22:40

I started writing a Python program, but I felt too gay
Python program, but I felt too gay
Python, gay

Name: Anonymous 2008-08-17 5:56

       +>>++++[<++++>-]<[<++++++>-]+[<[>>>>+<<<<-]>>>>[<<<<+>>>>>>+<<-]<+
   +++[>++++++++<-]>.[-]<+++[>+++<-]>+[>>.+<<-]>>[-]<<<++[<+++++>-]<.<<[>>>>+
 <<<<-]>>>>[<<<<+>>>>>>+<<-]<<[>>>>.+<<<++++++++++[<[>>+<<-]>>[<<+>>>>>++++++++
 +++<<<-]<[>+<-]>[<+>>>>+<<<-]>>>[>>>>>>>>>>>>+>+<<     <<<<<<<<<<<-]>>>>>>>>>>
>>[-[>>>>+<<<<-]>[>>>>+<<<<-]>>>]>      >>[<<<+>>  >-    ]<<<[>>+>+<<<-]>[->[<<<
<+>>>>-]<[<<<  <+>      >>>-]<<<< ]<     ++++++  ++       +[>+++++<-]>>[<<+>>-]<
<[>---<-]>.[- ]         <<<<<<<<< <      <<<<<< <         -]++++++++++.[-]<-]>>>
>[-]<[-]+++++           +++[>++++        ++++<     -     ]>--.[-]<,----------[<+
>-]>>>>>>+<<<<< <     <[>+>>>>>+>[      -]<<<      <<   <<-]>++++++++++>>>>>[[-]
<<,<<<<<<<->>>> >    >>[<<<<+>>>>-]<<<<[>>>>+      >+<<<<<-]>>>>>----------[<<<<
<<<<+<[>>>>+<<<      <-]>>>>[<<<<+>>>>>>+<<-      ]>[>-<-]>++++++++++[>+++++++++
++<-]<<<<<<[>>>      >+<<<<-]>>>>[<<<<+>>>>>      >+<<-]>>>>[<<->>-]<<++++++++++
[>+<-]>[>>>>>>>      >>>>>+>+<<<<      <<<<<      <<<<-]>>> >>     >>>>>>>[-[>>>
>+<<<<-]>[>>>>       +<<<<-]>> >       ]>> >           [<< <        +>>>-]+<<<[>
>>-<<<-]>[->[<      <<<+>>>>-]         <[ <            < <           <+>>>>-]<<<
<]<<<<<<<<<<<, [    -]]>]>[-+++        ++               +    +++     ++[>+++++++
++++>+++++++++ +    +<<-]>[-[>>>      +<<<-      ]>>>[ <    <<+      >>>>>>>+>+<
<<<<-]>>>>[-[> >    >>+<<<<-]>[>      >>>+< <    <<-]> >    >]>      >>[<<<+>>>-
]<<<[>>+>+<<< -     ]>[->[<<<<+>      >>>-] <    [<<< <    +>>       >>-]<<<<]<<
<<<<<<[>>>+<< <     -]>>>[<<<+>>      >>>>> +    >+<< <             <<-]<<[>>+<<
-]>>[<<+>>>>>      >+>+<<<<<-]>>      >>[-[ >    >>>+ <            <<<-]>[>>>>+<
<<<-]>[>>>>+<      <<<-]>>]>>>[ -    ]<[>+< -    ]<[ -           [<<<<+>>>>-]<<<
<]<<<<<<<<]<<      <<<<<<<<++++ +    +++++  [   >+++ +    ++++++[<[>>+<<-]>>[<<+
>>>>>++++++++ +    ++<<<     -] <    [>+<- ]    >[<+ >    >>>+<<<-]>>>[<<<+>>>-]
<<<[>>>+>>>>  >    +<<<<     <<      <<-]> >    >>>>       >>>[>>+<<-]>>[<<+<+>>
>-]<<<------ -    -----[     >>      >+<<< -    ]>>>       [<<<+> > >>>>>+>+<<<<
<-]>>>>[-[>> >    >+<<<<    -] >     [>>>> +    <<<<-       ]>>> ]  >>>[<<<+>>>-
]<<<[>>+>+<< <    -]>>>     >>           > >    [<<<+               >>>-]<<<[>>>
+<<<<<+>>-                  ]>           >     >>>>>[<             <<+>>>-]<<<[>
>>+<<<<<<<                  <<+         >      >>>>>-]<          <<<<<<[->[<<<<+
>>>>-]<[<<<<+>>>>-]<<<<]>[<<<<<<    <+>>>      >>>>-]<<<<     <<<<<+++++++++++[>
>>+<<<-]>>>[<<<+>>>>>>>+>+<<<<<-]>>>>[-[>     >>>+<<<<-]>[>>>>+<<<<-]>>>]>>>[<<<
+>>>-]<<<[>>+>+<<<-]>>>>>>>[<<<+>>>-]<<<[     >>>+<<<<<+>>-]>>>>>>>[<<<+>>>-]<<<
[>>>+<<<<<<<<<+>>>>>>-]<<<<<<<[->[< <  <     <+>>>>-]<[<<<<+>>>>-]<<<<]>[<<<<<<<
+>>>>>>>-]<<<<<<<<<+++++++++++[>>> >        >>>+>+<<<<<<<<-]>>>>>>>[-[>>>>+<<<<-
]>[>>>>+<<<<-]>>>]>>>[<<<+>>>-]<<< [       >>+>+<<<-]>>>>>>>[<<<+>>>-]<<<[>>>+<<
<<<+>>-]>>>>>>>[<<<+>>>-]<<<[>>>+<        <<<<<<<<+>>

Name: Anonymous 2008-08-17 7:35

more like
       +>>++++[<++++>-]<[<++++++>-]+[<[>>>>+<<<<-]>>>>[<<<<+>>>>>>+<<-]<+
   +++[>++++++++<-]>.[-]<+++[>+++<-]>+[>>.+<<-]>>[-]<<<++[<+++++>-]<.<<[>>>>+
 <<<<-]>>>>[<<<<+>>>>>>+<<-]<<[>>>>.+<<<++++++++++[<[>>+<<-]>>[<<+>>>>>++++++++
 +++<<<-]<[>+<-]>[<+>>>>+<<<-]>>>[>>>>>>>>>>>>+>+<<     <<<<<<<<<<<-]>>>>>>>>>>
>>[-[>>>>+<<<<-]>[>>>>+<<<<-]>>>]>      >>[<<<+>>  >-    ]<<<[>>+>+<<<-]>[->[<<<
<+>>>>-]<[<<<  <+>      >>>-]<<<< ]<     ++++++  ++       +[>+++++<-]>>[<<+>>-]<
<[>---<-]>.[- ]         <<<<<<<<< <      <<<<<< <         -]++++++++++.[-]<-]>>>
>[-]<[-]+++++           +++[>++++        ++++<     -     ]>--.[-]<,----------[<+
>-]>>>>>>+<<<<< <     <[>+>>>>>+>[      -]<<<      <<   <<-]>++++++++++>>>>>[[-]
<<,<<<<<<<->>>> >    >>[<<<<+>>>>-]<<<<[>>>>+      >+<<<<<-]>>>>>----------[<<<<
<<<<+<[>>>>+<<<      <-]>>>>[<<<<+>>>>>>+<<-      ]>[>-<-]>++++++++++[>+++++++++
++<-]<<<<<<[>>>      >+<<<<-]>>>>[<<<<+>>>>>      >+<<-]>>>>[<<->>-]<<++++++++++
[>+<-]>[>>>>>>>      >>>>>+>+<<<<      <<<<<      <<<<-]>>> >>     >>>>>>>[-[>>>
>+<<<<-]>[>>>>       +<<<<-]>> >       ]>> >           [<< <        +>>>-]+<<<[>
>>-<<<-]>[->[<      <<<+>>>>-]         <[ <            < <           <+>>>>-]<<<
<]<<<<<<<<<<<, [    -]]>]>[-+++        ++               +    +++     ++[>+++++++
++++>+++++++++ +    +<<-]>[-[>>>      +<<<-      ]>>>[ <    <<+      >>>>>>>+>+<
<<<<-]>>>>[-[> >    >>+<<<<-]>[>      >>>+< <    <<-]> >    >]>      >>[<<<+>>>-
]<<<[>>+>+<<< -     ]>[->[<<<<+>      >>>-] <    [<<< <    +>>       >>-]<<<<]<<
<<<<<<[>>>+<< <     -]>>>[<<<+>>      >>>>> +    >+<< <             <<-]<<[>>+<<
-]>>[<<+>>>>>      >+>+<<<<<-]>>      >>[-[ >    >>>+ <            <<<-]>[>>>>+<
<<<-]>[>>>>+<      <<<-]>>]>>>[ -    ]<[>+< -    ]<[ -           [<<<<+>>>>-]<<<
<]<<<<<<<<]<<      <<<<<<<<++++ +    +++++  [   >+++ +    ++++++[<[>>+<<-]>>[<<+
>>>>>++++++++ +    ++<<<     -] <    [>+<- ]    >[<+ >    >>>+<<<-]>>>[<<<+>>>-]
<<<[>>>+>>>>  >    +<<<<     <<      <<-]> >    >>>>       >>>[>>+<<-]>>[<<+<+>>
>-]<<<------ -    -----[     >>      >+<<< -    ]>>>       [<<<+> > >>>>>+>+<<<<
<-]>>>>[-[>> >    >+<<<<    -] >     [>>>> +    <<<<-       ]>>> ]  >>>[<<<+>>>-
]<<<[>>+>+<< <    -]>>>     >>           > >    [<<<+               >>>-]<<<[>>>
+<<<<<+>>-                  ]>           >     >>>>>[<             <<+>>>-]<<<[>
>>+<<<<<<<                  <<+         >      >>>>>-]<          <<<<<<[->[<<<<+
>>>>-]<[<<<<+>>>>-]<<<<]>[<<<<<<    <+>>>      >>>>-]<<<<     <<<<<+++++++++++[>
>>+<<<-]>>>[<<<+>>>>>>>+>+<<<<<-]>>>>[-[>     >>>+<<<<-]>[>>>>+<<<<-]>>>]>>>[<<<
+>>>-]<<<[>>+>+<<<-]>>>>>>>[<<<+>>>-]<<<[     >>>+<<<<<+>>-]>>>>>>>[<<<+>>>-]<<<
[>>>+<<<<<<<<<+>>>>>>-]<<<<<<<[->[< <  <     <+>>>>-]<[<<<<+>>>>-]<<<<]>[<<<<<<<
+>>>>>>>-]<<<<<<<<<+++++++++++[>>> >        >>>+>+<<<<<<<<-]>>>>>>>[-[>>>>+<<<<-
]>[>>>>+<<<<-]>>>]>>>[<<<+>>>-]<<< [       >>+>+<<<-]>>>>>>>[<<<+>>>-]<<<[>>>+<<
<<<+>>-]>>>>>>>[<<<+>>>-]<<<[>>>+<        <<<<<<<<+>>

Name: Anonymous 2008-08-17 8:23

>>98
Very nice, and how long did that take?

Name: Anonymous 2008-08-17 8:33

>>98
I jizzed.

Name: Anonymous 2008-08-17 18:05


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