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 deleted to keep the secret secret. I swear, the comments were there.
Monday, April 30, 2007
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?
Sunday, April 29, 2007
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 effectively forbid any competing or alternative organization of recording artists and labels to form, because they would be forced to just be members of the RIAA to collect on royalties. Such organizations are just what we need. When we have them, there is a front face to fight against the RIAA's tactics.
Many artists have shown a growing disdain against the RIAA. Days are numbered.
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 supports an open source implementation of this algorithm, named Hadoop. Google has yet and likely won't release source code or open up their MapReduce system, although much information is available through their research papers.
I guess I just find it interesting that although Google is considered so often to be the geeks company, and a more open and public loving corporate entity, much of it sometimes seems to just be face without substance. Yahoo is the one supporting the open source project, instead of a closed internal solution, and their concurrency language is available freely with its source code. Sometimes, I wonder if Yahoo is more in line with the communities than Google.
Found from Geeking with Greg.
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.
def __getattr__(cls, attr):
calling_frame = sys._getframe().f_back
instance_name = calling_frame.f_code.co_varnames
instance = calling_frame.f_locals[instance_name]
return getattr(instance.__super__, attr)
__metaclass__ = SuperMetaclass
def __init__(self, type, obj=None):
if isinstance(obj, Super):
obj = obj.__obj__
self.__type__ = type
self.__obj__ = obj
def __get__(self, obj, cls=None):
if obj is None:
raise Exception('only supports instances')
return Super(self.__type__, obj)
def __getattr__(self, attr):
mro = iter(self.__obj__.__class__.__mro__)
for cls in mro:
if cls is self.__type__:
for cls in mro:
if attr in cls.__dict__:
x = cls.__dict__[attr]
if hasattr(x, '__get__'):
x = x.__get__(self, cls)
raise AttributeError, attr
def __init__(cls, name, bases, clsdict):
cls.__super__ = Super(cls)
if __name__ == '__main__':
__metaclass__ = autosuper
return 'B' + Super.f()
return 'C' + Super.f()
class D(B, C):
def f(self, arg=None):
var = None
return 'D' + Super.f()
assert D().f() == 'DBCA'
What do you think?
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 being able to combine completely unrelated libraries like this, with effectively Zero glue between them?
What is even more impressive is that the benchmarks found this to actually beat the use of cElementTree outside of a database.
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.
Tuesday, April 24, 2007
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.
Monday, April 16, 2007
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()
Traceback (most recent call last):
- ► 2012 (19)
- ► 2011 (19)
- ► 2010 (32)
- ► 2008 (28)
- ▼ April (9)