programming


[Update] A porting guide is now available.

Had a great opportunity to do the Django 1 upgrade for one of my projects during the Django sprint held this week in Tel Aviv university. Couldn’t dream of a better place to do it: with experts & other people doing the same thing.

Main things I had to do:

  • Changed the signals code to the new syntax
  • Changed the admin & admin docs url mapping
    • See the docs & also for admin docs
    • Also had some links in our app for admin pages (such as Logout, & Change passwords) whose links have changed in v1. Took the new URL’s from the admin source files.
  • Changed the models admin metadata to the new syntax & separated it to new admin.py for every app
    • This seems at first like a task that would take several days of manual labor. Luckily, a script was written to automatically migrate code, which worked great. I’ve applied it to all of our apps (about 20 in this project) manually (too bad it wasn’t extended to migrate full project).
    • Besides running the script, I had to remove the existing admin metadata code from the models.py files.

The sprint BTW was quite fun, though I didn’t get to help with Django bugs, just do the migration & testing. Meir Kriheli gave a great Django tutorial, & I gave a small presentation about some of Django projects I’ve done. I hope it’ll contribute to the local Django community to raise its head over the boring Java/.Net/PHP water.

The classic “No silver bullet” paper states that the essence of software development is the decision what to develop (& not the accidental aspect of how to develop). Agile methodologies try to solve this by saying modestly that the solution to this problem can’t be known in advance, but rather reached iteratively using a feedback loop involving the software customer. Value-Creation methodologies recommend strategic gating, & various focus methods that try solve the essential problem of what to develop, which when done right eliminates many derivative problems.
Web2.0 best practices talks about early beta release & continuous feedback based improvement, directed in solving the problem right. Some companies, Google notably, allow themselves a more brute-force approach, of shooting to all directions, with small beta offerings, which either succeeds & is continued, or fails & is discontinued.
There are also several vendors, (e.g., Accept Software (which I happen to work with)), which try to help companies solve the problem right, by enabling analysis of what should be developed, based on both market/prospects inputs & development/resources cost estimations.
Even if you don’t practice all of these great solutions to the essential problem, at least be extremely aware of it: always focus on the initial “what to develop” question.

For the times they are a-changin’ (Bob Dylan) 

There’s a revolution taking place – if you’ve got the knowledge, you can work from anywhere, serving companies in other parts of the world. I’ve worked for the past few months with some brilliant programmers from Viet-nam doing software projects for firms in California. I’ve heard of young people creating objects in Second Life, such as Guns & Magic Wands, & selling them for $5-$20 a piece.They didn’t have to immigrate from their poor economies, just get the knowledge & provide services for companies in wealthier countries. Amazon is enabling this , with the Mechanical Turk mechanism, but its used less for Knowledge workers. The problem with knowledge workers is that knowledge is something you normally acquire by experience. As Peter Norvig said, the only way to be an expert in some field, is to work in it for at least 10 years. However, you can’t start gaining experience without some initial knowledge, that enables you to be competent enough to start bringing value & be able to get a job. Enter the Free Web Academy: a new mechanism in which people would be able to get practical knowledge in highly demanded professions, that can be practiced from anywhere in the world. It’s a non-profit & completely free university, with courses, lessons & exams given over the Web. It’s still in beta, & the 1st pilot course is starting next week. Students are not required to have anything except for: will, english & Internet connection.Free Web Academy (screenshot)Read more about it in this mind-map roadmap, & feel free to join!

I had an annoying problem in my Django app when I translated it to Hebrew, & started adding Hebrew data. It would yell the regular ‘ascii can’t decode non-ascii characters’ error page. I dug a bit inside the admin code but didn’t see something wrong or fixable.

So today I finally understood I need to change the __str__ method to __unicode__ . This solved the problem completely. Too bad it doesn’t appear in the Django documentation nowhere. I would expect it in the Internationalization page & the tutorials too!

For the past couple of monthes I’ve developed 2 large Web applications, using the amazing Django web framework, & recently chose it for my next large project. I can now say without any doubt that it is the platform of choice today for developing almost any type of software. Its slogan claims that it’s the web framework for perfectionists with deadlines, & I fully agree. It’s just a brilliant platform, that revolutionizes software development, in the amazing productivity that it enables. Beauty according to David Gelernter is simplicity & power, & the Django authors just achieved so much beauty!

I found the underlying programming language, Python, to be the programming language of my dreams, really powerful, simple & fun to work with!

When I tell people about Django, they either say that it’s just like Rails, or that they don’t see any reason to move away from their familiar PHP or J2EE.
Well, I can tell you what I think of these alternatives using a metaphor: if you need to buy a laptop today, you basically have 3 choices: a PC loaded with Windows, a PC loaded with Linux & a MacBook loaded with OS X. I worked extensively with all choices, & can tell you that I get things done much better, much faster & much much more enjoyably on my MacBook. I find Rails to be similar to a PC loaded with Vista, PHP/J2EE like a PC loaded with Linux, & Django like a MacBook loaded with OS X.

If you’re an entrepreneur today, BTW, you’re just committing a crime if you don’t take my recommendation seriously.

I couldn't find any documentation on how exactly to do this, so here's a sample code:

        ArrayList<String> errors = new ArrayList<String>();

        Project project = RemoteProjectManager.getInstance().getProject(kbHost,
                          kbUserName, kbPassword, kbName, true);
        if (errors.size() > 0) {
            for (String s : errors) {
                log.error(s);
            }
            throw new InitException("Failed to connect to the Knowledge Base");
        }
        knowledgeBase = project.getKnowledgeBase();

[They didn't provide documentation, but you can still digg their unit tests...]

  • My tweets

  • My bookmarks

  • My pictures

    Fixed summary of Erlang workshop by Ulf Wiger

    Fixed summary of Erlang talk by Ulf Wiger

    Erlang talk, Ulf Wiger

    Erlang workshop, Ulf Wiger

    AppEngine updates talk - Barack

    More Photos
  • My Deezer default playlist


    Discover Count Basic!
  • Top Clicks

  • My previous posts

  • Listed on BlogShares