Archive for the Category » programming «

Tuesday, November 04th, 2008 | Author: number.0

I decided to try Google App Engine for a personal project, that pulls yahoo weather at a regular time interval, but as I dived into Google App Engine then this simple thing can not be done in cron jobs, so I started to think about the solution, here is what I came up with, just the idea:

- Create a Cronjob class to handle the cronjob: this class will do the all the tasks that need to be done regularly
- Use javascript at client side to refresh the Cronjob page at a regular time interval.

I think the idea is simple, it does solve the problem but require you to have the page opened all the time. Some of you may have better idea?

Share/Save/Bookmark

Saturday, November 01st, 2008 | Author: number.0

I’m quite new to Django, Pinax and mod_wsgi, so today i decided to try on Pinax with a Slackware 12.1 development box. Everytime I forget after doing something, so better to note it down here, easier for me to remind it later, official Pinax 0.5 has been out for few days, and it’s a good time to try it to see how it can replace my current home-made PHP CMS. I’m not very used to Django, so another chance to play with it, my experience with Python framework only stop at Skunkweb & Quixote.

more…

Share/Save/Bookmark

Tuesday, October 21st, 2008 | Author: number.0

I keep some bookmarks of file manipulation with Python, please update if you know more. Thank you!

Documents / Office:

pyExcelerator: Generating Excel97 files
OOoPy: Manipulating OpenOffice documents
dbfpy: Manipulating dBase, Foxpro DBF files
vobject: Reading vCard & vCalendar
PalmDB: manipulating PalmPDB & PRC

Multimedia:

PyMedia: Manipulating wav, ogg, avi, divx, dvd etc..

Photos / Images:

TheBigPicture: manipulating EXIF & IPTC metadata in JPEG & TIFF files
jpeg.py: manipulating EXIF metadata of JPEG

GPS:

PyGarmin: Manipulating data from Garmin GPS

Utilities:

PyUNRAR: unpacking RAR files
libextractor: extract data from any type of files

Share/Save/Bookmark

Monday, October 20th, 2008 | Author: number.0

I’m writing a tokenizer in Python and found out a great GUI debugger for Regular Expression. For all of you that have been looking for a good Python Regular Expression GUI, you can depend on this - named Kodos:

Kodos is a Python GUI utility for creating, testing and debugging regular
expressions for the Python programming language. Kodos should aid any
developer to efficiently and effortlessly develop regular expressions in
Python. Since Python’s implementation of regular expressions is based on
the PCRE standard, Kodos should
benefit developers in other programming languages that also adhere to the
PCRE standard (Perl, PHP, etc…).

You can download and try it here

Share/Save/Bookmark

Category: editor, python  | Tags: , ,  | Leave a Comment
Sunday, October 05th, 2008 | Author: number.0

Here are the steps that I managed to install Mapnik 0.5.1 on Slackware 12.1, it’s for personal documentation but might be helpful for some of you out there.

Depends on your current installed packages, you may be required to install some other packages, for details of the dependencies, please refer to it’s wiki

Mapnik requires the Boost libraries, International Components for Unicode, Freetype, Proj4, and a variety of image libraries.

Installing Boost is often new to mapnik users, but the majority of remaining dependencies are more familiar.

If you have previously built or installed other open source graphics or mapping applications it is likely that most of the remaining dependencies are already installed.

Currently detailed notes on mapnik dependencies are included in each platform specific installation instructions.

See MapnikInstallation for more information.

Before installation, check your boost lib compatibility here
The boost lib I got from LinuxPackages.Net for Slackware 12.1 is at version 1.36, which is not compatible with mapnik 0.5.1 (I got error while compiling), so I took boost version 1.35 from here

- Install boost lib package
- Install scons package (from slacky.eu), requiredbuilder (from stabellini.net )
- Download SlackBuild of Mapnik for Slackware 12.1 from slacky.eu , put everything in the same folder (e.x /home/download/mapnik-slackbuild/)
- running #./mapnik.SlackBuild
- If everything is ok, you will get mapnik package at the same folder with the slackbuild scripts, install it like other Slackware packages.

Test your Mapnik:

Once the installation is completed, you can test your installation by running a Python Hello World with Mapnik (You can see detailed instruction from here). Here is my summarization

1. Download the data, put it in /home/work/mapnik/data/ & unzip it
2. Copy the python code below, put in it a file name world.py at /home/work/mapnik/

#!/usr/bin/env python

