Ingy 2.ö

Monday, March 10, 2008

Comprehensive Programming Archive Network


Tonight I uploaded jQuery to CPAN.

True. The 'j' in that sentence stands for JavaScript, and the 'P' stands for Perl. So why put a top notch JavaScript library on the world renowned archive network traditionally used for Perl?

To me it's all just about programming. I have been a major Perl module author since 2000AD. Last time I checked, less than 10 people have more Perl modules on CPAN. For the last 3 years I have been hacking more JavaScript than Perl. I do this mostly for work, but since my work supports Open Source, I have released much of this code as JavaScript modules on JSAN. I happen to be the only person in the world with a module that is both on JSAN and CPAN; the Jemplate module, because it is half Perl and half JavaScript. (It lets Perl's famous Template Toolkit be used in JavaScript).

JSAN was a really good idea, and led to some key people porting important parts of the Perl packaging framework to JavaScript. Especially the test framework. The result is that there is a fairly standard way to package JavaScript modules, especially if you are a CPAN guy like me.

The problem is that there are only a very small handful of folks paying any attention to the upkeep of JSAN. Truthfully JSAN will never be close to what CPAN is. Fortunately, I have found out it really doesn't need to be. :)

I started toying with the idea of putting other languages on CPAN about 5 years ago, but decided against it after discussing it with some Perl mongers at OSCON. I also started FreePAN.org in 2003 with the goal of making a CPAN for all languages, but that project never really took off.

A couple weeks ago I started rethinking the whole thing. Certainly most languages have their own strong communities and distribution systems in 2008. But JavaScript (as a language) really doesn't. And almost every project I work on these days involves both Perl and JavaScript. And JSAN made JavaScript modules look like Perl modules. So I decided to look into how hard it would be to leverage CPAN for JavaScript's benefit. It was surprisingly easy.

It turns out that if you put any file in the lib/ directory of a CPAN module it will get installed. So, for example, lib/jQuery.js would be installed when the user runs make install.

However, I decided that it wouldn't be too cool to put the jQuery package on CPAN and let the user figure out that it was JavaScript and not Perl. Besides, there is already a Perl module called jQuery! I decided to put all these modules in the JS namespace. So jQuery becomes JS-jQuery on CPAN.

But what use is it to get JavaScript modules installed on your machine if JavaScript can't find them? I wrote a companion module called JS.pm. This module lets you run a command like:

> js-cpan jQuery.js /Library/Perl/5.8.8/JS/jQuery.js

So you can get the path names of the JavaScript modules you have on your system. You can then copy or symlink these modules into your web app. With a *nix command like this for example:

ln -s `js-cpan jQuery.js` jquery.js
Now you can distribute Perl web apps on CPAN that require certain JavaScript modules, and have them be included in the standard way as Perl module prerequisites.

For the most part, I plan to just upload my own JavaScript code to CPAN. But lately, almost everything I write in JavaScript relies on jQuery. It's just that good. If JavaScript 2.0 ever comes out, it should have the jQuery core included in the spec. :)

Wednesday, February 6, 2008

The Year of the Wiki

Happy new year! It's Chinese New Year. The year of the Rat.

Rat. Hmm. I don't think I want to spend this whole year giving honor to the Rat. See, I live in America. I've spent the last 7 years under the Rat.

I'm actually very excited about this upcoming year, and the possibilities for doing good things and creating great things. I'm particularly excited about Wikis.

In 2003 I wrote some Wiki software called Kwiki. For a while it really started a wildfire, especially in the world of Perl. I set Kwiki up to make the software itself a collaborative experience, much in the way the Wiki is about collaborative content. In the following months and years, many Perl hackers hacked over 250 Kwiki Plugins!

Sadly, Kwiki fell to the sidelines for the last couple years. Last winter it started to surge again only to be stopped dead in its tracks by my accident in Taiwan in the Spring.

Now I am almost fully recovered and my enthusiasm for Wiki and Kwiki is back in full swing.

I spent this last week at Socialtext in Palo Alto. Socialtext is the original Wiki company and my employer of the last 5 years.

This last weekend I spent 48 hours in San Francisco, scheming and hacking with Eugene Eric Kim (eek) the father of the Purple Wiki. Eugene and I crafted some very ambitious Wiki plans for 2008.

Tonight I am at the Portland Wiki Wednesday, sitting across the table from Ward Cunningham, the inventor of the Wiki itself.

It's definitely been a Wiki Week. I'm getting the feeling that maybe it should be a Wiki Year. With all due respect to the Chinese, I declare the next year, starting right now:

The Year of the Wiki!!!



If you'd like to join me, visit:

Wednesday, November 28, 2007

The Hackers Will Always Overcome


So I bought a ticket to go to Taiwan in December, but later decided to postpone the trip.

The departure date was next week so I knew I'd better call today and cancel it. I called the airline at 5:15pm and they told me to use their website to cancel it. So I hung up and surfed on over.

After finally navigating this very crufty site to the cancellation page, I filled out the form and clicked the CONFIRM button. The page simply zipped to the top and did nothing. Strange. I tried again. Same thing. I looked around to find a better button to click. Nada.

So being a hacker I viewed the source code for the button and saw that it called the "validate_data" javascript function. I tried entering in some bad data, and it gave me alerts saying that my data was bad. Then I fixed all the bad data again and nothing. again.

At this point I said fµck it and called them back... I'm sorry, the office is now closed... office hours are from 9am to 5:30pm...

FµCK! This time I really said ƒµçk it!! I'm a hacker! I'm going to hack this site and make it work!!!

