Author Archives: Ted Leung

PyCon: Open Space with Sun folks

For those of you at PyCon, Frank Wierzbicki and I will be hosting an open space session on Saturday (tomorrow) at 2pm for people to come and tell us what they think Sun should do in the Python space. We are definitely interested in input and feedback from the larger Python community. If you aren’t at PyCon but have ideas, you can drop either of us e-mail. Our Sun e-mail addresses are <firstname>.<lastname>@sun.com.

If you think my job is all about Jython, you are confused.

Apparently people are confused about what I am working on at Sun, and with PyCon starting tomorrow, this is not a good thing. I am not going to be working on Jython directly, although I will certainly be poking my nose in to see what’s going on. The Python related part of my job (which will be the majority in the short term) is to figure out what Sun should be doing in the Python space, across all of the relevant platforms at Sun, including but not limited to: the JVM and JEE, Netbeans, and Solaris.

Sun isn’t done in the dynamic language space, and I will also be looking for opportunities with other dynamic languages and related technologies.

Lazyweb: Virtualization software

I am looking at building a bunch of virtualized machines, and I have no idea what software I should be using.

  1. I want to create and run images on Linux and OS X
  2. I want those images to be runnable on Linux, OS X, and Solaris (optional)
  3. I want to make images that run Linux, Windows, and Solaris
  4. I want to run one set of images on a box connected to the internet, and have those images appear as separate machines.
  5. Bonus round: I want there to be some ISP/hosting provider that I can send images to and have them hosted.

I am assuming that my choice are: VMWare, Parallels, and VirtualBox.

Useful pointers and advice appreciated.

Google Contacts and CardDAV

Earlier this week Mark Nottingham wrote about CardDAV and DAV based protocols:

All of this led me to mutter ‘DAV WTF?’ at the IETF APPS Architecture Workshop the other week. Do we really need to give folks the opportunity to mint more application-specific methods and headers?

Interestingly, Lisa Dusseault — one of the core folks in the DAV world — blogged about this the other day;

Were I to propose CalDAV today it would probably be CalAtom — some things would be easier, some harder, but it would catch a wave instead of drifting in the tail of something that was never much of a popular wave. Oh well, we needed something then, and WebDAV gave the most leverage at the time.

I gave a big sigh of relief when I read that, and I hope that the CardDAV folks take this to heart. Some parts of WebDAV (e.g., properties; see Yaron and Larry on this) deserve to be taken out back and shot — although, as Lisa says, they were necessary because of the state of the art at the time. That doesn’t mean we can’t do better now.

Almost as if in answer, yesterday Google announced the release of the Contacts API, which is AtomPub/GData based. Unlike CardDAV, it’s not based on vCard, which is both a blessing and a curse, since lots of popular contact systems (like the Mac address book) know how to export vCard information, and because vCard provides a very rich model for information about people. I’m not sure whether this is progress or not.

The Sun is going to shine on Python

Today is my first day as a Sun employee.

How?

Tim Bray was one of the first people to respond to my “looking for a job” blog post. I have not written about it much, but I’ve been very impressed with how Sun has handled the JRuby project. Tim told me that Sun was interested in ramping up their support for Python in a similar fashion, and asked if I would be interested in coming to Sun to lead such an effort.

Why?

After a bunch of talking and interviewing and so forth, it turns out that I was very interested. Long time readers know that I am a dynamic languages guy, going back to the original dynamic language, Lisp. I spent 2.75 of the last 4 years at OSAF working on a big desktop application written in Python (Contrary to some recent blog posts, Python was not a factor in the difficulties that we had with Chandler). The prospect of doing something that would help Python was very attractive. However, Sun has been slow to embrace dynamic languages (whether atop the JVM or not), and Sun’s history in open source has been somewhat checkered in my view. So there were some questions that I had to answer for myself before deciding to go to Sun (especially since I had 3 other very good options):

1. Can Sun actually work with an open source community?

