Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Smugdog Millionaire
Sep 14, 2002

8) Blame Icefrog

1337JiveTurkey posted:

You have to explicitly tell the standard Java regex to backtrack with (.*?) because it can significantly affect performance.

Is this true? If so, that's just amazingly awful.

Adbot
ADBOT LOVES YOU

Malloc Voidstar
May 7, 2007

Fuck the cowboys. Unf. Fuck em hard.
The Java regex system can also crash.
code:
    String F = 
        "(?x) .{0,2} | (?: (?=(\\2?)) (?=(\\2\\3|^.)) (?=(\\1)) \\2)+ . ";

    for (int n = 0; n < 1000; n++) {
        String s = new String(new char[n]);
        if (s.matches(F)) {
            System.out.print(n + " ");
        }
    } 
Throws a StringIndexOutOfBoundsException. Changing the end of the regex to "\\2)++ . " fixes it, though.

Volte
Oct 4, 2004

woosh woosh

yaoi prophet posted:

Huh, this looks interesting. Any idea why the mentioned languages don't use his approach?
It's because Thompson's implementation is a true regular expression implementation and can only match regular languages. Perl regex with recursion can match at least some context-free languages (messily), and most people who use regex in practice would prefer increased power over performance. It would have been nice if true regular expressions were kept and the expanded type of matching expression given a new name though.

wellwhoopdedooo
Nov 23, 2007

Pound Trooper!

Smugdog Millionaire posted:

Is this true? If so, that's just amazingly awful.

Hey guys! Let's use a nearly-the-same syntax, and make it mean different things than everything else that uses the syntax! Yeah! And then we can go suck each other's cocks over how you can write it once and run it anywhere and isn't it great that our language is so loving PURE! OHHH GOD gently caress YEAH UNNNNNNG

gently caress Java, gently caress it forever and ever. I would rather write an AJAX version of Office 2010 in PHP 3 than write one line of code in Java.

Volte
Oct 4, 2004

woosh woosh

1337JiveTurkey posted:

You have to explicitly tell the standard Java regex to backtrack with (.*?) because it can significantly affect performance.
In all implementations I've used, this just makes the .* act non-greedily. That is, it will make the part of the string that matches (.*) as small as possible, which doesn't require backtracking.

Janitor Prime
Jan 22, 2004

PC LOAD LETTER

What da fuck does that mean

Fun Shoe

wellwhoopdedooo posted:

Hey guys! Let's use a nearly-the-same syntax, and make it mean different things than everything else that uses the syntax! Yeah! And then we can go suck each other's cocks over how you can write it once and run it anywhere and isn't it great that our language is so loving PURE! OHHH GOD gently caress YEAH UNNNNNNG

gently caress Java, gently caress it forever and ever. I would rather write an AJAX version of Office 2010 in PHP 3 than write one line of code in Java.

u mad?

jonjonaug
Mar 26, 2010

by Lowtax

wellwhoopdedooo posted:

Hey guys! Let's use a nearly-the-same syntax, and make it mean different things than everything else that uses the syntax! Yeah! And then we can go suck each other's cocks over how you can write it once and run it anywhere and isn't it great that our language is so loving PURE! OHHH GOD gently caress YEAH UNNNNNNG

gently caress Java, gently caress it forever and ever. I would rather write an AJAX version of Office 2010 in PHP 3 than write one line of code in Java.

You should calm down.

Malloc Voidstar
May 7, 2007

Fuck the cowboys. Unf. Fuck em hard.

wellwhoopdedooo posted:

gently caress Java, gently caress it forever and ever. I would rather write an AJAX version of Office 2010 in PHP 3 than write one line of code in Java.
java's pretty nice actually

edit: but signed bytes are gently caress

NotShadowStar
Sep 20, 2000

wellwhoopdedooo posted:

