Programming and general geekiness.

Archive for the ‘Programming Thomas’ Category

Moving content over to Programming Thomas blog

I’ve decided to move the majority of my content over to my Programming Thomas blog instead of this one because it fits better with my other projects. Please go over there for any updates to my apps and general programming information.

Programming Thomas on WordPress.com

Updates to Keep Calm and Keep Calm Pro

I have made a few improvements to Keep Calm and Keep Calm Pro for Android. The key improvement that has been made is that the app is now fully multi-threaded which means it is a lot less likely to crash (I am ashamed to say that, yes, everything had been running in the UI thread before – oops).

Both apps now include PT Sans as the default font and Keep Calm Pro now allows you to choose between Open Sans, Open Sans Light (which used to be the default), PT Sans and the standard system font. I chose PT Sans because it matches the original font quite well. A less major modification that has been made to both apps is the change of the background color :) .

In response to comments I have also added a new option to Keep Calm that allows you to use the old designer. This feature has not been added to Keep Calm Pro as it would have made it far too complex and I believe the menu/sub-menu system that it currently uses is far more efficient.

Keep Calm 2.2 on Google Play

Keep Calm Pro 1.1 on Google Play

Keep Calm 2.0

I have updated Keep Calm for Android to version 2 so that it now uses them same UI as Keep Calm Pro.

Keep Calm on Google Play

Keep Calm Pro on Google Play

New Android app: Keep Calm Pro

It’s been just over two months since I originally published Keep Calm on Google Play and the time has come to upgrade it to introduce new exciting features. Keep Calm Pro is now officially available and introduces the following new exclusive features:

  • Updated rendering engine so that text always appears on the poster and so that it appears at the maximum size possible
  • New menu that makes the app easier to use and reduces time between loading the app and saving/sharing the finished poster
  • The option to use the standard sans-serif font or Open Sans Light
  • Change the text color
  • Change the icon to one of 50 included icons or any image from the your Gallery which is automatically resized, cropped and recolored so that it looks great at the top of the poster
  • Change the background color and choose whether it is a solid color, linear gradient or radial gradient
  • Change the background to an image of your choice from your Gallery
  • Improved wallpaper rendering for higher quality

Unfortunately camera integration didn’t work too well initially so in version 1.0 you will need to select the ‘Gallery’ option before pressing ‘Menu’ which then gives you the option to take a new photo. Please note the image of the teacup used in the screenshots is licensed under Creative Commons license from Wikimedia Commons. All other images used by the app are in the public domain.

Keep Calm Pro is by far the best Keep Calm and Carry On app available for Android at just 50p/99c.

User guide for Keep Calm 1.x

I first released Keep Calm for Android over a month ago and it remains the best Keep Calm and Carry On app available on Google Play with over 30,000 downloads and over 200 ratings. Recently I’ve had a number of comments suggesting that the ‘app freezes on the loading screen’ and other basic problems so I thought that I would write up a quick guide for basic usage. Please note that I am launching an awesome update to the app within the next week which gives it a completely new UI with loads of new options.

1) The home screen

This home screen (its not a loading screen!) is pretty simple and you can just press ‘Design’ to get going. There isn’t much interesting stuff on the ‘About’ screen.

2) The design screen

This screen is also pretty easy to use. When typing the text you do not have to have it on separate lines and if you do have it all on one line it gets split by word. Capitalization isn’t important because this happens automatically, staying true with the original poster. If you don’t type in anything the default text of  ‘KEEP CALM AND CARRY ON’ is used. The icon button probably doesn’t need any explaining – just tap it to be presented with a choice of 50 icons and then tap the one that you want to use. Tap the color button to pick a new color.

The color system used by version 1.x isn’t great, sadly (although it uses a color wheel in version 2). The sliders use the RGB color system where each color is represented by its red content from 0 to 255, green content from 0 to 255 and blue content from 0 to 255. To put it in perspective the color black is R0, G0 and B0 (because it doesn’t have any red, green or blue) and white is 255, 255, 255. The sliders therefore give you a choice of 16.7 million colors. You can the tap ‘Use Color’ once you are happy. Unfortunately version 1.x doesn’t allow you to change the text color so I have to recommend that you use darker colors.

