Categories
Uncategorized

Dissertation Handed In

If you’ve ever wondered what two copies of an 83 page Computer Science dissertation looks like, wonder no more.

On Thursday, 8th May 2014 at 11am I handed in my dissertation which was a culmination of a full academic year of work (take away large amounts of that time dedicated to other modules). The title is “Code Editor with Syntax Highlighting and Autocomplete” and the document itself describes the full process of developing Dollar IDE from the research stage to the final implementation.

I will of course update the blog when I find out how well I’ve done.

Danny

Categories
Software Engineering University

Introducing Dollar IDE – An Update on my Final Year Project

In the past few weeks, since the semester 1 exams in January, we third years have been blessed with some calm time without any exams to revise for or coursework to work on, just two days a week of lectures. During this free time I have been working on my final year project.

User Interface, Icons and a Name

As recently as two weeks ago I had very little to show anyone who asked to see my project due to it all being technical back-end stuff without user interaction, which was a shame as I’ve actually done a reasonable amount of work on it, however now I have developed some of the UI and finally have something I can ‘show off’.

My previously unnamed PHP IDE is now known as Dollar IDE, so called because of how all variables in PHP are denoted by a $ sign. At the top of this blog post you can see a fantastic logo which my friend, Harry Galuszka, who studies Graphic Design at Lincoln University designed for me.

The colour scheme I have chosen for the user interface and logos consists of various shades of purple,  an unusual choice for me because I don’t usually like the colour, however it is the ‘official’ colour of PHP, as you can see from the PHP.net website, and it also fits in quite well with the design language I am using, which is based on Microsoft’s Modern (formally metro) ideas.

The program doesn’t contain any bitmap images, instead I use XAML vectors, and is built using Windows Presentation Foundation meaning that the program works well on all screen resolutions and pixel densities, including Apples famous “retina displays”.

The main code editing screen isn’t ready to be shown off just yet, but below you can see some images of the “Start Screen”, which is the first window shown to the user when they launch the program. From here the user can opt to create a new Dollar IDE project, or open an existing Dollar IDE project or stand-alone PHP file. The 5 most recent projects and displayed in order to allow the user to rapidly get back to work on their website or web-app.

Dollar IDE - New Project Information Validation
Dollar IDE – New Project Information Validation

An important aspect of the start screen is its ability to inform the user of any issues in creating a new project before they continue, as you can see in the above screenshot issues are denoted by a red circle with a cross in, and fields which are OK are denoted by a green circle with a tick in.

This as-you-type validation means that mistakes can be spotted earlier, thus saving the user time and the exact cause of any issues can be determined and displayed. It’s always annoying when you enter some data into a program only to be told its wrong when you try to save… and then not be told what is wrong with it, being forced to make an educated guess. Dollar IDE gives you no such hassle.

Git Integration

Dollar IDE - Git and GitHub Integration
Dollar IDE – Git and GitHub Integration

One of the coolest aspect of my new IDE is its tight integration with the git revision control system. The program can interface with any git repository, hosted either locally or on a remote server, and has additional support for repositories hosted on the popular GitHub service.

In the main IDE window, which I will show off soon, the user will be able to

  • See which files have uncommitted changes
  • Commit files and projects
  • Merge files with conflicts
  • Pull changes from a remote server

Other Progress So Far

Other than what I’ve shown you in this very quick preview I have the following features working:

  • Correct tokenization of the most common PHP tokens
  • Complete coverage of the tokenizer with unit tests to ensure program correctness
  • A source code editing window with colour highlighted text and line numbers
  • Project loading and saving
  • File associations (to allow project files and PHP files to be loaded from Windows Explorer)

What’s Left to Do

There’s still rather a lot left to do on this project, but fortunately there’s still around another 2 months to do it in. I’m now feeling rather confident that I will finish my product on time with all of my primary functionality and a lot of my secondary functionality implemented.

I will of course keep the blog up to date on my progress.

Danny

 

Categories
University

Initial and Interim Report Results – 72% and 85%

The Interim Report is quite big, this is just under half of it

As part of the process of completing the final year project you have to submit two, smaller iterative, reports before your final report. These are a great opportunity to get in-depth feedback on your work before submitting your final report — they’re also a good way to evaluate your progress.

Initial Report

The initial report — which is produced early on in the project, in September — outlined the introduction and context of the project, for me this consisted of explaining what PHP is, what an integrated development environment (IDE) is and then discussing what other PHP IDE solutions are on the market today.

Initial ideas of what technologies and methodologies would be used for the project were also briefly discussed based on research I did over the summer, which had to be referenced in Harvard style.

Perhaps most importantly the initial report was the time when my project title, aims and objectives were set in stone for the first time. A time plan and associated gantt chart were produced to outline which work should be taking place at which time in order to deliver a finished product by the due date for the report.

The initial report was marked by Professor Ping Jiang and he awarded me a mark of 72%, which I was pretty happy with for my first mark of the third year. 🙂

