Blog

Latest blog posts


How to get image resize right on IE

Published 3 days, 14 hours ago

Ever wondered why resized images look fishy on IE? me too (not), but there is a way to fix it

check thsi link
http://code.flickr.com/blog/2008/11/12/on-ui-quality-the-little-things-client-side-image-resizing/

Tags: css ie

Programming Languages I've Learned (In Rough Order) Meme

Published 2 months ago

Via Eric Florenzano.

This is the list of the languages I've learned over time, from Pascal in 1997 to Python in 2008. These days I'm working mostly with PHP, Python and JavaScript


  • Pascal

  • C

  • VB6

  • VBScript

  • JavaScript

  • PHP

  • C#

  • VB.NET

  • PL/SQL

  • Python

Website redesign

Published 2 months, 2 weeks ago

I've had this green template sitting around for some 3 or 4 months already, and in the last couple of weeks I decided to do something about it. I have felt the need for a personal wiki from time to time, some place where I could store some knowledge I pick up here and there, and can check easily, so I've decided to build a wiki for myself. I must have spent at most between 15 to 20 hours doing html/css/js, server-setups, django coding. Git was a pain at times, but it was worth it.

I'm not that much of a blogger, so I think the wiki feed will be more useful.

PS: Comments are not yet available, I'm thinking of using disqus. I saw it first on Alcide's website and it seems a pretty good idea, but it will probably take a week or two until I have time to work on this again..

Django and Python tips

Published 3 months ago

Eric Holscher has written an awsome post full of django and python goodies.

check it out in http://ericholscher.com/blog/2008/oct/5/django-tips/

Tags: django python tips

Installing Fedora 9 and KDE4

Published 3 months, 1 week ago

I had some problems with Kubuntu's KDE4 support for dual monitors, so I decided to try Fedora 9 and KDE4.
The fedora 9 live cd has kde4.0, and there are some bugs (If on KDE4.0 the menu disapears just remove the ~/.kde folder and restart X), so the first thing to do is run the updates to kde4.1.

After all the updates are done, you might want to install Kontact 4 instead of 3.5 and Kate. Here's how to do it:

kdepim4 (Kontact 4)
su -
cd /etc/yum.repos.d/
(yum install wget)
wget http://apt.kde-redhat.org/apt/kde-redhat/fedora/kde.repo
yum --enablerepo=kde-unstable update kdepim kdeutils


kate
su -
yum install kdesdk


Thanks to the kind people at #fedora-kde in irc.freenode.net

Tags: fedora kde4 kmail kontact

Ditching Nautilus for Dolphin in Gnome

Published 5 months, 2 weeks ago

And KDE instead of Gnome might be next. I'm disappointed by the lack of progress in Gnome.. As KDE4 approaches a more stable release my desire to change increases, but for now KDE4 apps like Dolphin or Umbrello will do. Dolphin is in fact less resource hungry in Gnome than Nautilus, has a lot more features (dual pane, column navigation, tree+panel at the same time, among others) and also has much better looks!

Tags: gnome kde4

Python Tips, Tricks and hacks

Published 6 months, 1 week ago

Just an essential Python reference http://www.siafoo.net/article/52.

Tags: python

Template tags in Django

Published 6 months, 3 weeks ago

I was messing around today with django-gencal but the lack of an easy to follow documentation was a bit of a problem. I got some help from the official Django docs but most especially from this excelent post/howto from James Bennett.

PS: Just needed to reference this for future use. My delicious account has way too much stuff.

Tags: django, template tags

ASP.NET/Oracle PLSQL Poll App

Published 6 months, 4 weeks ago

I've just release an Poll App on codeplex. It was made as a college assignment, mainly focused on the Database side, using Functions/Stored Procedures whenever SQL was involved.

It was released under a MIT license on codeplex's website (because one was required), so feel to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software.



Tags: aspnet oracle plsql polls

Getting Real

Published 7 months ago

Getting Real is a book from 37signals, the famous company behind the popular Ruby On Rails framework.
Getting Real describes 37signal's philosophy and how they went from beeing a small design company to a multi-million dollar company that still has no more than 10 employees today. It talks about the process of building a web application, from design to project management, team selection, and a whole lot more.

It's not your regular book, but kind of a collection of tips, very easy to read. It's been out for a while, so Check it out if you haven't already.

Tags: 37signals book productivity web

The perfect PHP framework is your framework

Published 7 months ago

Yesterday a post popped up on sitepoint stating that PHP is a framework.

While I don't think calling PHP a framework is correct, chances are that if you use PHP, you are likely using a framework, even if it is just something you designed according to your needs.

The reason this post got my attention was that some months ago I was evaluating different PHP frameworks, and became a bit interested in the subject. I didn't have a range of criteria or anything at the time, I just wanted something that felt right working with and that had a decent community size.
I did take a serious shot a cakePHP however and even built a tiny custom framework based on it, but some things just didn't feel right. Since most of the projects I take part in usually don't take more than 3 weeks, and since most of the heavy work is done at the object level, why should the rest need to be complicated?

