TC33.org http://www.tc33.org Tom Castle on GP, Java and the Web Fri, 08 Apr 2011 11:17:22 +0000 en hourly 1 http://wordpress.org/?v=3.1 Go programming highlighter for conTEXT editor http://www.tc33.org/go/go-programming-highlighter-for-context-editor/ http://www.tc33.org/go/go-programming-highlighter-for-context-editor/#comments Sun, 27 Feb 2011 22:11:45 +0000 Tom Castle http://www.tc33.org/?p=738 [...]]]> When on Windows I use the conTEXT editor for basic text editing and for small programming tasks (when loading a full IDE would be a tad excessive!). The conTEXT editor website lists syntax highlighters for all sorts of programming languages. However, when experimenting with the Go programming language today, I discovered there was no conTEXT highlighter for Go. So, I wrote my own.

Download

Download conTEXT highlighter for Go programming language (.chl)

This is based upon the Go programming language specification as of the 2011-02-15 release.

Installation

To install the highlighter, drop the Go.chl file into the Highlighters directory. By default this is:

C:\Program Files\ConTEXT\Highlighters
]]>
http://www.tc33.org/go/go-programming-highlighter-for-context-editor/feed/ 6
Which Genetic Programming software? A comparison http://www.tc33.org/genetic-programming/genetic-programming-software-comparison/ http://www.tc33.org/genetic-programming/genetic-programming-software-comparison/#comments Tue, 15 Feb 2011 20:30:24 +0000 Tom Castle http://www.tc33.org/?p=622 [...]]]> This table is intended to be a comprehensive list of evolutionary algorithm software frameworks that support some flavour of genetic programming. Each entry lists the language the framework is written in, which program representations it supports and whether the software still appears to be being actively developed or not.

If you know of any other genetic programming software that has been omitted from this list, then please leave a comment with details.

Framework License Lang Tree GE CFG-GP CGP GEP Active?
AForge.NET LGPL .NET
Beagle LGPL C++
DEAP LGPL Python
DGPF LGPL Java
DRP GPL Ruby
Discipulus Commercial
ECF ? C++
ECJ AFL Java
EO LGPL C++ ? ? ? ? ?
EpochX LGPL Java
ep4js Apache JScript
Eva2 LGPL Java
Evogen MIT Flex ? ? ? ? ?
GAlib as specified C++
Genetik LGPL Java
GenPro Apache Java ?
GEVA GPL Java ?
GPC++ GPL C++ ?
GPalta GPL Java ?
GPE AFL .NET ? ? ? ? ?
GPLAB ? MATLAB ?
GPTIPS GPL MATLAB
Groovy GPL Java ?
JAGA GPL Java
Java GAlib ? Java ? ? ? ? ?
JCLEC GPL Java ? ? ?
JEF LGPL Java ? ? ? ?
JGAP LGPL/MPL Java ?
jGE GPL Java ?
JRGP GPL Java
lil-GP ? C ?
LAGEP GPL C++ ?
MicroGP GPL C++
PerlGP GPL Perl ?
PMDGP GPL C++ ?
PonyGE GPL Python
PushGP ? C++ ?
PySTEP MIT Python ?
Pyevolve PSF Python
Pyro ? Python ? ? ? ? ?
RMIT GP ? C++ ?
SmallGP GPL C++
TinyGP ? Java
Watchmaker Apache Java

The program representations that are listed are: tree (standard tree GP as described by Koza, including STGP), GE (Grammatical Evolution), CFG-GP (Whigham‘s Context-Free Grammar GP), CGP (Julian Miller’s Cartesian GP) and GEP (Gene-expression Programming). Other unlisted representations may also be supported by the listed software.