I fired up Firebug and did a document.getElementsByTagName('form'). Cool! Just one form. I clicked on the result and firebug showed me the guts of the form. It all looked good. Then I saw onsubmit="return validate_data()". That stupid stupid JS function. document.getElementsByTagName('form')[0].removeAttribute('onsubmit').

Buh-bye.

Now I went back and clicked CONFIRM again. Nothing... Hmm. Is this button even part of the form? Oh ƒµçk it. Who needs a button to submit a form? document.getElementsByTagName('form')[0].submit().

Voilà!

Don't let crappy e-commerce sites get you down. Just hack the ƒµçk out of them!

Friday, October 12, 2007

Fling, Me, A Passport


The craziest thing just happened to me! It makes me believe in life a little bit more.

A delightful man named Fling, whom I've never met before just walked up to me whilst I was working at Online Cafe. Yes, Fling. Yes, Online Cafe. None of this is made up. (I'm just not that creative!)

Fling asked me "Is your name Ingy"... Yes... I found your passport on the street... (jaw drops)... wait here and I'll run home and get it for you.

So two nights ago I got back from visiting my coworkers in Vancouver. I guess in the process of unpacking my car, the passport fell out. I had actually noticed it right away, and figured it was safe inside the car somewhere. Today when I got to the cafe, it crossed my mind to go get it from the car. Luckily I put it off and stayed in the cafe so Fling could find me, instead of going into a major freakout that would have ensued, since I need that passport to get back to Vancouver tomorrow.

Wow!

Fling rocks. Life is beautiful.

Speaking of life, I attended the funeral reception for the passing on of my good friend Meghan's
father, yesterday. The Tesh-s are a great family, and we all had a good time enjoying the comfort of friendships, and toasting to the life of Don Tesh. I only met him once, but he had an important effect on my life... He was the retired doctor who referred me to my most excellent wrist surgeon in April.

Rest in peace, Don.

Tuesday, September 11, 2007

Alter Ego And Edamame

I had dinner with Ingy!

Last night I got together and dined with my local alter ego, Ingy Pants. We ate at Seattle's best sushi restaurant, Maneki.

We babeled a bit about French and Chinese language, various arm surgeries, and the 4 "P" languages (Perl, Python, PHP and Ruby). We feasted on some fabulous Japanese food including the ever succulent Black Cod Collar Miso.

I met Ingy a couple years ago googling ingy seattle. She was number one, so I had to meet her. Today the spot seems taken by some dude named Brian Ingerson (maybe I'll meet him too some day).

Good to see you again Ingy. There's definitely room for two of us in this town.

Saturday, August 4, 2007

Trail of Four Cities


Somehow I always end up back in Seattle. But then I get wanderlust and takes to all kinds of great places in this great world. Still I have my favorites. The are the cities that I just feel at home in:

新竹 (Hsinchu) - This is the Taiwan city that I lived in for 6 months. Also the one that recently tried to eat my wrist. Still I love it and can't wait to get back. I will learn Chinese before I die.

Vancouver - Couver is a techie's haven. And it is naturally beautiful. And full of my favorite people. And it has the Excellent Eatery!

Portland - Portland peeps are real. I love it there. Where else can you find over half a dozen movie theaters with beer and pizza?

Seattle - You always get me back. But I'll always leave you again.

So hmm. What do these places all have in common? Great bicycle riding. Decent weather year round (except 新竹 in the summer). Ocean, mountains, flats and lush green. Great food (the best outside of Chicago, which is really the only city I can recommend for food). Technology. High cost of living (Couver is a bitch). Great people.

I think I'm ready to make a next move, Seattle... where shall I go?

Wednesday, June 27, 2007

Post Op Days


It's been almost a month since I wrote here. A week after I wrote that I went to the Swedish hospital for wrist surgery. In a word, the surgery was "good". The doc keeps his cards pretty close to his chest, but I could tell he was pretty excited about the turnout. That's the good news...

...life has been so low key since then. My wrist is going to be in the healing phase for the next year I think. It doesn't bend so much now, and I guess fixing that takes a long time.

But I have been steadily doing some low key but fun stuff. I went on a trip to Portland last weekend. I love that town. I'm always tempted to move back.

This past weekend my buddies Tatsuhiko Miyagawa and Steve Howell, were both in town. Monday night we all went to watch the Mariners beat the crap out of the Red Sox. I don't go to many baseball games, but can someone please tell me why every other fan at Safeco Field was cheering for Boston?!?

I hope Miyagawa had a good time. I'm not in the best shape to host people I think. But the weather was great and we got out a bit. Friday night I had my first BBQ party in nearly a year. I'm ready for another.

So ever since this surgery I've been sleeping more than ever. At first I thought it was the sleep drugs, but I've stopped taking those, and I'm still a zombie half the time.

What else? I've been spending some time writing my new Perl module, YAML::XS. It's exciting because Perl has been dieing for top notch YAML support, and YAML::XS is just that. It is a C binding to Kirill Siminov's libyaml library. The "top notch" credit all goes to Kirill. libyaml is simply amazing. I think Kirill is to programming, what Wolfgang Amadeus Mozart was to music. Well I just get the feeling that Kirill makes no mistakes. I haven't found a single bug in this opus of code.

Today I got out on my motorcycle! Technically I should probably wait a couple more weeks, but man... I gotta live. It was great to ride a few miles. Yesterday I rode my road bike for a bit, and last week I started running again. I'm still loving being alive. I think getting the pace of your life slowed down can be a good thing. It helps you notice all the good stuff around you.