All posts by nkhum625

Spotify on Fedora 17

Earlier this year I wrote a blog on how to get Spotify working on Fedora 16.

As Fedora is now on release 17, installing the latest version of Spotify has new problems.

I didn’t solve it myself this time, I Googled the problem and found another blogger with the solution. This may seem a bit lazy, but I really needed music while I was working and did not have time to investigate the problem.

So, instead of repeating the solution, I will provide you with a link to the blog that I used:

Sysadminworld

Plus they have some cool ascii art.

I could not leave a blog post with no new information for you, so staying on the topic of music I will list some of the music I like to listen to while programming.

I am a big fan of classical music while programming, the lack of lyrics and repetitive patterns make it great background music and it doesn’t distract me:

Beethoven : Moonlight Sonata, Fur Elise, Symphony No. 5, 6 & 8
Tchaikovsky : Swan Lake
Bach: Air on a G String, Toccata and Fugue

If I am planning and need some motivation:

Carl Orf: O Fortuna
Wagner: Ride of the Valkyries

If I am working on something that isn’t too tedious I like a bit of dubstep:

Skrillex: First of the Year

This track is the only one I will mention as there are so many, but this track is so great it deserves a mention. If you want to discover any new dubstep just go on youtube and search for “dubstep remix” and you will find loads of great music, anything by Skream normally does it for me.

Anyway, tune in and enjoy Spotify

The Science of Lucky Pants

Many people have a lucky item, a pair of pants, a rabbit’s foot or even a ritual that they do before an important event. It seems crazy to think that something like a pair of pants can have any effect on the outcome of a situation but I believe the answer may be in the human subconscious and the scenario that brought the owner to the conclusion that the pants are some how lucky in the first place.

If the owner accomplished something great the day he or she was wearing the pants, the feelings and the state of mind they were in at that point can become subconsciously linked to that item. In Neuro Linguistic Programming (NLP), this is called anchoring. Every time the person is back in that situation (i.e. wearing the pants) they will have the same emotions triggered as they did when they made that initial great accomplishment, allowing them to repeat the performance. This further strengths the belief that the pants are lucky. Again in NLP terms, this is called stacking.

There are lot’s of ways that we can bring back a resourceful state of mind and any trigger that does this can be very useful. You are probably wondering what such a topic has to do with software development?

From what I have read and observed, software engineers are very good at procrastination. We also get ourselves into states where we believe a problem cannot be solved and become incredibly frustrated by it. After walking away, maybe sleeping on it and then returning in a different state of mind the answer comes to us miraculously. This is not a time thing or a sleep thing, the solution came because our state of mind was different. If that state of mind could be harnessed and recalled whenever it was needed, we would accomplish much more.

There are numerous places where you can learn how to anchor and stack resourceful states so I will not go into detail here, this is just a blog entry to make you aware that it is possible.

Links
NLP on Wikipedia
Achoring on Wikipedia

So go, and be in the state of mind that best helps you overcome your challenges.

HackLDN

Over the last weekend (23rd -25th March 2012) I took part in the HackLDN event organised  by the founder of MyVoucherCode and CEO of Markco Media, Mark Pearson.  The hackathon took place in the Markco Media office, near London Bridge.

The idea of HackLDN was to create a business and hack together a prototype (or a full product) in 48 Hours and the office was open the entire time so that you could keep going as long as you wanted to (or until you passed out from fatigue).

I pitched an idea that my collegue, John Slade, and I had come up with a few months before and had talked about starting up.  The idea was selected and we got a really great team together.

The team worked incredibly hard and most of us worked through the Saturday night and all day Sunday to get a prototype and business plan ready.  I have never witnessed such dedication from a large group of people before.  People that, at the start of the event, had never met each other worked in perfect harmony and gave 110% to every aspect of the idea.

I attended Launch48 a few weeks prior to this event which has a very similar structure; pitch idea, get a team together, hack away, present progress and business case.  The problem I faced at Launch48 was that there were so few developers, the only real progress that most teams made were with the business case.

So what made HackLDN so much better?

There are a few things that made this event stand out from other events, these were:

  • There were so many developers present that all the teams had enough developers to produce some really cool technology (exactly what a hackathon should be like!!)
  • The office stayed open 48 hours so people could keep going (this created a real buzz in the place)
  • There were some real VC and Business heavy weights present to give advice and motivate people to push harder and further into the product and business.
  • All Food was provided (this may not seem important but believe me, when you have been hacking away for 18 Hours on redbull and coffee, nothing cheers you up more than a croissant and some cereal)
  • Mark Pearson and his team (especially Ben who was there most of the time and organised a lot of the event) were so cool, dedicated and excited that they increased the excitement by spurring people on.
  • The event had a really casual, lets see what happens, feel which made people feel at home in the office.
  • The office was cool….really cool…even the painting of Mark Pearson on the wall :-)
  • Mark had arranged for a number of the people who work for/with him provide API’s for some cool technology (I must thank the VouChaCha guys for helping us and providing an API to their service, thank you Ben and Julian).