Hey guys! Let's use a nearly-the-same syntax, and make it mean different things than everything else that uses the syntax! Yeah! And then we can go suck each other's cocks over how you can write it once and run it anywhere and isn't it great that our language is so loving PURE! OHHH GOD gently caress YEAH UNNNNNNG

gently caress Java, gently caress it forever and ever. I would rather write an AJAX version of Office 2010 in PHP 3 than write one line of code in Java.

I believe the trifecta of things that have perpetually held back technological progression so far have been PHP, Java/Sun, and Windows.

I would rather write an app in Java than PHP any single day, anytime. The syntax is loving atrocious, you need an IDE to get over the repetitive bullshit, but you can kind of bend it to your will. At the very least you can track down what the hell is going on in Java through some hosed up class hierarchy, rather than the gigantic Goldberg machine mess of global everything that most PHP projects are. Spend a week trying to work with Drupal and you'll see.

ColdPie
Jun 9, 2006

NotShadowStar posted:

I believe the trifecta of things that have perpetually held back technological progression so far have been PHP, Java/Sun, and Windows.

Certainly software patents deserve a spot. Look at the HTML5 video mess. I'd rank software patents as more destructive to progress than Java.

Blotto Skorzany
Nov 7, 2008

He's a PSoC, loose and runnin'
came the whisper from each lip
And he's here to do some business with
the bad ADC on his chip
bad ADC on his chiiiiip

Volte posted:

It would have been nice if true regular expressions were kept and the expanded type of matching expression given a new name though.

At least in Perl-land it's common to refer to true regular expressions as "regular expressions" and the superset of matching expressions supported by Perl as "regexes" or (esp. among perl 6 hackers) "regexps", thus: 'not all regexes are regular expressions' and similar

tef
May 30, 2004

-> some l-system crap ->

Volte posted:

It's because Thompson's implementation is a true regular expression implementation and can only match regular languages. Perl regex with recursion can match at least some context-free languages (messily), and most people who use regex in practice would prefer increased power over performance. It would have been nice if true regular expressions were kept and the expanded type of matching expression given a new name though.

perl regexes are pretty much turing complete, not just context-free


if they were context free it would be possible to bound them in cubic time

rjmccall
Sep 7, 2007

no worries friend
Fun Shoe
They're still well short of Turing complete.

ShoulderDaemon
Oct 9, 2003
support goon fund
Taco Defender

rjmccall posted:

They're still well short of Turing complete.

You can embed arbitrary Perl expressions in a Perl regexp.

Volte
Oct 4, 2004

woosh woosh

tef posted:

perl regexes are pretty much turing complete, not just context-free


if they were context free it would be possible to bound them in cubic time
They're only Turing complete if you cheat and include arbitrary perl code

rjmccall
Sep 7, 2007

no worries friend
Fun Shoe

ShoulderDaemon posted:

You can embed arbitrary Perl expressions in a Perl regexp.

Huh. Things I did not know.

It looks like it bounds recursive depth before advancement; I'm not certain you could actually simulate a Turing machine with that other than by cheating.

Mustach
Mar 2, 2003

