IMG_0296

Codemesh Conference – Day 2

Day 2 of this year’s Codemesh conference was just as mind blowing as day 1.

So without further ado, here are 3 things that I learnt from day 2 (I am moving house today so I don’t have time to do the full 5!).

1) Tiny is better
I will leave the explanation at that to respect this statement.

2) Purescript: functional programming for Javascript
This was one of those talks that I could actually apply to my current role. Purescript is
a Haskell style functional programming language that can be compiled directly into Javascript and
used on the web. Pretty awesome as you can do some pretty complex stuff a lot cleaner than if you wrote
in pure Javascript (even if you do use JQuery!).

3) I can program and test infrastructure

I do not know much about infrastructure and server configurations. But with tools such as Chef, I can essentially
set up a server using a programming language and set up tests to see if my application works on it. I also won a copy
of the Chef book in the raffle.

Overall, this conference really opened my mind to new technologies that
I would not normally have even heard of. There was a lot of information
over the past 2 days, but if anything, I have at least got the names of
new technologies that are being talked that I can later look into.

The feeling you get coming out of the conference is the same feeling you get
after you watch a Brian Cox documentary about the wonders of the Universe: you just feel
so small. In the web industry, you see a lot of young people playing and advancing the same
technologies, but then you come here, and you see a lot of people who have been programming since
before I was born. Proper, real programming – they point a laugh at the mention of Java.

I definitely hope that I can go next year and I have definitely been left with some
food for thought for the next few months.

20141104_175004

Codemesh Conference – Day 1

Today I went to the Codemesh conference. It is their third year running but this is the first year that I have been.

This conference is all about using the “right tool for the job”. It is not about  particular language or tool but more about how we can solve problems.

I was a little nervous coming to this one as I have only been to PHP conferences (a topic that I am very familiar with). But this one had talks about completely brand new topics that I had little or no knowledge about. I was also excited by this prospect.

One of the hot themes of the conference is functional programming. I had a little bit of exposure to this during my third year at University, when I did a module on Haskell. However, this was only the basic concepts and I have not looked at this for nearly 2 years!

To sum up day 1, I have decided to tell you the 5 things that I took away from this conference.

1) F# is awesome

Especially for data science – something I am quite interested in.  It is a functional programming language with some very powerful features. I have already played with the basics and so will be writing a post on that soon.

2) Type-directed development is also awesome

Type driven design is about modelling programs around “types”. This could be applied to pretty much any programming language (but as usual, their examples was with functional programming languages). The main advantage is that tests can never prove 100% that a program works, but the types can – this was a really interesting talk, I may need to do a post just on this!

3) Breaking down systems is nice – but increases the complexity massively

The keynote was all about the complexities of systems being outside the code. The main example was that if we have a system made of very nice beautifully coded modules, the connections between these modules can be very complex still! This is partly due to a lack of understanding of how all these components work internally and the lack of foreseeing problems before they come.

4) Category theory is very complicated

Especially just after lunch.

5) We need more metrics when it comes to using programming languages

The last talk of the day spoke about how the industry needs to start to measure the effect of adding features to a programming language to show whether the changes are positive or negatives. At the moment, claims are made with no formal evidence. For example, Andreas Stefnik and his team actually found that programmers using statically typed programming languages have higher productivity than those using dynamically typed programming languages – this is contrary to popular belief.

Overall, I really enjoyed the conference so far. It has exposed me to very different things that I am used to which is very good! I am looking to day two tomorrow.

Brief Guide To Ubuntu Permissions Part 2

Over a year and half ago, I posted a brief guide about Ubuntu permissions.

Whilst this covered most of the basics of Ubuntu permissions there was one part that I found myself looking into today: chmod.

You may or may not be familiar this command to change permissions. But the general usage is:

chmod 777 file.txt

In the above example, file.txt will be given complete read and write access for all users.

But where does 777 come from?

Well I’m glad you asked handsome stranger.

If you refer back to the original post, you will be reminded that permissions are split into three blocks:

  1. Permission for the user who owns the file.
  2. Permissions for the group that owns the file.
  3. Permissions for the rest of the world.

Each individual ‘7’ refers to each of those blocks in that order.

7 means all privileges for that section i.e. rwx. So 777 would be rwxrwxrwx. (Refer to the previous article for explanation of what r, w and x means).

Below shows what each number means:

7 = rwx
6 = rw-
5 = r-x
4 = r–
3 = -wx
2 = -w-
1 = –x
0 = —

So giving a file a privilege of 644 would mean, rw-r–r–, which means the owner can read and write in it only and everybody else can only read it.

But how can I remember those numbers?

Each privilege type is given a number as follows:

1 = execute
2 = write
4 = read

Simply add up the numbers of the privileges that you want to give. For example, read and write only would be 4 + 2 = 6, hence 6 is rw-.

Simple really isn’t it?

That is all for now. Thank you for reading!

Popping Champagne

Student No More

Today is a very special day.

