Writing A Web App With Python

I have spent my spare time in the past two weeks writing a web app. I couldn’t find a good web site that offered an easy personal journal. I wanted something that was a bit like a blog but with less fuss and totally private.

So I decided to try writing one. The language choice was obvious, Python. The next question was which framework to use. I did a web search and discovered that the choice quickly came down to two.

Django is the older giant in the room compared to Flask. The two also have a different philosophies. Django has it all built-in while Flask seems to be a thin wrapper over Werkzeug and Jinja2 mostly providing request and session handling while leaving almost everything else to extensions. Continue reading


Why the Changes WordPress.com?


WordPress (Photo credit: Adriano Gasparri)

So now WordPress.com bloggers have two different top bars. The old one you see when you first go to your blog or another WordPress.com blog and a new one when you go to almost any administration task.

How do I like the new top bar? To say that I don’t like it at all would be an understatement. It adds the ability to quickly get to the blog reader and Freshly Pressed and takes away the ability to quickly get to the two most important parts of the Dashboard, managing comments and the best New Post editor.

The simplified New Post editor, the only one accessible from the new top bar, lacks three extremely important features, the ability to set a category for your blog post, the ability to edit the ‘Publicize’ slug and where it will be publicised (I like to be able to turn off LinkedIn for my more personal posts) and finally it doesn’t support ‘Text’ mode which I use constantly since I type most of my posts into a text editor using MarkDown for format (which isn’t supported by WordPress.com) and then use “Export to clipboard in HTML” and paste the result into Text mode.

Continue reading

Some Thoughts On Socl

Microsoft has now entered the social space market with “Socl” (which they wish you to pronounce “social”).

Coming so late to the party you’d hope that they would offer something a little different and they have. Socl revolves around search and that’s certainly a new approach.

To create a post you enter a topic and you are presented with a number of images and links courtesy of Bing which you then assemble into a collage adding a bit of text. The end result looks a little like Pinterest.

This is social search. It would be an interesting idea if executed well but I fear Microsoft have dropped the ball badly.

The first problem I encountered was finding people to follow. Socl gives me no way of finding my Facebook friends on Socl, nor can I find the people I follow on Twitter or the people in my contact list.

So that leaves me wandering around attempting to find people who share my interests. That might be good but it raises the question of why I should bother.

Socl doesn’t allow someone to do much value adding. Why should I follow Joe Blow if he is just making collages from exactly the same search results as me without actually adding anything? Joe Blow has no opportunity to even give a caption to the images or a note on the links he assembles into his collage let alone add his own images or links to those found by Bing. You can’t even do a second search and keep adding from that.

One of the joys of the social net is that you can find people with the skill to curate information in a field you are interested in, Socl doesn’t allow these people to easily do their work.

The other problem is scale. I don’t know if everyone is having the same problem but Socl has now started to load slowly. Indeed this evening I’m just getting the page head and nothing else. It leaves me wondering if Microsoft are going to have the same problems on the web as Apple did.

While I have to admit to bashing Microsoft over the years I hope that they succeed with Socl just as I hope Google Plus works out for Google. The space of possible social net applications has yet to be fully explored and social search is a great idea, I just fear that despite months in beta before this public release Microsoft have not quite found the right mix.

Socl might surprise me, it may well find an audience, after all who could have predicted Pinterest would find one so large. Have you given it a try yet? What do you think?

Two Things Annoying Me About WordPress.com

Today I discovered two things about WordPress.com that are annoying. One they can easily fix, the other is just a result of the wierd society of the net . Well, I sort of knew about them before but today they annoyed me. Perhaps I’m in an annoyable state?

The easy one to fix is that the “New Post” link under the logo on the left of the top bar takes you to a really nice page to choose the type of post you want to make but then takes you to a post editing page that doesn’t let you categorise the post or change the publicize link.

On the other hand if you go to your blog name in the menu under your name and icon on the right of the bar you can go straight to the “Add New Post” page of the Dashboard. Unfortunately you don’t get those nice pre-formatted link types you get the other way.

I know, I know. First world problem. What am I complaining about, it’s really great blogging software?