So that is why this event stands out from the other startup weekends.  If you are planning a startup weekend, you can learn a lot from these guys.

On to my team.

I was the leader of the team, with John Slade providing the technical leadership.  We worked long and hard and had a real mixture of age and talent.  We had two seventeen year old guys who were fantastic and produced some great stuff.  It was great to see young people wanting to get involved with these events and having the confidence to sit in a team of professional developers and hold their own.  We had two of the Markco Media staff which were absolute rocks within the team and remained focused on their tasks until the very end.  The two team members producing the business plan never stopped researching, writing documents and doing competitor analysis and I zig-zagged between the two parts of the team doing what I could.

Every few hours we would stop, have a meeting to see where we were and decide what to get done by the next meeting (worlds shortest agile iteration??).  This worked well, and we even received the comment that we were the most organised team there.

The other teams.

The other teams were just as dedicated, very few people at the entire event slept and those that did sleep, did not sleep for long.  Testament to the dedication of every one at the event was the output.  I have never seen such great technology developed in such a short period of time.

If events like this carry on taking place, the future of tech startups in London looks promising!

Finally, I would like to thank Mark Pearson and his entire team for a totally fantastic weekend.

Code Jam Hack Day

On Saturday the 11th February 2012, a colleague and I organised a “hack day”.  For anyone not familiar with this concept it is a day of ultimate geekiness where you write software for fun (is there any other way to write software?).

A number of us squashed into my colleagues flat with laptops, keyboards, mice and enough sugary snacks to put us all into a coma.  We had done some organisation before the day, which included:

  • deciding on a programming language to use
  • setting up a GitHub repository
  • defining some features of the chosen language that we believe people should know before attending
  • collecting a number of ideas that we could develop on the day

This was a closed day where we invited a number of friends and colleagues.  We sent an email containing all the detailed information for the participants, which is summarized above.

Our chosen language was Python as we thought this was a nice language that we all had a familiarity with and we also had an interest in using Google app engine (which is an Platform as a Service that supports Python).  We tried to generate ideas around these technologies.  We agreed that all code generated from the day would be open source on GitHub.

The idea we finally decided upon was a photo mosaic generator.  Google app engine turned out to be great for this task as google provide a number of image manipulation utilities in python as well as a database that is easily created from the Python framework provided.  We had 5 people in total and decided to split off into two teams.  One team would work on the core utility of the mosaic maker and the other team would work on a GUI front end.

I was on the front end team along with one of my other colleagues.  Luckily for us, my colleague had created a set of python classes that handle the rendering of HTML, so we already had a frame work to work with.  There are a number of frameworks out there if you are not as lucky as I was.  One I found which looked very interesting (but I must admit I have not used) is a frame work called Pyjamas.  The Python code gets converted to JavaScript, so a GUI is easily created with absolutely no knowledge of JavaScript.

After the initial discussions of the idea and the splitting into teams, we all worked away for a number of hours before breaking for lunch.  The usual suspect of Pizza was ordered and after lunch we returned to our computers to continue hacking away.

About 9 Hours after starting we had a working Mosaic maker, a database to store the images and a GUI that allowed you to upload images into the database and create the mosaic from them.  The code still needs some work to improve the quality of the mosaic, allow the selecting of the main image that forms that background for the mosaic and to display the mosaic within the main page of the GUI (you currently get re-directed to a new page).

After this is complete the app will be uploaded to the app engine (it currently runs on our own local installations of the app engine) and I will provide a link to it.

I learnt a great deal about Python, Google app engine and the structure of a hack day.  I would say that if you have the opportunity to get involved in anything like this you should jump at the chance.  Its a great way to learn something new, a great way to network outside of work and a fantastic opportunity to have a really geeky day with like minded people.

Code Jam Hack Day 2 is on the cards, watch this space!

Spotify on Fedora 16 (64 bit)

As a user of Spotify, I have been waiting for a long time to be able to run it as a native application on linux (i.e not under wine).

Spotify released the debian packages but are yet to provide an RPM repo. But as is usually the case, the linux community have come to our rescue.

Most of the forums and tutorials for this are for peoples specific versions of libssl and requires small tweaks for different systems.

Here is how to get spotify running on fedora 16:

1. Download http://dl.dropbox.com/u/6310099/spotify-client-qt-0.6.1.309.gb871a7d-2.x86_64.rpm

2. as root, run