A framework is considered to be active still if it has had a release within the past 9 months. If its commit history is visible then it will only be considered active if there have been commits within the past 6 months.

]]>
http://www.tc33.org/genetic-programming/genetic-programming-software-comparison/feed/ 6
Answers to Melanie Mitchell’s Thought Exercises http://www.tc33.org/ga/answers-to-melanie-mitchells-thought-exercises/ http://www.tc33.org/ga/answers-to-melanie-mitchells-thought-exercises/#comments Thu, 27 Jan 2011 11:36:09 +0000 Tom Castle http://www.tc33.org/?p=554 [...]]]> Melanie Mitchell‘s book An Introduction to Genetic Algorithms, contains a series of thought exercises for the reader. The book itself does not contain Melanie’s answers, but they were previously freely available on her website. Unfortunately, the website no longer seems to be available. However, I was able to find a copy of her answers online still using the Wayback Machine. For convenience, I’m posting a copy here:

Melanie Mitchell’s thought exercise answers

Note that this is entirely her work, and if her website reappears, then I’ll remove this copy. As mentioned, this document is already freely available online at the following location, but I don’t think it would be appropriate to thrash the Wayback Machine with the same query:

http://web.archive.org/web/20000918164730/http://www.santafe.edu/~mm/exercise-solutions.ps.gz

]]>
http://www.tc33.org/ga/answers-to-melanie-mitchells-thought-exercises/feed/ 2
The Maverick Meerkat is loose! http://www.tc33.org/ubuntu/the-maverick-meerkat-is-loose/ http://www.tc33.org/ubuntu/the-maverick-meerkat-is-loose/#comments Fri, 17 Dec 2010 17:37:00 +0000 Tom Castle http://www.tc33.org/?p=529 [...]]]>

Maverick Meerkat was released on 10-10-2010

It took me a while to get around to upgrading Ubuntu to version 10.10, nicknamed Maverick Meerkat. The update went without too many difficulties, the only irritation being that the mouse stopped functioning for much of the installation process which meant setup dialogs had to be navigated with the keyboard – but the mouse worked fine again upon the restart. There doesn’t seem to be too much difference in functionality, but the new Ubuntu Font Family are very likeable.

Encroaching Shadows

There was one major striking problem from the start though. For some reason all menus and windows seemed to be shrouded in shadows, as if they had a z-index which wrongly put the shadow on top of the panel instead of underneath. I couldn’t find any similar tales online, so perhaps this is unusual. It would have been completely impossible to work with it how it was, but fortunately I have managed to dispel the shadows. So, what was the solution? Well… I’m not too sure. For some reason, modifying my window buttons (as described in the post about Lucid Lynx), resulted in the shadows immediately disappearing. I have attempted to recreate the situation, but I have no idea what the problem was, nor what specifically was the solution. But, if you have the same problem, then maybe twiddling the window button layout will help for you too!

]]>
http://www.tc33.org/ubuntu/the-maverick-meerkat-is-loose/feed/ 0
Evolution as a Blind Watchmaker http://www.tc33.org/genetic-programming/evolution-as-a-blind-watchmaker/ http://www.tc33.org/genetic-programming/evolution-as-a-blind-watchmaker/#comments Fri, 10 Dec 2010 18:32:49 +0000 Tom Castle http://www.tc33.org/?p=517 [...]]]> I stumbled across this video through a link on Stack Overflow. As well as providing a compelling argument for evolution against the old foe, intelligent design, it is also a great demonstration of the power of evolutionary algorithms. In the 9 minute video, he describes how evolution would approach the problem of reconstructing a smashed watch, and simulates it in Matlab. The result is an impressive progression from a collection of non-functioning components to a three or four handed timepiece. I am interested to know more about his implementation details, in particular the fitness function he uses. All his code is available, but as a non-Matlab programmer I haven’t invested the time to understand it yet.

]]>
http://www.tc33.org/genetic-programming/evolution-as-a-blind-watchmaker/feed/ 0
Hooks and Stats, announcing EpochX 1.3 http://www.tc33.org/genetic-programming/hooks-and-stats-announcing-epochx-1-3/ http://www.tc33.org/genetic-programming/hooks-and-stats-announcing-epochx-1-3/#comments Fri, 22 Oct 2010 21:28:56 +0000 Tom Castle http://www.tc33.org/?p=490 [...]]]> EpochX genetic programming software

