Sunday 26 June 2011

FallDown HTML5 Canvas

FallDown is probably one of the most successful free iPhone games of all time, and I quite like playing it even though I am really, really bad at most iPhone games. Just for the fun of it I decided to see if I could code my own version of the game in HTML5 Canvas because all the other versions on the web are flashed based, so I thought it would be nice for there to be a Canvas version.

You can play the game at programmingthomas.tk. I have tested it to work in the latest versions of Firefox and Chrome and I can't think why it wouldn't work in any other major browsers that support Canvas - maybe excluding IE9, but I'm not going to go there. The game itself was really easy to code, though my high-score is only 106 (the scoring works on the number of bars you get through)!

Friday 24 June 2011

Programmingthomas.tk to launch with DumbCMS v0.2


I will be relaunching my personal site on July 1st 2011. It will be using DumbCMS v0.2 and my blog will be transferred to the new site.

Wednesday 22 June 2011

DumbCMS update

I have shifted the update cycle slightly, and the following information is important: v0.1 FINAL will not be released at all, instead skipping straight to v0.2 FINAL on July 1st because I have sort of deleted the entire set-up for v0.1 on my computer and frankly it used a really nasty system (pages were requested through AJAX and the Admin section was plain nasty). The v0.2 release will allow for proper file management and multiple admin users, making it ideal for hosting a multi-user blog.

Unfortunately adding media to the system will be an issue because of PHP upload limits, but the admin center will automatically receive new files and process them when you login.

Saturday 18 June 2011

DumbCMS 0.1 and 0.2

The current version of DumbCMS at the moment 0.1b, however this is the BETA version on 0.1, as there is still some work to be done on the current version, using the current methods for its development. However, I don't like the way that the system currently manages content, so I am going to rebuild it, making it easier to use.

This means that the final version of 0.1 should be up by about the end of June, but I'm not promising anything because it is literally a one-man project, and then 0.2 should be available within a week of that. There will not be a beta for 0.2 as final code from 0.1 will be carried over.

Although at the moment all versions are effectively in beta towards version 1.0 final, which I intend to release on the 1st January 2012. Here is the planned release cycle for DumbCMS:
  • July 1st 2011: 0.1 FINAL
  • July 15th 2011: 0.2
  • August 1st 2011: 0.3
  • August 15th 2011: 0.4
  • September 1st 2011: 0.5
  • September 15th 2011: 0.6
  • October 1st 2011: 0.7
  • October 15th 2011: 0.8
  • November 1st 2011: 0.9
  • November 15th 2011: 0.9.5 (security and bug update)
  • December 1st 2011: 1.0a
  • December 15th 2011: 1.0b
  • 1st January 2011: 1.0 FINAL
I am currently unsure over what features will actually be in 1.0, but I have got some sort of road map figured out in my head up until 0.5.

There is also the potential for DumbCMS.Net which will be an ASP.NET version.

Tuesday 31 May 2011

Apps in the cloud

I like the idea of the cloud. I use Dropbox, Google Docs and loads of other Google Web Apps. I think that the cloud has a lot of potential, especially with new music storage services that are being developed by Google, Amazon and iTunes. However, there is a more interesting potential for the cloud: apps.

It makes a lot of sense to put apps in the cloud. Not apps in the way of JavaScript and lying on the server, being run by the browser. These kinds of applications already exist, and frankly they are a bit boring. I think it would be interesting to put applications in the cloud so that everything can be run from server, however the visual output happens on the desktop.

It is very difficult to put a full desktop application in the cloud. It would need a program much like a browser that would carry out requests to the server, and the server would then return visual output, potentially marked up like XML or HTML. In the future internet connections will probably be fast enough for these kind of applications to be streamed constant video. The advantage of all this is that everything is constantly updated, and the user wouldn't even know - very much like current web apps.

I would be interested to try and make a cloud based application in this way, that would be presented on the desktop rather than the browser. I think that I will do this in two parts:

The server

On the server I would probably have a set of scripts written in PHP that would return core parts of the application - the interface for instance, and they could also use sessions to manage individual users, perhaps a database to manage the data that they create. This wouldn't be particularly difficult to code.

The desktop

