Category Archives: tech

Paul Graham – Beating the averages

Recently, having been prodded sufficiently by fellow enthusiasts, I’d been looking into the rationale behind Clojure amidst the ongoing explosion of dynamic languages on the jvm. And while I was looking into that, somehow, I came across numerous sites linking to the essay by Paul Graham – Beating the averages. Today I finished reading it and I have to say it was a fascinating, captivating and thought provoking read. Paul Graham is an adept writer. Yes I’m late to this scene. I’ve never really paid much attention to his essays in the past but I guess I’m finding myself going back in time in some ways now.

Also being one of the most persuasive pieces of prose speaking in favour of a language I’ve ever read – it made me incredibly curious about Lisp of which Clojure is a derivative. I think, at this stage, simply as a result of having read that post, there is a real danger of me looking into Lisp along the way which, if nothing else, should at least give me some insight into why the jvm developers Joe Darcy, John Rose and Mark Reinhold have been so enamoured with it and why they take so much inspiration from it.

The Java 7 launch party videos also made numerous mentions of Scala and Clojure which you watch if you haven’t already. The Q&A video at the end is the one I’m referring to here but I’d recommend watching them all in order. Anyway, you should read Paul Graham’s essay simply to provoke thought if for no other reason.

If you’re an avid Paul Graham follower which essay is your favourite that you’d recommend?

LMAX disruptor framework and whitepaper

This is really old news now as I’m very late in posting it but since I’m still coming across people who have remained blissfully unaware I thought this was worth re-iterating. If you haven’t come across this yet drop everything else and read about the LMAX Disruptor framework and the associated whitepaper titled Disruptor: High performance alternative to bounded queues for exchanging data between concurrent threads. There is also an associated (and rather dated now) infoq presentation titled How to Do 100K TPS at Less than 1ms Latency.

In the beginning there was a main thread of execution, then came two and then thousands. Once we had scaled to starvation with threads came SEDA and the concept of queues, hierarchical topologies of queues and lots of writers and readers operating on queues with threads now relegated to second class citizen status. For a while the industry rested in the assurance that it had achieved equilibrium with innovation on latency. Then – out of the blue LMAX happened. LMAX (London Multi Asset eXchange) are the highest performance financial exchange in the world.

Read the whitepaper to find out just how outdated conventional wisdom on concurrent queuing in Java actually is and how a lack of awareness of how your financial code performs end-to-end hardware to VM could be created bottlenecks for your platform. The essence of the disruptor framework is a strikingly simple concept but at the same time profound not only in its effectiveness in attaining its goal – reducing latency – but also in the extent to which it leverages knowledge of hardware and the java virtual machine that it runs on.

It proves wrong beyond doubt the rather outdated mindset that questions employing Java for financial low latency use cases. Ever since Java 5 and particularly Java 6 – the JVM has dwarfed the Java language in its importance, capabilities and scope and as a result utilising Java is now fundamentally synonymous with utilising the JVM which is what makes the language so compelling.

It isn’t about the code that you write. It’s about the code that’s interpreted and then runs natively. It is naive to consider only the language as many seem to be doing in the light of the imminent release of Java 7. It’s important to bear in mind that whilst language sugar is important if runtime matters to you then you’ll want to focus on: (1) the VM (2) writing wholly non-idiomatic Java and (3) opposing conventional wisdom at every level of abstraction every step of the way.

Morgan Stanley Matrix wins UX 2011 Silver award

Morgan Stanley Matrix, a project I worked on for two years as part of the server side dev team, has won Silver in the User Experience 2011 Awards. Read the pitch and watch the application demo. Well done Morgan Stanley. It was a great team and a great project and I wish it continuing success.

WWDC June 2011 expectations

Bloomberg has quite tastefully summarised our expectations of what Steve Jobs is likely to announce at this year’s WWDC conference on 6th June. We’ve all become so accustomed to hardware revolutions every 12 months that it comes as a massive heartfelt let down that no such hardware announcements are expected this time around. A new iPad was released earlier this year and a new iPhone is not expected to be announced until Winter this year.

