Meditations on programming, startups, and technology
Currently Browsing: Python

Installing Python, Django, and DB2 on Ubuntu 11.04

Note: This is the Python version of the Ruby guide I just published. In this brief tutorial I’ll show you how to create a complete Python and Django setup for DB2 on Ubuntu. By following my step-by-step instructions, you’ll be able to install the following components: Python easy_install Django DB2 Express-C 9.7.4 The official Python driver, dbi module, and Django adapter for DB2 Installing Python and...

FAQ: What programming language should I learn first?

There are hundreds of different programming languages out there. As a newcomer you can ignore the fact that most of them exist. However, even if we narrow the list to just a dozen mainstream languages, deciding on what programming language to learn first can be a daunting task. You might find yourself asking, should I learn C, C++, Java, C#, or PHP first? If you ask ten programmers this question, you’ll...

Thoughts on Clojure

Lisp has had a tremendous impact on the world of programming. Even though Common Lisp and Scheme — the two main Lisp dialects — may not be considered mainstream today, several popular languages have been influenced by one or both of them. It isn’t stretching things too much to say that both Ruby and Python can be seen as slower, easier (for beginners), object-oriented, infix Lisp dialects. Some may...

DB2 support for Django 1.2 is here

The latest release of the IBM Adapter for Django now supports Django 1.2. Aside from enabling you to use the most recent version of Django, this release adds a few new goodies into the mix, that I’m sure many will appreciate. For example, IBM’s adapter (through the underlying DBI wrapper) now uses persistent connections, which are especially helpful when dealing with Django – as it lacks connection...

Free Python screencast about solving mazes

ThinkCode.TV’s English site is going to be launched on April 19th. To celebrate the upcoming launch and whet your appetite, a 19 minute long screencast about solving ASCII mazes with a few lines of Python code was just released for free. This video serves to illustrate Python’s elegance and power, as well as ThinkCode.TV’s approach to screencasts and education. In order to download the screencast,...

Benchmarking Tornado vs. Twisted Web vs. Tornado on Twisted

FriendFeed, which was recently acquired by Facebook, just released an interesting piece of open source software. Tornado is an open source version of the scalable, non-blocking web server and tools that power FriendFeed. The FriendFeed application is written using a web framework that looks a bit like web.py or Google’s webapp, but with additional tools and optimizations to take advantage of the underlying...

Improve the speed and security of your SQL queries

An easy way to improve the performance and security of SQL queries is to replace literals with parameters. By replacing literal values with parameters, advanced relational databases will be able to compile your queries and have their execution plans cached. This saves time and precious resources when the same query (minus the actual values) is executed over and over. Consider the following series of...

Enabling support for DB2 and Python/Django/SQLAlchemy on Mac OS X Snow Leopard

This article is obsolete. Please refer to the following articles for up do date instructions: Ruby/Rails and DB2 | Python/Django and DB2. Thank you! This is the Python version of a post I made about Ruby a few days ago. Now that Mac OS X 10.6 is out, it’s time to leave the world of 32 bit computing behind. The pre-installed Python interpreter will run in 64 bit mode by default, so you may need to pay attention...

Startup for sale on eBay (and it’s a great deal)

One of the best programmers I know is selling a web application on eBay, that he’s been developing and running for the past three years. Given the starting price and considering what one lucky person or company will walk away with, I must say, it’s an amazing deal. I’m writing about his auction here so that I can help it get the proper exposure it deserves and because I think it’s an...

The DB2 adapter now supports Django 1.1

This article is obsolete. Please refer to the following articles for up do date instructions: Ruby/Rails and DB2 | Python/Django and DB2. Thank you! I’m glad to announce that the API team has just released version 1.0.2 of the adapter for Django. And on my birthday to boot, what a nice present. This version extends its support to the recently released Django 1.1, as well as incorporating the feedback that was...

Serving Django Static Files through Apache

Django’s development server is capable of serving static (media) files thanks to the view django.views.static.serve. Popular web servers like Apache, Lighttpd or NGINX are much faster though, and as such should be used in production mode. Our goal is to bypass Django and let Apache (or other valid alternatives) directly serve static files like images, videos, CSS, JavaScript files, and so on, for us. Generally...

Memoization in Ruby and Python

Wikipedia defines memoization as “an optimization technique used primarily to speed up computer programs by having function calls avoid repeating the calculation of results for previously-processed inputs.”. This typically means caching the returning value of a function in a dictionary of sorts using the parameters passed to the function as a key. This is done in order to reuse that returning value...

Better Software 2009 and Pycon Italia Tre

In May I will be presenting at two conferences in Italy. The first is called Better Software 2009; it’s dedicated to the world of software development, Agile methodologies, Web 2.0 and a bunch of other buzzword compliant technologies. This conference will be held on May 6 and 7 in sunny Florence. If you speak Italian and happen to be in Europe, you can register here. Italian conferences tend to be fairly...

Ruby’s Biggest Challenge for 2009

According to the TIOBE index, Ruby is holding its own in the 11th position, sandwiched between Delphi and D. Meanwhile, its “cousin” Python has jumped up in rank and is currently the 6th most popular programming language in the world, beating out C#, JavaScript and Perl. Ruby’s exponential growth appears to have truly slowed down. Even if we disregard the TIOBE Index or view it as being entirely...

IBM’s Python driver is out of beta

This article is obsolete. Please refer to the following articles for up do date instructions: Ruby/Rails and DB2 | Python/Django and DB2. Thank you! There’s a new release of the Python driver/wrapper for DB2 and Informix in town. Version 0.7.0 is officially the first stable, production ready release. It includes fixes for a few known bugs and fully supports Unicode. This driver, and the DB-API 2.0 wrapper it...

Introducing Redis: a fast key-value database

One of the many advantages of having remarkable friends is learning quite early on about their most ambitious and interesting projects. Today, I’m going to talk about Redis, one such project that my friend Salvatore “antirez” Sanfilippo started. Redis (REmote DIctionary Server) is a key-value database written in C. It can be used like memcached, in front of a traditional database, or on its own...

DB2 support for Django is coming

This article is obsolete. Please refer to the following articles for up do date instructions: Ruby/Rails and DB2 | Python/Django and DB2. Thank you! Online Surveys & Market Research A few weeks after DB2 Express-C for Mac OS X was announced, I’m here to let you in on another great scoop. DB2 support for the Django web framework is going to be available soon to the community, under the...

Monte Carlo simulation of the Monty Hall Problem in Ruby and Python

Reading Jeff Atwood’s post The Problem of the Unfinished Game, reminded me of a similar problem. The Monty Hall Problem is a well known probability puzzle that has tricked many people. In fact, if you are not familiar with it already, chances are that you’ll get it wrong. And you would be in good company along with many mathematicians and physicists, including the great mathematician, Paul Erdos. This...

Merb, Rails Myths, Language Popularity and other Zenbits

Zenbits are posts which include a variety of interesting subjects that I’d like to talk about briefly, without writing a post for each of them. Merb: A few days ago Merb 1.0 was released. Congratulations to Ezra Zygmuntowicz on this important milestone, the Merb community and Engine Yard (who finances the project). Merb 1.0 wasn’t even out yet when some people had already started commenting on the...

The Rise of the Functional Paradigm

In yesterday’s address to the Ruby community, Dave Thomas invited Rubyists to fork Ruby, to freely research and experiment with new and interesting features. If this process is successful, many of these features will inevitably see their way back into Ruby’s core, thus improving the language in leaps and bounds. And I feel he couldn’t have been any more right. In fact, the whole industry is...

« Previous Entries

Copyright © 2005-2012 Antonio Cangiano. All rights reserved.