Today is the day that my University course finishes. So despite handing in my final dissertation 6 weeks ago and receiving my final results more than a week ago, today is the day that I am no longer enrolled as a student!

Oh yes, my results!

Well I am pleased to say that despite my concerns about the dissertation submission, I managed to achieve a First for it and I have managed to achieve a First for the whole degree!

I am naturally very pleased with this and it still hasn’t really sunk in.

Post student life has pretty much remained unchanged except that I feel less guilty when I want to relax (as I now can with the knowledge that I do not have a pressing coursework deadline coming up or an exam I should be revising for).

I am also now working full time. From a high level, this is just the same as before, except I work for one more day.

Another change is that my student travel card will expire at midnight and so I will have to pay full price for my monthly travel card tomorrow!

Other than these three things, it has just felt like I am just outside of term time.

It is a little bit unnerving to not know what the next few months will bring. October 2014 is the first month in a very long time (even beyond starting University to my school days) where the future hasn’t just been “Get a first in module X.” or “Complete the Y coursework.”

More nerve-racking is that 2015 will be the first year with a similar predicament! I am now an adult who can no longer say that I am just continuing “Year N” of school or University.

xkcd - Graduation

I have 3 main aims for between now and 2015:

1) Build a website for a personal client of mine – this has been an ongoing project for most

of this year with a version currently live (I am not happy with it enough to share it!).

2) Build an Android game – I wanted to do this for a while but University work got in the way. I am currently looking at coco-2d but am currently struggling to know where to start!

3) Maintain this blog – I am going to try and get back to doing regular posts starting with this one.

That is quite a lot to do. There are also a couple of other things that I have not mentioned here.

So here is to life as an adult!

And…..Done

Hello all!

Around now, 4 years ago, after weeks of worrying, I found out that I had done enough on my A-Levels that I had been offered a place at my first choice University.

4 years later and the final deadline for my dissertation – my final assessment for this course –  has passed. At 3pm yesterday, I officially finished.

Horray!

This has been the most difficult assessment that I have done over the past 4 years and perhaps even the most difficult one that I have done in my whole academic life!

The past week was particularly stressful as I set out to finish the report in time for today. I actually finished it for the day before because I had to get it printed and bound.

Then there was the stress a few weeks back to get a working system ready to demo. In fact, there were many stresses of trying to get that thing to work! This dissertation has been a constant presence in my life.

Also both my desktop and netbook failed. My desktop seems to randomly have power cuts. Then it didn’t even switch on for a week until it randomly started working fine until last weekend…I hope its the power supply unit and not the motherboard.

Then the netbook hardrive died. I had to buy a new one and reinstall everything. Decided to go for an SSD drive and it really sped things up. Luckily, in both cases, there was no loss in data as everything was in the cloud.

I do have some worries. I am constantly thinking, what if I missed out something major! I was not able to check with my tutor if it was OK before I finished, so I worry that I have gone completely the wrong way. Or what if I have missed out a section? Or done the references wrong so I get done for plagiarism? What if I submitted an incomplete version by accident (I have checked but still)?

So what next?

Well despite finishing all possible work I am still technically a student. Here are a few more milestones that will be happening until I finish:

1st September – Start my new full time job. Although it is at the same company doing more or less the same role, I will no longer be a student in their eyes, just a full time employee.

Latest 19th September – I find out my final mark for the dissertation and indeed my entire degree.

30th September – This is the date that my course officially ends. My student card and my student travel card both expire on this date. This is the date I am no longer a student.

27th, 28th, or 29th January 2015 – The graduation ceremony is on one of these three dates. Not sure which one yet.

Next week I shall be going on my summer holiday. It is still in August so technically, although late, it is a summer holiday! I have been looking forward to it and although I can’t completely forget about University until my result, at least there will be no hard work until I return and I can relax a little bit.

BRB

I can’t believe that I haven’t done a post here since April! It is amazing how “tomorrow” becomes “the weekend” which then becomes “next week”.

The truth is that I won’t be able to get back into the swing of things until September (or at the very earliest, late August)! The reason: university.

Being in my final year, I am currently undertaking a final year project. It is a project that I pretty much started a year ago and will not finish until towards the end of August.

At this point, I will have finished my long 4 years at university and I will no longer be a student. I have been looking forward to that day for a long time now and now, it is just around the corner.

However, between now and then, there is a lot of hard work. There is lots to do on the project before the deadline and I don’t have a lot of time to do it.

I want to spend a lot of time looking after this blog and it is time that I simply don’t have whilst the deadline is looming.

So this will probably be the last post I make more a while. I will check in occasionally to keep the back end up to date and will still read comments that I receive and when I return, I will commit the proper amount of time that I want to give this blog!

Why Does It Take So Long When Unsubscribing From Newsletters?

I recently posted a comment on an article for the Guardian newspaper. The process was quick and easy but I inadvertently signed up for a daily newsletter!

This is annoying as it is. I am usually very careful to spot the check-boxes and rigorously read them to make sure that I do not sign up to more unwanted mail.  So when one slips through, I come to the conclusion that it wasn’t there.

