ShALLaX.com
Home · Articles · Links · News CategoriesAugust 21 2008 18:10:16
Navigation
Home
CV
Articles
Links
News Categories
Contact Me
Media Gallery
Search
Login
Username

Password



Forgotten your password?
Request a new one here.
Advertising
Credit Card Consolidation - Hotel Las Vegas - Wills - Best Credit Cards
Apple Security Issue
PersonalI was recently given credit by Apple for discovering a security issue in their new Mobile Me service. I think it's very decent of Apple to give credit to people that find such security flaws.

ShALLaX on August 09 2008 05:51:16 · Print
Mac OSX Cocoa Development
SoftwareIt's been about 18 months since I switched to using Macs... and I feel quite guilty that I haven't taken the time to learn how to program using Objective C and Cocoa within the Xcode development environment. Well, with the iPhone SDK being released and international signups now being accepted, I decided it was time to give it a go. I've ordered two books, one on Objective C and the other on Cocoa (both sadly not immediately available). Due to the lack of availability, I decided to scour the web for tutorials and found two superbly illustrated (but lacking in in-depth detail) tutorials. Again, one for Objective C and one for Cocoa. These tutorials are okay if you grasp the basic concepts of C and Object Oriented programming, but will lead you into a false sense of security if you don't know of these concepts. Finally, another tutorial I found to be quite useful was Apple's own on Cocoa application development. Again, this tutorial is aimed at those who already know about programming and everything that goes with it (memory management, MVC pattern and OOP), but it's an incredibly useful resource for getting a feel for Cocoa and Xcode.

Anyway, what would a post discussing new development endeavours be without a screenshot? So here it is, the best Cocoa application ever created. My take on the currency convertor tutorial!


I'm impressed at how easy it was to get the application to look good. I can't claim any credit for the gradient background or the rounded widgets; it's all part of OSX! Without having any knowledge of Objective C and Cocoa, I'd say it took me an hour in total to get that application running (that includes reading all tutorials, messing around with Xcode's settings and then writing the application itself). The great thing is, if you know C or Java, you should understand how it all works because the principals are the same (in fact, Objective C is a superset of C, meaning everything in C is included in Objective C!).

Being serious, I know that this application is hugely trivial and that I have a vast amount of knowledge and experience to gain when it comes to Objective C and Cocoa, but I think I've achieved quite a bit for an hour of hacking. I'm also quite impressed with what I've seen so far in terms of Xcode and how it enforces the MVC pattern. Equally impressive are all of the little things which make development so easy, such as the way tab chain-of-focus is setup (see the Apple tutorial) and the way anchoring works (there is a superbly useful animation on the "Size" property window which shows what will happen to your widgets when the window is resized based on your current selections - take that Visual Studio!)

For anyone interested in following in my footsteps, I read the Objective C tutorial, followed by the Cocoa tutorial and finished with the Apple tutorial. This is probably the best order in which to read as each subsequent tutorial will make more sense after reading the previous one.

ShALLaX on May 05 2008 17:48:19 · Print
Project Management
SoftwareAfter years of using CVS, I decided to take the plunge and "upgrade" to using SVN based on seeing a project named Trac. Trac is a project tracking system that gives you a web front-end to manage issues, source code and Wiki entries pertaining to your project. The only problem I had was its incompatibility with CVS. Upgrading to SVN was a piece of cake thanks to cvs2svn and I have to say, I'm a lot happier with SVN than I was with CVS (the concept of "changesets" is very nice).

Back when I first started working on the SlX libraries and all projects that utilise said libraries, all I used for issue tracking was a ".txt" file and a text editor. Trac makes it so much easier for me to keep track of bugs and new features. If you are working on a software development project or are in a similarly semi-unorganised situation that I was in, I highly suggest that you check Trac out. It's never too late to implement good project management!

ShALLaX on March 24 2008 16:39:26 · Print
Java, MP3s and Lyrics
SoftwareI recently discovered that my iPhone is capable of displaying music lyrics whilst my songs are playing. I thought it'd be a good idea to get all of my MP3s tagged up with Lyrics to take advantage of this. Having previously tagged them all with album art, I knew this would be a rather daunting task (in fact, it's much worse, multiple songs share album art where as each song has its own lyrics!)...

