Archive for Internet

United States of France

Speaking of politics, this article from TIME Magazine is pretty funny, if not pathetic:

You just know the Frogs have only increased their disdain for us, if that is indeed possible. And why shouldn't they? The average American is working two and a half jobs, gets two weeks off and has all the employment security of a one-armed trapeze artist. The Bush Administration has preached the "ownership society" to America: own your house, own your retirement account; you don't need the government in your way. So Americans mortgaged themselves to the hilt to buy overpriced houses they can no longer afford and signed up for 401(k) programs that put money — where, exactly? In the stock market! Where rich Republicans fleeced them.

[...]

We've always dismissed the French as exquisitely fed wards of their welfare state. They work, what, 27 hours in a good week, have 19 holidays a month, go on strike for two days and enjoy a glass of wine every day with lunch — except for the 25% of the population working for the government, who have an even sweeter deal. They retire before their kids finish high school, and they don't have to save for $45,000-a-year college tuition, because college is free. For this, they pay a tax rate of about 103%, and their labor laws are so restrictive that they haven't had a net gain in jobs since Napoleon. There is no way the French government can pay for this lifestyle forever, except that it somehow does.

Anyways, with all the financial institutions going bankrupt everywhere, I'm just glad Nomura bought back Lehman Brothers' Asian operation and saved the jobs of 2 of my friends... at least for now.

Comments

Joss Whedon’s Dr. Horrible: don’t miss it

Joss Whedon's pet project, in answer to the writer's guild nonsense, came out yesterday: Dr. Horrible's sing-along blog. A mini-series exclusively for internet and for free, done on the cheap with his friends.

It's a mix between Pinky and the Brain, Mistery Men and a video blog, executed musical-style. It's brilliant, especially since I was a big Doogie Howser fan as a kid (Neil Patrick Harris) and burned through Whedon's Firefly series in a straight 2-days stand.

Act 2 will come out July 17th and Act 3 on July 19th. Catch it while it lasts!

Comments

Custom Django filters in Google App Engine

You want to create your own custom Django filters in App Engine without running a whole Django stack? Here's how in a few lines of code.

First create a specific python file to hold your custom filters at the root of your application. In my case I use customfilters.py like this:

import re
from google.appengine.ext import webapp
 
register = webapp.template.create_template_register()
 
def escapeimg(body):
	return re.sub(r'<img (.*)/>', '[IMG]', body)
 
register.filter(escapeimg)

Then in your main application source file, call the following line outside of the main() definition, for example just after your modules loading:

"""Load custom Django template filters"""
webapp.template.register_template_library('customfilters')

You should then be able to use the new filters you registered in customfilters.py straight away in any of your Django templates without any % load foobar % call

Comments (2)

Crossdomain proxy on Google App Engine

Here's a crossdomain proxy to pipe Javascript Ajax calls from you Google App Engine application to the Flickr API, since most browser will not let you call another domain directly.

import cgi
import urllib
from google.appengine.ext import webapp
from google.appengine.api import urlfetch
 
class FlickrController(webapp.RequestHandler):
	"""Proxy for Ajax calls to flickr"""
	def get(self):
		flickrapiendpoint = 'http://api.flickr.com/services/rest/'
		flickrapikey = 'you_flicker_api_key'
 
		params = self.request.GET
		params.add('api_key', flickrapikey)
		params.add('format', 'json')
		apiquery = urllib.urlencode(params)
 
		result = urlfetch.fetch(url=flickrapiendpoint + '?' + apiquery, method=urlfetch.GET)
		self.response.out.write(result.content)
 
def main():
	application = webapp.WSGIApplication(
		[('/flickr/', FlickrController)],
		debug=True)
	wsgiref.handlers.CGIHandler().run(application)
 
if __name__ == "__main__":
	main()

I didn't see examples of such a script anywhere else so I thought I'd post it here for all to see.

Comments

WWDC Keynote

Tonight (at least in Japanese time) is Steve Job's WWDC Keynote. It is widely accepted that he will be announcing the new 3G enabled iPhone and I am secretly hoping he will give us a release date for Japan live from the Moscone West.

These past weeks, I've been developing a live-blogging system for my other website to cover the event minute by minute. It's a challenge to devise a system, both software and hardware-wise, capable of handling the huge loads involved in such a big event. We are expecting more than 50.000 persons to follow the Keynote via MacBidouille.

Until now, all our attempts have failed. But this time, I'm trying something new with an Ajax based interface running on the new Google App Engine platform. It's been really fun using a new technology, Python, on Google's own architecture.

I have no idea if this new system while withstand the load this year, especially with the tight quotas in place for the beta phase of App Engine. But I sure hope Steve announces the iPhone launch in Japan starting tomorrow and I'll take the day-off to rush to the Apple Store in Ginza as soon as it opens...

Comments

Contact Juggling

YouTube Preview Image

Found this video on Digg, looks like Yoyogi Park. This guy is a million times more impressive than all those stupid jugglers and beanbag fanatics you find in such parks.

Yes, there's only one crowd I despise more than beanbaggers, it's the drum players. That's probably the main reason why I never hang out at Yoyogi Park...

Comments (1)

Address Power

Last July I wrote about a popular Japanese webservice that built an image of your brain out of your name. Everyone at work and on TV was talking about it. The concept was even copied overseas (replacing the kanjis with emoticons).

This weekend I saw on TV another of those websites that you know everyone will talk about. Its name is 住所パワー which aims at calculating your "Address Power" from the number and proximity of restaurants, schools, train stations, etc.

住所パワー - Address Power

My address, even though I live out in the relative boondocks, 20 minutes from 池袋 - the closest station on the Yamanote line - into 埼玉県, scored a nice 3,321 points and is ranked A-class.

details of my ranking

Here are the results by criterion, with the number of shop and the distance to the closest one (I added the translations). I probably owe my good score to being extremely close to the station and across the street from a supermarket on one side and a mall on the other.

Note that the number of Love Hotels and 風俗 - basically any kind of shop/bar/club/salon related to the sex industry - comes as a criterion, although they probably need a broader databases because there are at least 2 dozen hostess bars/キャバクラ in a 200m circle around my place that should have gotten me a lot more points...

Comments