Archive | Software Engineering RSS for this section

A Reading List

One of the things I’ve always tried to do is learn stuff outside of my university studies. Its nice to have a multitude of views about any given subject, from different people with different experience. Besides, university isn’t there to teach you everything you need to know — just to give you a very good foundation from which to progress.

I thought it might be a nice idea to note down what I’ve been reading recently, mainly so that I can refer back to it later, but also because it might be of use to someone else.

  1. Coding Horror – Lots of opinions and strategies for dealing with User Experience
  2. The Joel Test – List of things your Software Projects should be aiming to utilise by a former Excel Developer
  3. Slashdot – A website which aggregates general tech news
  4. Daring Fireball – Tech opinions from the guy who *invented* Markdown
  5. dev.ghost.org – Notes and information about the development of the Ghost blogging platform, especially interesting if you’re using that system, but also interesting for insight into how modern open-source development works.

As you can see its not a huge list, but I think its full of interesting opinions and news. If you have any publications you think your fellow computer scientists should be reading feel free to comment below.

One of the things I noticed whilst writing this list is how much I am missing reading HullCompSciBlogs. Don’t worry, CSBlogs.com is still on track to be released soon. You can aid in the development of the system here: https://github.com/csblogs/

Danny

Advertisements

Introducing Dollar IDE – An Update on my Final Year Project

Dollar IDE - The Modern IDE for PHP

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

 

LibreOffice Bug #67159 or The Story of my first foray into Open Source

LibreOffice Website

A few weeks ago, when I was at Campus Party: Europe, I attended a fascinating lecture by Michael Meeks about LibreOffice. Whilst his talk was mainly about getting people interested in using LibreOffice, he also suggested that people get involved in the development of open source projects. As I was interested in this particular aspect of his talk the most I put my hand up, and asked the question

How easy is it to get involved in Open Source, particularly LibreOffice?

Michael, who works at Collabora – a company which supports LibreOffice, gave a great response and asked me to speak with him after the talk. I did so, and it was at this point he mentioned the “easy hacks” list that LibreOffice developers maintain, the purpose of which is to take the fear out of getting involved in an open source project. Items on the easy hacks list should only take a few hours to complete, be simple in their nature and allow to learn about the coding standards and systems used by the project.

For those who aren’t quite as interested in productivity software as myself, LibreOffice is a Desktop Office suite which has similar functionality to that of the famous Microsoft Office package, it consists of the following programs:

  • Writer (similar to Microsoft Word)
  • Calc (similar to Microsoft Excel)
  • Impress (similar to Microsoft PowerPoint)
  • Base (similar to Microsoft Access)
  • Math
  • Draw
Michael Meeks talking about the recent addition of an iOS remote for LibreOffice Impress at Campus Party: Europe

Michael Meeks talking about the recent addition of an iOS remote for LibreOffice Impress at Campus Party: Europe

Fast forward a few weeks to the 12th of September and I stumble across an item on the easy hacks list that interests me, this item is called “Bug #67158 – FORMATTING: Add shortcut Ctrl+K (or cmd + K on OS X) for inserting hyperlinks”.  It interested me because it seemed like it would be relatively simple to add, it’s just an event handler after all, and it was marked as “Medium importance, enhancement”, this meant it was both considered more ‘important’ than some of the other easy hacks, and it was more likely to impact on users as it was an enhancement people could actively see as opposed to code formatting changes (which, of course, are equally important, just less visible to users). Another interesting aspect of this bug was that it affected Writer, Calc and Impress, and my changes would be useful to everyone who used these programs, whether they used Windows, GNU/Linux or Mac OSX as the event would work on all 3 major operating systems.

I clicked through, from the list, to the Bugzilla entry for the task and assigned the task to myself and left a comment showing my interest in taking it on.

The next thing I had to do was boot into my Fedora GNU/Linux operating system and set to work on making the development environment in which I would make my changes, This is an area in which GNU/Linux, particularly its package system, really comes into its own. To install every single resource I needed to work on the project, from libraries to images, I just had to to type

          $ yum-builddep libreoffice

Following this I just had to download the latest version of LibreOffice from their Git repository and run a shell script which dealt with everything else. It was really easy to do following this guide.

Now all I had to do was add in the event handler, and ‘fix the bug’ so to speak. Simple right? Well, sort of. LibreOffice has 7,075,071 lines of code (according to ohloh.net) so finding exactly where my fixes should go, and what exactly I should be writing to invoke the Hyperlink Editing and Insertion Dialog was a daunting task. Fortunately because my bug was assigned to the easy hack list some regular contributors to the project had left some pointers on what to do. Petr Mladek from Suse pointed me in the direction of the file which I needed to edit in order to add an event handler.

I played around with the file, finding out what the various variables did and meant and decided to swap around what Ctrl + C and the delete keydown events did, in order to see how easy it was to edit a pre-existing event handler — It was at this point I ran into my first issue.

When I attempted to build my changes it worked, however, when I ran LibreOffice Ctrl+C still copied things, and delete still deleted things. I was flummoxed. Thankfully when I reached out to Petr for help he was happy to provide it, it turned out I was providing the compiler with flags that meant it would ignore the changes I had made, with this knowledge I managed to get delete to copy things and ctrl + c to delete things, useless and in fact harmful changes, but a great test.