On the desktop there would be some sort of simple application written in a nice lightweight langauge - Java, maybe -that would get the data from the server and display it on screen. If the outputted data was HTML, it would be possible to use common controls to display it on screen. Alternatively the data might be outputted as XML, which could describe just the interface and connections: all the code would be hidden away on the server, with no way for the user to ever see it - however hard they tried to hack it.

I think that I will probably try to experiment with a project like this - probably using PHP to output XML files to describe the interface and manage the database with Java managing the desktop side. At first I will probably produce a simple Web App Manager that will offer simple applications: a calculator, note editor and image editor.

WWDC: What will Apple throw up?

For years Apple has managed the 'Apple Worldwide Developer Conference' - or WWDC for short. My nice little Google Reader feed has just told me (yeah, I only just logged on) that Apple are going to be announcing some exciting new features. To quote, we are going to see 'Mac OSX 10.7 Lion', 'iOS 5' and 'iCloud'. Interestingly, the only one that we really know much about is Lion, because Apple has been teasing us with the developer previews since last Autumn (it was really that long ago) and there is no doubt that we will probably see the polished version of Lion at WWDC, there will probably be very few features before it goes out to the general public later this summer.

iOS 5 could be an interesting one. In the past Apple has always announced iOS versions in around March, and then showing off the new iPhone at WWDC, however this year seems to be different: we are only seeing iOS 5, no mention of the iPhone 5. This is perhaps because the iPad is now launched in the early months of the year, and it is unreasonable for Apple to release one product with the old version of iOS before releasing the newer version of iOS just a few weeks later. In fact, it has been quite clear that the iPhone 5 will not be announced at WWDC, will probably just get a gist of what it might be like based on iOS 5 - but frankly the hardware probably isn't going to be very different, there might be a dual-core processor, a little more battery and it might be a bit thinner, but I doubt that Apple are going to want to make to many changes, especially considering that the iPhone is rapidly becoming one of their bestselling products. There are talks that we may not see that iPhone 5 for another year, and that the guys in Cupertino are actually just developing the iPhone 4S - a faster, slimmer version of the current iPhone.

Before considering what iOS 5 might entail, I think it is worth considering the mystery of the iCloud. Apple have made obvious hints at this before - they've bought a massive new data center and put in a few patent applications related to how it might work. Suggestions at the moment are that it will allow users to store their music in the cloud and have it streamed to their computer - or more importantly, iOS device - rather like Spotify. This will be interesting from the perspective of saving space on our computers - though I doubt that Apple will be storing all 30GB of the iTunes libraries of people I know - I should imagine parts of the iCloud service will be related to how MobileMe has always worked, there will a be fee - however this shouldn't be an issue for Apple - it has the credentials of millions of music purchasers, and if they stick a few massive ads on the iTunes store they're bound to make a bit of cash.

But iOS 5 might work differently with iCloud. It might not just be a storage facility for our media, it may well not only be the storage space for our apps, but also work as the processor for them to. There have been rumors that the iPhone 5 will be considerably cheaper than the iPhone 4 because it will have far more basic components because it will only need to be faster at getting data from the iCloud, it won't need anything else. This idea interests me, and I also see it as likely, though perhaps not now due to the lack of 3G and even 2G connection across the globe. I doubt that Apple would want to see their stock prices drop dramatically either if the iCloud were to fail.

Ultimately, there is little to be interested in iCloud 1, iOS 5 and Lion. We need to be interested in the next version of the products, where they will converge. Perhaps iOS and OSX will be forced to evolve into one another - the same OS on our computers and phones shouldn't be an issue provided that Apple get the cloud - the iCloud - right.

Originally posted on http://thomasinterestingblog.wordpress.com/2011/05/31/wwdc-what-will-apple-throw-up/ but I thought this blog was deserving of it to.

Monday 30 May 2011

Why I like C++

I am no C++ expert. In fact, my knowledge barely goes beyond pointers, arrays and classes. I couldn't create a fully fledged desktop application with it to the same degree that I can do in Java or C#, but I am gradually learning the Windows Development Process - even if it is a nightmare at first, especially with no MFC (Microsoft Foundation Classes - you need the full version of Visual Studio to get these). However, I have found that learning and coding with C++ is actually quite enjoyable.