EpochX is a Java framework for genetic programming

I have just released version 1.3 of EpochX, a Java based genetic programming framework built specifically for researchers working with genetic programming. Significant additions in version 1.3 include a hooks system which allows the dynamic modification of the population and programs mid-execution and an expanded set of statistics that can be obtained live while the run proceeds. There are a whole swathe of other improvements and bugfixes too.

The documentation for EpochX is also expanding as well. The first half of the Complete Guide documentation has now been published to the website.

Downloads and documentation are all available from www.epochx.org.

]]>
http://www.tc33.org/genetic-programming/hooks-and-stats-announcing-epochx-1-3/feed/ 2
Beyond Tags: 7 things to take web design further http://www.tc33.org/web-development/beyond-tags-7-things-to-take-web-design-further/ http://www.tc33.org/web-development/beyond-tags-7-things-to-take-web-design-further/#comments Wed, 12 May 2010 14:54:25 +0000 Tom Castle http://www.tc33.org/?p=392 [...]]]>

Puzzle graphic

Good web design is about putting the pieces together to create websites that are attractive, usable, fast and useful.

So, you’ve completed an introductory web design course and now you’re starting to feel comfortable with HTML tags and perhaps you’ve even done a bit of PHP. The next step is mastering the art of putting it all together to make websites that are attractive, usable, fast and useful. This post will outline 7 of the most important technologies, concepts and approaches that will help you make the transition from theory to practice.

1. Get a project

A really good way to learn web design is to read web design books. But a better way, is to design websites. Doing is also more fun than reading. So, choose a project to work on and get stuck in. Here are some ideas to get you thinking:

  • A personal website, perhaps with details of any projects you’re working on and your CV.
  • A blog – about a hobby, interest or a challenge you’re going to be undertaking.
  • Family archive – with details about your family history, a family tree and old family photos.
  • Photography – show off your photo collection.

2. Learn how to publish

You can start designing straight away, but there’s two things you’ll need in order to publish your website online – a domain name, and web hosting. The domain name is your unique name (www.example.com), you can choose any name you like as long as nobody else has registered it first. You can check the availability of a domain here. The final thing you’ll need is web hosting, which is online storage space where your website lives, and where your domain name directs to.

There are thousands of web hosts, and you have to be careful to ensure the one you choose supports everything you need – in particular ensure it has support for PHP 5 and MySql databases. The w3schools website has a good indepth tutorial on web hosting. Here are a few UK based hosts I can recommend:

So how much is all this going to cost? Setting up your own website is surprisingly cheap – for domain names think less than £10 per year, and for hosting £2+ per month. Once you have your domain and hosting, you’ll have somewhere to experiment with ideas, as well as a home for your latest project.

3. Learn the 4 web languages

Printed HTML code

Concentrate on HTML, CSS, Javascript and PHP

There are so many web programming and markup languages you could learn, many of them with very admirable aims. But in truth, if you are accomplished at HTML, CSS, PHP and Javascript then that will be sufficient to achieve about 99% of what you’ll ever need to. If you feel the need for extra information about any of them, then I suggest you start with the excellent w3schools website. Your ability to use these languages will strengthen magnificently once you’re pitted against a real problem that you’re passionate about, so use them in your project from point 1.

These languages are most likely what your introductory course focused upon, and rightly so since they are the foundation of web design. However, while these languages are indeed the foundation, they become so much more powerful when wielded effectively, and used alongside certain tools. The following points will introduce you to some exciting tools that you will need to know about if you’re going to be designing the next facebook, flickr or twitter.

4. Use PHP Extensions

When learning PHP you were probably given exercises to do such as validating an e-mail address but in truth, common tasks like this have been done thousands of times before and there is no need to do them again. Enter PHP extensions. There are PHP extensions for handling all sorts of problems such as the GD extension for processing images or FTP for transferring files. PHP extensions have generally been written by far cleverer people than you or I and have been tested thoroughly so are likely to be far more robust and quicker than what we would write. If you find yourself writing a piece of PHP to do a task that you’re sure is quite common, there almost certainly exists a PHP extension for it. Use it.