Having reverted the aforementioned events to do what was expected, I added in an event for Ctrl+K, using the same code style and formatting as the other event methods. To check the event was firing I made Ctrl+K Select all text in a document. Brilliantly, it worked first time.

I then set out the find what I would need to call in order to invoke the hyperlink editing dialog. This was made a lot easier by a really awesome utility LibreOffice has implemented called OpenGROK. OpenGROK allows you to search through all of LibreOffice’s code, instantly, using a web interface. I quickly found the method I needed to invoke to call the HyperLink Editing Dialog and added it to my code and compiled it. It worked! Awesome. My first patch to LibreOffice was ready to be submitted for review.

A review, in the context of open source, is when one of the project maintainers — kind of a manager of the project — looks over your code, ensures it does what it says it does and that it doesn’t break anything else, and then implements it into the main branch of code. At this point your code is part of the project and will then be made part of the next update which will be made available to the 150 million people who use LibreOffice! (thats over 100,000 downloads every day).

The LibreOffice Hyperlink Dialog in the Writer Application. Think of me when you invoke this using Ctrl + K!

The LibreOffice Hyperlink Dialog in the Writer Application. Think of me when you invoke this using Ctrl + K!

Today my code was accepted into the main branch. It’s really exciting to think that soon over 150 million people, and possibly many more in the future, will be using some of my code. I can’t wait to contribute some more, not only to this project but to others too!

You’ll be able to download my fix as part of LibreOffice 4.2, the release dates for which you can see here.

Danny

PHP Function Information Downloader

The Resulting XML Document from a PHP Downloader Request

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.

QuickSync – Stock Management Made Simple

QuickSync Homepage

As I promised in a previous blog post, today’s blog post is about my new start-up venture, QuickSync.

What is it?

QuickSync is the solution to a very simple problem — not selling things you don’t own, and ensuring you do sell things you do own.

Many small businesses around the country now sell their products online as well as in Brick-and-Mortar stores, they have to in order to actually sell their stock and be able to have a chance to compete with the bigger companies. The beauty of this is that those companies can then sell their goods to a larger market as well as attract more local people, however there is also an ugly side of selling products online. Selling online obviously means more work, and one of the biggest pieces of work these small stores — often with only a few employees — have to face is that of Stock management.

If the company has 2 Red Dresses and a customer comes into the shop and buys both the business is quite happy, until of course they forget to update their website to reflect the fact the item is out of stock and they have to deliver the disappointing news to a customer who thought she had bought the last one online. Similarly, if a company takes in a big re-stock of that popular little red number and forgets to update their website they may lose out on a lot of potential out-of-town custom! No business wants to be in either situation.

In order to keep stock levels up-to-date between their website and their shop many businesses were spending between 2 and 4 hours a day updating their websites and electronic point of sales (ePOS) systems to have the correct, syndicated, information — with a minimum wage of £6.08 an hour this was costing businesses at least £12.16 a day, over £85 a week, but usually more. When Guy Wallace at Forward Thinker Developments saw this issue, he and I set out to resolve it and the result is QuickSync, the tag line for which is “Stock Management Made Simple”.

The QuickSync Dashboard was built to be user friendly and to look great on both computers and mobile devices

The QuickSync Dashboard was built to be user friendly and to look great on both computers and mobile devices

QuickSync’s job is simple; syndicate stock levels between websites and ePOS systems ensuring that sales and re-stocking is reflected on both sides, do so in a pretty and user friendly way; and be available anywhere any-time — from mobile phones, through to tablets and larger desktop PC’s so businesses owners can be on-top of and check their stock levels at any time.

What was your involvement?

I was involved in the project from very early on, when it was just a series of diagrams and a little bit of code to read from an ePOS system. From there together Guy and I have a developed a solution which syndicates stock levels from ePOS systems, websites built using the magento framework, eBay and very soon we will be adding Amazon support.

As well as being the Lead Software Engineer and Technical Director for the company, I also had some influence on the design and marketing of the product. The colour scheme is actually based on my hair colour, and I helped come up with the tag line. In fact, some of the most interesting bits of the project for me have been the non-technical parts, such as working with other people, finding out what customers want, working with live and mission critical data for other peoples businesses and solving real life problems,

Remuneration for the project included 25% equity in the resulting company, which is very exciting indeed.

What’s in the future for QuickSync?

From now on my work with Forward Thinker Developments consists only of administrating, updating and upgrading the QuickSync experience. As I previously mentioned this includes upcoming Amazon support amongst other things.

At the moment we are working with a relatively small number of shops willing to test out our new software and in the month we’ve had the system online have had almost 0 problems. We’ll be opening up to a much wider audience very, very soon. This is especially exciting because we have had a lot, of interest from companies big and small. I will of course always keep this blog updated with news.

Where can I find out more?

About 2 weeks ago we launched our customer facing site which you can read to your hearts content here.

Danny

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

Fun with Formal Language

Tokenization

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