I eventually came to the conclusion that the best PHP framework, is the one that best adapts to your needs. Considering the amount of third party extensions in repositories like PEAR or PECL, and with resources like Smarty and many others. The freedom you get from using your own custom framework, by using whatever extensions you prefer, and coding the way you are more comfortable, might just be the best choice for both small and large projects.

Here's the structure I currently use:


|-- classes
| |-- page.class.php
| |-- post.class.php
|-- includes
| |-- libraries
| | |-- smarty
| | | |-- smarty.php
| | |-- phpmailer
| | | |-- phpmailer.php
| | |-- validate.class.php
| |-- config.inc.php
| |-- includes.inc.php
|-- controllers
| | |-- page.php
| | |-- page.detail.php
|-- templates
| | |-- inc.header.tpl
| | |-- inc.footer.tpl
| | |-- page.tpl
| | |-- page.detail.php
| | |-- static.contacts.tpl
| | |-- static.hp.tpl
|-- webroot
| |-- images
| |-- css
| |-- js
| |-- index.php
| |-- 404.html
|-- hander.php


I don't think it can get easier than this, but it wouldn't be the first time I'm mistaken :)
- Webroot is the root directory in apache.
- index.php defines the PATH constants (TEMPLATE_PATH, CONTROLLER_PATH, etc) and redirects every request to handler.php
- handler.php parses the url (clean urls) and calls the appropriate page. For example, if http://app.com/page is called it searches for static.page.php in the templates, and if it does not exists it checks for page.php in the controllers. In page.php I just use regular php.

Tags: php frameworks

gcode - Html scrapping with python (part 1)

Published 8 months ago

On with my project, I have just finished my gcode parser class. After searching around a bit I found an awesome module called BeautifulSoup that allows you to navigate through the DOM in a very friendly and quick way, but since this is an Academic project I decided to only use it to a small extent and use regular expressions for the rest of the parsing.
I didn't manage to group named regular expressions as I wanted, which means I had to repeat some simple patterns but I hope to get it together for final version.
The code documentation is mainly in Portuguese because it's a college project, but it will eventually be released in English.

Download it here

Tags: code python gcode

Google Code to RSS Feeds

Published 8 months ago

As part of a class this semester, we are suposed to build a web-based project that can/must have bits of various technologies such as Javascript (Ajax), XML, Regular Expressions, XSLT, Web Services or Database integration.

I was looking into doing something usefull, so I decided to tackle a "problem" I'm having at the moment with Django: The lack of RSS feeds for open source projects listed in Google Code.

The goal is to create a RESTful web service so you can retrive "Changes" and "Issues" in RSS (and eventualy JSON) format for any project.

My plan is to have a simple interface in Django, and a Python cronjob running every hour or so checking the source. The projects table will start empty and new projects will be added automaticly when necessary. If possible I will try to add some way to check how many users are subscribed to a particular feed (still have to figure out how).

I will be detailing my experiences here, and sharing the source code along the way.

Tags: gcode google code rss django python

About this website

Published 8 months, 2 weeks ago

Now for some things about this website..

I've been learning Python, and Django in the past few weeks, and as part of the learning process I needed some practice, thus I decided to build this website from scratch instead of just going with wordpress. I'm pretty happy with out it turned out, and the experience was really usefull. Anyway, let's move along..

Python is very easy language to pick up, the syntax is very clean and there are a lot of open source projects and code examples around. I used diveintopython, a free online book (but also available commercially) to get my first look at the language.

I then started with Django, and went trough to the tutorial, but I recomend you to take a look at the free online book first. The Documentation is also worth very much to take a look at, and it's noticeable that a lot of effort was made in this part aswell.

On to the technical part, I decided to use the auto admin in Django (why wouldn't I) and a very very good tagging app. On a side note, you can find a lot of very useful plugins/apps in www.djangopluggables.com. I also used Nuno Mariz code for friendfeed integrating my Google reader shared feeds and flickr account. The rest was up to me, not much at this point as well, but the objectives were met: implement views, templates, forms and raw sql. I also decided to use sqlite as database, which is natively supported by python.

On the hosting part, my inexperience with setting up production servers, and the fact that I don't have that many projects to host, were the only things preventing me to buy a slice at slicehost, but the excellent articles were reason enough to venture in this area as well. The very good feedback that floats around in the web about them is true, it's really a great service and it is worth to take a look at even if you are considering shared hosting.

So that's it, I will probably release the source code sometime. It is very simple, but in the meantime if someone is interested you can just drop me an email at mlouro _at_ zolbe dot com and I will happily send it.

Tags: django slicehost tagging blog

Hello world!

Published 8 months, 3 weeks ago

This is my first post on my django Powered Blog!