Some extensions are built into PHP installations by default, others need to be installed specially.

5. Use a Content Management System

Content Management Systems (CMS) are amazingly useful, and using one makes it trivial to maintain your website once it is setup. Since they allow off-the-shelf layouts to be used, they can also be an extremely quick way of getting a website up and running. Two of the most popular are WordPress and Drupal. They provide fine configuration options to allow you to update content, insert pages and track users, all without having to write any HTML. Most of this can be done without using any of your web languages, but don’t feel like you’re cheating – as with the PHP extensions above, it is all about reuse, to avoid repeating the work that thousands of people have done before you.

If you want to experiment with using a CMS, then start by installing one on your web hosting and set about configuring it. Once you understand how to configure your CMS of choice, the next big step is designing your own layout for it. Each CMS has plenty of guides and tutorials on how to get started with this.

6. Make it load FAST!

Stop watch

If your website loads slowly, your visitors will not wait.

Performance tuning is a vital skill for a web designer, but it is so often overlooked. If your web page loads slowly then your visitors will lose interest. Thankfully, it is very easy to make some massive savings simply by being aware of what takes up the time. There are two excellent web pages that I highly recommend for information about this – webpageanalyzer.com which will analyse the load time of the different components of your website, and this Yahoo! article which covers just about all the things you can do to improve load time.

7. Go interactive with Ajax

Web 2.0 and Ajax are big terms that are thrown around these days. Knowing what they are and how to use them can turn a rather dull set of web pages into an interactive web application. So what are they then? Well, web 2.0 refers to all those neat little features that websites such as facebook, flickr and google use such as updating automatically and Ajax is a way of using your web languages to achieve that web 2.0 functionality.

The primary language that is used to implement Ajax features is Javascript, although some server-side elements are usually required – so thats your PHP. However, manually writing all the necessary Javascript code to perform complex tasks like this is not straight forward and is very time consuming. But, remember it’s all about reuse reuse reuse. So, we reuse code that has already been written to make the job easier – these are Javascript toolkits or frameworks. My favourite one is Dojo, but the most popular is jQuery, there are also numerous others.

There are many, many more possible topics that you could choose to look into, I’ve merely chosen the ones that I believe are most important and relevant right now. But, I’ll name-check a few others that I considered including, and I’ll leave you to google them: accessibility, usability, CSS grid systems, SSL, stock photography, promotion and search engine optimisation.

]]>
http://www.tc33.org/web-development/beyond-tags-7-things-to-take-web-design-further/feed/ 0
Create heat maps with JHeatChart 0.5 http://www.tc33.org/java/create-heat-maps-with-jheatchart-0-5/ http://www.tc33.org/java/create-heat-maps-with-jheatchart-0-5/#comments Mon, 10 May 2010 22:50:30 +0000 Tom Castle http://www.tc33.org/?p=367 [...]]]> I’ve just released version 0.5 of JHeatChart, my little heat map Java API.

New in 0.5

  • Added support for both horizontal and vertical axis values for both x and y axis.
  • Changed chart dimensions to be calculated more reliably from individual cell dimensions.
  • Fixed issue where the title is not aligned centrally properly in certain circumstances.

Here’s a little example of a heat map chart that was generated with JHeatChart for a recent publication:

An example chart created with JHeatChart

An example heat map chart created with JHeatChart.

You can download the latest version from the JHeatChart project page. The source code, JavaDoc and example code is also available there.

]]>
http://www.tc33.org/java/create-heat-maps-with-jheatchart-0-5/feed/ 0
Lucid Lynx button positions http://www.tc33.org/ubuntu/lucid-lynx-button-positions/ http://www.tc33.org/ubuntu/lucid-lynx-button-positions/#comments Tue, 04 May 2010 12:32:32 +0000 Tom Castle http://www.tc33.org/?p=360 [...]]]> The new Ubuntu Lucid Lynx has been released, hurrah! My upgrade went smoothly and everything seems to be working nicely. There is however one minor thing that will strike you pretty quickly if you make the step. They’ve gone all Mac OS on us and by default the window buttons have been moved to the left of the title bar. I’m sure there are some very good reasons for this, but I’m not keen.