rpm -Uvh --nodeps /home/****/Downloads/spotify-client-qt-0.6.1.309.gb871a7d-2.x86_64.rpm

where **** is your username for the fedora system (change the path to wherever you downloaded the .rpm file to)

3. again as root run:

ln -s /usr/lib64/libssl.so.1.0.0* /usr/lib64/libssl.so.0.9.8
ln -s /lib64/libcrypto.so.10 /lib64/libcrypto.so.0.9.8

here the * indicates a letter that will be appended to the end of the libssl file, check which version you have and replace the * with the letter that is for the version that you have.

voila, spotify should work.

Moving Into The Cloud

I have spent the last few days looking at the “Chromebook” netbooks and investigating various cloud based applications.  This got me thinking about the future of software development if we moved everything into the cloud.  I have found a number of IDE’s that run completely in the cloud and I will be discussing a few of them in this post.

Three of the IDE’s that I found seem to stand out from the rest, they all have pro’s and con’s but seems as we are in the early days of cloud computing things are looking promising.

The first IDE that I found was exo Cloud IDE. This IDE is free and has a really nice interface. It has loads of features including support for importing projects from Github, saving projects to your account, thorough documentation, sample projects and tutorials. It supports Java, Groovy, JSP, HTML, PHP, Javascript, XML, Ruby and CSS. The IDE also has some cool templates for creating Google Chrome and Netbite gadgets.

The potential downside to this application is that the execution of the code you write requires you to create another account with a PaaS (Platform as a Service, see JTES blog). exo Cloud IDE gives you a number of options of PaaS, two of which are Cloud Foundry and Heroku. The accounts with these providers are free as long as you don’t want too much processing time (< ~750 Hours).

The next IDE that I found was Python Fiddle. As the name suggests this is a Python specific cloud ide. The interface is very nice and quite intuitive. It also provides a nice method of accessing a number of the python libraries and the code is executed on the IDE’s server meaning that you do not need yet another account.

The idea behind this IDE is one of social coding. You save your python code as what this site calls a “fiddle”. You provide tags for your fiddle and it is saved as a public project. Python fiddle do not support importing any projects from Github but do support importing code from stackoverflow comments which I thought was a pretty cool feature.

My third, and favourite, cloud IDE is SourceLair. SourceLair supports C, C++. Obejective-C, Fortran 90/95, Pascal, HTML, CSS, Javascript and PHP. So this is the only IDE that I found that provides support for Languages that are not platform-independent (I will discuss this term in a later blog!). This IDE seems to be in a very early stage and I am excited to see what they do. I have checked out the blog and twitter feeds for the Guys running this project and they seem to be really excited and judging by their twitter feed they are working hard to get new features out.

The most interesting feature that SourceLair promises to deliver (quite soon!) is the public API. This is definitely a feature that will be useful. Hopefully the API will allow you to specify the compiler that you wish to use. Another feature that I hope these guys develop is the ability to access the executable. I think that this IDE has the potential to free software engineers from the office and it will be great to see the SourceLair team make progress with this IDE. I will be using this tool and will provide updates to new features as they arrive. I will also post a review of the public API when it is released.

The cloud is looking great for everyone, not just software developers. As Adobe releases Photoshop to the cloud to compete with Google Picasa, and Google Music (only available in the US unfortunately) allows music editing online, anyone with an internet connection and a web browser can do what previously only people with modern computers could do. The old mac in my studio might actually be able to run the latest version of Adobe Photoshop!

In summary, the Cloud is looking promising. If it keeps getting better I might just have to buy a Chromebook!

Single Log On Website

I have created quite a few websites over the last few years, some with dynamic galleries, some with blogs and others with eCommerce sections. My own personal website, this website, is a basic WordPress template (I intend to improve upon the design at some point). One problem I have had with creating sites that have dynamically editable regions is that every part of the site with user editable data/regions has its own sign-in page and admin section.

I am currently in the process of building a website that will have pretty much all of the previously mentioned features. It is going to have 2 pages that each have dynamic photo galleries, it will have a blog and it will have an online store, as well as the usual about us, contact us and home page. I do not want to have to set up lots of different log on screens, user names, passwords etc…

For this reason I am going to develop the entire site in WordPress.

Every feature that I have mentioned so far has an easy to install plugin/feature in wordpress. For example:

  • I have used Zen Cart for eCommerce in the past, I recommend Jigoshop plugin for WordPress
  • I have used Zen Photo for photo galleries in the past (this is great if you decide not to use WordPress), but for wordpress I would recommend Gallery or NextGen gallery plugins
  • WordPress can nicely handle static pages, so creating a home, contact and about pages is easily done
  • Do I need to suggest what to use as a blog?

