Archive for December, 2009

Google Wave invitations

Wednesday, December 9th, 2009

I’ve got several Google Wave invitations to hand out, so if you want one, send me an email (you should know my email address if you’re my friend :-) ).

Social network[ing] services clients

Monday, December 7th, 2009

All the social services (Facebook, Twitter, etc) client apps I’ve seen (Gwibber on the desktop, Mauku on Maemo) fail in the same way, which is:

  • They just show the latest “feed” of messages from the service, not allowing users to either keep some message for a while, or remove messages they are not interested in.
  • They don’t integrate well with all the services (having a ‘@friend ….’ message in your Facebook profile doesn’t look well at all, which is what is done when you ‘reply’ to a message in Twitter) or just don’t integrate at all.
  • Some of them, like the Facebook widget on Maemo, just display your home page in Facebook when you click on one item, instead of sending you to the entry for that message you’re clicking on!

The only “thing” that does it correctly, from what I’ve seen so far, is yoono, a Firefox extension, which shows all the messages from all the services you configure it with, allowing you to remove messages you’re not interested in or have already read, or keeping messages for future reference. Also, it gets you to the right page at Facebook when you click on one item, and also allows you to comment directly to the messages right from yoono itself.

It’s true though that it would be great to have it not tied to Firefox, as an independent application, so /me dreams about gwibber/mauku implementing something like yoono.

PHP Help

Sunday, December 6th, 2009

Dear lazy web:

How do I make PHP not run out of memory when doing thumbnails of large images? I’ve got this code:

                        $href = $path . "/" . $file;
			$tn_file = "thumbnail-" . $file;
			$orig_file = $full_path . "/" . $file;

			/* generate thumbnail if it does not exist */
			if (file_exists ($tn_file) == false) {
				$im = @imagecreatefromjpeg ($orig_file);
				if (!$im) {
				        $im = @imagecreatefrompng ($orig_file);
					if (!$im)
						continue;
					$is_png = 1;
				} else
					$is_png = 0;

				if (imagesx ($im) < imagesy ($im)) {
					$new_width = round (imagesx ($im) / (imagesy ($im) / 240));
					$new_height = 240;
				} else {
					$new_width = 240;
					$new_height = round (imagesy ($im) / (imagesx ($im) / 240));
				}
				
				$copy_im = imagecreatetruecolor ($new_width, $new_height);
				imagecopyresampled ($copy_im, $im, 0, 0, 0, 0,
					$new_width, $new_height, imagesx ($im), imagesy ($im));
				if (is_png == 1)
				        imagepng ($copy_im, $tn_file);
				else
				        imagejpeg ($copy_im, $tn_file);

				imagedestroy ($copy_im);
				imagedestroy ($im);
			}

			//$get_url = "/images/thumbnail-" . $file;
			$get_url = $tn_file;

It works great for most of my images (as you can see here), but it doesn't for big images (2592x1944 pixels, like this one).

I've been trying all the solutions mentioned in this page, but none seems to work for me :-( I am assuming it's an out-of-memory problem, but could it be something else?

The dream comes true

Thursday, December 3rd, 2009

Two years ago I started dreaming about driving a Yamaha XT660Z Teneré. At that time, the motorbike had just been announced, getting to shops a few months later. Then, when available, I started trying to sell my previous motorbike (Aprilia Pegaso 650 Trail), which was hard because of the crisis, but some weeks ago, a nice guy from Coruña came here and got it (quite cheaper than what I could have got if there was no crisis though), so right after that, I went to the Yamaha shop and, finally, ordered one. After 3 weeks waiting (I wanted the 2008 model, which has that khakhi color as an option, not available in the 2009 model, so it took a bit to get it from another Yamaha shop), a few weeks ago I could finally get it.

After 1200 kms with it, I can only say it’s the best motorbike I could have bought, since it’s perfect for daily usage as well as for off-road, specially after having changed its tyres yesterday:


Now all the mud, snow and tracks around here are nothing I can’t deal with :-)