ronny.haryan.to

Icon

Print: $9.50 — Online: free

psycopg2 and 64-bit Apache on Leopard

The Apache httpd that comes with Mac OS X Leopard runs in 64-bit mode, so everything else that’s loaded, including mod_wsgi and psycopg2 must be able to run in 64-bit mode as well. Graham Dumpleton explained this behaviour in a post to the django-users mailing list.

Compiling psycopg2 using MacPorts as well as from the tarball would result in something like this when loaded from a web application that runs on Apache:

ImproperlyConfigured: Error loading psycopg2 module: dlopen(/Library/Python/2.5/site-packages/psycopg2/_psycopg.so, 2): no suitable image found.  Did find: /Library/Python/2.5/site-packages/psycopg2/_psycopg.so: no matching architecture in universal wrapper

So all I needed to do was force psycopg2 extension to be built for 64-bit as well as 32-bit. After extracting the latest psycopg2 source, do this instead:

LDFLAGS="-arch ppc -arch i386 -arch x86_64" CFLAGS="-arch ppc -arch i386 -arch x86_64" python setup.py build

Then sudo python setup.py install. After that, check the .so file, it should look something like this:

$ file /Library/Python/2.5/site-packages/psycopg2/_psycopg.so 
/Library/Python/2.5/site-packages/psycopg2/_psycopg.so: Mach-O universal binary with 3 architectures
/Library/Python/2.5/site-packages/psycopg2/_psycopg.so (for architecture i386): Mach-O bundle i386
/Library/Python/2.5/site-packages/psycopg2/_psycopg.so (for architecture ppc7400):      Mach-O bundle ppc
/Library/Python/2.5/site-packages/psycopg2/_psycopg.so (for architecture x86_64):       Mach-O 64-bit bundle x86_64

Don’t forget to restart Apache, and that should be it.

Update: It happened to PIL too, it was giving this error: The _imaging C module is not installed, so I had to do the same thing as above: LDFLAGS=... CFLAGS=... python setup.py build followed by sudo python setup.py install.

A designer must also be a user

Pop quiz, hotshot. How do you navigate to the previous screen in a BCA ATM?

If you’re like me and most people, you press “Cancel”, reinsert your card, punch in your PIN again, and navigate to the screen that you want. Try repeating that while finding a menu item and a few people line up behind you and you keep reinserting the card back as soon as the machine pops it out.

I saw there were at least two buttons on the keypad that were unassigned and could have been programmed as a generic back button. Even if implementing a generic “back” button is too much effort, the “back” function could have been easily assigned to one of the side screen buttons.

And if you want to pay for a ticket, do you go to “Pembayaran” or “Pembelian” first?

klikbca is not any better. They seem to enjoy torturing their user. OK, rather than just complaining, I’ll straight away give one possible improvement to their balance checking interface. Merge the “Informasi Saldo” and “Mutasi” as one menu item called “Informasi Saldo”. Then, show the balance at the top and all the transactions for the past 31 days below it by default while still allowing the user to filter the transactions by date. Don’t ask the user to manually count (today – 31 days), just show it. If the range I put is more than 31 days, then just show what you have up to 31 days, don’t ask me to correct the starting date if you can easily fix it for me. If the info is too much and I don’t want to see that much info, then I’ll filter it later. If it’s too much info to show in one page, split it up into multiple pages. This is common sense. Why force the user to jump extra hoops every time?

The default should be sensible, and the default should be chosen because most people use it that way, NOT because it’s easier to program it that way. In order to understand the user’s pains, a designer must see from the user’s perspective and use the things they’re designing themselves. My girlfriend pointed out to me that most of these usability idiocy is because the people who designed/created it don’t use it themselves very often, and I agree with her.

All these big companies providing services to the public must hire at least a usability expert rather than wasting their money on paying half-assed so-called “designers” (that is if they even hire designers, they probably just let the programmers do the design). I mean just look at their websites. If any of you is an Indosat M2 subscriber, you would know how terrible their website is when you check your internet usage, it looks like it’s designed and written by a high-school kid who just learned PHP. Who the hell in this Web 2.0 age uses pop ups to notify the user that the login was successful?! Yes, successful, not unsuccessful.

Secara Goblok

“Secara” artinya adalah “dengan cara”. Jangan pernah menggunakan kata secara jika yang anda maksud adalah soalnya atau karena atau sebab. Secara anda akan kedengaran seperti orang goblok jika menggunakan secara tidak pada tempatnya. See what I mean?

Updates to Planet Terasi

It’s been more than a year since a major update was done to Planet Terasi. The recent bru-ha-ha kinda forced me to do an update.

So I did these:

  • I clarified the general topic for Planet Terasi in the About Planet Terasi section,
  • I also put clarification for inclusion (and rejection) in the contact page,
  • I removed some of the non-functional feeds,
  • I removed some of the feeds due to complaints I received from readers,
  • I changed Budi Rahardjo’s feed to only include the tech section (Pak Budi: I know you asked me to remove your feeds from Planet Terasi, but I hope you don’t mind me keeping this one. If you do mind, please let me know, I will gladly remove it.)
  • I went through 188 inclusion requests sent to me via email (collected for over a year now) over a slow internet connection and reviewed all 188 blogs (the working ones anyway) to be included in Planet Terasi,
  • I decided to add 20 new blogs to Planet Terasi (can you name them all?),
  • I bugged my network administrator to open SSH access so I can update Planet Terasi,
  • I wrote this post.

Most of the blogs from the 188 requests that I did not add are due to obvious splog (spam blog), off-topic, or unreachable when I reviewed them. Some of them are apparently very popular, very well written, and very well designed. I’m hoping I could post them here later so that you can still check them out if you like. I have added some of them to my personal aggregator.

I’m actually amazed and happy at the same time that people care enough about Planet Terasi to make a petition. But it was not necessary. All you need to do is fill out the contact form and talk to me. I appreciate all your input. And I hope I can keep Planet Terasi useful and fun to all its readers. Thanks for all your support.

“Thanks Before”

“Thanks before.”

“Same same.”

“Don’t follow mix.”

“Your children fruit is stupid very much.”

“My body is not delicious.”

I don’t know what the correct English translation is, so I will just assume that I can translate the words one by one, it should make sense, right? After all, each word can only have exactly one direct translation, right? It’s impossible that a word in one language can have more than one meaning in another language. And screw the context. We don’t need no context. And what did you say about culture? It has nothing to do with translating.

Since we are very good with assumptions, we always assume everything we don’t know because we can’t be bothered to look for what’s right. Assuming is easier. Mathematicians do it often, why can’t we? If I just assume the problem doesn’t exist then it’s not there anymore. Problem solved. Wait, what problem?

OK, the next person who says “thanks before” has to send me cookies.

About

Ronny Haryanto is a technology addict/chef wannabe living in beautiful Melbourne, Australia.

Read more…

Follow Me on Twitter

Follow @ronny on Twitter where I post much more often than my blog.