Interim Report

Yesterday I got back my mark for my Interim Report. The Interim Report is used to detail your progress since the initial report, and is submitted in January, about half way through your development time.

All the reports are iterative, in other words based off of the previous one. So I added in more detail about which methodologies I have been using to develop my project, updated my time plan to be more realistic and discussed the risks and ethical issues associated with the production of my IDE.

Dr. Martin Walker marked this report and I’m very happy to say that I got 85%. This gives me a good base on which to produce a good final project, especially with the in-depth feedback I received.

I will of course keep the blog updated with future developments on the final year project.

Danny

Categories
Computer Science Programming

The Generation Game – A Simple Genetic Algorithm

Last night my housemate Hayley and I were talking about the Data Mining and Decision Systems module we took last semester, during that discussion the concept of genetic algorithms came up.

In the computer science field of artificial intelligence, a genetic algorithm (GA) is a search heuristic that mimics the process of natural selection, except that GAs use a goal-oriented targeted search and natural selection isn’t a search at all

– Wikipedia

Hayley explained the concept to me using the idea of an animal that is more likely to survive in its environment by blending in with the colour of its surroundings. So tonight, as a nice change from revision and work on my Final Year Project, I had a go at developing such an algorithm — with a somewhat humorous undertone. The result of this undertaking is a little tech demo called “The Generation Game – A Simple Genetic Algorithm”.

In the demo it is advantageous for a sheep to be green, in order to fit in with its field. However at the beginning of the game the ten sheep in the initial flock are of completely random colours.

Turns are taken, in order by

  1. A Flock of Sheep, which breeds, producing 1 new sheep for every two sheep in the flock (if there is a left over sheep it doesn’t breed). Sheep produced by the mating process are the median colour of its two parents.
  2. A Wolfpack which depending on its hunting ability can eat 10% – 60% of the heard in any given turn

The closer a sheep is to the colour green, the less likely it is the be a casualty of a wolf attack (however there are other contributing factors, and a green sheep can still be killed).

As you can see from the gif image above if the initial flock has a green sheep amongst its ranks then evolution takes place (survival of the fittest, like how Darwin described it) and within just 20 generations the flock consists of only green sheep.

Another interesting situation is when there is no green sheep in the initial flock.

Evolution with No Green Sheep
Evolution with No Green Sheep

As you can see from the example above which starts with no green sheep the flock gradually becomes a light brown colour, this is the closest colour the flock could get to green with the genes avaliable in its gene pool.