But I digress, this article is about something that annoys me even more: the unsubscribe process.

After following the “unsubscribe” link, I am greeted with this message: unsubscribe“This will take effect within 7 days.”

7 days?! It takes 7 days for a simple PHP script to update a single record in a database after pressing a button?!

The Guardian are not the only ones. Every time I have unsubscribed from any newsletter, they have shown me a similar message.

But I don’t understand why! They are able to sign you up instantly, so why can’t they unsubscribe instantly.

It is obvious to me that it is not a technical issue. Updates on a database should take seconds at most.

So if it is not a technical issue what is it? Is it so they can get as much of our attention as possible before we go? Surely anyone unsubscribing will just delete any remaining e-mails that come through, so this is a waste of time!

There is simply no good explanation.

I am not the only person to question this. But the answers people have suggested on that post are unsatisfactory.

The only decent explanation can be found as a comment of this post they said:

Until recently it used to take around 10 days (sometimes less) to process the unsubscribe requests as the email newsletters were managed by a third party company. The requests were sent through to them once a week in a batch.

That still doesn’t answer the question of why it doesn’t take that long to subscribe. If it took 10 days to unsubscribe, it should take 10 days to subscribe! There is no excuse really.

This answer was from 2010, but even then, I would expect any third-party company to handle instant requests! Maybe via an API?

So that concludes my rant. Let me know your thoughts in the comments if you have had similar experiences. I would be particularly interested if you are maintaining a system that handles unsubscribe requests, maybe you can enlighten us!

How to Fix Heartbleed OpenSSL Bug

This week, a major bug on Openssl, called Heartbleed, was announced which basically renders any ssl protection useless.

You can test if your site is vulnerable by doing this test by Qualys.heartbleedbeforeAs you can see, we have failed the test and it highlights the fact that we have the vulnerability.

How to patch it

sudo -s
(optional, but the other commands will have to be proceeded with sudo if you do not).

openssl version -b

You will get something like, built on: Wed Jan  8 20:45:51 UTC 2014. If the date is less than April 7th, then you will have the bug.

Do

apt-get upgrade openssl

Press Y to continue.

Note: you may need to do apt-get update first to get the latest packages.

And that is it. Vulnerability fixed. Do openssl version -b again and check the day is at least Apr 7.heartbleed after

The test also shows the vulnerability is fixed!

Thanks to my colleague, Sheraz, for help finding a solution to the problem!

Quick Guides: #1 – Installing PHP Composer

Want to install and use PHP Composer on your Ubuntu machine?

Simply run:

curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer

You can now use the command, composer install in a directory that has a composer.json file.

Want to know what a composer.json file should look like?

See below for an example:

{
    "require": {
        "symfony/class-loader": "v2.4.1",
        "symfony/yaml": "v2.4.1"
    }
}
Voila! Another guide decrapified.

Life before vs Life after the Web

This week, the World Wide Web turned 25! Seems strange to think that it is only a little bit older than me!

The Metro ran an article where they looked at 11 ways that the web has changed our lives.

I thought I would add to the list some more ways that I thought of.

Enjoy.

1. Sharing photos

tumblr_inline_mjipr3iCae1qz4rgp

Before:  Use up the rest of the film used for the holiday pictures and then take it to the chemist to be printed. “Would you like the 24 hour service or the 7 day service?”

After:  Plug camera into computer. Log on to Facebook. Upload all photos. Spend 24 hours tagging them all.

2. Selling stuff

ebay-ad

Before: Put a hand written note in the corner shop window. If you are feeling really posh, make a listing in the local paper or in the Loot newspaper. Wait by the phone.

After: Take amazing pictures from every angle. Create a listing on a website such as eBay, go about your day whilst buyers have a bidding war over your item.

3. Fund raising for sponsored activity

Stewie-Demands-Brian-Griffin-Give-Him-Back-His-Money-On-Family-Guy

Before: Get people to pledge how much they will donate for you to do something. Spend three months following the event tracking down the pledgers, who are suddenly always busy.

After: Create a page on Justgiving. Spread this page through the power of social media. Anyone who pledges automatically has money taken from their account and placed directly in the hands of the charity.

4. School research project

Cat Reading

Before: Go to the library and use the Dewey Decimal System to locate the books on the topic. “The book is checked out for another week?! But the deadline is tomorrow!”

After: Google.

5. Topup pay as you go phones (does anyone even have these anymore?)

queen-phone-460a_1127984c

Before: Down the local shop. “Hi can I have £10 top up for O2 please.” “O2?” “Yes, O2″ (seriously, the guy in the sweet shop would always do this double check and it would infuriate me inside. You heard the £10 part correctly, so why do you need to know the network again!?). Then call a number, and type a 10000 digit number to load your call time. That is if your top up ticket doesn’t get wet or blown away by the wind.

After: Log into the network’s website and top up online. Balance is added instantly.

It is interesting to note that in all these scenarios, the World Wide Web on its own did not do anything. It was people who used this amazing tool to create and do even more amazing things.