Friday, April 10, 2009

Making Django's Built-in Auth Tests Pass

Django (web framework)Image via Wikipedia

I added the built in auth framework to a relatively fresh Django project today, and upon running my tests, I got a large number of failures coming from auth. This problem does not appear to be fully documented so this is what I did.

First, notice that most of the errors are template missing errors. Fix these by
  1. Installing the admin tool. Auth relies on some of its templates.
  2. Stub out any other missing templates (ie. login, logout).
Next, the test cases will complain about missing text in your new templates. Just add in exactly what its asking for as plain text.

Finally, some of the password reset tests were complaining about getting redirect (301) codes instead of success (200) codes. This was an error on my part. They're looking for a link in the password reset email and GETting it. I wrapped the link in an HTML anchor, and the regex in the test was grabbing the closing HTML tag. Removing the HTML fixed that problem. Finally, I just had to add some missing text as above, and all the tests passed.
Reblog this post [with Zemanta]

Sunday, February 22, 2009

How to Compile OCMOCK_VALUE for the iPhone

If you're using OCMock to test your iPhone application and OCMOCK_VALUE gives you this error message:
error: syntax error before 'typeof'


Add this line to the top of your test case:
#define typeof __typeof__


What seems to be happening is that the ObjC compiler on the iPhone has renamed 'typeof' to '__typeof__'. The macro above will add the old version back in. Some Googleing seems to suggest that this is related to C99 compatibility.
Reblog this post [with Zemanta]

Monday, December 1, 2008

Make money from open source? Umm, no.

Computer rigeneriamociImage by rigeneriamoci via FlickrOn Open Source:
Companies have long hoped to make money from this freely available software by charging customers for support and add-on features. Some have succeeded. Many others have failed or will falter, and their ranks may swell as the economy worsens. This will require many to adopt a new mindset, viewing open source more as a means than an end in itself.
- Open Source: The Model Is Broken
Umm... Duh.

Let's look at a couple of the premises of Open Source.
  1. Open Source code is higher quality
  2. Anyone can modify it
  3. The more successful the software it, the larger the community.
Now, lets look at the business model.
  1. Give software away for free
  2. Charge for support
  3. Charge for custom development
You're giving the software away for free so you can't charge for a license. Charging for support means that when something breaks or your clients need help, you help them in exchange for a yearly or monthly fee. Unfortunately, by making your product a successful open source project, you destroy the value of your support contracts (see 1 and 3 in the first list). You say you want to charge for customization like a consultant? See number 2 in the above list. That project is going to the lowest bidder. Also, good luck making that scale.

What sucks here is that I like open source. And to make something sustainable, you have to be able to make money off of it. I don't know how to do that. The original author might, but he just spent two pages not telling us.


Reblog this post [with Zemanta]

The Best Programming Books of 2008

Smalltalk booksImage by eMaringolo via FlickrThere's a thread over at Stack Overflow asking for the Best Programming Books in 2008. I think I'm missing out because I've only read one of them: Programming Collective Intelligence: Building Smart Web 2.0 Applications.

It can be hard to keep up with what's been going on in the world of programming so I appreciate these lists. They help keep me up to date.

These are the books that are on my reading list, but only one of them is from 2008.

  1. Patterns of Enterprise Application Architecture (Addison-Wesley Signature Series)

  2. Real World Haskell

  3. Smalltalk 80: The Language


Reblog this post [with Zemanta]

Unless you do something, listening is a waste of time

Image via WikipediaListening is hard. It's easier to ignore and rationalize. What's harder though is learning from those conversations and applying what you've learned. The real reason? People don't like change. It scares them.

Dave Winer's recent article - If you never listen you never learn - makes this point. He also offers an anecdote where they listened to one suggestion from one user "and company went from being in the brink of shutting down to gushing cash".

Yes, if you listen you can learn, but unless you're willing to do something about it, its a wasted effort.

Reblog this post [with Zemanta]

Wednesday, November 26, 2008

If EMail is EFail, What's EFTW?

Twitter-GoogleImage by Nils Geylen via Flickr"The underlying problem is that individual human beings don't scale." - Jeff Atwood

Not only is email inefficient, it leads to lost information. If I send you something by email, but Bob needs that info, how is he supposed to get it? In this day in age, if you can't get it through a Google search bar, it doesn't exist.

Now, I don't want to dump all of my company's information into the big G's index, and their appliances are a little pricey. So what do we do about internal data? Here are a couple of ideas I've come up with recently.

  • Set up Wordpress and post time sensitive notices there.

  • Set up a Mediawiki and use it to document EVERYTHING.

  • When someone asks you a question, reply with the link, not the info.

  • When you get information by email, put it in the wiki and reply with the new link

  • When the volume of information starts to grow, set up Nutch, the open source search engine, or invest in a Google Mini.



This doesn't solve every problem. For instance, you still don't get a private Twitter or FriendFeed, but with a little creativity, I'm sure you can hack something together.

Final thought: Email is an expensive way to transfer information, and your time is to valuable.



Reblog this post [with Zemanta]

Tuesday, November 25, 2008

Follow my Tumblelog

I've started posting some of the random stuff I find online to a Tumlelog. You can find it at http://pfeff.tumblr.com.

The stuff I post there comes mostly from my collection of RSS feeds. Using the bookmarklet, its really to just post an interesting article with a quick thought. I have trouble keeping up with blogging, but RSS + Tumblr makes it really easy to post throughout the day.



Reblog this post [with Zemanta]