Archive for April, 2008
Whats on my reading list
I’m a voracious reader. I spend a lot (both money and time) on books. Blogs bring in a lot of flexibility and casualness to such a habit. I keep modifying my reading list according to perceived benefits. Here are some of them:
Management Thoughts
HBS Working Knowledge: From Harvard Business School. Academic discussions on management.
InsideCRM – The CRM Industry’s Web Resource, PGreenblog & The CRM Consultant: Being a CRM consultant, I look for blogs providing decent CRM information. I added these blogs recently on my reading list. So far I am happy with them.
Raven’s Brain: She has good information on project management. Not only that she collates pretty good articles on project management too.
Scottberkun.com: Scott Berkun’s The Art of Project Management is a must-read for all project managers. His web page is a collection of information on his books and essays.
LinkedIn Answers: Management: Another very professional and active discussions on anything related to management – projects, people, outsourcing and so on. I’ve found these discussions to be focused and stimulating, to say the least.
ElementalTruths.Com: Reg Adkins is a behavioral consultant. I found his early writings to be very informative. I feel that recently, he has deviated from his core strengths. But I still keep reading him.
Technical
Grey Sparling PeopleSoft Expert’s Corner: I’m from Vantive world who moved on to Peoplesoft world. I don’t develop in Peoplesoft but manage two projects (with some excellent team leads) in Peoplesoft. Tips from Grey Sparling helps me understand Peoplesoft little better.
The Django community aggregator: I’ve recently started with Django, a web framework in Python. I find Django easy to learn and Python easy to code. Hopefully I can develop some decent, useful applications in Django. I already developed SOL, a Twitter clone for our department use.
Joel on Software: I’m not sure if this should be under Technical or under Management, because Joel speaks authoritatively on both topics. Whatever be the topic, his articles are very informative of the subject.
programming: what’s new online: Reddit’s collection of articles of interest on Programming. These articles are rated socially and hence generally worth reading.
Scott Hanselman’s Computer Zen: I stumbled on Scott Hanselman’s blog while looking for useful tools. He not only blogs about useful utilities but about .NET as well.
The Yourdon Report: Ed Yourdon is the authority on System Analysis and Design. Those concepts introduced by him are still so relevant. I admire his energy – he blogs, travels a lot, micro-blogs and still come out with good articles.
LinkedIn Answers: Technology: Related to LinkedIn Management Answers. I don’t find this discussion forum that useful like the other one. Yet, time to time I get some valuable tips from this forum.
Indian blogs
Just a little something:I envy Anita’s photography skills and admire her nomadic spirit. Every time I see one of her photos, I wish to shoot like that. I visited her Photography Exhibition too.
Ouch My Toe!: Jammy can make you laugh. Sometimes louder. With all the sarcasm, I wonder how he is not yet put in jail or divorced (his wife is the point of jokes in most of the entries).
Prabhu n Ferrari: If you understand Tamil, be sure to read his He-She series. They are humorous. He should publish his series using the Depot’s self-publish service.
Tasty Palettes: Food blog of an ex-colleague. I’ve not yet had the opportunity to taste her work; but looking at her photos I am sure they are a treat.
Walk in the clouds: I can’t understand all of Seema’s poems; I am no good in literature. But the ones I understand are fantastic; most of them are romantic; few others are inspiring.
Others
Quotes of the Day: List of famous quotes. Not just inspiring quotes; but funny ones too.
Geek & Poke: Cartoons on IT folks. I know Dilbert is a famous one. But some how I like Geek & Poke.
Joke of the day: Another site for relaxation.
I am no bag of potatoes
‘Products should be generalized; People should be differentiated‘
This is a paraphrased form of what Jack Welch says in his book, ‘Straight from the Gut’, about people and products. Coming from someone who managed both labor-intensive organizations and knowledge-intensive organizations, this is a valuable advice to manage people. Yet, often organizations get this wrong.
We build specialized products for customers but generalize employees by labeling them as those who belong to ‘last year batch’ or ’2 year batch’ or ‘non-BE batch’ or something similar. Though employees are encouraged to compete across these ‘labels’, they are limited to their batches while deciding for promotion and compensation. Such continued labeling and restrictions frustrates even the highly motivated employees.
Let us say a ‘fresher’ demonstrates the quality of a team lead and does well in that role as well. However when the time of reckoning (appraisal time) comes in, she can’t be promoted because she hasn’t yet completed two years in the firm!
I face this issue year after year, both for myself and for those in my team. In my opinion the compensations and promotions should be based on merits and not on seniority. Wouldn’t that be misused? Of course yes. May be there should be few parameters on which a candidate should be evaluated for the role rather than seniority. And may be there should be a panel too.
I used to think that this issue pertains to Indian IT companies as most in the HR department are from government positions. However recently I read few posts on the same topic from Scott Berken PM Clinic ForumsĀ and I was surprised that this is a global issue.
As I said earlier, I don’t know the best answer for this issue. I’m like the guy who goes to a million dollar budget movie with a hundred rupees ticket and feels that the movie is not that good. Can I direct a better movie? Hell no. But I can differentiate a good movie and a bad movie. So is this issue. Do I know a better solution? No. But I know that current solution is not the right one. It needs to change.
A tale of two customer services
I believe that as businesses become virtual, it is not only necessary to ensure that customers have good experience during pre-buying (as they browse through product catalogue) and buying (shopping cart) but post-buying (customer service) as well.
A positive one
I was introduced to Zoom In by a colleague. He said that among the many online photo printing sites that he visited, he liked Zoom In. I decided to try it out because of his strong recommendation.
I had to agree with him because every thing was as easy as it could be – signing up, uploading photos and ordering photos. Uploading photos took sometime, but otherwise the site was quite fast; Utilizing their 25 free prints, I ordered few prints. The prints were neat and were delivered through courier. Neither the prints nor the delivery was expensive.
That was not the best part. I wanted to order few calendar prints that they advertised. When I tried to use one of the uploaded photos, it showed an red exclamation mark but didn’t throw up any message. I was bit confused and sent them an email. Promptly came the reply with proper explanation. I agree it could’ve been set in their page in the first place; but I was forgiving considering all the other pleasant experience that I had with Zoom In.
When I shared this with my colleague, he informed that, Zoom In claims that they read every e-mail and respond. There should be cost involved, but probably Zoom In considers that it is worth. Good for them!
A bad one
I’ve been looking to purchase, ‘Peopleware‘ by Tom. I searched in most of the ‘real’ bookshops and whatever online bookshops that I knew, but without any success. So when I saw ‘Available’ against ‘Peopleware‘ in NBC bookshop, I was glad and immediately ordered one. I ordered one more book along with it and the amount was immediately debited.
However, I got only one book and when I sent them a mail they said the shipping time is 3-4 weeks for ‘Peopleware‘ and it will be shipped in that duration. Since it was a normal time duration, I didn’t bother. But not so when that became 6 weeks. I sent them a reminder and I got a response:
Your book is dispatched from the international stores. We will inform you once it reaches us.
That seemed a reasonable response and I decided to wait for few more days. However after 8 weeks, I sent them a ‘strong’ message. Then they replied saying:
The book you ordered is out-of-stock. We will pay you back.
I’m not surprised that the book is out-of-stock or that they agreed to pay back, but the way they provided misleading information put me off. Had they told me in the first place that the book was out-of-stock, probably I would’ve continued to do business with them. But not after providing wrong information. (By the way, I am still waiting to get their refund).
When I have to print some more photos, I’ll surely go to Zoom In; when I want to buy a book, I will definitely look at some other online shop.
Django application as a stand-alone desktop application
There are few options available to package Django as a stand-alone desktop apps. They are:
- cx_freeze
- PyInstaller
- Py2exe
- dbuilder.py
Siddharta already packaged Django as a windows application using cx_freeze. I based my experiment on his entry. Though he has explained it pretty well, being a python/django newbie, I needed a lot more than what he explained in his article.
I read pages after pages and spent about a week in making a desktop app of SOL. I didn’t make much progress and was very frustrated. (I wrote about it here). After a time, I switched to py2exe, as I was not able to locate much info about cx_freeze.
I used py2exe, sqlite and cherrypy for packaging as a desktop app. As it is only for demo purpose, I would’ve preferred to have the default development server itself. But I don’t know how to do it; and info about cherrypy was readily available.
Fundamentally, you need to import all of the required Django modules. That takes the most of the time. Whenever I got, ‘module’ object has no attribute ‘xxxx’, I had to trace it to one of Django’s module and import it.
Once I got all of the modules, I had to integrate with CherryPy. It wasn’t difficult as info was already available. However, admin css were not delivered. I read through ‘AdminMediaHandler’ code and understood that I had to pass an absolute path for admin media folder. That got me both local media and admin media done.
I had to make only one change to settings.py. I replaced
os.path.dirname(os.path.abspath(__file__))
with
sys.argv[0]
I was glad that I persevered to make this. Here I post the setup, imports and the build script with the hope that it might be useful for others.
This is the first file – sol.py
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
import os, sys
os.environ['DJANGO_SETTINGS_MODULE'] = "settings"
#these pertain to your application
import sol.models
import sol.views
import urls
import manage
import settings
#these are django imports
import django.template.loaders.filesystem
import django.template.loaders.app_directories
import django.middleware.common
import django.contrib.sessions.middleware
import django.contrib.auth.middleware
import django.middleware.doc
import django.contrib.auth
import django.contrib.contenttypes
import django.contrib.sessions
import django.contrib.sessions.backends.db
import django.contrib.sites
import django.contrib.admin
import django.core.cache.backends
import django.db.backends.sqlite3.base
import django.db.backends.sqlite3.introspection
import django.db.backends.sqlite3.creation
import django.db.backends.sqlite3.client
import django.template.defaulttags
import django.template.defaultfilters
import django.template.loader_tags
import django.contrib.admin.urls
from django.conf.urls.defaults import *
import django.contrib.admin.views.main
import django.core.context_processors
import django.contrib.auth.views
import django.contrib.auth.backends
import django.views.static
import django.contrib.admin.templatetags.adminmedia
import django.contrib.admin.templatetags.adminapplist
import django.contrib.admin.templatetags.admin_list
import django.contrib.admin.templatetags.admin_modify
import django.contrib.admin.templatetags.log
import django.contrib.admin.views.auth
import django.contrib.admin.views.doc
import django.contrib.admin.views.template
import django.conf.urls.shortcut
import django.views.defaults
#dont need to import these pkgs
#need to know how to exclude them
import email.mime.audio
import email.mime.base
import email.mime.image
import email.mime.message
import email.mime.multipart
import email.mime.nonmultipart
import email.mime.text
import email.charset
import email.encoders
import email.errors
import email.feedparser
import email.generator
import email.header
import email.iterators
import email.message
import email.parser
import email.utils
import email.base64mime
import email.quoprimime
import django.core.cache.backends.locmem
import django.templatetags.i18n
import django.views.i18n
#let us hook up cherrypy
#is it possible to hook up the dev server itself?
from cherrypy import wsgiserver
import cherrypy
from django.core.handlers.wsgi import WSGIHandler
from django.core.servers.basehttp import AdminMediaHandler
if __name__ == "__main__":
print '*****************************************************'
print 'Open your browser and point to http://localhost:8000'
print 'To close, press ctrl-c'
print ''
print 'local user id is: jjude; password is also jjude'
print 'admin user id is: admin; password is also admin'
print '*****************************************************'
os.environ["DJANGO_SETTINGS_MODULE"] = "settings"
# Set up site-wide config first so we get a log if errors occur.
cherrypy.config.update({'environment': 'production',
'log.error_file': 'site.log',
'log.screen': False})
try:
sys.path.insert(0,"..")
#2nd param to AdminMediaHandler should be absolute path to the admin media files
cherrypy.tree.graft(AdminMediaHandler(WSGIHandler(),media_dir=os.path.dirname(os.path.abspath(sys.argv[0])) + settings.ADMIN_MEDIA_PREFIX), '/')
cherrypy.server.socket_port = 8000
cherrypy.server.quickstart()
cherrypy.engine.start()
except KeyboardInterrupt:
cherrypy.server.stop()
This is setup.py
from distutils.core import setup
import py2exe
import glob
setup(
options = {"py2exe": {"compressed": 1,
"optimize": 2,
"ascii": 1,
"bundle_files": 1,
"packages":["encodings"],
"excludes" : ["pywin", "pywin.debugger", "pywin.debugger.dbgcon","pywin.dialogs",
"pywin.dialogs.list","Tkconstants","Tkinter","tcl"],
}},
#these are the data files like templates, site media and admin media
data_files = [(".",["sol.db"]),
("templates",glob.glob("templates\*.*")),
#("files",glob.glob("files\*.*")),
("media",glob.glob("media\*.*")),
("media\css",glob.glob("media\css\*.*")),
("templates\admin",glob.glob("C:\Python25\Lib\site-packages\django\contrib\admin\templates\admin\*.*")),
("templates\admin\auth\user",glob.glob("C:\Python25\Libsite-packages\django\contrib\admin\templates\admin\auth\user\*.*")),
("templates\admin_doc",glob.glob("C:\Python25\Lib\site-packages\django\contrib\admin\templates\admin_doc\*.*")),
("templates\widget",glob.glob("C:\Python25\Lib\site-packages\django\contrib\admin\templates\widget\*.*")),
("templates\registration",glob.glob("C:\Python25\Lib\site-packages\django\contrib\admin\templates\registration\*.*")),
("adminmedia\css",glob.glob("C:\Python25\Lib\site-packages\django\contrib\admin\media\css*.*")),
("adminmedia\js",glob.glob("C:\Python25\Lib\site-packages\django\contrib\admin\media\js\*.*")),
("adminmedia\img",glob.glob("C:\Python25\Lib\site-packages\django\contrib\admin\media\img\*.*")),
],
zipfile = None,
console=['sol.py'],
)
This is the build script.
python -OO setup.py py2exe --b 2 --optimize 2 --dist-dir y:sol rd /s /q build
You can download the demo from code.google.com. I’ll keep updating these scripts as I learn more. So get the updated scripts from code.google.com.
If you are to engage in such a exercise, you need lot of patience.
Next steps:
- Integrate with UPX
- Integrate with Inno Setup (or some other windows setup makers)
I’m sure this can be done in a better way. Feel free to comment.
Reference:
My frustration with packaging django
I have been trying to package django application as a windows executable. I know it might sound ridiculous to most of the web-apps developers. Most of Windows users are not used to ‘svn’ a source. Add to it that Python is not a default installation in any of windows installation. So it would be better, if I could make a self-contained executable version. This will be useful for demo purposes. If I can make this work, I can even create desktop applications on Django. How cool that would be!
I might be doing something really stupid, because there are at least three utilities available for this purpose.
First, I tried, dbuilder.py, which try to package django apps. There I got the below error.
Unknown command: 'runserver' Type 'manage.pyc help' for usage.
When I asked around in irc, I was told that it will not work. Nothing can be done.
Then I tried cx_freeze. I couldn’t find much of documentation for cx_freeze. Yea, I can make a hello.py as an executable. That is easy but including some packages and other stuff is difficult. By searching around, I finally wrote a script that compiled. But when I executed the output, I got the below error:
WindowsError: [Error 3] The system cannot find the path specified: 'C:\Documents and Settings\Joseph\Desktop\SOL\sol.exe\django\db\backends/*.*'
Being a Python newbie, probably I am expecting too much of myself! But after 5 evening of reading and trying, I am frustrated now. I know there is py2exe and pyinstaller. But I am not sure if I can figure out to make them work. So I’m going to shut down now with lots of frustration.