My first idea was to find some existing software that did this automatically. I found something called "Corripio" for the Mac, which lets you code your own script to scrape a website for lyrics. This seemed perfect except that it meant learning a bit of Ruby (the creator's language of choice). After the program crashed a couple of times, I decided it wasn't stable enough to use. At this point I ported the Ruby scraper that I wrote to Java with the intention of using an ID3 library from the internet. The scraper hit lyrc.com.ar for song lyrics. It worked fine, but the quality of lyrics was pretty terrible (I swear most people are deaf), because of this, I decided to rewrite the scraper to scrape LyricWiki (a great site!).

I tried the JavaMusicTag ID3 library which I soon found to be buggy and horribly structured (try using it on an ID3v2.4 tag, it'll tell you that it can't cast new frames from ID3v2.3 to ID3v2.4 frames due its the horrible use of inheritance).

As the old adage goes, "If you want something doing right, do it yourself". So I wrote my own ID3 library for Java which copes with most of the ID3 features that I'd care about. Everything seemed to work fine until I tried editing the ID3 tag in iTunes, at which point I could no longer alter the lyric tags after saving in iTunes. It turned out that when iTunes saves the ID3 tags it checks for the ID3 version. If it finds version 2.4, it saves the album art with a synchSafe integer size but DOESN'T flag that it has done so in the frame header. This means that my tool would mis-read the album art frame and corrupt the header.

My solution for now (though inelegant) is to not support ID3v2.4 tags with my tool.

Anyway, I'm happy to say that all 2211 of my MP3s are now fully title, artist, album, artwork, track number and max track number tagged!

ShALLaX on March 02 2008 18:23:09 · Print
New Car
PersonalOn December 6th 2007, my Peugeot 205 was written off by a careless van driver, who ran into the back of me while I was stationary in traffic at a roundabout. I now have a 2001 VW Polo. Despite it being the same size engine (and even being 16v), it's not as powerful as the 205 and not as fun to drive. I guess they don't make cars like they used to anymore!

ShALLaX on December 30 2007 01:51:33 · Print
iPhone (or never shop at The Carphone Warehouse)
PersonalSo I caved in and bought an iPhone today. So far I'm quite enjoying it. It's very responsive, the UI has been superbly designed for usability and feedback. My only problems with it are that it's locked in to a contract with no hope of unlocking it through O2 (only hacks will be available) and there is no way of making third-party apps for it (yet!). Apparently an SDK is coming in Jan/Feb.

I spent about 2 hours trying to purchase the device from The Carphone Warehouse - forget it. The salesman there was a downright liar and con artist. The guy's name was "Izzy" from the Harlow, Howard Way store. He suggested I get their insurance for 40 GBP quarterly because it covers "everything" and that O2's insurance at 7.50 GP per month wouldn't. I checked the O2 website and it had exactly the same coverage. There's lie #1. The guy even said he was calling his "friend at O2" to compare insurance coverage, I'm fairly sure O2 said they had the same coverage, at which point he hung up and told me they did not. Lie #2.

I asked him if there was an O2 shop nearby so that I could compare insurance myself (I knew there was), he said no. Lie #3. He also said all O2 shops would be sold out, again he had no way of knowing this for sure.

He then told me I needed to give him my bank details so that he could run a credit check when there is absolutely no need for him to do this as it is done entirely by O2 and Apple via iTunes. I was told by him that O2 cross-check what I enter when I activate the iPhone with what he enters whilst I am purchasing the phone - lie #4. I eventually gave in but then found out he was doing it so that he could charge me for the insurance. He then told me "Because it's an iPhone, the insurance is mandatory"- lie #5. He then told me I would not be able to get insurance from anywhere else after buyng it - lie #6. He told me that if I bought the iPhone from Apple directly that they would force me to buy the extended warranty - lie #7. After telling him I'd walk out if he didn't stop harassing me over the insurance he eventually gave in and tried putting the payment through for just the phone... their systems crashed. I waited for another 30 minutes whilst he promised that he was doing everything he could to bring the system back online, but after being in the store for 1.5 to 2 hours, enough was enough. I asked for my card back and told him to tear up all of the paperwork that I had signed. I then drove the 5 minutes to the O2 store that didn't exist and was in and out of the store within 10 minutes, new iPhone in hand, 5.83 GBP per month better off and no hassle of "cross-checking" my bank details - all I did was pay for the phone with a credit card, nothing more.

Apparently I'm not the only person this has happened to, see here, here, here or just Google it.

Lesson: Never shop at The Carphone Warehouse.

I've forwarded this complaint to the BBC Watchdog. If anyone else has had a similar experience, I strongly urge you to do the same!

ShALLaX on November 15 2007 15:16:37 · Print
Apple Airport Extreme
MiscYesterday I bought an Apple Airport Extreme base station (read: a wireless router) to replace my current router, which has a failing WiFi card in it. I figured it'd be nice having a small, neat package that does everything my current Linux router box does. The first minor annoyance was that it only allows you to maintain a class C (/24 - 192.168.1.x) network. I like to use class B (/16 - 192.168.x.y) to partition all of the networked devices in my house nicely. After devising a new class C network, I then found out it wasn't possible to assign names to systems so that I could address systems by name rather than IP. To get around this I had to add a new zone to my BIND server to and make all computers search this "local" zone when resolving names, which didn't work very well. Further to this, you can reserve IPs on the DHCP table for MAC addresses within the Airport Extreme setup program, but when configuring NAT forwarding you have to use the IP address rather than the name which means despite naming machines, you still need to recall their IP addresses in order to setup NAT.

To top everything off, the Airport Extreme does not allow you to forward port 53 via NAT (thanks to a bug in the software, which Apple is aware of but has not yet fixed). This makes it totally impossible to host DNS behind the Airport Extreme! I've had to put my old router above it in the network and use the Airport Extreme as a wireless bridge only. I would probably have been better off just buying a new WiFi card!

ShALLaX on November 04 2007 13:45:57 · Print
Out of the Country
PersonalI'm typing this from the airport. For the next 3 or so days, I'll be in Washington D.C.

ShALLaX on September 07 2007 03:29:15 · Print
The hunt is over...
PersonalI've accepted a job today at Sagentia as a software engineer. Unfortunately this meant turning down a dream job at Last.FM simply because it would have required a 1.5 hour commute each way. I'm confident that I'll be just as happy at Sagentia, though!

ShALLaX on August 24 2007 13:26:56 · Print
.NET and Mono
SoftwareIt's been a while since I messed around with .NET (probably over a year now). I figured I'd been messing around with Java quite a lot and should broaden my skills so I decided to make a quick application in C# to get my AudioScrobbler information and display it (nothing too complex). The result can be seen here. However, I'm a Mac user so I figured I'd try the application running under Mono on OSX. I hadn't really used Mono before but I assumed it wouldn't have a System.Windows.Forms implementation, I was wrong! As you can see here, it's not perfect by a long short, but it's definitely working!

This is fairly exciting because, in some ways, C# is a more powerful language than Java (it has delegates, properties and "out" variables). However, I think these could easily be abused to make bad OO software. With Java you are forced to design your software in a more OO style. E.g. if you need to return multiple results from a method, you'd make an encapsulating method. With C#, you could be lazy and use multiple "out" variables. I'm also not sure I like the ability to alias namespaces in C#, you could alias "System.Console" as "pinecone", then your code could be filled with "pinecone.WriteLine(...)", which could be pretty confusing. C# also does not force filenames and filesystem structures based on class names and namespaces, which could lead to messy organisation of code. Anyway, I'm still learning the ins and outs of .NET and for now it's quite exciting.

ShALLaX on August 22 2007 15:59:30 · Print
Linux Zealots
MiscI came across this link in an IRC chat room... and I've got to say, it's absolutely spot on. While I really do like Linux and use it as the operating system of choice on my servers and router... I cannot stand it when I see people "defending" Linux in this way. Linux is definitely not suited to all applications - I personally wont use it as a desktop operating system because it requires too much playing about with X configurations and kernel drivers and the likes.

There is the other side of the argument that people will badmouth Linux because they are unwilling to read some documentation on how to get something working, which can be annoying to see. Maybe a little more effort from people trying Linux for the first time, and a little more understanding from people who are seasoned Linux users is in order.

ShALLaX on August 07 2007 15:59:17 · Print
Page 1 of 3 1 2 3 >
Copyright © Thomas Pedley