This Week in Web – PHP Needs X, Python IDEs, Firefox5, jQuery Mobile, Python Games

June 25, 2011 No comments yet

Firefox 5 Released

Mozilla have released Firefox 5.0 final. Some of the biggest changes are support for CSS animations, the addition of the do not track header and better HTML5 support. A list of features and changes that developers may find relevant can be found here. If you were a user of the Firefox 4 beta versions, Firefox should update to version 5 in the background. Otherwise you can download Firefox 5 from the downloads page.

jQuery Mobile Beta 1

The jQuery Mobile team is happy to announce the release of Beta 1. We’re proud of the refinements we’ve made to make jQuery Mobile faster, extensible and more compatible over the last 12 weeks and look forward to having more frequent releases as we work up to 1.0 in late summer. We’re planning on releasing a second Beta in about a month that will begin decoupling our code so you can include only the components you need, add greater extensibility to support dynamic JS-driven sites, and bring even broader device support.

Note that jQuery Mobile 1.0 will require jQuery core 1.6 as a baseline. Going forward, we’ll be supporting the two latest major versions of core but

This Week in Web – SMF2, ZF2, Python Lamdas, Future of JS, Titanium 1.7

June 18, 2011 No comments yet

Simple Machines Forum 2.0 Final

After being at Release Candidate stage for over two years, SMF 2.0 has now gone gold. Along with some minor bug fixes and security enhancements the biggest change is that SMF 2 is now licensed under the BSD License. SMF 1 and all previous SMF 2 RCs were licensed under a propriety ‘SMF License’ that prevented people from modifying the original SMF source and redistributing it themselves. With the change to the BSD license, SMF is on it’s way to becoming a mainstream open source project. Unfortunately development is still done in a private version control system.

Video: Future of Javascript

Jeremy Ashkenas and Brendan Eich talk about the future of Javascript at JSConf 2011.

Titanium Studio, Mobile SDK 1.7 Release

Appcelerator has released the final version of their Titanium Studio product and Mobile SDK version 1.7. A full list of changes to the Mobile SDK since the previous release can be found here.

Fastdev for Android speeds prototyping and testing by enabling local changes to become instantly available to your application while the simulator is running. This eliminates the time-consuming steps of packaging, building and deploying apps for each

This Week in Web -Django Hosting, Podcasts, Git Tutorials, Python Apps with Titanium

June 11, 2011 Comments Off

Django Hosting Roundup

Over the last month and a half Ken Cochrane has been evaluating the different cloud webhosts for Django apps. In this summary post, Cochrane provides a useful table that compares features and prices of all cloud hosts as well as App Engine and Web Faction. Below are links to the individual host reviews.

This Week in Web – jQuery API, Python Video Archive, Symfony2 Beta, Heatmap.js

June 3, 2011 No comments yet

I Don’t Like [Django] Class Based Generic View

John DeRosa has written a blog post detailing why he does not like class based generic views (which were introduced in Django 1.3). He is of the opinion that generic views should be very simple and require a minimal amount of code to use. Class based generic views require you to subclass the generic view and override particular methods and properties (such the name of the template). This is in contrast to the old “function style” generic views where all you needed to do was call method and pass in the appropriate parameters.

jQAPI.com

The jQuery documentation is great, very complete, nicely written and with a lot of examples and demos. The only thing that bugs me is the way we have to find the right documentation for what we search for. Try to search for the .is() function for example. Over 100 matches before the actual function I am looking for?! And it is a fixed layout which means even on my big screen I have to scroll all the way down and have to scan for it. There have to be a better way, obviously.

Just to make

This Week In Web – Python, NodeJS CMS, Google APIs, XDebug

May 27, 2011 No comments yet

Writing Clean, Testable, High Quality Code in Python

Noah Gift, Python book author and Associate Director of Engineering at AT&T has written an article titled Writing Clean, Testable, High Quality Code in Python on IBM Developer Works. Gift primarily talks about good coding practices such as multiple small functions, test coverage and static analysis (with PyLint). Although all code in the article is Python, the lessons he teaches and topics he discusses can be applied to any dynamic language such as Javascript, PHP and Ruby. If you are relatively new to programming I recommend your read this article.

NodeJS Cheatsheet

The folks over at GoSquared have published a great NodeJS cheatsheet [pdf] [jpg].

Removal and Deprecation of some Google APIs

Following the standard deprecation period – often, as long as three years – some of the deprecated APIs will be shut down. The rest have no scheduled date for shutdown, but won’t get any new features. The policy for each deprecated API is specified in its documentation.

These APIs are now deprecated but have no scheduled shutdown date: Code Search API, Diacritize API, Feedburner APIs, Finance API, Power Meter API, Sidewiki API, Wave API
These

Resources for Learning Vim

May 23, 2011 No comments yet

Over the last few months I’ve found myself using the Vim text editor an increasing amount. Below are some resources that I found particularly useful.

Venturing Into Vim

Jeffery Way, editor and author of Nettuts, has released a 4 part video tutorial series called Learning Vim From The Ground Up. The 4 videos total over 2 hours playtime and cost just $5. They are recorded on Mac OS X at a screen resolution of 1280×720. Way’s experience in screencasting really shows in these videos. He clearly communicates all of his points, step by step, at a good speed. These videos start with the assumption you know absolutely nothing about Vim so they are a great resource for a Vim user of any level.

Vim Cheatsheet

The folks at ViEmu.com (who produce Vim keybindings for MS Office and Visual Studio) have produced a printable Vim cheatsheet. The cheatsheet clearly lays out the lower and upper case functionality for each key as well as some general Vim commands. The text size and colour contrast makes it easy to read from a distance, I recommend you print it out.

