#!/usr/bin/perl print "Content-type: text/html\n\n"; use CGI qw/:standard :netscape/; use POSIX qw/strftime/; $page = param(page) || substr(path_info(),1) || 1; ($q,$ext) = $ENV{SCRIPT_NAME} eq $ENV{PATH_INFO} ? ('?page=','') : ('','.html'); $data = join("",); $data = "$1$2$2$3" while ($data =~ /(.*\n)(===.*?\n)\.\.\.\n(.*)/s); @data = split(/\n===\s*/s, join("",$data)); ($title, $body) = ($data[$page] =~ /(.*?) ===\s+(.*)/s); print < RS: $title EOH if ($page =~ /contents-?(\d*)/) { $page = $1 || 1; shift @data; $prev=''; foreach $page (@data) { ($title, $body) = ($page =~ /(.*?) ===\s+(.*)/s); $i++; next if $prev eq $title; $prev=$title; push @contents,"* <% $title %>\n"; } undef @data; for ($i=0; $i<=$#contents; $i++) { $data[int($i/8)+1] .= $contents[$i]; } $title="Contents"; $body="#pragma compact\n" . $data[$page]; $q .= "contents-"; } print "\n" unless ($prev=$page-1)<1; print "\n" unless ($next=$page+1)>$#data; $compact=1 if $body =~ s/#pragma compact\s*//; @chunks = split(/<%(.*?)%>/ms, $body); for ($i=0; $i<@chunks; $i+=2) { $chunks[$i] =~ s/&/&/msg; $chunks[$i] =~ s/\n/msg; $chunks[$i] =~ s/\x92/’/g; $chunks[$i] =~ s/ /  /g; $chunks[$i] =~ s/^~ (.*)/
\1<\/div>/mg; $chunks[$i] =~ s/\[(\S*\.jpg) (.*?)\]//g; $chunks[$i] =~ s/\[(\S*\.html?)\]/\1<\/a>/g; $chunks[$i] =~ s/\[(http:\S*) (.*?)\]/\2<\/a>/g; $chunks[$i] =~ s/\[:(.*?):\]/
\1<\/pre>/msg;
}
$body=join('',@chunks);

print "\n

$title

\n\n"; print "
\n"; $ul = 0; $ol = 0; foreach $line (split("\n",$body)) { ($stars,$line) = ($line =~ /(?:(\*+)\s*)?(.*)/); print "
    " while $ul++" while --$ul>length($stars); ($hashes,$line) = ($line =~ /(#*)(.*)/); print "
      " while $ol++" while --$ol>length($hashes); print "
    1. " if $stars or $hashes; $line .= "
      \n
      " if !defined($compact); print "$line"; $stars = $hashes = undef; } print "
\n" while $ul-->0; print "\n" while $ol-->0; print "\n\n\n"; __DATA__ === === === Radical Simplification === ~ Hello from the open source world! === Open Source === I wrote a tool to correlate [http://www.apache.org/licenses/#clas CLA] data with names from password file... ... # Original version by Sam Ruby, written in Python. ... # Ported to Perl, and enhanced by Jim Jagielski ... # Enhanced to have links to personal pages by Sam Ruby. ... # Enhanced to have the code suck less by Ask Bjoern Hansen. === Open Source === "Where's your patch?" === Question === #pragma compact If you suspected you found a bug in WebSphere, and were given full access to the source, how long do you think it would take you to: ... * Download all the source and dependencies ... * Figure out where to make the change ... * Make the change ... * Figure out how to build it ... * Actually perform the build ... * Verify the fix === Answer === For Tomcat, or PHP? ... ~ About an hour === What does that mean? === ... ~ Zero Training ... Operational definition of Simplicity: === Why? === ... Theory: half life of team membership === Basic === [: 10 print "hello world" :] === C === [: #include main() { printf("Hello World!\n"); } :] === C++ === [: #include main() { cout << "Hello World!" << endl; } :] === Java === [: class HelloWorld { public static void main(String args[]) { System.out.print("Hello World "); } } :] === C# === [: class HelloWorld { public static void Main(string[] args) { System.Console.WriteLine("Hello World!"); } } :] === WSDL === <%