This is just a simple tech demo (written in C# with XNA) to prove to myself I understood the concept, but it worked out quite well and I think its cool. I’ll be cleaning up the code and adding some comments, so be sure to check out the repository containing the program on GitHub.

Thats all for now,
Danny

Categories
Life University

Goodbye 2013, Hello 2014

2013 was another year that simply flew past.

It’s strange to think that it was almost 3 years ago that I first made the journey from Dunstable to Hull and started my degree in Computer Science.

Last year was an important year, and this one will be even more so — here’s a roundup of what happened, and a plan for what is to come.

2013

What happened in 2013:

  • I passed my second year with an average grade of 85%
  • I had my first experience of commercial development as part of a business over the summer
  • I co-developed QuickSync — a platform for syndicating stock levels between different systems
  • I chose and started developing my Final Year Project, an Integrated Development Environment for PHP
  • I started considering alternative choices for my masters (and hopefully future PhD) and received some offers (more on that later in the year)
  • I had a lot of fun with my awesome friends at uni, and some students who spent a semester here from America.
  • I started arranging and saving for a month-long holiday to America with my housemate Rob (including meeting up with aforementioned Americans!)
  • I did loads of cool events with Microsoft, including going to Campus Party
  • I had blue hair for most of it!

2014

What I expect (and hope!) will happen in the new year:

  • More sensible hair
  • Graduating from The University of Hull with a first class Bachelors of Science Degree in Computer Science
  • The release of my final year project as an open source initiative
  • Lots of preparation for my masters degree, including lots of maths revision and learning Java (it seems like every other university mainly teaches using Java as opposed to C#)
  • Moving from The University of Hull to another university for my Masters Degree
  • An awesome road-trip around Arizona, Nevada and California from Phoenix to San Francisco

I think that will take most of my time!

I hope you all had a great time in 2013 and wish you a fantastic 2014. Thanks to everyone who made 2013 such a special year for me, of whom there are too many to list — you know who you are. 🙂

Danny

Categories
Software Engineering University

PHP Function Information Downloader

I’ve spent much of the last day building a little application in preparation for more work on my final year project. As I’ve mentioned before, my project is to build an IDE for the web programming language PHP, so one of the things I have to be able to do is autocomplete and autocorrect PHP function names, and give the user information on functions.

In order to be able to do this I need the information in the first place, after a search online for a machine readable list of functions, their parameters and their descriptions — perhaps in JSON or XML format — I was unable to find anything of use, therefore I decided I would have to scrape this information from the PHP.net website myself.

Scraping for functions was made somewhat easier than I thought it might be because the people at PHP.net maintain a quick reference page avaliable at http://www.php.net/quickref.php. After downloading this my program searches for anchor tags (links) in the unordered list element called ‘quickref_functions’, ensuring that what it is looking at is indeed a page about a function and not a page about a class, by ensuring the url starts with “/manual/en/function”. I then grab the hyperlink reference from each anchor tag.

Once I have parsed the entire page I am left with a list of URLs, each of these URLs points to a page with all the information about a particular function. For example, the first URL I always have in the list is http://www.php.net/manual/en/function.abs.php which gives all the information about the function abs();

I go through and download each of pages at these URLs and parse them, taking out the function signature, which looks like this:

number abs ( mixed $number )

Information about each parameter, the return type, the description and a link to the comments section. In the coming few days I hope to be able to parse out information allowing me to flag deprecated functions, provide popular comments about the function and show code examples amongst other things.

At the moment once I have downloaded and parsed all 4700+ function pages and parsed them I output them to an XML document, eventually I will insert all of them as records into a NoSQL database.

Because downloading and parsing all the information takes quite a while I will ship my IDE with a pre made database of PHP functions, but will allow uses to, via an advanced settings panel, attempt a redownload of all functions in order to download new ones, or changes to old ones. I think this will be a function that only the most advanced users use, if anyone does at all, but it is however an interesting unique selling point to my product.

Danny.

Categories
Employment Forward Thinker Developments Life Software Engineering University

Summer of Software 2013

So, we’re just over half way through the summer break from university, so I thought it would be a nice time to summarise what I’ve been up to.

I’ve spent much of my time working for a company called Forward Thinker Developments which operates from the Enterprise Centre at the university

Much of the work has been on a system which we call QuickSync which syndicates stock levels and information between electronic point of sale (EPOS) systems and websites for fashion shops, saving businesses up to 4 man hours a day stock checking and updating their systems . As one of the benefits of working on the system from the very beginning, to this version 1 release and onwards into the future, I have a 25% stake in the company. I’ll be posting more information on the service, which already has 35 customers, in the near future.

The Countdown to the Launch of The Hull Box Office
The Countdown to the Launch of The Hull Box Office

On top of my work on QuickSync I’ve also been developing the new Hull Box Office website. At the moment Hull City Council and some of the larger clubs and venues in the city all use separate, and old, systems to sell tickets and update local people on upcoming events. The council itself doesn’t actually have an online presence for selling tickets to its events and still uses an actual kiosk in the city centre to sell tickets, meaning a lot more effort for potential customers. To resolve this the council, along with Welly and Fruit has contracted us to build them http://www.hullboxoffice.com, which will be the one stop shop for buying tickets for events in Hull, including club nights like Shinobi at Welly. I will of course update this blog when the site goes live.

I’ve been enjoying doing my commercial work, which I hope will have lots of happy users, but the project I’m most excited about is my final year project.

Since my last blog post I’ve been working on the auto complete algorithms, and am starting to get to a point at which I’m really happen with them. I’m testing the usefulness of the algorithm I have created using the test harness you can see in the image below, in which you enter a search term — in the real IDE this would just be the letters you have typed since the last token — and it delivers back to you a list of the functions you are most likely to want. At the moment it contains a list of all the built in functions of PHP, but ofcourse this will be expanded to contain user-created functions as well in the finished product.

Auto Complete for PHP Function Names
Auto Complete for PHP Function Names

For now I’ll keep quiet on how exactly I do this, but I will be open sourcing the application towards the end of development next year, so you will see then!

I hope everyone’s had a good summer, and I look forward to seeing many of my readers back at University in September! Remember to look out for posts about QuickSync and The Hull Box Office.

Danny

Categories
Programming Software Engineering University

Fun with Formal Language

It’s been a while since I’ve updated you all on my progress regarding my final year project, in which I’m building an integrated development environment for the PHP scripting language.

At this stage I’m researching different methodologies and algorithms for what I want to achieve in my first prototype, as well as different methodologies for the actual software engineering experience in, and of, itself.

Whilst doing this I’ve found that writing code for the algorithms I’ve been researching has been super useful in determining the ease of implementation, and actually understanding the ideas involved themselves. In the above screenshot you can see an example of one algorithm I’ve implemented to tokenize my code.

Tokenization is the process of identifying the name and value of each token in a piece of code. A token is just a set of symbols, such as a $variableName or a keyword such as true — or even a simple code delimiter such as ; or { or }.

The above screenshot shows the code as highlighted by Visual Studio and as highlighted by my program, some of the formatting is a tad different than you would expect, but this is a very early version of the program and won’t be used as part of my final product — it’s just to help me visualize how an algorithm works.

Danny