Archive | Software Engineering RSS for this section

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

Make Yourself a Nice Workplace

Github for Windows and the Powershell Command Prompt for Git

I’ve recently started a new job as a Software Engineer at a local tech start up called Forward Thinker Developments. One of the nice things about this new role is that I have been given a reasonable amount of control over the workflow of the projects we are working on, all of which are pretty exciting! One of the things I’ve discovered whilst doing this is just how important it is to make yourself a nice environment to work in, much like Rob spoke about whilst teaching us in the first year.

As a Software Engineer your job is simply to design and develop software to a specification given to you by either a customer, or in this case, your boss. Whilst I cannot understate how important things like source control, coding standards and the set up of your development environment are making these things work for you isn’t actually part of your final product. This is why its important you get it done right first time — though there is of course scope to review and amend certain practices — and make it simple and elegant to use.

I’m a firm believer in beautiful, user friendly software. Some people in the Computer Science community will looks down on me for this but if I can avoid the use of a command line tool, I do.

This is for the simple reason that when I am working I like to be immersed, because this is how I do my best work. For me immersion is thinking purely about the code and the product I’m developing with no distractions, this means I don’t want to have to spend a few moments — even if its just a second or two — trying to remember the command to branch a git repository, for example. Why? Because that means I’ve lost my train of thought about the thing I’m actually trying to develop.

This is why rather than use Git Bash, I am using GitHub for windows, and I have to say I can see now downsides at all to its use. I have a pretty front end program for my source control, which makes it a pleasure rather than a chore to use but then if I need to do something particularly complicated I still have the option to open Powershell, the Windows Command Line or even our old friend Bash to do whatever I need to in the command line. Another, perhaps more important reason to use a GUI rather than a CLI for things such as source control is that you wan’t to make them as accessible as possible, the less “nasty” a program is to operate, the more likely your team members will use it frequently, and if you’re working on any sort of commercial project you really do want frequent commits to source control.

Whilst reading an article on Ars Technica which asks the question “Is it a good idea to impose uniform code format for all developers?”, I realized that having an automated code formatter might be a good idea. An automated code formatted can be used to ensure that all code is formatted in the same way before being commited to source control or before being uploaded to an FTP server — i.e. Make sure it conforms to your companes particularly coding conventions —  but the also ensure that code is downloaded to the develops machine in the format he likes.

So, for example, I love the Allman style indentation — in which curly braces for any function or control block are on the line after the declaration, like so:

public static void MethodName()
{
      //Content inside method is tabulated
      //Danny likes this style
}

Whereas some of my colleagues may prefer K&R style indentation, in which many of the curly braces are on the same line as function or control block declaration

public static void MethodName() {
      //Content inside method is tabulated
      //Danny doesn't like this style
}

This article on Smashing Magazine has some really cool online formatters which could do the job of making code styled the way you like it a lot easier.

Conclusion

Here’s the tl;dr, if you want to spend your time developing great software make sure you’re not spending a great deal of your time doing menial tasks when theres an easier way. Before I discovered code formatters I would spend a lot of time formatting things the way I like them, now I don’t. Before our team discovered Git for Windows, over git bash, we would spend longer typing commands and administrating our own self-hosted git repo, now we let the GitHub team deal with all of that and only crack out Git Bash on the rare occasion we wan’t to do something complex.