In this long line, there's been some real strange genes. You've got 'em all, with some extras thrown in.
I was disappointed when I dug this up and found it doesn't involve regexes as I remembered, but hey, it's still one of the most glorious wastes of human ingenuity that software development was wrought, so here it is again:
code:
#!/usr/bin/perl
$_='
         $q ="\                   47"; wh
        ile                           ($ ;=
      $z                +=              .5 ){
    %c=           $r=0;$/ ="";whi         le(2
   0+          $z>($;+=.05)){$c{int$       _+ 2
  6+         2*($              r+= .0       2) *
 s          in$                   ;}{1       -$_
+1         0+           int        $r*c       o s
$         ;}         =1for(0.       .1)        }$
t        =r         ever se;$        /.        =`
c        le        ar     `.         "         #!
/        usr       /bi             n/         pe
rl       \n\       $_ =$q        \n"          ;
fo        r$y        (1..20){$c{$_}          {
$ y       }? $         /.=chop$t            :
 ($/        . ="                          \4
 0")         for(0.                    .53)          ;
   $/.        ="\n"}pri            nt"$/$          q;
   s; ".         chr(9 2)."s;;g;eval\n           "}

';s;\s;;g;eval

PalmTreeFun
Apr 25, 2010

*toot*
Perl: Syntax so bizarre you can make ASCII art out of it!

wellwhoopdedooo
Nov 23, 2007

Pound Trooper!

NotShadowStar posted:

I believe the trifecta of things that have perpetually held back technological progression so far have been PHP, Java/Sun, and Windows.

I would rather write an app in Java than PHP any single day, anytime. The syntax is loving atrocious, you need an IDE to get over the repetitive bullshit, but you can kind of bend it to your will. At the very least you can track down what the hell is going on in Java through some hosed up class hierarchy, rather than the gigantic Goldberg machine mess of global everything that most PHP projects are. Spend a week trying to work with Drupal and you'll see.

Well one condition of my angrypost was that I'd get to write one all by my self. If my choice was to extend or bugfix an in-use Java or PHP app I'd just go gas myself and be done with it.

Mustach
Mar 2, 2003

In this long line, there's been some real strange genes. You've got 'em all, with some extras thrown in.

PalmTreeFun posted:

Perl: Syntax so bizarre you can make ASCII art out of it!
You gotsta run that code, my man.

BlackMK4
Aug 23, 2006

wat.
Megamarm

Mustach posted:

You gotsta run that code, my man.

Holy poo poo.
For the lazy ones: it animates the loving spiral.

tef
May 30, 2004

-> some l-system crap ->
I keep that code in my sig for handy reference

as seen on hacker news

Sewer Adventure
Aug 25, 2004

BlackMK4 posted:

Holy poo poo.
For the lazy ones: it animates the loving spiral.

Every frame of which is valid code to continue the spiral

tef
May 30, 2004

-> some l-system crap ->
it's a series of programs that print the source code of the next one, in a loop, and each program happens to be in the shape of a spiral, rotated slightly.

it's drat awesome.

please to not be forgetting http://search.cpan.org/~asavige/Acme-EyeDrops-1.55/lib/Acme/EyeDrops.pm

The Reaganomicon
Oct 14, 2010

by Lowtax

Mustach posted:

You gotsta run that code, my man.

A language that gets poo poo done and trolls people? Why do people keep using PHP when this gem is around??

tef
May 30, 2004

-> some l-system crap ->
it's the best languages for reliable top quality hosting like dreamhost

Zombywuf
Mar 29, 2008

nielsm posted:

Remember that the two graphs on the top have different vertical scales. The Perl one measures seconds, the DFM one measures microseconds.

So it is. The real horror is labelling graphs that way.

wellwhoopdedooo
Nov 23, 2007

Pound Trooper!

Zombywuf posted:

So it is. The real horror is labelling graphs that way.

oh no you didn't just diss logarithmic scales. How dare you sir.

good jovi
Dec 11, 2000

'm pro-dickgirl, and I VOTE!

logarithmic scales are the best, especially in cases like this. "Wow, perl's performance is pretty bad." "No, actually it's much worse."

tef
May 30, 2004

-> some l-system crap ->

wellwhoopdedooo posted:

oh no you didn't just diss logarithmic scales. How dare you sir.

no he didnt

tef
May 30, 2004

-> some l-system crap ->
having two scales on the same graph was what confused him, not log scales

PalmTreeFun
Apr 25, 2010

*toot*

BlackMK4 posted:

Holy poo poo.
For the lazy ones: it animates the loving spiral.

Holy mother of god that is amazing.

Perl: Syntax so bizarre, you can animate the source code!

clockwork automaton
May 2, 2007

You've probably never heard of them.

Fun Shoe

PalmTreeFun posted:

Holy mother of god that is amazing.

Perl: Syntax so bizarre, you can animate the source code!

Ruby has some neat quines too. This is "The Qlobe" and it rotates the earth 45 degrees when you execute it and you can pass it however many degrees you want it to rotate. It doesn't self animate like the perl one does, but you can easily write a single liner command to do so.

code:
v=0000;eval$s=%q~d=%!^Lcf<LK8,                  _@7gj*LJ=c5nM)Tp1g0%Xv.,S[<>YoP
4ZojjV)O>qIH1/n[|2yE[>:ieC       "%.#%  :::##"       97N-A&Kj_K_><wS5rtWk@*a+Y5
yH?b[F^e7C/56j|pmRe+:)B     "##%      ::##########"     O98(Zh)'Iof*nm.,$C5Nyt=
PPu01Avw^<IiQ=5$'D-y?    "##:         ###############"    g6`YT+qLw9k^ch|K'),tc
6ygIL8xI#LNz3v}T=4W    "#            #.   .####:#######"    lL27FZ0ij)7TQCI)P7u
}RT5-iJbbG5P-DHB<.   "              ##### # :############"   R,YvZ_rnv6ky-G+4U'
$*are@b4U351Q-ug5   "              #######################"   00x8RR%`Om7VDp4M5
PFixrPvl&<p[]1IJ   "              ############:####  %#####"   EGgDt8Lm#;bc4zS^
y]0`_PstfUxOC(q   "              .#############:##%   .##  ."   /,}.YOIFj(k&q_V
zcaAi?]^lCVYp!;  " %%            .################.     #.   "  ;s="v=%04o;ev"%
(;v=(v-($*+[45,  ":####:          :##############%       :   "  ])[n=0].to_i;)%
360)+"al$s=%q#{  "%######.              #########            "  ;;"%c"%126+$s<<
126}";d.gsub!(/  "##########.           #######%             "  |\s|".*"/,"");;
require"zlib"||  "###########           :######.             "  ;d=d.unpack"C*"
d.map{|c|n=(n||  ":#########:           .######: .           "  )*90+(c-2)%91};
e=["%x"%n].pack   " :#######%           :###### #:          "   &&"H*";e=Zlib::
Inflate.inflate(   "  ######%           .####% ::          "   &&e).unpack("b*"
)[0];22.times{|y|   "  ####%             %###             "   ;w=(Math.sqrt(1-(
(y*2.0-21)/22)**(;   " .###:             .#%             "   ;2))*23).floor;(w*
2-1).times{|x|u=(e+    " %##                           "    )[y*z=360,z]*2;u=u[
90*x/w+v+90,90/w];s[(    " #.                        "    ;y*80)+120-w+x]=(""<<
32<<".:%#")[4*u.count((     " .                   "     ;"0"))/u.size]}};;puts\
s+";_ The Qlobe#{" "*18+ (       "#  :#######"       ;"Copyright(C).Yusuke End\
oh, 2010")}";exit~;_ The Qlobe                  Copyright(C).Yusuke Endoh, 2010