Thankfully it is quite simple to return it back to something sensible. Here’s what you do:

  1. Press Alt-F2 (or open a terminal window).
  2. Type ‘gconf-editor‘ and hit enter. The Configuration Editor will open.
  3. In the directory tree on the left, go to apps > metacity > general.
  4. Find the ‘button_layout‘ key, which will have a value of something like “close,minimize,maximize:
  5. Edit the key. To move the buttons to the right, you simply have to reposition the colon. However, you probably also want to move the close button to be the right-most button. So, replace the value with: “:minimize,maximize,close“. Or, I prefer to use “menu:minimize,maximize,close”, which puts a menu button on the left, with the rest of the buttons on the right.
  6. The buttons will update instantly.
  7. Close the Configuration Editor, using the close button now back on the right.
]]>
http://www.tc33.org/ubuntu/lucid-lynx-button-positions/feed/ 0
Installing PHP’s intl extension on windows with PECL http://www.tc33.org/web-development/php/installing-phps-intl-extension-on-windows-with-pecl/ http://www.tc33.org/web-development/php/installing-phps-intl-extension-on-windows-with-pecl/#comments Tue, 16 Feb 2010 13:11:06 +0000 Tom Castle http://www.tc33.org/?p=264 [...]]]> Alternative title: Beware PHP’s intl extension.

I have spent far longer than I am prepared to admit trying to install PHP’s intl extension for internationalisation on an apache server running on windows. As a result of this adventure I have discovered many (largely unhelpful) things about the intl extension and PHP’s extensions in general. I share them here in the hope that it saves some other soul the hours of torment that I had languishing in my own ineptitude.

Your first attempt is likely to be something along the lines of running this command at your command prompt:

pecl install intl

This will fail. The problem here is actually a general issue with PECL extensions. Currently there is very limited support for windows. You can install all the PEAR tools and feel very confident that everything is going swimmingly, only to then hit a cryptic error message such as “ERROR: The DSP intl.dsp does not exist.”. If you happen to come across this message, what it infact means is – windows hates you, and also that it does not have the right tools to compile your extension.

But there is a right way to install pecl extensions on windows. You are supposed to go to http://pecl4win.php.net/ and download the pre-compiled dll for the extension you’re after then just throw in an extension=intl.dll line in php.ini. But there’s a problem with this – that website has been discontinued and there is currently no replacement. At some point in the future the dll downloads are supposed to be appearing on the main pecl website I believe, but that’s no good for us here in the present. The dll for ‘some’ PECL extensions (not intl) are available from http://downloads.php.net/pierre/.

It was at about this stage in my quest that I discovered that PHP version 5.3 has intl included as a core extension. So solution #1: upgrade your version of PHP to 5.3+. This is a very valid solution, but it was no good for me because A) it is not backwards compatible so it broke my whole site, B) WebCrate‘s servers are stuck on 5.2 for the time being. One other thing you might think to try is to simply grab the intl.dll from a PHP 5.3 install. I had no luck with this, and resolved that the versions were incompatible.

So is there a happy ending? Not really. I gave up on intl and implemented my own very crude mechanism for localisation which controls the currency formatting on Devex-Templates.

But it’s not all doom and gloom about intl, so on the plus side:

  • Intl installed like a dream on my linux box. (solution #2: get yourself a copy of Ubuntu?)
  • It’s an excellent extension once you’ve got it running.
  • This will all be made irrelevant once version 5.3 is in wider use.
]]>
http://www.tc33.org/web-development/php/installing-phps-intl-extension-on-windows-with-pecl/feed/ 1