Then the second problem. “Like” whores. If you have a blog here on WordPress.com you know them, the people who come along and they hit the “Like” button on more than half a dozen posts on your blog and when you check their notifications it links back to ‘yourultimatediet.net’ or something similar. I wonder why they bother when on the post itself the link is to their Gravatar profile? I like to think my writing is good but to hit the “Like” button on the last eight posts. I’m not that good. I guess it could be that hitting the like button costs them nothing and they do actually think the post is worth reading. They may just set the bar a lot lower than me, frankly I read a lot of posts and I don’t hit that button unless I really do think your post is a good one. Indeed I’m almost certain to now go and read a few more of your posts and if I find another couple worth liking likely to follow you in my WordPress.com Reader.

Yeah, yeah, another first world problem. Hey, it might surprise you to learn it but I live in the first world, by definition all my problems are going to be first world problems.

So as a blogger what rattles your cage?

Amazon Doesn’t Appreciate My Taste In Books

(c) Ian Wilson

In the middle of the night when insomnia hits the best thing to do is take a book to bed.

The only problem is finding the right book. OK I have a lot on my shelves and on the iPad but what about when I want a new one?

I have an extremely wide, but fairly specific taste in books. For example I can read David Weber’s “Honor Harrington” series but don’t like his “Safehold” series at all. As well as science fiction I read classics such as Austen and Bronte but can’t stand Dickens. I like biographies but tend to enjoy those of people long dead rather than modern ones – Italian renaissance biographies are my favourites.

In non-fiction I enjoy computer books (though not for night time reading), science books and some philosophy but generally can’t stand business books, though I’ve bought and enjoyed some by more tech oriented authors.

Put all this together and I find the Amazon recommendation engine an almost total waste of time. I’m not sure what good it does to tell it I’m not interested in a suggested book. As an example it seems that a lot of people who enjoy David Weber also enjoy Eric Flint. Personally I don’t like his writing and I’ve said “Not interested” to at least five or six of his books, but his keep on getting recommended.

The other annoying feature is that it doesn’t automatically ignore something I buy or add. Recently I added Photoshop Elements to my wish list so Amazon suggested books on the software. Shouldn’t it realise I don’t want **any** books on the topic when I turn down the first six it suggests?

The core problem is not the base engine, it certainly seems to make enough connections, but that it doesn’t do any learning from the items I turn down.

The most annoying thing is that it throws up enough books that I do like the look of that I don’t want to ignore it entirely. One or two books in the first thirty isn’t a terribly good hit rate though.

So how to fix it? I know that the movie people Flixster ran a competition to improve their recommendation engine, I think the time is overdue for Amazon to do the same thing.

What's This Chrome?

So the big news on the ‘net is the release of the Chromium beta from Google. Google have unveiled the long rumoured web browser.

This is an important event on a number of levels, remember Google would be happiest if you lived in the browser using Google products (where they can show you advertising) rather than in a stand alone application. To do that Chrome is a smart move, they need better browsers and throwing real competition into the space can only help.

So I downloaded it. I’m not going to comment on speed or stability for several reasons. First, it’s a beta – we’ll give them some slack. Second, I’m running it in Fusion on a Mac. Third, my copy of Fusion is the release candidate for v2. Hey, if it runs it’s a bonus.

Before We Run

Before we have a look inside the browser itself let’s have a look at some of the things Google has done below the UI to make this a better browser.

The most important is that they have split each tab into a separate process. Modern CPUs are perfectly capable of running multiple processes each with multiple threads, until now browsers have ignored that and been single process, single thread. that was all well and good when all we were doing was looking up information on fairly static web sites, but now we run multiple tabs with our word processing, mail and calendar inside the browser and view web pages that include movies.

Shifting each browser tab into its own process offers a wealth of advantages. The most obvious to the user will be that things don’t stop in one tab when one is busy. It will also mean that a hung tab will be less likely to take the whole browser down. Then it also has benefits for memory management, where closing a tab will take all the memory requirements with it.

The other important move is to a new architecture for the JavaScript engine. When we all started using JavaScript we had a few lines per web page, now we are loading enormously large libraries for AJAX and user interface. It once made sense to have a JavaScript interpreter, the runtime advantage of compiling in the browser was outweighed by the time it took. Now you can gain a speed boost in your web applications by compiling the JavaScript after you read it and then running much faster.

First Look

When you run Chromium the first thing you will notice is that the top appears upside down. Rather than being under the address bar the tabs are now at the top. You also get a new tab button at the right of the current tabs.

