Blog Tag python

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

Published by Myles Braithwaite 3 months, 3 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.

Talking about XMPP at the next PyGTA

Published by Myles Braithwaite 4 months, 2 weeks ago. 0 Comments

Tags , , , , and

I am going to be talking about XMPP at Tuesday's (tomorrow's) PyGTA meeting at the Linuxcaffe.

XMPP is chat. It's the underlying protocol for open peer-to-peer communication systems, but what becomes possible when the peers are servers? How can you make your server a chatty teen?

Myles Braithwaite uses XMPP a lot. He ships documents and data-sets across it that look nothing like the chatter of teenagers. He'll explain how he does this, why he does this, and how you can do it too.

Hope you will be able to make it out.

Episteme

Published by Myles Braithwaite 5 months, 1 week ago. 0 Comments

Tags , , , and

Back in February I tweeted "Starting work on #Episteme today."#. A few hours latter I got the following query in an email:

From: Ivan Avery Frey
To: Myles Braithwaite
Date: Thu, Feb 4, 2010 at 3:24 PM
Subject: What's Episteme???

Self-explanatory.

Episteme is a wiki engine (more of a wiki library) I am currently working on (I have actually been working on it for the last two years). It was originally a fork of Yaki (which powers The Tao of Mac), then was powered by CouchDB, and now is a fork of Hatta (not so much as a fork because I am still going to be using Hatta's WikiStorage module).

So why am I working on yet-another-wiki-engine?

  • I like flat files (easy to backup using rsync).
  • I think that Relation databases (like MySQL and PostgreSQL) were not design for wiki documents.
  • I like storing the documents in a Revision Control System so I can edit them in a text editor.
  • I like being able to search.
  • I don't ware the same cloths every day why should I have to use the same markup language.

This is an example of a wiki document:

Title: Python
Tags: python, programming
Content-Type: text/x-wiki

**Python** is a dynamic programming language.

== Resources

* [[http://www.enricozini.org/2009/debian/using-python-datetime/|Tips on using python's datetime module]]
* [[http://diveintopython.org/|Dive into Python]]

I am using RFC822 (similar to an email) for meta information (title, tags, markup, date, author, etc).

Episteme will always be a work in progress and many never be released.

PyGTA - PyCon Dress Rehearsal

Published by Myles Braithwaite 7 months ago in Planet. 0 Comments

Tags , , , and

This month's PyGTA we will have three presenters talking about their upcoming PyCon talks. Leigh Honeywell will be presenting Teaching Python in Your Community -- her experience teaching a Python class at HackLabTO. Greg Wilson on What We've Learned From Building Basie -- what a bunch of undergraduates accomplished building a Django-based replacement for Trac called Basie. Mike C. Fletcher on Debating 'til Dawn -- will be presenting some of the best discussion/ideas/talks at PyGTA the last three years in his attempt to make PyCon cool again.

Remember to bring your laptop because Mike will have a Real-time feedback tool for chatting with the presenters and give feedback on their talks (he has been") working for the last three months).

Tornado at PyGTA

Published by Myles Braithwaite 7 months, 2 weeks 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:

Exception Handling in Python

Published by Myles Braithwaite 1 year ago in Planet. 0 Comments

Tags , , , , and

Last night PyGTA was a Exceptional Conditions round table, like most PyGTA meetings it went philosophical side of programming.

My personal philosophy, in web development, is to log exceptions, not found pages, and performance to almost extreme levels. Then weekly I take the logs and analyzes them with a script which puts them into a database, which groups the results. If an error happens more than five times in the given week the script creates a ticket in the issue tracker for me to work on later. I log all not found pages by real people (not search engine bots) to try and understand why they navigated to that page. The performance log is how long the system took to generate the page and SQL queries and time it took to execute them.

Mike took some good notes so if you are interested you should definitely check it out.

Talking about Google App Engine @ PyGTA

Published by Myles Braithwaite 1 year, 5 months ago in Planet. 0 Comments

Tags , , , and

On 21 April 2009 at 7:30 pm I am going to be giving a talk about Google App Engine at the linuxcaffe.

Google App Engine is a platform to building and hosting web applications on Google's infrastructure (which is sometimes called PaaS1). It has a pay-for-what-you-use payment level but anything below 5 million pageviews a month.

PaaS
Platform as a Service is the delivery of a computing platform and solution stack as a service.

Last nights PyGTA Meeting.

Published by Myles Braithwaite 1 year, 8 months ago. 0 Comments

Tags , , , and

Last night at PyGTA we talked about our Personal Programming Mantras and came up with an interesting list, my personal favorites:

In the face of ambiguity, refuse the temptation to guess.
Have a vision before you start coding.
Nothing is sacred.
No one owns any piece of code.
Keep it simple, smartarse.
Sometimes the solution really is simple.
You are wrong.
About optimization.
About planning.
About everything.
.2% of reusable code is reused.
DRY gone wild, wet-T-shirt edition.
I'm an idio-nius.
Constant self-doubt is good/bad.
Standard naming, but no naming Nazis.
Don't trust standards.
My standards are good.
Yours suck.
Prototype in the target language.
Power Builder Sucks
Be a programmer, not a DBA, dammit!
Leave sysadminning to the sysadmins.
Leave DBA-ing to the DBAs.
I like my bubble.
Limit your knowledge, avoid doing the dumb things.
Space-Nazi's suck.
It doesn't fucking matter about spaces... Please just leave me alone.

Also I am going to be doing the PyGTA presentation in January on CouchDB, the first 30 miniutes will be a quick overview of my GTALUG presentation and the rest will be looking at using CouchDB in Python.

Django Basic Tumblelog 0.5

Published by Myles Braithwaite 1 year, 10 months ago. 0 Comments

Tags , , , , and

I released Django Basic Tumblelog 0.5 so you should definitely download it, the only really change is that I switched from the save() method in the model to the signals.

Moving *.arific.com to the Google Cloud

Published by Myles Braithwaite 1 year, 11 months ago. 0 Comments

Tags , , , , , and

*.arific.com was a project I started about a year ago to house some of really cool ideas I might have. Most of them haven’t really be published because doing the setup is to much work. Those in a effort to fix this I am moving everything (Email, Websites, Chat, and Project Management) to Google’s Cloud. Currently the only thing that is running on any of my servers is DNS and a redirect from `arific.com` to `www.arific.com`.

Released Version 0.1 of django-basic-tumblelog

Published by Myles Braithwaite 2 years, 2 months ago. 0 Comments

Tags , , , , and

I released version 0.1 of Django Basic Tumblelog in zip and gzip tar, if you interested please download a copy today.

Some Quick notes on Django Photo Gallery

Published by Myles Braithwaite 2 years, 2 months ago. 0 Comments

Tags , , , , , and

I am currently working on a new project called Django Photo Gallery which is a port of Stopdesgin Movable Type Photo Gallery Templates to the Django python framework. I am working on it about an hour everyday to try and get it to a releasable state by the end of June.

If you are interested in contribution to the project please email me at me[at]mylesbraithwaite.com and I will add you to the subversion repository. If you don’t have any programming or design skills add a feature request.

P.S. I am trying to blog at-least five times a week now.

OLPC Toronto Game Jam/Sprint

Published by Myles Braithwaite 2 years, 9 months ago. 0 Comments

Tags , , , and

This weekend was the first OLPC Toronto Game Jam/Sprint.

Ajaxian.com 2006 Survey Results of People using Python

Published by Myles Braithwaite 3 years ago. 1 Comment

Tags , and

Today Ajaxian.com 2006 Survey Results came out and I saw a suppresing amount of Python users. Which made me think what is the most used Ajax/JavaScript Toolkit that Pythoners use?






Not much difference against the whole with Prototype still winning but it is interesting that Dojo is the second most used. I use jQuery the most so I am a little disappointed that it is some what last.

And when did Django and TurboGears become a Ajax Framework?

Converted my Wiki To Yaki

Published by Myles Braithwaite 3 years, 1 month ago. 0 Comments

Tags , and

I have converted most of my Wiki to Yaki today now just this blog and I am done.

Getting Excited for my pyGTK Presentation

Published by Myles Braithwaite 3 years, 1 month ago. 0 Comments

Tags , , and

If you don’t already know I am going to be presenting PyGTK at the next PyGTA meeting today! I will try and have slide up afterwards and even some more demos that I wont be showing at the meeting (because of the screw up at the last).

PyGTA Presentation on pyGTK

Published by Myles Braithwaite 3 years, 2 months ago. 0 Comments

Tags , , and

I will be presenting IronPython at the next PyGTA meeting at the linuxcaffe.

Presenting IronPython at PyGTA

Published by Myles Braithwaite 3 years, 4 months ago. 0 Comments

Tags , , , and

I will be presenting IronPython at the next PyGTA meeting.

Newsgroups: comp.lang.python.announce
From: “Mike C. Fletcher”
Date: Fri, 13 Apr 2007 00:15:27
Subject: Python in a strange land: IronPython and ASP.NET at the next PyGTA

IronPython is a native implementation of Python on the Microsoft .NET platform. The implementation is from Microsoft and the language is well supported by the Visual Studio development environment which has always been one of the Microsoft platform’s strengths. Though Python is often associated with the Free and Open Source communities, consultants and developers frequently need to solve real-world problems using Python on the .NET platform. IronPython makes using Python in these situations a natural choice for the Python programmer.

Our speaker for the evening is Myles Braithwaite, a local consultant and developer. He is going to give us an idea of how developing a web application using ASP.NET looks when using IronPython instead of C#, as well as his impressions of the platform.

As usual, we will hold the presentation at Linux Caffe, gathering for introductions at 6:30 PM, with the formal presentation beginning at 7:00 PM. We normally head out around 8:30 PM for beer, coffee and/or ice cream. You can find directions and maps to Linux Caffe on the wiki:

http://web.engcorp.com/pygta/wiki/NextMeeting

Update

I have the Presentation and Demo files at my wiki: /Presentations/2007/PyGTA-IronPython

Python, C#, and Visual Basic in ASP.NET

Published by Myles Braithwaite 3 years, 5 months ago. 0 Comments

Tags , , , , , and

I install IronPython’s module for ASP.NET on one of my Windows Boxes to see how it would work. Here are some simple sinpplets of the differentces bettween Python, C#, and Visual Basic.

I have moved this page to my wiki.

If you want a reason why I switched from Java to Python.

Published by Myles Braithwaite 3 years, 5 months ago. 0 Comments

Tags , and

I just read today that RedHat/JBoss has trademarked “Hibernate” (USPTO #3135582 look it up here).