• Python Tips, Tricks and hacks

    Posted on 2008-07-04 00:14:53

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

    Tags: python 0 comment(s)

  • Template tags in Django

    Posted on 2008-06-15 22:36:06

    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 1 comment(s)

  • ASP.NET/Oracle PLSQ Poll App

    Posted on 2008-06-13 01:15:11

    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 0 comment(s)

  • Getting Real

    Posted on 2008-06-10 03:38:36

    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 0 comment(s)

  • The perfect PHP framework is your framework

    Posted on 2008-06-08 23:43:17

    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 0 comment(s)

  • gcode - Html scrapping with python (part 1)

    Posted on 2008-05-09 02:38:15

    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 0 comment(s)

  • Google Code to RSS Feeds

    Posted on 2008-05-06 20:37:49

    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 0 comment(s)

  • About this website

    Posted on 2008-04-27 00:18:59

    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 0 comment(s)

  • Hello world!

    Posted on 2008-04-20 01:05:04

    This is my first post on my django Powered Blog!

    Tags: hello django 0 comment(s)