14th December, 2011
While considering upgrading from the excellent MAMP to the new kid on the block, MNPP I stumbled across a selection of side projects which I embarked on during my final year at university when I should have been working towards my finals. I was surprised (and delighted) to find that many of them are still in a runnable state (2 laptops later). This post is a little trip down memory lane, thumbnails are clickable!
As an eager beaver I turned up to my final year a week early to take part in SPARK06, an entrepreneurial course run at Bristol University. This is an excellent course, like a combination of Dragon’s Den and The Apprentice. We had two days to create a business plan before pitching to several investors. Our pitch was for a company called in-case systems and being the token electronic engineer I was the technical lead.
Above is the logo I created for our business. The premise was that a huge number of bags are lost or mislaid by airlines and other transport companies. We intended to change this by replacing the standard barcode labels applied to luggage at airports with a superior RFID label.
The advantage of RFID compared to a barcode is that they can be scanned without requiring direct line of sight of the label. Our intention was to have scanning gates/posts every 100m from check-in to cargo hold, thus allowing very precise tracking of baggage at all times. This would also be a deterrent against baggage theft.
Our business plan and technology was well received by the panel and some consideration was given to taking the idea further, perhaps by attempting to partner with a regional airline to solve the chicken-and-egg problem. Sadly further research showed that a couple of companies were already trialling such systems in Hong Kong so the idea was abandoned.
I’ve found that I learn well by repeating drills so I decided to write a program to allow me to make computerised multiple choice tests. This software allowed varying numbers of questions and answers, repeated harder questions more frequently, allowed embedded media (video, images, sounds) for questions and answers and kept running statistics. Rather than use this to help me study for finals, I decided to enter it into the new enterprise business competition run by Bristol university. Here is the (terrible) promotional website:
I have always been something of an Apple nut. As a student I watched their stock keep rising to the lofty highs of around $70, thinking perhaps one day I’d be able to afford to buy some of this great company after graduation (damn it!). Initially, I used a program called BlueChip to monitor the share price as part of a fantasy portfolio but when considering buying it thought it would be a better (and cheaper!) learning exercise to re-create the functionality myself. The first versions were made in RealBasic before I re-wrote it in Objective-C and Cocoa. The core functionality is to track the value of various investments overtime using freely available market data.
Oxford Trading Analysis
Continuing on the stock market theme, I became interested in learning PHP development, neural networks, CGI and technical analysis. Throw all of this together and you get Oxford Trading Analysis (I’m originally from Oxford, UK). I wrote a neural network library from scratch in C and hooked it up to my web server using CGI (old school, I know). I used my slowly improving design skills and new found PHP prowess to build a front end website. I leveraged the work I had done in StockBook to retrieve market data from Yahoo Finance and fairly soon had a public, Google Advertising funded website.
This would allow a visitor to select a stock, and chart the last few weeks data. This data would be fed through my neural network to attempt to predict the next few days movements. All this worked swimmingly aside from two significant problems:
- The mathematics behind predicting the stock market in this way is utter BS
- My cheap web host cut CGI script execution after just a few seconds resulting in no useful output
I did however refer to this work in a later interview for a quantitative trading house, who employed me before I left uni so perhaps a worthwhile learning exercise!
Facebook hit the UK during my penultimate year and was slowly gaining traction through some UK universities, Bristol included. It was far from dominating the field at that point in time with other networks in the UK being more popular such as WAYN (Where Are You Now?). Since I stayed on to do a Masters many of my friends had left at the end of the previous year and were off travelling the world. Often they wanted to keep in touch with people back home but found mass-emailing to be too intrusive while blogging was too technical. Additionally they didn’t always want to give out their real email address to people they met on their travels and wanted a good way to share their pictures.
I decided to create a social network to learn more PHP and client side web design. The network was called MapPin (a working title) and its focus was on travel, to address the issues encountered by my travelling friends. It was born from the code of an earlier social network I had begun and abandoned (The KissingProject – a story for another time!) but took many cues from Facebook in terms of features, unassuming style and user restrictions. Its “killer feature” was tagging people and places in photos and and using Google Maps to visualise journeys.
Eventually this project was put aside in favour of others and finals. I did later consider a re-write using CakePHP, but by this time TripAdvisor and CitiesIveVisited had become big players selling out for millions as Facebook apps. Kudos to Facebook for inventing a web based app platform!
When I started my geeky course on electronic engineering, I was practically laughed out of the lecture hall for turning up with an Apple iBook! Pretty much everyone else had Windows computers and thought Macs were a joke. This started to change when Apple announced they were transitioning from PPC processors to x86. More and more Macs started popping up around the university and people kept coming to me asking for the best free (students!) software to replicate some functionality from Windows.
I created the following website to catalog various applications I used frequently. This was another Linux/Apache/MySQL/PHP gem which did pay for itself with advertising revenue for a while. I also gave the code away to a friend who ran a sister site called InMyWin.
Incidentally, even the most initially Apple-hating of my geeky course mates is now a die-hard Mac user!
Podcasts were all the rage back then having recently been picked up by Apple and integrated into iTunes. My housemate was interested in creating a satirical video podcast looking at current affairs and lamenting the state of the world. I put together a website and logo and hooked up a podcast publishing system. Sadly (fortunately) the podcast was never published and I’ve opted not to upload a video file in order to protect the guilty!
Late in the year, with finals looming were my thoughts on revision? No. Perhaps on writing up my thesis? No. Not intending to get a job I was busily working on the prototype of my fortune-making project, Blinky! Finally using some of that electronics learned over the last few years I used an ATMEL micro controller, a bunch of shift registers and a nice LED matrix to produce a sound-reactive animated toy.
Using a simple analogue low-pass filter it would detect the bass beat of music to change each frame. It operated in two modes, a “disco dance floor” mode with random colours generated by reading the thermal noise on an analogue pin, and an “animation mode”. Both modes are shown in the video of the working prototype linked above. I wrote an accompanying cross-platform piece of software called “Blinky Animation Studio” which allowed end-users to create and exchange new animations. The final design was intended to have square LED diffusers to give a more dance floor-like effect, as shown in the prototype website.
It’s strange recalling that this was what I intended to do after university. One of the challenges is to bring the manufacturing cost down so that profits aren’t eaten up by certifications, shipping, distribution and retail. The difficulty I faced is the many different ways this product could be put together – use a basic FPGA to reduce component count with increased component cost, discrete logic vs expensive controllers and so on. In the end I was hired by a company with overly restrictive employment contracts and Blinky was abandoned.
Having been hired while still at university by a quantitative trading company, I decided I had better learn something about what these companies do. I decided to create a new application as an enhanced version of my StockBook app. This program, “Stryder” (not sure where all these names came from!), would have an embedded scripting language and allow the user to define an algorithmic trading strategy which could be back-tested over historical market data. The results in terms of statistics and profit were to be presented graphically. This screenshot shows an early version.
The application was written in a mix of C (electronic engineer’s favourite) and Objective-C (Apple fanboy’s favourite). Rather than make things easy on myself, I designed a custom scripting language grammar and used Flex and Bison to create an interpreter – this is what is shown in the “Rule” text box. I based my scripting language on that in a similar program by Drew McCormack called TradeStrategist. The rule shown tells the system to BUY (at the open price) if the closing price is higher than the previous day’s closing price.
As an aside, this model obviously isn’t possible in real life and the value of close(0) should be retrieved as an expected value from some indicators rather than historical data. The program downloads the historical data from Yahoo (yay for code reuse) and then runs through the date range specified working out trading signals for each day based on the rule/model entered.
Significant further work was done on this project to allow multiple rules, multiple equities, custom indicators (including neural networks), portfolio optimisation (using genetic algorithms), graphing the results, syntax-highlighting rule entry, local database caching of data and basic slippage modelling. Additional indicators, models, optimising engines and so on could be swapped in using a plugin system rather than having to re-compile the whole program. This was done as the intention was to release it to the market place. However, once again this was stifled by employment contracts. Perhaps it will be resurrected for the Mac App store in time.
The iPhone was announced during my final year. Initially Apple decreed that there would be no third party native applications on the device. However the possibilities were too tempting for many developers and a bunch of people reverse engineered their own unofficial software development kit. I started writing iPortfolio against this unofficial SDK and later against the early official Betas provided by Apple after they caved to immense demand. This is essentially a mobile version of StockBook, allowing you to track your portfolio of equities on your iPhone. I doubt it compiles against the latest version of the SDK and much of the code is probably redundant given all the new APIs since then.
The morals of the story? Finish what you start and don’t sign stupid contracts!