Post archive for November, 2008

Programming Meme

Eric Florenzano started a fun programming meme over at his blog, and I thought I'd join the fun. I'm planning to get a G1 phone sometime early next year, so I thought it would be a good time for an initial foray into Java since I plan to create custom Android applications in the future. This is the first program I've ever written in Java, so I'm sure it's a mess in many ways I don't yet understand. One thing I found very telling is the amount of code to implement this compared to the amount of code needed in Python. I understand Java was never meant to be a command-line scripting language, however, so I'm giving it the benefit of the doubt and assuming that's why it took so much to get so little. . . So, without further ado, I present to you Eric Florenzano's programming meme in ...

(view comments) (read more)

Django's Dynamic URLs

One of the strengths of the Django framework is its emphasis on the Don't Repeat Yourself philosophy. From Wikipedia: "The philosophy emphasizes that information should not be duplicated, because duplication increases the difficulty of change, may decrease clarity, and leads to opportunities for inconsistency." This approach has many advantages in web development, avoiding a great deal of the redundant and tedious HTML editing that often must be done on static sites. One way that Django truly shines in facilitating the implementation of DRY is in its URL handling. In traditional static HTML authoring, the URL is defined by the filesystem. If a directory changes for any reason, every HTML file that contains a link to that resource must be edited with the new URL. Even in small sites, this can quickly eat up a developer's time and generate a lot of frustration. It's easy to fall into the trap of ...

(view comments) (read more)

My Django Development, Testing, and Production Environments

I've seen a lot of discussion lately about different strategies for developing and deploying Django applications. I wanted to share my current environment in the hopes that it might help someone new to Django or software development in general, and I was also hoping for some constructive criticism so that I can learn best practices. Most of my coding is done on my own, but I've been trying to stay away from cowboy coding habits as much as possible to keep my development practices disciplined. I started out using Gedit with plugins and the Linux command shell, and that worked very well. As my projects grew larger, though, I really wanted a more feature-rich environment that would allow tighter integration of Subversion. I also did a small amount of development on a Windows machine (not by choice), and I wanted a development environment that I could use across multiple platforms. ...

(view comments) (read more)

Blog Updates

I implemented a few minor updates to the blog today that I wanted to spend a moment talking about. Redirects I added the django.contrib.redirects app to redirect requests for the old URLs from the Diario app to the new URLs under the Django Basic Blog app. I switched to Basic Blog about a month ago because I liked its structure and simplicity, but I noticed that I was still getting a lot of hits for the old URLs. I didn't realize that I was getting so many visitors from Google searches. Welcome! With the redirects in place, now visitors from Google's index will still get to the right place. Code Highlighting I wanted to implement code highlighting for the blog because I post a lot of code snippets here. The code was formatted simply as white text on a grey background, and it was easy to get lost in the ...

(view comments) (read more)

Simple Sharepoint API Usage with jQuery - Part 2

In my last post I talked about a simple example of using Sharepoint's owssvr.dll API interface with jQuery. Today I want to provide a more complex example by showing how I've used the technique to create object collections that can be manipulated to generate on-the-fly statistics. To start with, I had a Sharepoint survey that captured a set of data from the user. That data was later used to calculate statistics. Previously, the survey was exported to Excel and that was used to come up with the numbers. My goal was to create a client-side application that would pull the information from Sharepoint and generate the statistics dynamically based on up-to-the-minute data. To do this, I used the technique I described in my previous post to build a $.get query. var list = 'A1234567-B123-C123-D123-A12345678901'; var view = 'E9876543-F987-9876-B987-A98765432109'; Then, I set up an object called fields that would map each ...

(view comments) (read more)

Simple Sharepoint API Usage with jQuery - Part 1

(This is part 1 of a 2-part post. Part 2 can be found here) I've recently worked on some projects for a company heavily using Microsoft's Sharepoint platform. I've been trying to move away from it as much as possible, but for a few of my projects it has been unavoidable. On those projects I needed to work dynamically with data captured in Sharepoint. After a lot of trial and error, I discovered the owssvr.dll API interface. The owssvr.dll interface lives in the _vti_bin directory under the Sharepoint site you are working with. Using GET requests, you can access XML data in SOAP form containing the information from lists and surveys in Sharepoint. More information about the API can be found here. UPDATE: On part 2 of this post, Eduard Ralph pointed out that there is a Webservice API offered by WSS 3.0 and MOSS. Information on this can be ...

(view comments) (read more)