Archive

Archive for the ‘Software Development’ Category

jQuery Lightbox: Adjust big images to the window size

December 9th, 2011 2 comments

jQuery lightBox is a great plugin inspired in the well-known Lightbox JS by Lokesh Dhakar.
After starting using it I realized that things became messy with big images, so I made a small modification to limit the image size to the current browser window size.
Also I added an option to hide the image information. The images used to navigate between images and close the preview are in English, so I modified the images to be more neutral (just icons)
Read more…

Migrating GAE Blobstore to an HRD application

November 14th, 2011 No comments

Google App EngineIf you are planning to migrate your Google App Engine application to the “new” High Replication Database scheme, then you probably know that the Google migration process won’t handle Blobstore files.

Here you will find some python scripts that will help you to move the Blobstore files from the old application to the new one, and correct all the references in the new database. As always, use at your own risk, don’t try to do anything without reading and understanding the scripts, otherwise you may loose your data permanently.

Read more…

Make something useful out of your DPF (Digital Photo Frame)

April 4th, 2011 No comments

We had this great idea of using an old digital photo frame from smartparts to display some useful reports at work.
In this case, useful will mean that the reports (pictures in the frame) needs to be automatically updated, with no human intervention.
Take a look to this post, you may find something useful for your own DIY project!
Read more…

How to fix the “federated domain” problem in emesene

March 30th, 2011 No comments


If your emesene keeps displaying the annoying message “User could not be added: Email Domain is IM Federated Contact LiveID xxx@yyy.com is federated domain.” no matter if you accept or reject the user, then you probably want to apply this patch.
This is not really a fix, but a workaround, is just a hack to avoid displaying the error message if you really like emesene and you want to use it. If you don’t like this kind of ugly solutions, there are always other options like Pidgin, aMSN, etc. — in other words if you don’t like programming forget it, or wait for a new emesene version.
Read more…

Firefox add-on: UploadProgress

August 26th, 2010 11 comments

UploadProgress add-on This Firefox add-on adds a new option to the Tools menu called “Uploads” that displays a small window, similar to the downloads, but displaying only current uploads in progress. The uploads are automatically removed from the window after they finish. The idea is to have a way to know the progress of your file uploads and an estimated remaining time to finish.

Useful for sites that does not shows the upload progress like youtube.

This is my first add-on, so if you find something wrong please let me know.
I’ve submitted it to AMO but since it takes time to get released to the general public, I’ve decided to put it here in our blog if you want to give it a try.

Download it here, enjoy!

Read more…

How to create two wired virtual serial ports on Linux?

February 19th, 2010 No comments

To create two bridged virtual serial ports use the following command:

socat -d -d pty,raw,echo=0 pty,raw,echo=0

The output will show you which are the virtual ports (or pseudo terminals) created, e.g.:

2010/02/19 16:16:33 socat[9662] N PTY is /dev/pts/3
2010/02/19 16:16:33 socat[9662] N PTY is /dev/pts/4
2010/02/19 16:16:33 socat[9662] N starting data transfer loop with FDs [3,3] and [5,5]

Note: if you are using Ubuntu and you do not have this command, try:

sudo apt-get install socat

Image source

How do I compare two binary files on Linux?

February 19th, 2010 No comments

The easiest way I found is dumping the binaries into text files using hexdump and then comparing them with your favourite program (diff, Meld, etc.). E.g.:

hexdump -C a.bin >a.txt
hexdump -C b.bin >b.txt
diff a.txt b.txt

Image source

Extracting FLV meta tags with Python

February 5th, 2010 No comments

I’ve stolen this code from http://code.activestate.com/recipes/457406/ which in turn was stolen / ported from http://inlet-media.de/flvtool2 , made some small fixes in bugs related to the date conversion function, object and array unmarshaling, file name hardcoded, etc… If you want to learn more about the FLV format and metatags read Acrobat’s Video File Format Specification Version 10
Read more…

Categories: Programming FAQ Tags: , , , ,

(HTML) Table cell not inheriting style

June 4th, 2009 No comments

The goal of this new blog category called “Programming FAQ” is to publish short posts with day to day programming problems and their solutions, or at least provide a tip to find the proper solution to your problem. And today we start with this simple and stupid problem that can happen to anyone with poor HTML experience like me. “My HTML table does not seems to inherit the style from a parent element”, here is the example:

<html>
<body>
<div style="color: blue;">
	<table>
	<tbody>
		<tr>
			<td>BLUE TEXT</td>
		</tr>
	</tbody>
	</table>
<div>
</body>
</html>

In the below example I would expect to see the “BLUE TEXT” in blue, but is not (at least in FireFox). So what the hell is wrong with my code? probably many things but because I’m not interested in following/reading the W3C recommendations for my uncle’s home page, here is one possible solution: Add the transitional DOCTYPE to your document, or the DOCTYPE that adequate better to your page (read more here). E.g.:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

So, now you know. Never forget the DOCTYPE it is very important… Why? read this… It has to do with poor standards, browsers and all that crap.

Categories: Programming FAQ Tags:

Simplified DES (S-DES) file encryption implementation in C

May 8th, 2009 No comments
Simplified DES

Simplified DES

This encryption algorithm is not secure at all, in fact it was made for educational purposes. It uses a 10-bit key that can be quickly broken by a brute force attack. But, who knows, it may be good for someone interested in some quick encryption where security is not that important, or for embedded devices were resources are limited, or just for lazy students. :D

Read more…