Blog Category Project52

What is the Django Template Tag intequaltest and an update on Django Quiz?

Published by Myles Braithwaite 2 months, 2 weeks ago in Project52. 1 Comment

Tags , , and

Travis Millward commented on my Django Quiz project today:

Hey Myles, I believe I'm going to checkout your django quiz. Can you explain what the

{% if score.corrent_anwsers|intequaltest:question %} This wont work {% endif %} is doing? It looks really good!

First I just like to say I love talking to people so if you ever have a question for me about anything (literally) don't hesitate emailing me (me@mylesbraithwaite.com) or chatting with me (XMPP/GTalk me@mylesbraithwaite.com).

def intequaltest(value, arg): return (value == arg)

Okay so intequaltest is got to be the studied template tag in the world. It's sole purpose is to see if two things (i.e. a list, str, dict, etc.) are the same and if they are return True or False. In this case see if the correct answer is equal to the answer they gave. I will go into the history a little later in this post but essentially this application use to work a lot differently and the only reason this template tag is in here is because I have an issue with copying and pasting.

When I first started developing the Django Quiz application in 2008 it was for a client. They wanted to quiz their sales consultants on very complex financial process. The consultants could take each quiz as many times as they want, but their "score" wouldn't be submitted to their manager until they got prefix.

I spent about a two days in July (10th, and 11th) developing this application for the client. In the middle of my second day the client came to me and said they found a better solution, a pice of paper and a pencil.

I have been asked about this application five or six times in the last month, so I guess it is about time I write my formal apology. This application doesn't work. I tried to start up again on April 28, but my heart isn't really there anymore (my heart was not really there the first time but I was getting paid).

So will this application ever be completed? Maybe, if one day I wake up and get really excited about coding it again or a client comes along and ask me to code them a quiz application.

Some Thoughts on the iPad

Published by Myles Braithwaite 4 months, 1 week ago in Planet, and Project52. 0 Comments

Tags , , and

This is a blog post I wrote the a few weeks after iPad was shown to the world and never got around to publishing it on this blog. It was on an internal company blog though. Sorry for bring up such an old news item.

A lot has been said the last two months about how Apple's iPad will kill the Kindle and how the iPhone/iPod Touch has already killed Sony's PSP and Nintendo's DSi (because the iPad will be able to play games it will some how destroy a extremely large industry). Personally I never like the idea of a device that did it all, Multi-Function Printers always gave me a bad feeling why combine the three most complicated systems in an office Printer, Fax, and Copier? Yes I will be buying an iPad when it comes out (not sure if Wi-Fi or 3G) but I will not be replacing my Kindle that has a better screen for reading and it will not be replacing any of my portable video game systems. I will use the iPad for the purpose I believe is servers: a netbook.

@mylesb I hear they have the revolutionary feature of only allowing the user to run one application at a time.

At quote from Chirs Browne's tweet on 27th January 2010 at 1:46pm.

Yes the iPad can only run one application at a time. But if I need to run more than one application at the same time I can easily take out my laptop. I see the iPad as more of a internet device than a computer.

Got another Linode & Moved the Wiki

Published by Myles Braithwaite 5 months, 3 weeks ago in Project52. 2 Comments

Tags , , , , and

I ordered a second Linode (a 360) on the weekend for some PHP applications (Fever and DokuWiki). I have been with many VPS services and Linode is by far the best you can buy (shared host I will have to say Nearly Free Speech). It is hosted in the same data centre (Newark, NJ) so I have an internal IP address connecting both of them. I am running Nagios and Munin on both computers (Panda is monitoring Fox and Fox is monitoring Panda) that way if one goes down the other will notify me.

I also moved my Wiki from DokuWiki to Hatta. Hatta is a really simple wiki engine written in Python that use Mercurial for storage. Which means I just have to clone a repository to edit a page (you can clone the my draft wiki or my published wiki). I am going to miss some of the more powerful features of DokuWiki so I have started working on my own wiki engine called Episteme.

Episteme will have some of my favorite feature of DokuWiki, Hatta, Confluence, and Yaki.

Tornado at PyGTA

Published by Myles Braithwaite 6 months, 1 week ago in Planet, and Project52. 0 Comments

Tags , , , and

Last night at PyGTA, Mike gave a short talk/demo about his findings using Tornado and CouchDB to write a real time chat and voting application for his PyCon talk.

Tornado is a lightweight non-blocking web server created by FriendFeed and Open Source by Facebook. The API is similar to web.py and App Engine's webapp framework. Mike's ending comments was that Tornado can out perform Twisted. But he found he had to write a lot of code to do things that were built into Twisted (or any other modern web framework) already.

His thoughts on CouchDB:

I'm really beginning to regret the choice of CouchDB for the back-end. It's working perfectly well, but I have literally dozens of pieces of code hanging around for doing SQL-based paging... none of which are applicable to CouchDB.

*Referenced: Things I'd like to play with (given enough time)*

This website (and a few other sites I manage) will be moving from Apache 2 and WSGI to Tornado and Nginx #. It will still be built on top of Django thought so most of the issues Mike was talking about wouldn't apply to me.

Other people who wrote about this event:

Geektool Setup

Published by Myles Braithwaite 6 months, 4 weeks ago in Project52. 0 Comments

Tags , , , , , and

I recently installed Geektool on my MacBook Pro. I used so many sources to set it up that I thought it would be a good idea that I write a blog post about some of the more complicated configurations.

My Geektool Setup

Sunrise & Sunset

Sunrise & Sunset

I am getting the sunrise & sunset data from weather undergroup mobile website.

Sunrise

curl --silent http://m.wund.com/global/stations/71265.html | grep 'Sunrise' | sed -e :a -e 's/]*>//g;/</N;//ba' | sed -e 's/Sunrise/Sunrise: /g' | sed -e 's/EST//g'
Sunset
curl --silent http://m.wund.com/global/stations/71265.html | grep 'Sunset' | sed -e :a -e 's/]*>//g;/</N;//ba' | sed -e 's/Sunset/Sunset: /g' | sed -e 's/EST//g'

IP Addresses

IP Addresses

Weather Image

Weather Image

Weather Forecast

Weather Forecast

I am using Yahoo Weather to get the weather image.

curl --silent "http://weather.yahooapis.com/forecastrss?p=CAXX0504&u=c" | grep -E '(Current Conditions:|C<BR)' | sed -e 's/Current Conditions://' -e 's///' -e 's/<b>//' -e 's///' -e 's///' -e 's///' -e 's///'</b>

Project52

Published by Myles Braithwaite 7 months, 1 week ago in Project52. 0 Comments

I have signed up for Project 52 a personal challenge geared toward getting fresh content on my website. Which means I will be writing a blog post a week. I am currently coming up with some interesting topic to write about, but if you have any suggestions please suggest them to me.

You can follow my progress by subscribing to the feed, subscribe to the newsletter, or follow the dedicated twitter account.