So what can we expect this month? A new iCloud service is probably the most intriguing of rumors due to novelty factor whereby Apple will allow storage of music on the cloud as opposed to the local hard drive. It sounds interesting and certainly has the advantage of removing the need for the tedious backup process. However it also increases reliance on the internet which is generally very poorly featured in the UK in both mobile and terrestrial forms and non-existent on the London tubes. Though Apple pushing forward the performance boundaries of telecommunication networks has and can only continue to be a good thing.

However any investment in cloud technology must at this point be innovative and compelling in ways that currently are inconceivable simply due to the sheer abundance of cloud technology that has come to be over the years and the shameless exploitation of cloud terminology strewn across the internet. Microsoft’s blatant billboards and posters about cloud computing in London tube stations certainly didn’t help as it simply wasn’t clear what they were selling. Yes I know your stuff is on the cloud but so is mine. So is everyone and everything out there. It’s called the internet. At this point I’m so overwhelmed by the sheer quantity of cloud news in the last few years that I’m almost not receptive to anything further in this domain.

The next most exciting piece of news is expected to be about the next version of iOS and Mac OS X (codenamed Lion). Given how long we go between software updates from certain vendors examples being Microsoft and Sun – Apple customers are spoilt in this sense. iOS 5 is rumored to have a new widget mechanism and a new notifications feature and documentation on Lion has been available for quite some time now.

It’ll be interesting to see how Apple approaches the threat of increased competition from upcoming Mango and increasing market share acquisition by Android through both its cloud services and iOS upgrades. Regarding the new handset in September my wishlist would be to make the sim card even smaller, incorporate hardware NFC for mobile payments, increase battery life by making the battery even bigger in capacity and through support of 4G place even greater strain on the UK networks. That’s my rant over. Thank you for listening.

Foreign exchange hiring and trading rising

Foreign exchange hiring and trading are reported to be rising. Efinancial careers reports on hiring that:

… a lot of the current opportunities are within the more established FX houses. BarCap is hiring Java and C++ developers for its 250-strong FX IT team, Citi has openings for developers and connectivity specialists for its front office FX IT division, while Morgan Stanley and Credit Suisse are both recruiting techies for their Matrix and Merlin platforms respectively.

Bloomberg says on fx trading that:

[It] rose last year, with the value of transactions handled by CLS Bank, the New York-based operator of the largest currency-settlement system, jumping 22 percent to an average $4.1 trillion a day. Currency markets climbed to record highs for average daily trading volume in the U.K. and North America, according to central bank reports … and … electronic trading volumes increased 25 percent from the previous year, according to the Euromoney survey, to account for 56 percent of all foreign-exchange business.

It seems like FX is a good asset class to bet on right now and an ever more competitive space.

Microsoft Mango: Windows Phone 7 Previewed

BBC has provided a preview of Microsoft Mango, the new Windows Phone 7 mobile operating system, adopted by Nokia to replace their aging and rendered obsolete Symbian operating system. It certainly looks like a worthy competitor to iOS and Android with the usual incorporations such as threaded conversations, unified inboxes, social networking support and seamless integration between various different aspects of functionality. It tries, however, in addition to go a few steps further with many of these features. The UI is pleasing to the eye being lean, simple and calm in its colour scheme. Flash is only partially supported which in effect will mean that the default browser probably won’t work on the majority of flash websites but this is no different to iOS for the time being.

Nokia certainly need the assurance of revival that Mango offers and I would say it’s a positive move for them. For Microsoft I think the Nokia deal has added the essential, previously lacking, momentum to take this project to production. Microsoft just have to make sure that they keep the operating system stable (like Symbian was) and that they learn valuable lessons from the successes of iOS and Android since they are following in their footsteps. It’s great to see aggressive competition in the field of mobile operating systems and I’m certainly looking forward to Mango going live to see how they push the boundaries of what currently exists.

I wonder what the next generational leap can be for all parties concerned. Near field communication is one that comes to mind which Google is going to market with very soon. Mobile Money is also kicking off with the joint initiative between Barclays and Orange. It’s also interesting to consider how phones will adapt to upcoming 4G. There will I think always be a trend towards improving hardware whilst improving also the battery life of devices. What more would you like to have with your phone?