It’s no secret that I have not been a fan of Sun’s handling of the open sourcing of Java, and it seems like OpenSolaris is having some governance problems of its own at the moment. However, if you look at the way that JRuby has been handled, you’ll see that there are parts of Sun that are learning how to work with a community, and doing a very good job of it. Sun hired two of the leading JRuby contributors and gave them license to keep doing what they had been doing. The JRuby guys have been well received by the “C” Ruby community and even the CLR/.NET Ruby community. In addition Sun has been investing in Ruby via support in NetBeans and via some collaborations with the University of Tokyo on the C VM for Ruby. Over the years, I’ve met many people at Sun who understand a collaborative development style. Many of those folks are committers on Apache projects.

2. How serious is Sun about dynamic languages and how deep does that support go?

Sun is (finally?) very serious about this. As part of Sun’s new direction, Sun wants to give developers the ability to use whatever tool sets they want. Ruby, Python, PHP, Java. On or off OpenSolaris. On or off the JVM. There is an official project, John Rose’s DaVinci Machine project, to modify the JVM to support dynamic languages. As far as Python goes, Frank Wierzbicki, the maintainer of Jython, started at Sun last Monday, so there will be at least two of us working on Python related stuff. That includes Jython, Python support for Netbeans, and some other stuff that we haven’t quite figured out yet. We definitely will be looking for things that we can do to support CPython and the Python language as a whole. This is not just about Python on on the JVM. Sun will try to make its platforms, OpenSolaris and the JVM, the best place to develop and deploy Python applications. But at the moment that’s a goal and not a reality, so there is lots to do.

What’s Next?

Frank and I will be at PyCon in Chicago in a week or so. One of my goals (besides hooking back up with people since I missed PyCon last year) will be to sit down and talk to anyone who has ideas about sensible things that Sun could do to help Python. In the mean time, my e-mail address will be <FirstName>.<LastName>@Sun.com

Oh, one more thing. My new job title is “Principal Engineer, Dynamic Languages and Tools”, so expect to see me dinking around with other dynamic language stuff as well.

My thanks to Tim Bray for helping to make this happen.

Update:
It looks like it’s going to take a little longer to get my e-mail address fully operational…
Update 2:
Ok, e-mail is set and ready to go.

Job Search 2.0

Looking for a job has certainly changed since the last time I actively searched for a job.

My entire job search consisted of this blog post, and this tweet on Twitter. (Ok, I did send a couple of e-mails, but it sounds better if it’s just the blog and Twitter). Within 2 hours, I had 4 serious inquiries and 11 in total by the end of the first day. That’s pretty good, considering that I live on an island outside of Seattle, and not in the Bay Area. Interestingly enough, only two of those inquiries were from companies with physical offices in the Seattle area.

Having a blog turned out to be quite important. At least one opportunity came via e-mail with a preamble that went like this: “You don’t know me, but I’ve been a reader of your blog for a long time”.

Until about 2 weeks ago, I talked to a lot of people on the phone, and went to California two weeks in a row for in-person interviews (those of you following along on Twitter already know this — it’s sad but true that Twitter has eaten into my blogging). I feel very fortunate that the four companies that I preferred the most were all fine with the notion of me continuing to work remotely. All four of these companies were doing really interesting stuff. It just goes to show that you don’t have to live in Silicon Valley in order to have access to interesting work opportunities.

I’m going to save the identity of my new employer for tomorrow’s post. But in this post, I would like to say “Thank You” to everyone who contacted me with a job opportunity, and to those who dropped me a note just to find out what was up or how I was doing. It’s nice to know that you have friends.

Moving from Movable Type 3.2 to WordPress 2.3