from mapnik import *
m = Map(600,300,“+proj=latlong +datum=WGS84″)
m.background = Color(’steelblue’)
s = Style()
r=Rule()
r.symbols.append(PolygonSymbolizer(Color(‘#f2eff9′)))
r.symbols.append(LineSymbolizer(Color(‘rgb(50%,50%,50%)’),0.1))
s.rules.append(r)
m.append_style(‘My Style’,s)
lyr = Layer(‘world’)
lyr.datasource = Shapefile(file=‘/home/work/mapnik/data/world_borders’)
lyr.styles.append(‘My Style’)
m.layers.append(lyr)
m.zoom_to_box(lyr.envelope())
render_to_file(m,‘world.png’, ‘png’)

3. Go to /home/work/mapnik/ and run the script #python world.py, if you get the world.png file in the same folder then everything is fine, mean the installation was successful

Share/Save/Bookmark

Category: programming, slackware  | Tags: , ,  | 2 Comments
Friday, October 03rd, 2008 | Author: number.0

This post will help me to keep track of some good resources on Internet related to CouchDB development

Wiki

http://wiki.apache.org/couchdb/

Tutorials

Introduction
Official website
Author blog (Jan Lehnardt)
Author blog (Damien Katz)
Conceptual Diagram

Step-by-step guide:
Programming CouchDB with Javascript (very good & detailed guide)
CouchDB on Rails (nice one, detailed, step-by-step, but I’m not a rail developer, may be later on)
Simple one way replication (Ruby)

General Discussion:
CouchDB - Use case
Couchdb Joins by Paul Joseph Davis
CouchDB Joins by Christopher Lenz
Storing hierachical data in CouchDB

PHP:
PHPillow - object oriented wrapper for CouchDB
http://wiki.apache.org/couchdb/GettingStartedWithPhp

Python:
Python-CouchDB wrapper library
CouchDB via Python (python-couchdb author website)
CouchDB with Django

Ruby & Rails:
CouchDB on Rails
Planet CouchDB
CouchDB and CouchObjects

.NET:
CouchDB Gui Front End

JAVA:
CouchDB4J

Hard-core:
These stuffs are at high level for those of you - brilliant minds, quite difficult to understand for me but they are here for completeness and you may find cool thing to plow more and become CouchDB experts :)
Inspecting CouchDB
CouchDB btree:lookup
CouchDB btree:query_modify

Comparision:
Amazon SimpleDB & CouchDB

Performance:
A quick look at couchdb performance

Real-word Examples:

You will find a lot of projects started to use CouchDB here

Hope that you find them useful for getting start with CouchDB, I will try to keep this up-to-date, so help me if you can

Share/Save/Bookmark

Wednesday, September 24th, 2008 | Author: number.0

I managed to have CouchDB running with Django inside mod_python, everything was installed on my Slackware 12.1 development server.

1. mod_python is compiled for Apache2, if you don’t know how then proceed here
2. I used official release from Django, check out here if you need help with the installation
3. Install Erlang, CouchDB as described in my previous post
4. Install CouchDB Python binding is easy with easy_install couchdb
5. I set up a virtualhost to run my couchdb-django testing (/etc/httpd/extra/httpd-vhosts.conf)


ServerAdmin abc@abc.com
DocumentRoot “/srv/djangocouchdb”
ServerName django.dev.com

Options FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all


PythonPath “[r'/srv/'] + sys.path”
SetHandler python-program
SetEnv DJANGO_SETTINGS_MODULE djangocouchdb.settings
PythonHandler django.core.handlers.modpython
PythonOption django.root /couchdb
PythonDebug On

(well, i made my /etc/hosts file to have entry for django.dev.com for sure )

6. Then I followed instruction from HERE to create my django project and couchdb app inside that project. And everything worked, just with a little problem (access denied) with PYTHON_EGG_CACHE which in my system refered to /root/.python-eggs. I reset PYTHON_EGG_CACHE to /tmp and restarted my server, then everything worked fine.

Now it’s time to explore more :)

Share/Save/Bookmark

Category: programming, python  | Tags: , ,  | 2 Comments
Wednesday, August 27th, 2008 | Author: number.0

Ohhh yaa,

I have been using Skunkweb for almost 1 year and feeling happy with it. It’s one of the nicest python framework out there but the only down side is lack of community & documentation. I thought the development has been stopped since the homepage is not updated for a long time, but recently Skunkweb has comed with new name Satimol, but personally I think the old name is better. Anyway, I am happy to see it again and will try to explore it when I’m out of my current work mesh.

Thanks to the creator of Skunkweb to still keep it alive, Jacob Smullyan and Drew Csillag

Share/Save/Bookmark

Category: programming, python  | Tags: , ,  | Leave a Comment
Monday, August 25th, 2008 | Author: number.0

I found a great editor for AIML, if you are tired of working with plain xml file then this is the best tool out there for creating aiml file. And best of all, it’s free

 

GaitoBot AIML Editor - With the GaitoBot AIML editor you are able to produce correct AIML fast and easy. Using the innovative built in workflow viewer you keep the overview even with larger projects. 

 

You can find it here

Share/Save/Bookmark

Category: editor  | Tags: , ,  | Leave a Comment
Tuesday, August 19th, 2008 | Author: number.0

An interesting article to differentiate OpenID and SSO at http://www.cricketschirping.com/weblog/?p=1123

Enjoy yourself!!!

Share/Save/Bookmark

Category: general, programming  | Tags: ,  | Leave a Comment