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.

Wednesday 25 May 2011

Update to me on the internet

I have now finished shifting a few things round. Here is where I am online now:

Delete Local Storage set by a site in Chrome

OK, I must admit I am a bit of a fan of Chrome Angry Birds, and I did sort of start cheating a bit using a simple JavaScript hack to push up my high scores. Having felt guilty about this, I only thought that it was right to go back and reset it - but there appeared to be no option on the site. Turns out you only need to do this:
  • Clear the Spanner
  • Click Options
  • Click Under The Hood
  • Click Content Settings
  • Click All Cookies And Site Data
  • Scroll down to the appropriate site and click on it
  • Click Local Storage
  • Click Remove
And that's it!

Sunday 22 May 2011

Moving Beziers

This morning I was on my computer and playing around with the Graphics class in C#, and with this you can draw objects to the screen or a Bitmap object. This was quite good fun, however after a while it got a little dull, so I started to experiment with how I could get a Bezier curve to move as if it had been animated in a program like Flash, i.e. it was tweening between each point.

At first I thought it was going to be quite hard to calculate the positions, using trigonometry to calculate new positions between starting and end points, however I discovered it was as simple as increasing the X and Y coordinates by the correct amount.

The end result was a simple C# program that uses Background Worker (so it doesn't crash) to render 1000 frames. The program only randomly generates 10 different curves and simply calculates the other 990 that fall in between those points, gradually moving them.

In terms of animation software like Flash, this is a linear animation, i.e. the tween it uses between points is always the same speed, however other effects can be produced:
Linear

Quadratic

Square root

There are more many more options other the graphs like these, many animation programs offer a bounce effect where the graph quickly gets to the top before moving itself back a little before going back to the final position. I doubt it would be particularly difficult to extend my program to be able to cope with such graphs.
Currently the application has no real interface other than a button the kickstarts the render process. At some point I plan to extend the application so that there is some sort of animation interface, perhaps using WPF rather than WinForms, so that the user can create simple animations with tweens in.

I eventually intend to code something that will use Ribbon + WPF that will be a little like programs such as Pivot Stickfigure Animator that allow the user to animate a stickman, except that my program will have tweening between frames, allowing animation to be more fluid and natural.


Saturday 21 May 2011

DumbCMS 0.1b Finished

I have finally got round to finishing the preliminary version of DumbCMS at http://code.google.com/p/dumbcms/, however the following things are now targets:
  • Get decent file manager
  • Proper tag management on blog
  • More color schemes (currently only has brown)
  • More design layouts
  • Better page management

Wednesday 18 May 2011

DumbCMS 0.1b Launch List

OK, here is a list of planned features for Saturday's release of 0.1b:
  • Pages with full HTML editing in admin
  • Blog with post date, title, content and tags
  • Blog view
  • Color scheme picker
  • Statistics logger:
    • IP of visitor
    • Which browser they are using
    • What date the visited
    • How many times they have visited
  •  Everything stored in a MySQL database
  • Fades between pages; accessed via AJAX
  • Runs on PHP, MySQL, JavaScript, jQuery and simple HTML
  • Extensible; it wouldn't be difficult to redesign it to suit your site
http://code.google.com/p/dumbcms/

    Tuesday 17 May 2011

    DumbCMS - when I get the code up, helpers are wanted!

    DumbCMS 0.1b is all set for release on Saturday, and I am going to need some people with experience to help me out. I don't really need pro-PHP/JavaScript guys because I don't want to look too bad, but it would be nice for some people to work on some parts of the project. DumbCMS 0.1b won't include the following, so I'll need the following work done (and I could do most of it) before version 0.2b:
    • Proper blog view with RSS feed generation
    • Template design
    • Color scheme design - at the moment you can just select from some predefined color schemes

    Monday 16 May 2011

    DumbCMS Progress

    I have almost finished work on DumbCMS - a new CMS that I am building. It will be released on Google Code by the end of the week, if not earlier. I will aim to get the files needed Zipped up and put in the downloads section first before adding all the source code up in full. The development of the project has proved to be surprisingly easy, it is just basic PHP and JavaScript - the only thing that has really proved difficult has been building up the admin options - these are actually quite complex and need to be protected from intrusion.

    The plan will be that all the files are uploaded to the server and the user then runs a script (install.php) which will configure the database. Once that is done users will be able to modify their site from admin, or edit the source code for other pages.

    At the moment the system will be able to log a huge variety of data on visiting users: you will be able to see which IPs are logging in, what browser they are using, what time of day they are browsing, which pages they are visiting and how many times they do so. This is all managed through an SQL table, and is also relatively easy to code. Note that admins will be able to turn off this feature because it could quickly fill up the SQL database limit, but if you wanted the insight it is always there.

    When it is released (probably on Saturday), it will be released as version 0.1 beta, with the plan being for a full version being released by the end of June 2011. Whilst it won't be as feature rich as other CMS systems, it will be designed for people that want to be able to control the HTML side of their site whilst still being able to manage things such as the design.

    At the moment everything works through two pages: index.php and page.php. The index file simply takes in the a parameter of which page the user is on and then uses an AJAX request to page.php to get the page content from a database. The advantage of working like this is that there can be complex jQuery animations between each page (OK, maybe not complex, but it slides and fades and looks quite cool!).