Skip to main content

Posts

Showing posts from April, 2007

Python in Your Browser: Not From Who You Thought

There is a long history of people wanting to use Python in a browser . I have been one of those people. Of course, we always thought that this would come from Mozilla , who already has support for Python in their XPCOM framework (through cooperation with ActiveState ), which their JavaScript components are also based on. It seemed that sandboxing python was the only piece missing to replace JavaScript with Python. Well, here's a hit from left field we never saw coming (or did we?): Microsoft is giving us support for sandboxed Python in the browser. Silverlight is supposed to be cross-platform, so this shouldn't be an IE-only beast. When announcements were made recently about Silverlight, and included a note about a secret to be revealsed at Mix'07, I called the Python support. Now, sadly I can't prove this . All the comment that suspected Ruby and my comment suspect Python support seem to have gone missing. My theory is the guesses were too close, so they were delet...

Peer Pressure Turned Me Into A Programming Language

Everyone else is doing it. I took it once and lost the results, and got a different result. But, I'm glad. I am not PERL. Which Programming Language are You?

Internet Radio On The Rocks

I was a strong supporter of Pandora when they came out, so I'm a know proponent of internet radio. So, obviously, the recent problems facing them all is very troubling to me. I think I am even more troubled by the revealing of the RIAA 's SoundExchange organization and their policy and terrible legal right to collect royalties for non-members , and force them to join the RIAA and pay fees to collect those royalties. No musician is legally allowed to opt out of this, meaning no musician has the right to make direct deals with internet radio organizations or to allow their works to be used for free. According to these laws, even royalties on public domain works would be collected, and SoundExchange would just pocket the cash. If it were just bad policies it would be one thing, but their lobbyist have made this our law. Organizations like the RIAA are effectively allowing monopolies. They and SoundExchange might be supposedly independent, but its far from reality. These laws...

Distributed Battle of the Giants

Google and Yahoo are facing each other on a lot of battle grounds, and some of them are less public than others. Research is key to the long term survival of both companies, and lots of information is the bread and butter of the two. Without effective technology to burrow through unheard of volumes of data in record time, neither will make it. Some of the things coming out of this struggle are interesting. New languages are under development by the research teams at both Yahoo and Google. Sawzall is a the topic of a research paper from Rob Pike , Sean Dorward, Robert Griesemer, and Sean Quinlan. Pig , with a much less elegant name, is an working language from Yahoo Research. Off the bat, note that Sawzall is a paper, and you can download Pig's source today. If Google has an implementation of Sawzall, they are not making it public at this time. Both are based around respective implementations of the popular concurrency algorithm, MapReduce, originally a Google creation. Yahoo suppo...

New Super

Discussions and my first PEP will hopefully lead to "fixing" super in 3.0 and could probably also be backported to 2.x branches. The two threads are linked here, and I'm going to include the reference implementation so anyone can check it out and comment on the design. http://mail.python.org/pipermail/python-3000/2007-April/006667.html http://mail.python.org/pipermail/python-dev/2007-April/072807.html #!/usr/bin/env python # # newsuper.py import sys class SuperMetaclass(type): def __getattr__(cls, attr): calling_frame = sys._getframe().f_back instance_name = calling_frame.f_code.co_varnames[0] instance = calling_frame.f_locals[instance_name] return getattr(instance.__super__, attr) class Super(object): __metaclass__ = SuperMetaclass def __init__(self, type, obj=None): if isinstance(obj, Super): obj = obj.__obj__ self.__typ...

SoliDOM Simpler Than I Thought

I have been playing around with the idea of a project I codenamed "SoliDOM", which would parse XML documents into a DOM structure thats actually stored in a database, which means you can have very large or very many documents operating on DOM interfaces at the same time, because the database can manage far more than you could reliably work with in memory at any one time. I did some small interface designs, but never had time to take it far. Then I found this . I don't think its a complete solution, and I want to think my SoliDOM would do the job much better, being designed specifically for this use. Still, I think it shows the power of languages like Python when the solution can be found so amazingly simply. All this guy has done is created classes that subclass both the xml parsing ElementTree classes and the database persistant Durus classes, and BOOM : Instant persistant XML document interfaces. There isn't even any real code. Do you realize the significance of bei...

I'm all twittery!

I finally gave in and started using twitter. I actually think it might help keep me focused, somehow. Figure this in: I'll be posting what I do publicly, so I'll want to look good. That means I'll try to focus on really doing things more. I don't want to post to twitter that im play minesweeper, but if I am, I will. Posting one thing and doing another is lying to The Entire Freaking Planet, so I don't think I'll fabricate much. Anyone else twitter? I'd like to build a network. My Twitter Page.

Agile Charlotte Meetup

Attending my first meetup tomorrow for the Agile Charlotte group from meetup.com. My old area, surrounded by cows and corn, had no chance of getting any meetups, so I'm excited to be back at the city and able to partake in some community. If anyone by chance is attending, or near enough to make it, check out the information and drop a note.

Notes on generators, yield expressions, and order of execution

I was messing around with the use of yield as an expression, the new feature in Python 2.5, and I got a little tripped in small cases of order with how you need to iterate over the generator and when you call send(), etc. I just thought I would post this example to make anyone passively reading aware of the ordering. >>> def g(): ... print 1 ... print 2, (yield) ... print 3 ... >>> gen = g() >>> gen.next() 1 2 >>> gen.send(0) 0 3 Traceback (most recent call last): File " ", line 1, in StopIteration >>>