vim cheatsheet

VimCasts.org

Drew Neil produces short, focused Vim screencasts and posts…

This Week in Web – jQuery Chrono, jMongoBrowser, PHP DI, Titanium

May 20, 2011 No comments yet

jQuery Chrono

The jQuery Chrono plugin provides an easy, human-readable wrapper around the Javascript functions setTimeout() and setInterval().

Rather than writing:

setTimeout(function() { ... }, 5 * 60 * 1000);

You can write:

$.after(5, "minutes", function() { ... });

Likewise

setInterval(function(){ ... }, 60 * 60 * 1000);

becomes

$.every(1, "hour", function() { ... });

PyGame Examples

The Simpson College Computer Science Department has posted a collection of 15 GUI PyGame scripts. They range from drawing simple graphics onto the screen to full blown games with keyboard control. This is a great resource for those wanting to learn PyGame but don’t know where to start.

jMongoBrowser

jMongoBrowser is a cross platform GUI administration tool for MongoDB written in Java. It provides GUI tools that allow you to easily manage your databases, collections and documents. jMongoBrowser also allows you to execute queries and explore the returned data through the rich user interface.

Titanium Mobile SDK 1.7 RC1

Titanium Mobile SDK 1.7 Release Candidate 1 is now available, providing new functionality, enhancements and bug fixes across iOS and Android. Download and install the release candidate SDK to test drive

Kohana 3.1 Wiki Tutorial Routes

May 16, 2011 No comments yet

In the original Kohana wiki application the URLs in the views were hardcoded. If we wanted to change the domain name or restructure a route we would need to go through the application and change every single URL.

Thankfully the Kohana Route class comes with a method url() which allows us to generate URLs to routes we have specified in the application. In the first tutorial we defined the following routes in application/bootstrap.php:

Route::set('wiki-edit', 'wiki/<page>/edit')
	->defaults(array(
		'controller'=> 'wiki',
		'action'	=> 'edit_page',
	));

Route::set('wiki-save', 'wiki/<page>/save')
	->defaults(array(
		'controller'=> 'wiki',
		'action'	=> 'save_page',
	));

Route::set('wiki-page', 'wiki/<page>')
	->defaults(array(
		'controller'=> 'wiki',
		'action'	=> 'view_page',
	));

Route::set('default', 'wiki')
	->defaults(array(
		'controller' => 'wiki',
		'action'     => 'view_page',
		'id'		 => 'index',
	));

Before we can generate routes we need to set some configuration options in application/bootstrap.php (line ~82). We need to specify the base_url and index_file attributes in the array passed to Kohana::init(). The application on my local install is located at 127.0.0.1/query7kwiki/index.php, so my Kohana::init() statement would read:

Kohana::init(array(
	'base_url'   => '/query7kwiki/',
	'index_file' => 'index.php'
));

In application/views/edit.php the form action attribute was hardcoded to the value /query7kwiki/index.php/wiki/. That can be replaced by:

<?php echo Route::url('wiki-save', array('page' => $page)); ?>

In application/views/single.php there is a…

This week in web – Vim Python IDE, Silex, Dojo JS Classes, New Appengine Datastore API

May 13, 2011 No comments yet

Python Appengine Datastore alternate API

Guido van Rossum has published a document detailing Datastore plus, a new Python API for the Google AppEngine Datastore. It beings by explaining the conventions and terminology used (Kind, Ancestor, Property) and then covers all classes and methods. The document is packed with examples of the API in use which makes it a really good learning tool. A printable API cheatsheet is provided at the bottom.

Also check out the new Appengine 1.5.0 API

Turning Vim into a modern Python IDE

John Anderson has written a detailed tutorial on setting up Vim for Python development. It covers the basics such as syntax highlighting and indentation through to the more complicated such as integrating pytest, git and virtualenv into Vim workflow. The finished vimrc file can be installed through the following:

git clone https://github.com/sontek/dotfiles.git
cd dotfiles
./install.sh vim

Titanium Mobile Fastdev for Android

The idea behind Fastdev is simple: Instead of packaging, building, and deploying your app’s files every time you want to see a change, the application requests those files directly from a server running on your machine. This means that any changes that are made locally are instantly available

Kohana 3.1 Wiki Tutorial

May 9, 2011 No comments yet

In this tutorial you will learn how to create a simple wiki using the PHP framework Kohana version 3.1. Several years ago Siddharta Govindaraj created a screencast demonstrating how to create a wiki using Django, this is essentially the Kohana version of that. It covers using Kohana’s Routing, ORM and MVC systems. Full source code of the application is available on github.

The wiki application has 3 different pages:

  • /wiki/somepage/save – handles the saving of the page
  • /wiki/somepage/edit – displays a form that allows the user to edit the page
  • /wiki/somepage – displays the page

Configuration

We will be using the ORM module to query the database for our wiki pages so we must load it in the application/bootstrap.php file (Line ~99).

Kohana::modules(array(

	'database'   => MODPATH.'database',   // Database access
	'orm'        => MODPATH.'orm',        // Object Relationship Mapping

	));

We also need to specify our database configuration settings. This is done in application/config/database.php.

<?php

return array
  (
  	'default' => array
  	(
  		'type'       => 'mysql',
  		'connection' => array(
  			'hostname'   => '127.0.0.1',
  			'username'   => 'root',
  			'password'   => 'root',
  			'persistent' => FALSE,
  			'database'   => 'query7kwiki',
  		),
  		'table_prefix' => '',
  		'charset'      => 'utf8',
  		'caching'      => FALSE,
  		'profiling'    => TRUE,
  	),
  );