There is also a lot less UI to go around. There is no menubar at all. The top bar of the tab has just two menus at the right. If the web page requires no scrollbars then there are nothing on the edges either. It will be interesting to see how they handle this on the Mac, with its permanent menubar.

Tab handling is nice. You can easily shuffle them, rip one up or down and you can create a new window. You can even shove the new window back in to the old one.

The whole look and feel of Chromium seems to be aiming at minimizing the feel of being in a browser.

What Does It All Mean For Me?

Google have made move into the browser market for one good reason. They want us all using a better browser so we spend more and more time inside it, preferably using Google products so they can show us advertising. Despite giving a lot of money to Mozilla they haven’t really started a genuine browser war, the two major contenders are Firefox, used by the smart folks, and the bloated Internet Explorer, used by the default folks and the corporates forced to by their lazy corporate programmers.

So Google had to build their own. They need a more resilient, faster and more secure web browser so that we use it more. The other element that comes into this is that Google don’t even need to win the browser war. So long as they start Microsoft, Mozilla and to a lesser extent Apple (remember all those iPhones running Mobile Safari) moving in the same direction towards fast, secure, stable web browsers they win.

Seen in this light we can even start to see the Android project as the exact same move. With more and more of us using our mobile phone as a second computer and browsing the web Google want a good web browser with a good interface and screen in our phones. Certainly Nokia, Motorola and Sony-Ericsson weren’t really delivering which gave Apple a wide open market for the iPhone. So Google needs Android to push the competition along, give the iPhone some competition and get the big three actually delivering on their promise of the mobile web.

So, in conclusion, what Chromium means to you and I is a major push in the performance and stability of our web browser. Even if you never run Chromium then you will benefit from the work and money Google is spending (they are giving the source way, after all) in your current favourite browser on both your computer and your phone. The real laugh in all of this is that Microsoft can’t not compete in delivering a better browser and as the browser improves we will be less and less concerned with the operating system and more and more with web applications.

Website hosting

I just read a post on another blog (I’m not mentioning names) which was a thoroughly confused and misleading post about types of web hosting. Having personally used many types and advised a fair number of friends and clients I think I can do a better job.

The first thing to remember is that if you just want a nice little vanity web log like this one with some customization of appearance and a few ads to earn a couple of dollars then you don’t need web hosting. Blogger, TypePad and WordPress are more than happy to host your blog and share some of the ad revenue with you. With the assistance of other free services such as image and file hosting you can even use these services to host quite good small web sites.

If you want more control over the software you run and to tie in other things such as a wiki or forums for your blog then you need to go to real hosting. You’ll also need your own domain name.

At the bottom level of hosting is shared hosting. For a couple of dollars a month (and often purchased cheaply at the same time as your domain name) you get an account on a computer that allows you to upload web applications and do some configuration of the web server.

Most of these hosting services offer a “control panel” that allows you to change some of the configuration, manage files and even install a fair range of software easily. My web host offers WordPress, Joomla, MediaWiki, phpBB, a guest book, picture gallery, Ruby on Rails and a site engine all installed easily and quickly, often with just one click and a single web form.

You may find it difficult to install some software as you cannot change such things as the Apache or Perl modules installed as you are only one account on a computer. You also are at risk of another account on the computer tieing up the system – a web application hitting a race condition in Apache, for example.

For just a little more some web hosts offer a virtual server. This uses virtualization software on a computer to offer a virtual computer that you control yourself. This is the best system for almost everyone to start with. You have almost total control including all the Apache, Perl and PHP configuration. Most still install some sort of control panel for you to use. The underlying virtualization software significantly reduces the risk of your “server” being over run by one of the other virtual servers. In fact they do such a good job that even large server farms will run multiple boxes running multiple virtual servers.

All of these three levels offer advantages such as high availability and automatic backups. Both shared and virtual server hosting offer excellent customer support at exceptionally low prices.

This level of hosting will be perfectly acceptable for almost all small to medum businesses. You can even have quite large online stores and popular sites using large amounts of bandwidth on a virtual server. I’ve known sites that have mutiple virtual servers, one for the web site, one for the store and another for the database back end.

Oh, one final note. My favourite web hosting company is WestHost, good service, good prices. If you click on the link and order I’ll even earn a dollar or two.