Julie has decided that she wants to blog a little more frequently. One obstacle to this is that her blog is a spam magnet – or it was until I deleted the Movable Type comment CGIs as a last ditch defense. I’ve had very good results with Akismet on WordPress, so inevitably this meant an upgrade from Movable Type to WordPress. It was only a matter of time before this happened, especially now that I am on WordPress myself. Importing is pretty straight forward. It’s making sure that the permalinks don’t break is the problem. In order to do that you need to make sure that WordPress uses the same numerical id’s that Movable Type used. Which means that you have to hack Movable Type to add an ID field to the exported data, and hack WordPress to use that ID when it creates the new blog entries. Then you do a little mod_rewrite action, and the permalinks should keep on ticking. I’ll now proceed with describing the hacks.

I started with the basic WordPress docs to migrate from Movable Type to WordPress.

Go into the Movable Type 3.2 install and edit lib/MT/ImportExport.pm to add an ID field:

--- ImportExport.pm     2008-02-17 17:55:19.000000000 -0800
+++ ImportExport.pm~    2006-01-04 00:21:09.000000000 -0800
@@ -439,7 +439,6 @@
     my $tmpl = MT::Template->new;
     $tmpl->name('Export Template');
     $tmpl->text(<<'TEXT');
-ID: <$MTEntryID$>
 AUTHOR: <$MTEntryAuthor strip_linefeeds="1"$>
 TITLE: <$MTEntryTitle strip_linefeeds="1"$>
 STATUS: <$MTEntryStatus strip_linefeeds="1"$>

I used Joshua Zader’s modified mt.php and modified it some more so that it would work off of a local file since the MT 3.2 export was over 7MB.

--- /tmp/mt.php 2006-03-27 17:15:00.000000000 -0800
+++ mt.php      2008-02-17 20:51:53.000000000 -0800
@@ -1,7 +1,9 @@
-f<?
+<?
 
 // HERE I'M DEFINING A CUSTOM FUNCTION BASED ON THE ORIGINAL WP_INSERT_POST FUNCTION LOCATED IN IN FUNCTIONS-POST.PHP
 
+set_time_limit(0);
+
 function wp_insert_post_with_id($postarr = array()) {
        global $wpdb, $wp_rewrite, $allowedtags, $user_ID;
 
@@ -287,7 +289,7 @@
 
        function get_entries() {
                set_magic_quotes_runtime(0);
-               $importdata = file($this->file); // Read the file into an array
+               $importdata = file('/usr/share/wordpress/wp-content/mt-export.txt'); // Read the file into an array
                $importdata = implode('', $importdata); // squish it
                $importdata = preg_replace("/(\r\n|\n|\r)/", "\n", $importdata);                
                $importdata = preg_replace("/\n--------\n/", "--MT-ENTRY--\n", $importdata);
@@ -371,7 +373,8 @@
        }
 
        function select_authors() {
-               $file = wp_import_handle_upload();
+/*             $file = wp_import_handle_upload(); */
+                $file['file'] = '/usr/share/wordpress/wp-content/mt-export.txt'; 
                if ( isset($file['error']) ) {
                        echo $file['error'];
                        return;

I hope this will save some poor person the time I wasted piecing all this together. Most of the documentation that I googled up was for earlier versions of either Movable Type or WordPress or both. Really, some right thinking, PHP handy person ought to just go in and fix the Movable Type importer and document how to use the Movable Type template in order to make this all work.

Oh, and if you’re going to run multiple WordPress blogs with different url prefixes on a Debian supplied WordPress, then you are going to need this.

Twitter, meet Planet…

So Cote thinks that it’s time for organizations and companies to aggregate Twitter:

In theory, this whole pulse idea could be packaged up to be as easily deployable as ‘planet’ sites. Here, ‘pulse’ is the operational brand-name of aggregating Twitter accounts, where as ‘planet’ is the tried and true operation brand-name of aggregating blogs.

Last time I looked, There was an RSS feed for every person on Twitter, and the code for Planet is available (I’m pointing to Sam’s Venus version). About the only thing missing here is a nice web based UI that lets you put in people’s Twitter user names….