Rarely do I feel impassioned about something so much that I just have to write but I have found that something! This has nothing to do with computing so those that normally ignore can now listen.
My issue is with the whole Russell Brand and Jonathan Ross thing that is plastered all over the media. I mean do people not have a life and can they not get a joke? I fuckin hate these kind of people. As much as I have championed the Russell Brand podcast on here before I’m no real lover of his stand-up material so I think I’m pretty unbiased about all this. The facts of this whole situation are, number 1, only two people complained about the show when it was aired or in fact in the first week, that means that all those who listened thought it was fine. This means that the 10,000 people who complained since decided to listen to something that they knew would offend them, yet they still listened. Should we even pander to the opinions of these “demi-gods”? I mean, they had the option of just not listening but chose to listen and be offended. Number 2, they asked Andrew Sachs, the offendee in question, if it was ok to broadcast it and he clearly didn’t say no. Number 3. Gordon Brown wants to get involved. Is the whole country not in enough of a mess without listening to this man tell YOU what to do. So the unemployment rate is rising and what does he want to do, sack two people, good one 🙂
So the crux of this matter is if any of your friends are genuinely offended by this please don’t call them your friends. Don’t fool yourself into being offended just because you don’t like Brand or Ross or are jealous of their money – that would just make you look weak. The offended people are those that want to turn this whole place into a nation of dreary shitheads. Stand up against this and tell the media where to go. If I can think of some way to stand up to these shitheads then I will. In fact, now that I think about it, I actually have a Russell Brand related domain name that maybe can be put to good use (www.fusspotfarm.com). Fusspot Farm, which is probably exactly where we should send these people.
I was going to post about a little problem that I experienced while undertaking a project I’m involved with but canned it thinking it was of limited interest. That was, however, until I made the same mistake again yesterday, so I thought I would document it to save my own sanity, even if there is no-one else who cares – not that anyone reads this anyway.
So to my faux pas, and believe it or not this cost me a few hours! The problem: well as part of my project (a bike shop website for those who really want to know – www.cyclewize.com) I’m programming in PHP using cakePHP. The advantages/disadvantages of PHP can be debated from dusk till dawn if that is your thing – just remember though, while you are debating all those smart people are just getting on with doing stuff. That said, my problem was, in a sense, due to the use of PHP or dynamic languages in particular.
Anyway, back on track, so the component I was working on simply uploads a set of photos and scales them accordingly. Simple as that. The problem that I kept seeing was that although the photographs were being uploaded ok, i.e no errors were being reported, I was unable to copy the files from their temporary directory over to their new home. Since no errors were being returned I was stuck as to what was happening. I battled away putting
print_r’s in here there and everywhere to no avail. Then I just happened to check my call to
move_uploaded_file. On inspection, I noticed I had a slight misspelling of a variable name in one of the functions arguments, thus only at that point did the variable come into existence. Therefore what was getting passed to the function was the empty string and hence
move_uploaded_file could not copy the file – you would have thought it should have raised an error but no. However, as it turns out, even if it had raised an error it wouldn’t have helped me much. Why? Because straight after the call to
move_uploaded_file I was doing a redirect to a new page. Therefore, any errors related to the problem http request were output to a screen which flashed by too quickly for me to notice.
So what is the root of this problem? Well if I was using a complied language it is likely that the compiler would have warned me that the variable I was passing to
move_uploaded_file was either not declared or at least never been initialised. I’m pretty sure that a warning message would have been output (which I missed) by PHP’s interpreter but this is no substitute for a compile-time message. As much as I love the freedom of dynamic languages you have to be aware of this significant drawback, and people can go on about how this stuff gets picked up through thorough testing but I’m not sure that’s good enough. Also, the page redirect was a killer, as it made me miss all the output messages. It’s probably worth while not performing redirects if you find something isn’t working, just to ensure that you are seeing all the messages output by the interpreter (you can always switch it back on later). Finally, some sort of lint check should have picked this up. So from now on I think I will be running things through
php –l to check that my syntax is good.
There you have it, a nice root cause analysis! I probably missed out the fact that it was my rather inane programming that was the main problem, but bugger it, I’m not really into damaging my ego.
Faced with the task of learning a new programming language (and its associated libraries) I was left considering what is the best way to do this effectively. I will now describe what I do, and by no means am I advocating its use, be aware of the hidden dangers that lie with it.
My first port of call is normally to try and see if some book on Amazon is the overwhelming favourite of the masses and purchase it. I must admit though, I often get the book, flick through it, and then probably ignore just about everything in it. I do however normally remember the name of the book and the author and when someone asks me if there is a book I recommend I spout this information to them. So the moral of this is probably never to ask me to recommend a book as I’m probably grossly misinformed about what is actually in it.
After this initial push though, it tends to get easier, I replace the crack induced cold turkey with a slightly more sociable nicotine based habit, but experience constant irritation at the need to stand out in the cold street whenever I want to spark up in public. At this stage I try to abstract most things away from the language itself and think more about how I can isolate change. In other words I tend to have the thought process where I ask myself, if someone asked me to change a requirement, how can I do it with just a change to one line; oh and preferably that one line I would have to change is at the top of the file so I don’t have to search through everything to find it. My motto is that not everyone cares enough to want to learn how something works and is happy if the process is simple and easy. Me, I prefer to waste a mountain of time trying to figure out every detail of how the code fits together – I really need to give up that pursuit, rehab or something. So at this point I start to trace into every language feature, not happy with it just working – tantamount to starting chain smoking. If I get through this stage then I will normally stick with the language, many however have fallen by the wayside after two weeks. More so learning specific frameworks though, as you start thinking “God I could do this far easier if I was writing ALL the code myself”. Remember if you get these thoughts they are normally bullshit though, try to ignore them, as you ARE wrong, you just don’t know it. It’s your mind trying to trick you out of a little hard work. All you will be is a hopeless quiter!
So only after I’ve kicked the crack pipe by weeding myself on to ciggies, and then developed a massive chain smoking habit, do I get the moment of enlightenment where I dump the ciggies and tag myself clean of any irritants (well apart from all those people who tell you that you have learned the wrong language, who all should go get a life). At this point I still occasionally use my copy-paste system described above but it’s becoming easier.
As I said at the beginning of this post I’m not sure this is the best way to go about this process. The main problem that I see is that I don’t learn all the language specific features (maybe this is a good thing). In most languages I work with a standard set of ideas that I apply to the specific language. This always leaves me thinking I could get more out of the language if I only pushed the boundaries a little further. For example, I always think that I’m not quite getting as much out of things like closures, lamdas, etc. I use these things but the way people rave about them I feel there must be more to it.
So that’s it. It usually takes me about a month or so to get comfortable with the language. I then use the language exclusively for around six months and then, for whatever reason, have to shift back to an old favourite which I have forgot how to use. So I dust down the crack pipe and seek out the Rizlas and start all over again……
Over the last six months I have taken to the ultimate geek porno, software development podcasts. I line up the podcasts on my cheap-ass USB pen come mp3 player and go out on my bike, cycling to the rhythm of MVC, jQuery, and the Cloud. It has to be said though, I have learned quite a bit from this process. Anyway, I just wanted to document the list of podcasts that I’m currently actively listening to (in no particular order, other than that I prefer the one in first place to the one in second place 😉 ).
- Stack Overflow – Hosted by Joel Spolsky and Jeff Atwood, think Laurel and Hardy, only funnier. I have been listening to this since podcast 1 and I’m pretty hooked. Topics vary from software management techniques to good/bad coding principles and practices.
- Boagworld – Hosted by Paul Boag and Marcus Lillington. I’ve only been listening to this for maybe a month or so now but I like it. It’s not so much software development but web design but interesting topics and interviews all the same. Also, I would swear that Marcus Lillington is Noel Fielding, he sure sounds like him. This can actually be a bit disconcerting, as sometimes I think “is this just a couple of guys taking the piss out of computer geeks” – now that would be worth listening to.
- Open Web Podcast – Hosted by Dion Almaer, John Resig, and Alex Russell. This started off well but there currently has not been a podcast for nearly a month so I’m losing a bit of hope. One thing I have to say about this podcast is that it tended to go into the topics in a fair bit of depth and when out on a cycle this maybe doesn’t sink in so much. You really had to be on the ball and up-to-date with the topic to have a full understanding. Also, I’m into a bit of humor whether intended or not, and this was maybe a little too serious. None-the-less still interesting.
- WebDevRadio – Hosted by Michael Kimsal – variety of stuff on this podcast, I don’t tend to listen to it religously as it can be a little off topic to my interests at times.
- Hanselminutes – Hosted by Scott Hanselman and Carl Franklin. This can tend to have a strong .NET bias which has put me off a little, but can sometimes have a topic that is of more general interest.
To summarise: a top podcast has to have an interesting people, interesting topics, and humour. Alternatively, it can just have humour, and this is why the Russell Brand podcast is one of the first I listen to each week. He’s not everybody’s cup of tea but I recommend a listen, you may be surprised. The show is at its best when Matt Morgan and Noel Gallagher are both in attendance but is always worth a listen.
Well, two days two entries, not bad eh. This one will be short though, because I’m still feeling pretty tired. Which is one of the points I want to make actually. After a year of, how can I say it, managing my own time? I’m now back in the unreal world of real work. I hate getting up in the morning though. I don’t mind so much when the sun is shining but when it’s pissing it down there just feels little incentive. More so in the heart of winter when the sun doesn’t come up until 9am. The pleasures of living in Scotland. I have no issues with getting up at 10am but 9am or before is just a day breaker.
So I hear you say, what is this work I hear you talk about? Well for the next six months I will be working for Glasgow University creating/maintaining/living matching software (maybe I will write a post about what I will be doing – when I finally figure that out). I have actually been working for around a week now, bizarrely enough though I still have not really been in. That is a long story I won’t go into. None-the-less I have been doing a fair amount of work, which leads me to my point.
After a few years of (self-imposed) exile from using Java, the tempestuous love affair has been rekindled in the last week. The majority of the stuff within the department I’m working in is implemented in C# but I was struggling to find a constraint programming toolkit that could be used with C#. However, I must make the same mistakes again and again when I go back to Java. That is, without fail, I get “
java.lang.NoClassDefFoundError: AppName” when running the application, despite setting the correct classpath on the command line. And without fail I sit pissing around with the command trying every possible permutation to get it to work. Then, the bell rings, and I remember this happens to me every time, and the solution presents itself (usually about 2 hours wasted).
So the problem: well I like to use cygwin as my terminal in windows, simply because it looks and feels nicer than a dirty old windows command prompt. However, the java command that I pick up on my path in the cygwin installation is the windows version, and as a consequence doesn’t understand the path separator in the classpath parameter, e.g. it understands neither
java -classpath .:./lib/log4j.jar AppName nor
java -classpath .;./lib/log4j.jar. With the first command the java application just thinks .
:./lib/log4j.jar is the full path and on the second it treats the ; as the end of the first command. The solution? Well for me it was just to use windows command prompt, where everything worked fine. For others it will be to use the cygwin version of java (which I assume is available but have not checked). The latter means managing two version of java on my system which seemed enough work to warrant not doing it. Instead I prefer to waste half my day typing
ls into the command prompt.
Right well, I suppose that I had better eventually put something on this. For those fools that followed my last blog then it’s gonna be a little different around these parts! First, I’m gonna try and not swear, but I guess that rule won’t last too long. Next, this is going to be more computer/software (maybe music) related mumbo jumbo. However, that said, I’m sure I will spill out some vitriolic attacks when someone pisses me off enough.
This was just a short entry to get the ball rolling and hopfully with a little nudge now and again (aye you Richie) will keep this current and up to date. That said I spent about 30 mins trying to figure out how to make a post on this site as in the month since I set it up I had completely forgotten how to login and then once I found that I had no idea of my username and password – thank the browser god of autocomplete.
Anyway the old www.feellikefalling.com site is still going with new tracks being added now and again. So you will just have to keep track of both now 🙂