Pedro Assunção

Archive for August, 2009

Django: Reverse HTTP redirect with parameters

Here’s how to, from a view, redirect to another URL passing parameters to it. For instance, to redirect the user to a certain page after login: return HttpResponseRedirect(reverse(‘dz_details’, kwargs={‘dz_id’:dz.id})) This will lookup the ‘dz_details’ name in your urls.py file, which could be defined like so: url(r’^details/(\d+)/$’, views.dz_details, name=’dz_details’), There is a simpler way to do [...]

Quicktime: You have a problem because your net connection is online.

I mean, what? You are telling me that the fact that my internet connection is online is actually a problem. Oh, maybe it’s just a way of Apple engineers telling me that I should not spend so much time online. Thanks Apple!

Peoplebrowsr uses Joomla?

I recently came across this when I tried to add my digg.com to my.peoplebrowsr.com. Something wrong happened in the server and I got the reply in the first picture. After clicking the “homepage” link in that screen Peoplebrowsr loaded a second full site in the popup. Neat stuff

[Django] Dynamic redirection after login

Here’s how to redirect to the login page in django, making it go to a certain view (by name) after a successful login: login_url = ‘%s?next=%s’ % (reverse(‘acct_login’), reverse(‘jumplog_index’)) return HttpResponseRedirect(login_url) Notes: acct_login is django’s view name for the login page (double check this, as it might change in future django versions); jumplog_index is the [...]

Two Guys and a Beer (actually a joint this time) episode 80

Two Guys and a Video episode 80 is live. Full video, here. Audio-only version, here. This week: – A joint… – Jerking off during trial – Sperm Travels Faster – Sperm grown in lab – Buy MIGs – Avoid this job – Balls on fire – Kitten blamed for child pornography – Murder turtle – [...]

Plane crash in Portuguese airfield

Holly crap, a plane just crashed in my Dropzone in Portugal. According to early reports in Portuguese news sites, the pilot owner was behind the controls – along with the co-pilot, when the airplane crashed against a house in a neighborhood in Evora. The airplane had just dropped off the skydivers that were on board [...]

Vimeo uploads

I’ve been recently writing a python script to upload videos to vimeo, as I usually do when I have to upload a new episode of Two Guys and a Beer. Today I believe they rolled out a new advanced upload API, though the old one should still work until November 13th. But the problem is [...]

Going to hell. Two Guys and a Beer, episode 79.

Two Guys and a Video episode 79 is live. Full video, here. Audio-only version, here. This week: A trip to hell, and: Chinese kid beaten to death MIT tackles charging an electric car under 11 minutes Twitter DDOS Baby doll vest 12 years ago: MS – Apple deal a funny microsoft ad open source video [...]

Floating balconies

One of the cool things about having a meal in a restaurant by the Amsterdam canals is the boat show you are exposed to. There is all kinds of interesting, freaky, psycho, old, new, crazy, and obnoxious styles for your viewing pleasure. There is, however, one constant: The 80s music that everyone in Amsterdam seems [...]

Java HTTP proxy servlet (with Spring)

I always wanted to build my own proxy. I’m kidding. I do have better things to do with my time. Nevertheless, a problem presented itself and here’s my solution for it: An HTTP proxy Spring controller. Currently: Handles GET and POST methods; Guaranties the type of the response to be the one the target server [...]

Road trip to citybox at Amsterdam Noord

Since I need to move out of my current apartment by the end of this month, I decided to get some storage space to put all my belongings. The place I chose was citybox, in the north of Amsterdam, and the trip there involves taking a nice (free) ferry boat from the Amsterdam Centraal Station [...]

JIRA issues reporting with Python

I recently took interest in knowing how one of the projects I worked previously had evolved in JIRA over time. So I decided to write a python script to do it for me. Turns out it’s pretty easy, using the xmlrpclib that comes with python, if your JIRA installation has this remote entry point enabled. [...]