Monday April 29, 2002

In case you were looking for it, I have an algorithm (written in Python or VBScript, got yer choice) for calculating the distance between two points specified in longitude and latitude and a database of all the zips in the US and their corrensponding longitude-latitude centroids.

I'm a-givin' it to the chillun

Sunday April 28, 2002

I gotta kick this little monk's ass up on to the net. Recently I spent an entire day evaluating every moment of my existence in relation to the afternoon I spent on top of this hill in Pelling, Sikkim. I listened to the cicadas making their racket, I played with the dirt and stones, I took pictures of monk kids, and I stood there with my hands on my hips. I tried to keep going on through the sickness.

What I kept thinking in-between day-dreams was how insignificant that day will be in the sweep of my life and how pivotal the day in Pelling was. This monastery has some crazy shit that doesn't exist anywhere else in the world -- like the only sacred murals of Buddhisatvas having sex. I have a little bit of it here for you. I wanted to tell my friend David about it that day, but it was really just sentimentality and I was the only one who possessed it. I wanted to tell him, while we were at the burger shop, about the little kid sleeping in the grass while another kid bashed cymbals over his head. That I wandered around what was essentially an abandoned ancient outpost, staffed only by a few deformed children.

Now, watch as this monk kid tries to whistle for the cameras. I had to get setup with my camera, and by the time I was ready, he couldn't whistle. I tried to whistle to get him to start but I think it was me turning the screen around on my vidcam so he could watch himself that got him going. Every single second of footage I shot on this day is worth public viewing. I think I'll do the chattering, ringing cymbal thing that this kid can do next.

click for monk action
the whistling monk kid
1:07 minutes
or download 2.6 megs

Thursday April 25, 2002

The words of the beautiful Sam Ruff as he faced into the evil wind on 18th street:

Spring is sooohoho marginal.

Wednesday April 24, 2002

I just wanted to put this up here so that I can show what I did last night in case it looks like I'm not doing anything (I'm talking to myself in the future by the way. I will forget how busy I was.)

This script txt2link.py, is used by my squidparser to makes links out of all those email addresses and urls in the squid events. Now it's new, it's improved, it's da da dum....SUPERUSEFULL!!!!

import re

""" this was adapted from vagueurl.py -- regular expression to match
    informal URLs in plain text.

    This doesn't do and exact job (it doesn't parse the complete syntax
    of URLs) but it should find URLs that at least start right.
    It looks for the start of an address then gobbles up as many legal URL
    characters as it can find.
    originally by Glyn Webster <glyn@ninz.org.nz> 1999-04-27
    now by dave primmer http://primco.org
"""

pattern = r'''
  ( ( \w | - | % )+ @  #  email address prefix (e.g. "glyn@")
  | \w+ ://            #  or protocol prefix (e.g. "http://")
  | news:              #  or "news:" prefix (special case: no "//")
  | mailto:            #
  | www \.             #  lazy typists leave off common prefixes
  | ftp \.
  )                    #  then
  [^\\{}|[\]^<>"'\s]*  #  the rest are any characters allowed in a URL.
  [^\\{}|[\]^<>"'\s.,;?:!]
                       #  it mustn't end in a punctuation mark or this would
                       #  match this wrong: "Www.w3.org, ftp.simtel.net."
'''


def vagueurl(url):
  """ Add an appropiate prefix to an informal URL
      if a match object is passed (convert to a string).
  """
  if re.match(r"\w+:", url):           #Has prefix already, leave it alone.
    return url
  else:
    if re.match(r"(\w|-|%)+@", url):   #Starts like an email address.
      return "mailto:" + url
    elif url[:3] == 'ftp':             #Starts like an FTP address.
      return "ftp://" + url
    else:                              #Assume it's a WWW address.
      return "http://" + url

def URL2htmllink(url):
    """ wraps html link code around url
        url is a match object which is converted to a string
    """
    url = url.group(0)
    return '<a href="%s">%s</a>' % (vagueurl(url), url)

def URL2xmllink(url):
    """ wraps xml link code around url
        url is a match object which is converted to a string
    """
    url = url.group(0)
    return '<link><address>%s</address><text>%s</text></link>' % (vagueurl(url),url)

def linktext(text,mode='html'):
    regexp = re.compile(pattern, re.IGNORECASE | re.VERBOSE)
    if mode == 'xml':
      return re.sub(regexp,URL2xmllink ,text)
    else:return re.sub(regexp,URL2htmllink,text)

if __name__ == '__main__':
  sampletext = """dsik sdksils difjsk http://primco.org akd is sss.sss.www
 www.ddd another and nobody@nowhere.com aid """
  print linktext(sampletext)

After switching primco.org from 66.33.4.4 to 66.70.232.218 and then finally to 66.70.151.85 and mucking with linix builds for 2 weeks straight, I'm ready to post the newest programming turdlet available from primco.org. It's the STATS page. (I copied the code from diveintomark.org) It's self explanatory. The magic of referrer logs have been covered before on this blog so I'll not go into that now. Keep checking back for that daily dose of google zaniness!

Monday April 15, 2002

As I was telling Dave and Mona today, I gave about 25 of the most powerful brain hours I have had in recent memory to the creation of a little calendar program for the squidlist. I wolfed down Dexedrine and finished it last night after the PinkandBrown show. It doesn't look like much but it is functional goddamnit and you don't have to sift through the crud just to figure out what's going on tonight. The "about" page tells you more if you need to know. It's called The SquidSheet.

Saturday April 13, 2002

fuck