The Syntax makes sense

A Java programmer can look at C# or C++ and get it. A C# programmer can look at C++ or Java and get it. A C++ programmer can look at C# or Java and get it. The reasoning for this is the syntax is nice. Everything is tabbed, variable decelerations happen based on type, initiation is easy, classes are easy. Blocks of codes are surrounded by curly brackets {}. Everything is easy to code. Even a beginner can look at some C++ code and make sense of it - there are only really a few basics to learn before a programmer can do an awful lot.

It's extensible

Some programming languages are incredibly limited because they do not allow for easy extensibility. C++ is not one of these languages. The default libraries for C++ are incredible, and development with these is neat, tidy and professional. These libraries can be extended upon by libraries provided by either sources, such as Operating Systems or SDKs.

Programs are lightweight

When I compile a program that does something simple (say a simple Math game) it is only a few KB in its compiled form. In Java it can be a few times more and in C# it can be dramatically bigger due to the .Net framework. C++ is not like this. Not only are the files themselves lightweight, the strain on the processor is lower and C++ programs tend to run faster because they use less resources.

It's compatible

When I write a simple C++ program I can re-compile it for many systems purely because there are compilers for those systems, and in fact there are C++ compilers for almost every system. Even if I'm coding a UI based application I can still recompile it with little modification thanks to the huge number of libraries like GTK that allow for interfaces to be created easily.

People actually use it

If I have a problem with C++, I can easily go and Google for the solution because so many people use C++, support simply exists. After all, the less popular a language is, the less support there is because there are less people to support it, but as one of the most popular languages, C++ is instantly helpful.

Learning is easy

Once you have learned the basics of C++ you can easily extend your knowledge because there is a global understanding of how it works, and all C++ programmers know to write their code in an easy-to-read way so that continuing to develop in the language is easy. A good example of this is learning Windows development in C++. Creating a Window does bring in different libraries and classes, however there are no really complex requirements for initialising a Window.

Sunday 29 May 2011

Making a Clock with Canvas


I've been experimenting with Canvas this weekend and I decided to make a clock, however Blogger doesn't allow me to insert it properly, so please click here for a live example. I have designed it so that the canvas can be set to any square shape and it will allow for appropriate resizing. Feel free to have a look at the code and use it on  your own site!

Saturday 28 May 2011

OpenGL vs DirectX

OpenGL really is quite incredible. It has the honor of being used for nearly every 3D environment, or at least a variation of it is used for nearly every 3D environment. Its libraries are used across phones, games consoles, TVs, computers and hundreds of other devices. Despite this incredible success, is it really the best tool for 3D today in applications?

DirectX is what Microsoft likes to sell to the world. It is used in Windows, Windows Phone and XBOX. DirectX has frequently been the choice of games developers working on Windows because it has a wide set of libraries and integrates incredibly well into Windows. It is currently being used to render Windows Presentation Foundation (WPF) applications built with the .Net framework and these are frequently faster than their WinForms counterparts.

However, both DirectX and OpenGL have advantages and disadvantages. The problem with both is that when you are using the other on a platform that they both exist on (basically Windows) there is no reason not to use either of them. DirectX is just as good as OpenGL for most tasks and vice verse. However, there is a reason to use OpenGL over DirectX: its lightweight.

I hadn't really dabbled much in OpenGL programming with C++ before, however I realized that my compiler already had all the tools that I needed to get started, and I did. However, if I wanted to get started with DirectX development on my computer, I would have to download the enormous DirectX SDK, and I don't really want to have to do that.

Not only is OpenGL already there, but it isn't difficult either. Creating windows with C++ is hardly hard work - it can be done in about 30 lines of code and with a bit more work you can add OpenGL support. My IDE on my laptop, Dev-C++, comes with an OpenGL sample of a triangle spinning round and this is just 191 lines of code. What's more is that even an OpenGL beginner like me can read the code, it is all just basic functions and numbers - no complex pointers or anything.

OpenGL also has the advantage that it can be used in just about any programming language, even JavaScript now, whereas DirectX has a very limited portfolio.

I can't really say that I am into 3D graphics programming, however it is very interesting, and I am sure that I will consider it more in the future.