Developing and installing a custom theme for WordPress is very easy, so there is no reason why your website can not be completely your own. The only way people will be able to tell that you have developed around a WordPress site is if they view the site source and see the document structure, but I am guessing the kind of person visiting your site will not be interested in this.

A few nice features/plugins that I have found while doing my site are:

  • Pages Post by Rich Gubby is a great plugin, if you set your blog to post to a page that you do not have in your menu, then use this plugin to send specific category posts to specific pages, you can effectively have two blogs within one wordpress site e.g. my software and photography sections (the posting to a page that is not in your menu is a way of hiding the entire list of posts as every post will go to this page as well as the specific pages set in this plug in)
  • The All In One Social Network Button Plugin is great for linking to all your social networks
  • The Google Analytics plugin is an easy way to monitor traffic to your site

Just do a search in the plugin’s section of WordPress and you will find thousands of plugins. If you can’t find the one you are looking for and fancy some fun, you could develop one. WordPress provides an API and developer documentation, you can find it here

The important thing with all these cool features is that they are all available via a single log on, you do not need to navigate to the admin sections of several different parts of your site. Once I have finished the website in question I will be placing a link within the Website section of my Projects page. I will post a blog entry when I have made progress, I will also post updates with any new cool features or plugins I find useful along the way.

Write Once, Write Right

I am sure that every software engineer has had somebody more senior than themselves say that they should write something correct the first time and not have to go back and correct their earlier work.  I know I have.  I think there is a time and a place that this statement holds true.  For instance, in a project at work, where time is critical,  getting software correct the first time is desirable as this saves vast amounts of time when it comes to testing, debugging etc…

However, this is easier said than done.  Writing something correct first time, especially when it is an area that you do not know very well, which is often the case in the work place, is very difficult.  So how do we write once, write right?

As an analogy, imagine a drummer.  She practices the drums every day, practices lots of different styles, techniques and can play all of the music in her collection.  One day she gets a phone call and is asked if she can turn up at a venue and play a piece of sheet music correct first time, an original piece she has never seen before.  Of course she can.  The general concepts are the same as the music already in her collection, she has practiced them, recognises them as soon as she sees them on the sheet and can play them with relative ease.  She even knows the potential pitfalls of certain arrangements and has worked out her own ways of avoiding them.  All this talent has come with practice and experience that she has built up in her years as a drummer.

Lets get back to the software world.  Write once, write right is great for the work place.  But like the drummer in our analogy, practicing software at home, learning the styles, techniques and pitfalls is the best way to be able to write once, write right in the workplace.  The place to make mistakes (and learn from them) is at home.

So how do we practice programming?

I have recently compiled a list of software languages that I want to learn.  All have different benefits and strengths.  They also all solve different problems (just like a plumber would have lots of tools in his bag, one for every job….some things might do more than one job but you get what I am saying).

I have books on most of the languages I want to learn and a collection of online resources (just google your chosen language and you will be sure to find hundreds of tutorials).  But how can I practice?  Just like our drummer had file of sheet music, we must have a file of programming problems.  Luckily, some very nice people on the internet have already created these files for us, packed with hundreds of programming problems.  The best part about most of them is that they are not language specific (this is a pro and a con as the non-language specific ones do require you to enter a final answer, no code need submitting)

Here are a few of the sites that I find most useful:

http://projecteuler.net/problems  – maths based problems where you write a program and submit an answer.*

http://www.spoj.pl/problems/classical/ - a range of problems (the input and expected output is given in the example)*

http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=1 - again, this site has a range of programming excercies and the input and expected outputs are given.*

This is certainly not a comprehensive list, and googling your chosen language along with “programming exercises” is sure to turn up a hole host of sites that you will find useful.

There are also online courses that you will find, such as:

http://ocw.mit.edu/index.htm - MIT open courseware has some great materials online for programming and computer science.

http://www.db-class.org/course/auth/welcome - Stanford are running a series of free elearning courses.  This is a link to the database class, all the other classes can be found at the botton of the database class page.  I did the database class on the last run.  The interface is great and you will learn a lot.  The downside is that it is timed, there are online tests and the schedule can be demanding if you have a full time job and a social life as well.  (you can just sign up and do it at your own pace if you do not care for the statistics of you vs’ all the other participants).

*the cons of these types of learning are that they do not mark  the code, just the output.

These types of online materials are great to get you thinking about the code without having to have a specific motivation.  I believe that the best way to use these resources is to repeat each exercise in a variety of languages to see which one best fits the problem. This way you will learn multiple languages and have the knowledge and the tools to make similar decisions in future.

In Summary, just like any other skill, software requires practice, there is only so much you can get from reading a book, doing a variety of programming exercises in a variety of languages will give you a programming tool box that you will be able to call upon at any time.

Pick your language, and start practicing!