3) The final poster

Once you’ve tapped ‘Design’ you’ll be able to see a preview of your final poster. The poster is rendered at 600 pixels wide by 900 pixels high. You can either tap the poster itself or press the Menu button on your phone to display the menu. As of version 1.2.2 tapping Save will save the image to the SD card and then display it in the Gallery app. In earlier versions it seemed that a user had to reboot their phone or wait a significant amount of time for the image to appear in the Gallery however a bug with Android stops the Gallery app refreshing by itself so I added one line of code to force it to refresh. Sharing will display a menu of different options for saving, dependent on which social networks’ apps you already have installed (so you’ll need the Twitter app to share on Twitter, the Facebook app to post on Facebook, etc).

Setting as wallpaper works exactly like saving except that a new image has to be generated because Android handles wallpapers in peculiar ways and requires a landscape image so it occasionally takes a while to set the wallpaper on older devices, but on new devices it is pretty much instant.

Hopefully this guide will have helped some of the users that are having issues with version 1.x. If you have an older version than the most recent 1.2.2 update I highly recommend that you update although in a week there will be an awesome new update that will give loads of new features, such watch this space!

New Theme

After having used the WordPress Freshy theme for about eight months I’ve made the decision to change to the Spectrum theme. Here’s what my blog used to look like:

And here is what it now looks like:

My Christmas countdown website

Every year I produce a Christmas countdown website for the fun of it. This year I have done something similar that uses HTML5 and JavaScript to produce a nice and simple countdown. You can view it here. If you would like to upload images for the slideshow, please click here. I intend to add audio in the future.

An update of my use of Tumblr

I had completely forgotten that I had a Tumblr account until the other day when one of my friends reminded me that I did. I’ve been experimenting with it again so I’ve posted solutions to Euler problems 6, 7 and 8 on there. Click the image to go to my Tumblr blog (and please follow me)…

Looking back at the weird world of ThomasScript

I’ve done a surprisingly large amount of work over the last year. Looking back over my blog I sometimes don’t even recognize some of the crap that I’ve written here  - I’ve done almost 300 posts this year. Never mind. I am sure you can cope. A few months back in July I coded a language called ThomasScript that was basically Java running over a file and interpreting what it found there. Evidently the language was pretty much useless and a nightmare to code to the degree that I can’t even remember how it worked which is quite bad considering that I wrote the whole damn language.

I vaguely remember that branching didn’t really happen very well and IF statements just took a comparison and a number and then redirected the interpreter to that number line in the source code. In essence it was useless though some of the variable stuff didn’t look too bad even if nothing on the wiki makes sense.

I haven’t written a full specification of the language and I don’t really want to be honest. Considering that it doesn’t work particularly well there is very little point. I can vaguely remember that I started writing the language in C or C++ at the beginning of the year and I then wrote it in a few days using Java after having done nothing before hand.

If you are interested in looking over the source code I think it is here. I don’t think it is very good and I could definitely improve it. I might in the future but I don’t want to. My current main projects are DumbCMS (a really simple but effective CMS written in PHP) and a new JavaScript library that should hopefully make writing HTML5 games a lot easier.

Scoff – a new HTML5 Canvas game


I have been meaning to create a new HTML5 game for a while now howver I have only just got round to it. I have therefore built an incredibly simple game called Scoff. The aim of the game is to catch as many red balls as possible (the maximum is 1000) using the green paddle. The green paddle can be controlled with arrow keys or if you are using a phone, by tilting it from side to side. Each time you catch a new ball the paddle increases in width by 1%.

The game didn’t take that long to code and it isn’t very good, but it is worth having a look at anyway. I have found that the game is unplayable below 20fps, though most computers should be able to manage more than about 40 so it shouldn’t be an issue. If you are having problems, download the page and adjust the line that reads ctxSize = 400; to a smaller number.

Dual posted from programmingthomas.tk

Follow

Get every new post delivered to your Inbox.