Tiny victories.
For the frigging record, the person who grades my computer science work invented the autoimp module, which I practically (should) use every day.
Frig yeah.
A weblog by Hao Lian.
A terrible secret guarded by golems.
A note that thanks you for being born, all those years ago.
For the frigging record, the person who grades my computer science work invented the autoimp module, which I practically (should) use every day.
Frig yeah.
I spend too much time on Reddit.
from eukaryota.animalia.chordata.mammalia.primates.hominidae.homo import sapiens
from song.objects import *
import __main__
class Me(sapiens.Sapiens):
def __init__(self):
self.made_for = You()
def love(self, receiver): ...
def find(self, receiver): ...
def adore(self, receiver): ...
def receive_love(self, giver):
if not given == self.made_for: raise Exception()
...
def stare_at(self, object): ...
def feet_hit(self, object): ...
def check(self, object): ...
I = Me()
I.stare_at(Door())
I.feet_hit(Floor(cold = True))
I.check(Reflection(I))
mystery = False
for var in dir(__main__):
if type(var) == Passion: print 'Found passion'
if type(var) == Flame:
if var.creates_more_feeling(I): print 'Found flame'
assert type(I.made_for) == You
I.love(I.made_for)
I.find(I.made_for)
I.adore(I.made_for)
I.receive_love(I.made_for)
What follows is part of a patch against the twitter.py file from the awesome python-twitter project. You can download the entire patch if you so choose. With it, you can have read from Twitter from Google App Engine. I have not experimented with writing (posting) yet. By default, you get problems using urllib2 on GAE, which I bypass here like a stealthy lightning ninja greased with the body fat of my enemies. It’s part of my Quo Quo status project, which I’ll release soon enough.
+ method = urlfetch.GET
+ data, params, headers = {}, {}, {}
+ if post_data:
+ method = urlfetch.POST
+ data.update(post_data)
+
+ for x in (parameters, self._default_params):
+ if x: params.update(x)
+
+ url = self._BuildUrl(url, extra_params = params)
+ if method == urlfetch.POST:
+ mime = 'application/x-www-form-urlencoded'
+ headers.update({'Content-type': mime})
+
+ # Skip the cache, we're on GAE. This hack by shadytrees.
+ data = urllib.urlencode(data)
+ url_data = urlfetch.fetch(url, payload = data,
+ method = method,
+ headers = headers,
+ ).content
- reddit post title: “A C compiler written in Python (yes, Python!)”
- berlinbrown: Why is that shocking?
- orbhota: Python the animal :o
Let’s wrap up the 2007 predictions with as little crying as possible, OK?
[Mac OS X failing], with Vista, will leave a power vacuum in the OS market, one that is not filled by Linux, which will lack an OS to copy from which to copy any more features.
TRUE. 2007 was not a good year for operating systems. Unless, of course, you count the release of Emacs 22.1. What happened to version 22, you ask? It’s currently lost in the beard of Richard Stallman, and no amount of open source communism is enough to entice anybody to go and retrieve it.
Web 2.0 will stagnate.
TRUE. Web 2.0 is no longer cool. Lame Internet fads are cool again.
Language interpreters will become a bottleneck.
TRUE. Python is cool now. We all know Python is not interpreted; it’s, in fact fed through van Rossum’s head before he manually flips the diodes in your monitor. That’s right, I’m making this public: Python only runs on LCDs. Deal with it, bitches.
Perl 6.0 will not be released. Python 3000 will not be released.
DOUBLE TRUE. Perl now has Rakudo, Pugs, and about twenty other mini-languages. Apparently, “focus” in the Perl community is a weird way of spelling “vapor.” As in vaporware. MORPHEME BURN. Sizzle sizzle, bitches. (Seriously, when C++0x adds a whole bunch of unnecessary features, it’s lame. But when Perl 6 does it, it’s “Come on, we have nightly builds?”)
dotfloofy dotblog will reach its fourth anniversary.
FALSE. We had a continuity jump and we are, indeed, in our sixth anniversary by now. Scientists, with their sciencing, widely believe this is due to anomalies caused by the pesto sauce I spilled back around June of 2007.