Blotto Skorzany
Nov 7, 2008

He's a PSoC, loose and runnin'
came the whisper from each lip
And he's here to do some business with
the bad ADC on his chip
bad ADC on his chiiiiip

Mustach posted:

I was disappointed when I dug this up and found it doesn't involve regexes as I remembered, but hey, it's still one of the most glorious wastes of human ingenuity that software development was wrought, so here it is again:
code:
...
s;\s;;g;eval

There's a regex substitution being used on the default argument before the eval to effect a pseudo-source filter that removes all whitespace (this is what allows eg. the keyword 'while' to be split between two lines) :v:

Scaevolus
Apr 16, 2007

the best quine

"This is a Ruby program that outputs a Python program that outputs a Perl program that outputs a Lua program that outputs a OCaml program that outputs a Haskell program that outputs a C program that outputs a Java program that outputs a brainfuck program that outputs a Whitespace program that outputs a Unlambda program that outputs the program itself."

code:
# ruby
l=92.chr;eval s="s=s.dump[r=1..-2].gsub(/("+l*4+"){4,}(?!\")/){|t|'\"+l*%d+\"'%(t
.size/2)};5.times{s=s.dump[r]};puts\"# python\\nprint(\\\"# perl\\\\nprint(\\\\\\
\"# lua"+l*4+"nprint("+l*7+"\"(* ocaml *)"+l*8+"nprint_endline"+l*15+"\"-- haskel
l"+l*16+"nimport Data.List;import Data.Bits;import Data.Char;main=putStrLn("+l*31
+"\"/* C */"+l*32+"n#include<stdio.h>"+l*32+"nint main(void){char*s[501]={"+l*31+
"\"++intercalate"+l*31+"\","+l*31+"\"(c(tail(init(show("+l*31+"\"/* Java */"+l*32
+"npublic class QuineRelay{public static void main(String[]a){String[]s={"+l*31+"
\"++intercalate"+l*31+"\","+l*31+"\"(c("+l*31+"\"brainfuck"+l*64+"n++++++++[>++++
<-]+++++++++>>++++++++++"+l*31+"\"++(concat(snd(mapAccumL h 2("+l*31+"\"110"+l*31
+"\"++g(length s)++"+l*31+"\"22111211100111112021111102011112120012"+l*31+"\"++co
ncatMap("+l*32+"c->let d=ord c in if d<11then"+l*31+"\"21002"+l*31+"\"else"+l*31+
"\"111"+l*31+"\"++g d++"+l*31+"\"22102"+l*31+"\")s++"+l*31+"\"2100211101012021122
2211211101000120211021120221102111000110120211202"+l*31+"\"))))))++"+l*31+"\","+l
*63+"\""+l*64+"n"+l*63+"\"};int i=0;for(;i<94;i++)System.out.print(s[i]);}}"+l*31
+"\")))))++"+l*31+"\",0};int i=0;for(;s[i];i++)printf("+l*63+"\"%s"+l*63+"\",s[i]
);puts("+l*63+"\""+l*63+"\");return 0;}"+l*31+"\");c s=map("+l*32+"s->"+l*31+"\""
+l*63+"\""+l*31+"\"++s++"+l*31+"\""+l*63+"\""+l*31+"\")(unfoldr t s);t[]=Nothing;
t s=Just(splitAt(if length s>w&&s!!w=='"+l*31+"\"'then 501else w)s);w=500;f 0=Not
hing;f x=Just((if x`mod`2>0then '0'else '1'),x`div`2);g x= reverse (unfoldr f x);
h p c=let d=ord c-48in(d,replicate(abs(p-d))(if d<p then '<'else '>')++"+l*31+"\"
."+l*31+"\");s="+l*31+"\"# ruby"+l*32+"n"+l*31+"\"++"+l*31+"\"l=92.chr;eval s=\"+
(z=l*31)+\"\\\"\"+s+z+\"\\\""+l*31+"\"++"+l*31+"\""+l*32+"n"+l*31+"\""+l*15+"\""+
l*7+"\")"+l*4+"n\\\\\\\")\\\")\"########### (c) Yusuke Endoh, 2009 ###########\n"
(he also wrote the qlobe)

Scaevolus fucked around with this message at 03:22 on Apr 15, 2011

fishmech
Jul 16, 2006

by VideoGames
Salad Prong
The COBOL quine is still fairly impressive considering how wordy the languague is:
code:

       IDENTIFICATION DIVISION.                                         
        PROGRAM-ID. QUINE.                                              
        AUTHOR. DAVE BURT.                                              
        DATE-WRITTEN. 18-09-2002.                                       
       ENVIRONMENT DIVISION.                                            
       DATA DIVISION.                                                   
        WORKING-STORAGE SECTION.                                        
        01 WS.                                                          
         05 WS-DATA.                                                    
          09 PIC X(40) VALUE "   09 PIC X(40) VALUE                   ".
          09 PIC X(40) VALUE ".                                       ".
          09 PIC X(40) VALUE "IDENTIFICATION DIVISION.                ".
          09 PIC X(40) VALUE " PROGRAM-ID. QUINE.                     ".
          09 PIC X(40) VALUE " AUTHOR. DAVE BURT.                     ".
          09 PIC X(40) VALUE " DATE-WRITTEN. 18-09-2002.              ".
          09 PIC X(40) VALUE "ENVIRONMENT DIVISION.                   ".
          09 PIC X(40) VALUE "DATA DIVISION.                          ".
          09 PIC X(40) VALUE " WORKING-STORAGE SECTION.               ".
          09 PIC X(40) VALUE " 01 WS.                                 ".
          09 PIC X(40) VALUE "  05 WS-DATA.                           ".
          09 PIC X(40) VALUE "  05 WS-ARR PIC X(40)                   ".
          09 PIC X(40) VALUE "    OCCURS 4 REDEFINES WS-DATA.         ".
          09 PIC X(40) VALUE "  05 WS-INTS USAGE IS COMPUTATIONAL.    ".
          09 PIC X(40) VALUE "   09 WS-NDX   PIC 9(4) VALUE ZERO.     ".
          09 PIC X(40) VALUE "   09 WS-START PIC 9(4) VALUE 3.        ".
          09 PIC X(40) VALUE "   09 WS-SPLIT PIC 9(4) VALUE 12.       ".
          09 PIC X(40) VALUE "   09 WS-CNT   PIC 9(4) VALUE 51.       ".
          09 PIC X(40) VALUE " 01 WS-OUT-REC.                         ".
          09 PIC X(40) VALUE "  05 FILLER      PIC X(7) VALUE SPACES. ".
          09 PIC X(40) VALUE "  05 WS-OUT-AREA.                       ".
          09 PIC X(40) VALUE "   09 WS-OUT-PFX PIC X(22).             ".
          09 PIC X(40) VALUE "   09 WS-OUT-Q1  PIC X.                 ".
          09 PIC X(40) VALUE "   09 WS-OUT-STR PIC x(40).             ".
          09 PIC X(40) VALUE "   09 WS-OUT-Q2  PIC X.                 ".
          09 PIC X(40) VALUE "   09 WS-OUT-SFX PIC X.                 ".
          09 PIC X(40) VALUE "PROCEDURE DIVISION.                     ".
          09 PIC X(40) VALUE "  000-MAIN.                             ".
          09 PIC X(40) VALUE "    PERFORM VARYING WS-NDX              ".
          09 PIC X(40) VALUE "            FROM WS-START BY 1          ".
          09 PIC X(40) VALUE "            UNTIL WS-NDX >= WS-SPLIT    ".
          09 PIC X(40) VALUE "     MOVE WS-ARR(WS-NDX) TO WS-OUT-AREA ".
          09 PIC X(40) VALUE "     DISPLAY WS-OUT-REC                 ".
          09 PIC X(40) VALUE "    END-PERFORM                         ".
          09 PIC X(40) VALUE "    MOVE WS-ARR(1) TO WS-OUT-PFX        ".
          09 PIC X(40) VALUE "    MOVE QUOTE TO WS-OUT-Q1             ".
          09 PIC X(40) VALUE "    MOVE QUOTE TO WS-OUT-Q2             ".
          09 PIC X(40) VALUE "    MOVE WS-ARR(2) TO WS-OUT-SFX        ".
          09 PIC X(40) VALUE "    PERFORM VARYING WS-NDX              ".
          09 PIC X(40) VALUE "            FROM 1 BY 1                 ".
          09 PIC X(40) VALUE "            UNTIL WS-NDX > WS-CNT       ".
          09 PIC X(40) VALUE "     MOVE WS-ARR(WS-NDX) TO WS-OUT-STR  ".
          09 PIC X(40) VALUE "     DISPLAY WS-OUT-REC                 ".
          09 PIC X(40) VALUE "    END-PERFORM                         ".
          09 PIC X(40) VALUE "    PERFORM VARYING WS-NDX              ".
          09 PIC X(40) VALUE "            FROM WS-SPLIT BY 1          ".
          09 PIC X(40) VALUE "            UNTIL WS-NDX > WS-CNT       ".
          09 PIC X(40) VALUE "     MOVE WS-ARR(WS-NDX) TO WS-OUT-AREA ".
          09 PIC X(40) VALUE "     DISPLAY WS-OUT-REC                 ".
          09 PIC X(40) VALUE "    END-PERFORM                         ".
          09 PIC X(40) VALUE "    STOP RUN.                           ".
         05 WS-ARR PIC X(40)                                            
           OCCURS 4 REDEFINES WS-DATA.                                  
         05 WS-INTS USAGE IS COMPUTATIONAL.                             
          09 WS-NDX   PIC 9(4) VALUE ZERO.                              
          09 WS-START PIC 9(4) VALUE 3.                                 
          09 WS-SPLIT PIC 9(4) VALUE 12.                                
          09 WS-CNT   PIC 9(4) VALUE 51.                                
        01 WS-OUT-REC.                                                  
         05 FILLER      PIC X(7) VALUE SPACES.                          
         05 WS-OUT-AREA.                                                
          09 WS-OUT-PFX PIC X(22).                                      
          09 WS-OUT-Q1  PIC X.                                          
          09 WS-OUT-STR PIC x(40).                                      
          09 WS-OUT-Q2  PIC X.                                          
          09 WS-OUT-SFX PIC X.                                          
       PROCEDURE DIVISION.                                              
         000-MAIN.                                                      
           PERFORM VARYING WS-NDX                                       
                   FROM WS-START BY 1                                   
                   UNTIL WS-NDX >= WS-SPLIT                             
            MOVE WS-ARR(WS-NDX) TO WS-OUT-AREA                          
            DISPLAY WS-OUT-REC                                          
           END-PERFORM                                                  
           MOVE WS-ARR(1) TO WS-OUT-PFX                                 
           MOVE QUOTE TO WS-OUT-Q1                                      
           MOVE QUOTE TO WS-OUT-Q2                                      
           MOVE WS-ARR(2) TO WS-OUT-SFX                                 
           PERFORM VARYING WS-NDX                                       
                   FROM 1 BY 1                                          
                   UNTIL WS-NDX > WS-CNT                                
            MOVE WS-ARR(WS-NDX) TO WS-OUT-STR                           
            DISPLAY WS-OUT-REC                                          
           END-PERFORM                                                  
           PERFORM VARYING WS-NDX                                       
                   FROM WS-SPLIT BY 1                                   
                   UNTIL WS-NDX > WS-CNT                                
            MOVE WS-ARR(WS-NDX) TO WS-OUT-AREA                          
            DISPLAY WS-OUT-REC                                          
           END-PERFORM                                                  
           STOP RUN.                                                    

bobthecheese
Jun 7, 2006
Although I've never met Martha Stewart, I'll probably never birth her child.
php quine

php:
<?
echo file_get_contents($_SERVER['SCRIPT_FILENAME']);
?>
Is that cheating?

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.
It's pretty boring.

MutantBlue
Jun 8, 2001

bobthecheese posted:

php quine

php:
<?
echo file_get_contents($_SERVER['SCRIPT_FILENAME']);
?>
Is that cheating?

You've found the one thing that PHP is good for.

Adbot
ADBOT LOVES YOU

Scaevolus
Apr 16, 2007

hq9+ quine
code:
q

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply