Ballmer Peak

(n.b http://xkcd.com/323/ )

I woke up with my terminal filled with sed scripts like this one:

/<div class="maple">/,/<\/div>/ {
        s/<.*>/ /g
        s/&gt;/ /g

        s/\((.*\)\n\(*.*)\)\(:\|;\)/\1\2/g
        s/[1-9]/ /g
        s/\-//g

        s/\(\#.*\)$/ /g

        s/([^()])/ /g
        s/{[^()]}/ /g
        s/\[[^()]\]//g
        s/\w*\s*:=/ /g
        s/\w*\s*=/ /g
        s/[:;=+&^$"'{}\*\\\/]/ /g
        s/\[\|\]/ /g
        s/^\(\n\)*/\1/

        /\w*(/{
                s/,\{0,\}\(\w\|[^()]\)*\(\,\|)\|\n\|\s\)/ /g
                s/^\(\n\)*/\1/
                s/\(\w*\)(/\1\n/g
                s/ *//g
                p
        }

        s/\s.\s//g
        s/\s..\s//g
}


… wich, (un)surprisingly works.

Still don’t know how nor why it does. I guess it’s time for more python.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.