Installing subversion using subdomain on Apache and Debian

Here’s a quick reference on the basics of installing Subversion on Debian using an Apache subdomain both for my own reference and others too. There were a couple of bits I had to search around for so I thought an all-in-one guide might be useful for others.

Install subversion.

apt-get install subversion

Install Apache and the SVN module for it.

apt-get install libapache2-svn apache2

Create the subversion root directory.

mkdir -p /svn

Create a repository.

svnadmin create /svn/default

Give apache rights on the root directory and its contents.

chown -R www-data:www-data /svn

Enable dav and svn modules on Apache.

a2enmod dav
a2enmod dav_svn

If you want to use a subdomain for svn like svn.example.com set up a vhost as follows.

Note: Don’t forget to replace the IP with your own.

<VirtualHost 12.34.56.78:80>
  ServerAdmin webmaster@example.com
  ServerName svn.example.com
  ErrorLog /var/www/svn.example.com/logs/error.log
  CustomLog /var/www/svn.example.com/logs/access.log combined
  <Location />
    DAV svn
    SVNParentPath /svn
    SVNListParentPath on
    AuthType Basic
    AuthName "Subversion Repository"
    AuthUserFile /auth/svn/default/htpasswd
    Require valid-user
  </Location>
  <Location /default>
    AuthType Basic
    AuthName "Subversion Repository"
    AuthUserFile /auth/svn/default/htpasswd
    Require valid-user
  </Location>
</VirtualHost>

Obviously configure the above to match your requirements.

Create the Apache log directory specified above.

mkdir -p /var/www/svn.example.com/logs

Give Apache rights to the log directories you’ve set up above.

chown -R www-data:www-data /var/www/svn.example.com/logs

Create a password file with your chosen username.

htpasswd -s -c /auth/svn/default/htpasswd USERNAME

Restart apache and test your setup.

/etc/init.d/apache2 restart

Note: The following configuration in the above vhost config specifies the location in the filesystem of a parent directory whose child directories are Subversion repositories.

SVNParentPath /svn

Note: And the following configuration in the above vhost config allows a GET of SVNParentPath, which results in a listing of all repositories under that path. This means that you can go to svn.example.com in your browser and see a listing of repositories underneath it.

SVNListParentPath on

That’s it. For further details see the svn book. Thanks to the excellent library article by linode.com for providing me with a concise introduction which I could adapt for my own needs. If you are not already hosting with linode.com you should be. They are the best hosting provider in the world.

Was this post helpful to you? Please let me know in the comments!

Good code

Good code

Good code. The Reality. How true.

Good code bad code

Good code and bad code. The Naked Truth.

How true. Is there really such a thing as good code? If so how can it be attained, qualified and quantified? Perhaps there is only code that serves a purpose for a length of time and another that is retired or is never adopted. This is a philosophical debate I fear so I’m going to stop here. The above osnews sketch is probably my favourite programming cartoon of all time as nothing is truer.

Intel Sandy Bridge announced

The eagerly awaited Intel Sandy Bridge processors have finally been announced (yesterday) and have received superb reviews. Read more at Macrumors, Engadget, TechReport, Intel, Intel Blogs (an older link). They feature, amongst overall improvements on all fronts, vastly improved graphics performance and battery life. These really can’t be found on the mac line soon enough. No doubt Apple will be touting 15 hours battery life with these if they’re touting 10 hours now. Mid year release, I reckon, along with Lion though I’d like to see those on the MacBook Air more than any other model as they are, without a doubt, best of breed now. To quote Intel on the most significant feature of this release in my opinion:

Improved Cores with Innovative Ring Interconnect: The 2nd generation Intel Core Processor family microarchitecture features vastly improved cores that are better connected with an innovative ring interconnect for improved data bandwidth, performance and power efficiency. The ring interconnect is a high bandwidth, low latency modular on-die system for connection between processor components for improved performance. The ring interconnect enables high speed and low latency communication between the upgraded processor cores, processor graphics, and other integrated components such as memory controller and display.