Totally awesome software for iPhone and OS X

Tuesday, December 16, 2008

La Philosophie pour les Nul(l)s...

As the dark, cold nights are drawing in I've been throwing logs on the fire, sitting in a comfortable chair with a glass of Cardhu and thinking a little about null values work (or should work) in Java. For example, if you define a method as returning a String, conceptually speaking, what should it do? Should it return only String instances, or should it return either an instance of a String or null.

I've long been used to the way Java happily passes null around and have developed a hell of a lot of code over the years that checks for null, as I'm sure have most people. But, wouldn't it make more sense if the implicit contract of the return type specified by the method were adhered to?

Recently, in some cases, we've been writing what I guess you could call 'null-safe' objects (all fields pre-initialised and setters that don't allow values to be nullified). This on the face of it seems conceptually valid, the methods return what they say they'll return and there's a lot less null checking to do when using them. Objects written like this are ideal for e.g. sticking into freemarker templates as then the template designers don't need to care about checking whether or not values exist because they always do.

Problem solved?

Not really. There is an obvious conceptual difference between zero and nothing for a Long value, or between 'no string at all' and an empty string. And if you're going to 'protect' your objects like this, how do you signal that you've done so to other users of your API?

I think most people are comfortable with a certain synonymity between a null string and an empty string, but it gets trickier for other types (and let's not even get into primitives - which can't ever be null in Java). The problem seems to be that Java has no proper way of handling null other than throwing an unchecked exception when you accidentally encounter it.

Microsoft's venerable .NET has the concept of nullable types which (at least for value types, structs and enums) allows you to specify that a type can, infact, be null e.g. int? j = null; But this, with the exception of allowing nullable value types is little more than a syntatcially nice way of doing null checking (or, indeed the 'null-safe' object approach I identified above).

Is there a better way?

Well, it appears that other languages may have a more cromulent approach. Haskell, Scala etc. avoid the use of null (well, technically Scala does have null, but generally it's not used).

Scala prefers instead the use of a simple 'Option' monad that has two sub-classes 'Some' and 'None'. Option is type-safe, so you can have an Option of any type (but only of the type you define it to be). 'None' is essentially a type-safe null (a singleton object, like Nil in Ruby) and 'Some' is a holder for the actual value. Combined with Scala's filtering and pattern matching, we can explicitly exclude 'None' values from operations or act differently (insert a defult value instead, perhaps) depending on how we want to proceed. I'm no Scala expert, but this does seem a saner approach.

Another similar approach is taken by Objective-C, in which Nil is an object. The nice thing about the way Objective-C handles Nil (and objects in general) is that you can happily send messages to Nil and nothing bad will happen. Unexpected things may happen, but nothing bad :)

Oops *oops = nil;
NSLog(@"Oops is doing %@", [oops doSomething]);

This will probably, from memory, print out something like "Oops is doing (null)", not brilliant. But surely better than a runtime exception?

So, in short, I don't really know what the answer is here... In some cases you need to know about null, nil and empty values and in other cases you don't, that's a given. And you can, kind of, achieve this duality in Java but it's annoying that null itself is a special case. It's not an object, it isn't a proper type and calling methods on a null object throws a runtime exception. You could, I suppose, almost say that this approach was similar to Scala's, in that every java Object is implicity an 'Option', 'Some' is the value (if any) and null is synonymous with 'None' (except it's not type-safe etc. etc. etc.) and you do all the pattern matching and checking yourself and if you don't, or get it wrong the whole thing blows up in your face.

I can't help thinking there could have been a cleaner way to handle all of this.

Monday, December 15, 2008

Fancy learning books.

Bill the lizard has a great post listing books that programmers don't really read . In the post he points out that lots of people claim to have read titles such as the GOF patterns book, but haven't really :) He also suggests a list of books which programmers actually (probably) have read, such as Code Complete.

I'll confess to owning a copy of The Art of Computer Programming and never having read it. I have worked through some of the maths with a paper and pencil and I've used it as an infrequent reference but that's about it. I'm saving the rest of it for my retirement...

As for his other suggestions, I agree wholeheartedly. If you're looking for a comprehensive list of worthwhile holiday reading you could do worse than filling in the gaps in your book collection with these suggestions.

On another note, I noticed the following comment from 'anonymous'.

I graduated from Imperial(UK) around 2 years ago and have been programming for a well-known company in a well-paid job for just over a year now. I have read none of these books. Hurray!


Sadly, this attitude is quite prevalent amongst 'career coder drones' in the various industries I've worked in. It seems bizzare to me that people would be working in a field that they have little or no interest in - other than that of getting paid at the end of the month.

I suppose you can get away with it, but, as they say, 'those who don't learn from history are doomed to repeat it' and I'm sure it's unmotivated, bookshy coders like this that are responsible for the 'well-paid' contracts in 'well-known' companies that I keep getting offered to help fix their broken wheel reimplementations...

Wednesday, November 26, 2008

The Closet JRubyists

Brian Tatnall writes an interesting article on JRuby. In short, he says it's fantastic. It looks like they used it to solve memory and performance issues in a financial processing app. Interesting read, makes me want to play a bit more with JRuby.

Friday, November 21, 2008

Is not using an ORM premature optimisation?

Corey Trager writes in this blog post about how he's "stockpiling ammunition" (collecting articles) to use in a workplace argument (discussion) against using an ORM solution in a project.

Now, apart from what he describes in his post, I don't know much about his project and in his case he may well be right to argue that using an ORM, for them, is a complete waste of time and effort. I don't know.

But in the general case (i.e. almost everywhere) I personally think that chosing not to use ORM is a premature optimisation. Simply giving hand waving arguments about performance without metrics and claiming that using ORM is just following the herd is not going to sway my point of view on this and here's why...

1. Performance

Ok, so you could argue that, even without supplying metrics, not using an ORM can ultimately be more performant for some scenarios (which may or may not represent real life usage patterns). But that's like arguing that writing your app in assembly language is going to run faster than the same thing done in Java, Ruby, Python etc. It may be technically true, but you're going to burn up a lot of time and build in a lot of complexity right from the start. So in terms of developer performance and code maintainability you're going to lose out.

'Whaa?', I hear you say, 'who cares if it's easy for the developers to work with, I want blazing fast systems not lazy, bigass developers futzing around with the 'tool du jour' just because it makes their lives easier'.

Yes, but also remeber that you don't necessarily know at this point what the performance characteristics of your application need to be. Let's say you're building a web based API as Corey is. Do you know upfront what the average load will be, how it will be used and so on. Sure, you can guess or even do a little research and get some approximate figures and patterns. Hell, you could even run some benchmarks that test the relative performance of direct connections to a database against an ORM, but they won't tell you anything meaningful at this point. You may even discover that the direct connections are marginally quicker, but it's not a real life usage scenario and half of the (free) benefits of using an ORM probably won't even be brought into play by your test scenarios.

One thing I've discovered in my ten or so years of building big ass apps is that the bottleneck will at some point be the database. Yep, the database itself. Whether it be locked up doing some big query or update (hey, ORMs make locking problems easier to solve too), sending data down the wire to your app servers, out of memory, disk space, available connections or whatever. It's very rarely the app that you'll find yourself waiting on. Of course, there's a case that some of these problems may be the fault of the your app but this is going to be true regardless of whether you're talking to it via some kind of ORM library or a bunch of connections and queries you're managing yourself.

Anyway, we'll come back to performance so let's move on :

2. Software Developers != DBAs

In my experience developers don't think or act like DBAs. They don't often write optimal SQL and they tend to think in terms of code when trying to solve problems in SQL. The opposite is also true, DBA's often write funny code, I once worked with one who was given the task of parsing text files and, of course, set about solving it using an RDBMS. The parsing worked, but took hours and it was quickly replaced with a few lines of C or Perl (I forget which) that did the same job in seconds.

So, abstracting developers from the database can be a good idea, ORMs generally don't make too bad a job of optimising queries and laying out schemas in most cases and they at least follow consistent principles in how they go about such things. The same can't usually be said of people. And besides, ORM frameworks keep getting better as they evolve, so you get the optimisation benefits (collected over years of other peoples' real life scenarios) for FREE every time you update the library. You can't easily build that in yourself and you almost certainly can't build it for free.

By all means, design the database properly, or better still get a DBA in to do it for you. There's no rule anywhere that says you have to model your entity objects in some hyper generic, polymorphic uber-pattern that creates thousands of tables with many-to-many relationships between them and slows to a crawl trying to inflate an object.

You can be pragmatic here. If you have an existing schema or a nice DBA designed one, why not just map your entities directly to that? Think a bit about how your entity model is going to look when mapped out as a database schema, change it if necessary. Most ORMs offer some kind of migration feature that will create and update your database schema for you.

If you know nothing at all about databases, then letting the ORM create you one based on your object model isn't going to be any worse (and probably better) than you'd manage without.

'Wait a minute!' you say, 'That's not much of an abstraction.' Well, no it's not and yes it is, with an ORM the real abstractions are the mechanisms for acquiring database connections, querying relationships, fetching and updating data, managing transactions, caching things and more. The responsibility of knowing that your design is stupid and won't work when translated into a database schema ultimately rests with you.

Again, this is also true if you decide to go down the 'roll your own' route, you just don't get any help along the way.

3. Caching

Big apps are all about caching. Caching everywhere. Facebook have something like 25 terabytes of in memory caches and you're probably going to want some too at some point. Most, if not all, ORM implementations have caching built in, they cache queries, entities, relationships and all the things that you're going to need to remember to find and optimise and cache yourself if you don't use one. They deal with stale objects in the cache for you and take the load of development, testing and debugging all this crap from off your shoulders. Of course, you can tweak them for performance later (when you know what needs doing) and add more caching as you need to other parts of your app, but they're all there ready to go.

Caching is quite a hard problem, but if you decide on rolling your own anyway you'll find caching libraries everywhere and they're not that difficult to work with, but applying them consistently and appropriately is.

This is done for you when using a decent ORM.

4. When you're not using an ORM aren't you really just using an ORM?

If you're not using an ORM to manage the 'interface' between your app and your database. What are you doing? You're probably getting a connection, querying data (being careful to only query for the data you need and doulbly optimising the query), doing some stuff with caches and putting it in a sort of code based representation of the data, cleaning up any used resources and sending it on it to the user. The representation, probably a DTO of some sort, is doubtless an object.

So you're bascially just writing your own specialised ORM then?

Except you've written (and need to maintain) more of your own code to do it. It used to be the case that ORMs required a tightly coupled set of confusing mapping files in xml or similar and involved a lot of work to do apparently simple schema updates. But this hasn't been the case for some time. The two ORMs I use most frequenty JPA/EJB3 (Hibernate) and ActiveObjects are mapped using annotations within the code. But instead, if you don't use an ORM, you've now got a codebase that's tightly coupled to your database. Of course, there may be some benefits to this, but I doubt they'll have much real value. If you've made your database abstract layer more generic than this, then, well why didn't you just use an off the shelf solution?

'Yeah, but what if you're doing data intensive stuff, that's where ORMs really suck. Like getting tens of thousands of rows and performing calculations on them?' You ask.

Well any ORM worth it's salt will let you use...

5. Native queries

Sometimes the whole coding thing just breaks down and SQL is more appropriate, as it usually is for large set based operations. Imagine a scenario where you have to do something to huge datasets and need to update them all at once. You could (but probably don't want to) use an ORM to do something like.


//get every MyEntity in the database
//increment someting by 5
for(MyEntity entity : entityManger.find(MyEntity.class)) {
entity.setSomething(entity.getSomething()+5);
entity.save();
}


This will be slower than the equivalent UPDATE statement on any given RDBMS, if for no other reason than the database doesn't have to transfer the data between itself and your app. This should be pretty obvious.

The arguments for not approaching this specific type of problem this way are the same irrespective of whether or not you're using an ORM. And no ORM worth using is going to tie you in to iterating a massive result set just because it's somehow more 'OO' to do so.

Again, ORMs allow you to bypass their funkiness and call directly through to the underlying database. Breaking the abstraction? Not really, just being pragmatic. Maybe I'm wrong, but as mentioned earlier I don't think the purpose of an ORM is to allow you to create 'whatever crazy OO model you dream of' and magically and transparently map it to a database with little thought or effort and everything will perform wonderfully. The abstraction is the abstraction of not having to deal with the whole kit and kaboodle of connection pools, caches, query optimisations etc. except when you have to.

It can scarcely be denied that the supreme goal of all theory is to make the irreducible basic elements as simple and as few as possible without having to surrender the adequate representation of a single datum of experience. - Albert Einstein


6. What else?

Other complaints that I've seen levelled at ORMs include the following. I'll deal with them quickly as this is becoming a long(er than intended) post...

Concurrent updates : From the 'ammunition' collected in the post that sparked this article, I found this quote, from Bruce Eckel I believe, "Most O/R mappings try to give the illusion that there is just that one Customer object with custID 100, and it literally is that customer. If you get the customer and set a field on it, then you have now changed that customer. That constrasts with: you have changed this copy of the customer, but not that copy. And if two people update the customer on two copies of the object, whoever updates first, or maybe last, wins."

This is simply not true. Hibernate et al. support optimistic concurrency control as much as the next man. How else were you going to solve this? Make your domain objects singletons, lock the row when you 'check out' some data to read it just incase you decide to modify it?

The SELECT * 'problem' : It's a common belief that looking up objects in an ORM involves eagerly loading everything, even stuff you don't want. Again, not true. Completely configurable. Make sensible choices. If you roll your own you're going to need to do this anyway.

7. So, I built an ORM based solution and it totally sucks...

Well, ok, if you're absolutley sure you did your best and the whole thing is falling apart and it completely sucks and it's all the fault *exclusively* of the ORM and you've proven this mathematically and no ammount of tuning and tweaking makes it work.

Then rip it all out.

You should have a clean enough code base, after all you'll be left with POJOs and stuff which you can reuse. I'd hope that your code will be much smaller and easier to refactor as a result of having used an ORM than it would be otherwise. Did I mention that ORMs generally make unit testing and the like much easier as well? Improving code quality overall.

To summarise then:

1. ORMs are not magic, they don't understand intent. They just help abstract away some of the pain of dealing with databases and all the associated cruft that comes with that. You don't have to make random design decisions, if you're stuck with an existing database consider accomodating it a bit in your OO design rather than performing a bunch of crazy mappings. Better still migrate it. Do whatever you'd do if you weren't using an ORM, they generally don't enforce a strict set of rules on how you should use them.

2. Work done by other people, built upon work done by better people and tested in thousands of real life scenarios is going to be better and more bug-free than something you knock up yourself. Every time.

3. Don't immediately wave your hands in the air and claim 'performance sucks'. I've worked on sites using JPA/EJB3 that deal daily with many hundreds of hits per second and don't suffer from performance issues. I've also used ORM in environments where very high processing throughput and heavy calculations were required, again without issue. It may well have been the case that EJB2s container managed persistence was a bit 'merdique' (shitty) but god, that was years ago things have come a long way since those days...

4. If you don't use an ORM and your app isn't running entirely in the database (oracle forms?) then you're going to be building some form of database abstraction layer anyway, whatever you call it or think of it as it's just a custom, one off ORM. That's what it is. I'm sure that this approach could, in the end, be slightly more tuned to your specific needs. But I'd argue that it's a lot of extra work for not much extra gain.

Richy

The Typing of the Dead

Surprisingly, I found myself agreeing for once with Jeff Atwood in his recent blog post regarding typing.

Its one of those things, like ergonomics that is fundamental to what us professional nerds do. Away from the glare of the monitor I also have some other hobbies inluding building and restoring old sports cars and fixing broken analogue synthesizers (wierd mix, I guess). Anyway, you wouldn't approach either of these tasks without some basic understanding of how go about them and some decent enough tools to work with.

Yet people do this every day when they sit down to work in their offices on sub-standard (or even broken) chairs, with crappy office supplied keyboards and mouses and the monitor positioned such that they have to spend the day craning their neck to read whatever it is that people in offices read all day.

So, I thought I'd compile a list of things I find essential in my office.

1. Ability to type - as Jeff points out, as a geek you'll be doing a lot of this. Play Typing of the Dead or Mavis Beacon, or whatever it takes to get you to at least 70-80 wpm _comfortably_.

2. Decent Keyboard. For Macs, I still recommend the KeyOvation Goldtouch keyboard. I've been itching to try a dvorak layout for a while, but then it'd be back to point 1 for me, will definitely be trying it at some point though.

3. Decent Chair. I have a Herman Miller Aeron chair and I love it. When you think about how much time you're going to spend sitting on your fat arse typing you may as well splash out a few quid on a decent, ergonomic chair. They're not always expensive either, I got mine from a company going bust (these may be quite easy to find these days :) ). There are other 'decent chairs' around as well, so make sure you try it out first and pick one that suits you and you think you can spend 8+ hours a day sitting in. Chosing a crappy chair (like most companies do on your behalf) is rather like being a professional driver and chosing a Daewoo Lacetti.

4. An Editor that doesn't mean you have to code with one hand on the mouse. Again, I think something Jeff blogged ago a while back, but seriously use something proper like MacVim or Aquamacs Emacs , once you get over the slight learning hump you'll find yourself being much more productive. Note: I'm not necessarily saying that you should ditch the IDE either, there are ways of using the both interoperably and for the tasks they're best at. While you're at it, it's worth spending a few minutes each day leaning the keyboard shortcuts for _everything_ on your OS of choice :)

5. Some completely awesome music to listen to. OK, not essential, but a nice to have. I'm going to go out on a limb here and recommend the new Negativland album Thigmotactic.

Tuesday, September 2, 2008

Pimp your (Mac)Vim

One of the truly great productivity enhancing pieces of software everyone should play with is Vim.

Currently I'm using MacVim as my 'IDE' of choice and even when it's not my choice (e.g. I'm using IntelliJ for one project) I have MacVim set up as an external editor and 9/10 open and edit files in it. It's like TextMate but good (hee hee).

I thought I'd share here a few of my favourite plugins.

1. NERDTree

Probably nothing new to regular Vim users, but NERDTree gives you that full on IDE style file browser in a separate pane, like this.



Once installed simply type :NERDTree /path/to/whatever and it'll open at the specified directory.

The beauty of this approach is that you can navigate around using the standard Vi movement keys (h,j,k,l) and open files in a new buffer (on the right) using 'o' (using 'o' on a directory opens or closes it depending on it's current state). You can also use the usual search features to quickly find files and directories (way quicker than teh puny scroll wheel). Oh, and you can switch back and forth between windows using Ctrl-w Ctrl-w.

Why is that beautiful? Well, your hands no longer need to leave the keyboard and reach for the mouse and after a short learning curve you earn 10 productivity points. Well done!

You can download NERDTree here.

2. Buffer Explorer

Now that you're awesome at opening and working with hundreds of files (just like a real IDE) you'll probably want an easy way to switch between them. Vim does let you do this quite easily using e.g. :b 2 (switch to buffer 2) and :buffers to list open buffers, but that's not good enough for us Vim pimps.

So I'd suggest Buffer Explorer. With Buffer Explorer in place you simply need to type \be to get a navigable (as in searchable, uses standard vi movement keys etc. etc.) list of all your open buffers.



Hit enter to switch to the currently highlighted one. Easy.

You can download Buffer Explorer here.

3. Browser

'NOFIRETRUCKINGWAY!' I hear you scream. But yes. Yes, you can have limited web browsing capabilities in Vim. It's arguable wether most browsing is actually productive most of the time, but I find it useful to be able to reference Suns javadoc quickly on occasion. Also, having a browser that strips out images and javascript and 99% of the web experience BUT gets you straight to the data is a good thing.

There's a couple of browsers available for Vim, I chose one based on Lynx as it doesn't appear that MacVim was built with the embedded perl extensions and I couldn't really be bothered to tinker too much. So you'll need Lynx. I got this via. MacPorts, all fairly straight forward (sudo port install lynx)...

So now in command mode I can type e.g. :WebBrowser www.reddit.com and catch up on the latest interlinks, kind of...



Ok, it's not beautiful, but it's functional and quicker than scrobbling about looking for Safari amongst the sea of desktop flotsam.

You can download browser.vim from here.

Installing Plugins.


Because MacVim comes packaged as a .app the only way I've found to install these plugins is to copy them into the App bundle itself. You can either do this in Finder (using Show Package Contents) or from the command line. Either way you need to put them in this directory :

/Applications/MacVim.app/Contents/Resources/vim/runtime/plugin

Monday, August 18, 2008

Decluttering Skype...

Like many freelancers I find myself using Skype every day to talk with friends, colleagues and clients. And, in general it's fine apart from the huge ammount of desktop space that it seems to take over.

So I quickly (very quickly) created an alternative, minimalist SkypeChatStyle which you can use to change the style of Skype on OS X to something a bit less, well chunky.

Here's some pictures to show you what I mean.

Below is the Default (only) style - Skype Modern.



And here is my new Minimal syle - WUFU Minimal.



Look, you get nearly twice as much natter for the same ammount of space. And it's brilliantly low tech. And, as far as I can tell, everything still works.

So how do you go about installing it?

Firstly download and unzip the following file.

WUFU Minimal.SkypeChatFile

Then double click on the file - WUFU Minimal.SkypeChatStyle

Skype should do the rest (at least it did for me). It will then appear in your chat preferences.

If this doesn't work, right click on the Skype application in the finder and select 'Show package contents' then navigate to /Contents/Resources/ChatStyles and drop it there. Then you'll just need to restart Skype.

I was kind of surprised that I couldn't find many other skype style files out there, if you know of any more or have made any yourself please drop me a line I'd love to hear about any others.

Thursday, August 14, 2008

Until they become conscious they will never rebel..

Oh dear! they are at it again.

This time the plan is to store "a billion incidents of data exchange a day". Namely, your personal emails, SMS messages, phone call details and so on and make it available to "Local councils, health authorities and hundreds of other public bodies."

Obviously this is done with all the best intentions in the world - stopping terrorism, drugs, crime, paedophiles and all that good stuff, although what role the local health authority will play in any of those is, as yet, unclear.

However, recent history has shown that in reality it's use will likely be wider reaching and more mundane.

Now, this concerns me somewhat and I'd be pretty surprised if it didn't concern everyone, so I'm going to suggest something.

Why not encrypt as many of your communications as possible?

There is nothing illegal in doing this, as far as I can tell. Although, you are of course bound by the Regulation of Investigatory Powers Act 2000 to hand over any encryption keys to the legal authorities if they ask.

The upside of this is that at least it'll prevent random text searching across your data and it may annoy a few council jobsworths along the way. Plus, if they really think you're up to something they can jolly well go and get a summons for your keys (assuming you haven't, *ahem*, misplaced them or something) right?

Another free benefit of this is the verification of your email traffic - by signing and receiving signed messages you can gain some assurance of where they're coming from.

Wouldn't it be ironic (and lovely) if this move by the government actually lead to a widespread adoption of email encryption?

Here's some links to get you started....

encryptedemail.org - has tutorials for getting started in Thunderbird and Gmail

Mac GNU Privacy Guard - Set of mac utilities to deal with encryption and key management.

PGP For Apple Mail - Bundle plugin for Mail.app, I personally use this and it's fine. The latest beta is mostly functional on Leopard.

GPG Eudora - Scripts for Eudora.

EntourageGPG - some Microsoft email thing some people use :)

Oh, and my public key if you want to send encrypted stuff to me :)

Friday, August 1, 2008

Hassle free contacts.

I've just received my beta invite for Soocialand have been playing around with it a bit.

It looks so far like the perfect application for syncing contacts between your macs/gmail/phones etc. It's very slick. Of course, my crappy £5 Sagem 'pay as you go' phone isn't supported, so I could just use .mac (or me.com as they call it) and hack the Leopard Address book to sync with GMail (which was my previous setup). However, I'm interested in a couple of things;

1. Smoothness of operation - .mac had an annoying tendency to sync things at seemingly random times and was quite obtrusive when it did so. Soocial may even run alongside .mac syncing in the future, they advise turning this off for now however.

2. Cost - The beta is free and I've no idea if Soocial will start charging for their service later (I was too lazy to read all the details), but it could potentially replace my .mac account as I don't really use many of its other features.

3. Support - I know at least one person who'd love it if this synced with windows PCs as well, probably with Outlook (or wherever you store contacts on a PC). It seems to me that Soocial have the advantage here as, in theory, they can build in support for almost anything they can be bothered to. I suspect .mac will stick to iPhones and Macs for the foreseeable future.

Saturday, June 28, 2008

Travel Tips: Getting a cheap internet connection in Malaysia.

I'm currently out in Sarawak (Borneo) and spent some time searching for a cheap dial up ISP in Malaysia.

I couldn't find any obvious candidates that didn't involve some sort of dodgy download dialer.exe thing (that wouldn't work on a mac anyway).

So, when I got here I relied on stumbling across open wi-fi connections which seem fairly widespread, but this approach doesn't always guarantee you'll be able to connect.

Anyway, it turns out that Telekom Malaysia offer a dial-up ISP service that requires no registration. It costs 4 Sen per minute (less than 1 pence UK) and all you need to do is dial 1315 (no username or password required).

Of course, if you've got a recent-ish mac you'll need to buy/bring a USB modem as well :)

Friday, June 6, 2008

Enable hidden Skype (2.7 Beta) Emoticons in OS X

I discovered today that there are a bunch of hidden, amusing and animated emoticons in Skype 2.7 Beta (and possibly other versions) on OS X (and possibly other OSs).

They look like this :



So, being a geeky sort I knocked up a quick one liner to enable them all in OS X.

This bit of copypasta can be run in the Terminal and it assumes that you've installed Skype in the default location (/Applications)

perl -p -i -e 's/<true\/>/<false\/>/g' \
/Applications/Skype.app/Contents/Resources/Emoticons/\
Animated\ Emoticons.SkypeEmoticonset/Emoticons.plist

Thursday, May 22, 2008

Oh lordy...

The uk gvt wants to store details of every phone call made, email sent and minute spent on the internet by the public.


Let's hope they sign a contract with Microsoft for an improved version of Access.

Who on earth (or in the UK) could honestly think that this is a good idea?

Tuesday, May 20, 2008

Great spam subject lines...

I just received a spam email (rarely happens these days) with the following subject line.

Set your wife on fire

Now, perhaps it's just me but I thought bloody hell that's a bit harsh.

On further reading it appears that I will be more 'manly' if I do...

Monday, May 19, 2008

Things to think about...

I've been using restlet on a couple of client projects recently and you could say that it's piqued my interest in Java web frameworks and more.

I had been using 'proper' J2EE frameworks for what seems like forever now and this came up as a refreshing change, I loved the whole 'non-app serverness' of it all :)

So my explorations have taken me to Wicket, probably most pure 'java' web framework I've looked at. It's kind of neat, but takes a bit of getting your head around the way it models certain components. I very much liked the way the templates are pure xhtml and contain no crazy scripting or embedded markup (and therefore can be edited by designers with no knowledge of strange JSF components). Like Restlet, Wicket uses Jetty as the webserver by default (although it's not mandatory) and means I can bundle up my apps into a single .jar file for distribution.

However, my most surprising find (as a die hard EJB user - yeah, even since back when it really sucked) has been Active Objects. Ok, this wasn't really a 'find' I've known about it for a while and I know the guy who wrote it, but I've never played with it. But playing with new frameworks made me want to find a quick and simple persistence mechanism that didn't really involve setting anything up.

Again, Active Objects seems very Java-y. It doesn't require any configuration (other than the datasource) and unlike JPA/Hibernate it uses Interfaces rather than POJOs. However, I found that despite the lack of documentation I had everything I needed up and running for a simple data model within the first hour of playing with it - including the databse.

I'm aware that there are a few bits of esoteric stuff Active Objects won't do (distributed transactions, for example) but it covers most bases more than adequately, including cacheing. It's strength, however, is it's simplicy and light weight approach. The API makes a kind of immediate sense, especially if you've used other ORM solutions and I've found it a pleasure to work with.

I'm looking forward to using it on some 'real' projects in the near-future.

Thursday, April 17, 2008

Why does everything suck?: The Stats Are In. YouTube Really Is A Turd

Hank Williams poses an interesting question regarding YouTube: what value does user generated video have. He seems to think none to negative.

The comments also touch on 'monetizing' Twitter, something I blogged about recently.

Why does everything suck?: The Stats Are In. YouTube Really Is A Turd

I think it's likely that we'll see Google doing content deals soon and using the YouTube platform for something akin to the BBCs iPlayer.

Tuesday, April 15, 2008

ffs

This is why people campaign for privacy rights. Not because they're pro-terrorism or un-patriotic.

There's no need to look like a demick!

Right, demicks. Mark E Smith has an autobiography coming out, as it isn't a fiction book I can read it in English without breaking my new rule, good thing too I doubt I could wait for the 'traduction'.

There's some fantastic extracts from it on the (pinko commie) Guardian site

Mark is, to me, the poster child of doing things your own way. In stark contrast to many 'rock stars' he remains unphased by current trends or people's opinion of him. As a consequence his music is not necessarily easily approachable. But, like most things you have to work at, you're usually glad when you have made the effort.

For those of you who have no idea who Mark E Smith is, this video may (may) give a slight insight, but as one of the most prolific artists around (26 odd albums) around I doubt it really will. I hope you enjoy it anyway...




Saturday, April 12, 2008

Beercan

I'm building a new office (more on this later) and am currently at the optimistic stage where one believes anything to be possible. Before reality hits home and I find myself short of engineering talent I'm reading a lot of books for inspiration. More accurately, I'm looking at a lot of pictures, some of which happen to be in books.

One resource my wife bought me to look at was this:





It's rather good and has some interesting ideas for making funky furnishings out of, well, junk. Now one thing my new office definitely requires is a room divider. I simply can't cut awesome rockstar code whilst staring at a pile of broken synthesizers and cables, nor can I fix broken synthesizers or be inspired to write any music on them whilst staring at a pile of unfinished awesome rockstar code.

This book appears to have the perfect solution. A beer-can room divider! All I need to do now is drink 216 cans of beer.

I also like the look of the RealMac offices, which NikF posted on flickr recently. You can see the full set here.

Wednesday, April 9, 2008

Technology is the rise of communicating less more

When people ask me why I don't have an account on Twitter I give them the look I usually reserve for people who ask me why I don't watch Ready, Steady Cook. Why would I have an account on Twitter? I just don't get it and neither it seems, does anyone I know.

Before writing this post I asked all of my IM contacts who were on-line to tell me in ten words or less what they thought of Twitter. Some were more effusive than others and were unable to restrain themselves to the arbritrary word limit.

Here are a few of their responses:

"Pointless wankery for people who think their opinions matter." - Senior software developer

"Some people seem to like it - I don't see point (would have preferred 11 words...)" - Software Architect

"I don't even know what Twitter is." - Musician

"What the fuck is twitter? That's what I think." - Digital Photographer

"Maybe it should be called Twatter. A word lacking from the English language which should mean the banal mutterings of people that believe they are part of the digital ecosphere as they reach out for similarly socially retarded wastrels in a quest for mutual justification." - Software Developer

Interestingly not a single one (of those that had heard of it) thought that Twitter was a good idea, not that this alone proves it isn't. The last comment also raises a good point, it's about 'group-think' isn't it? Communicating without actually saying anything, symptomatic of today's feeling without thinking mindset. Twitter, at least to me, appears to be the epoch of knee-jerk reactionism - a sure sign that we're turning into a world of attention defecit infovores. Quick! I've been Twittered @, best think up (or better still copy) someone's opinion and broadcast it to anyone that cares, which fortunately, doesn't appear to be many.

Twitter is reasonably popular, it has 959,558 users worldwide today which in UK terms gives it about as many users as the Daily Telegraph has readers - multiply that by 7 and you're getting close the readership for The Sun which can just about influence an election in the UK on a good day.

Of course, 7 million users scattered across the globe are unlikely to influence much - if Facebook, with 39 million users, is anything to go by they will most likely spend their time pretending to be virtual zombies or playing Scrabble. What's more, most of Twitter's users are likely ultra-hip, web 2.0 types who spend a large portion of their time celebrating themselves, perhaps as the comment puts it "in a quest for mutual justification". I like to imagine Twitter as the virtual equivalent of a sports hall full of Nathan Barley's shouting at each other.

Years ago I used to work with live news feeds and I'll admit that the constant gratification of knowing something before almost anyone else can be a rush. I watched tickertape wars break out, tickertape oil tankers crash slowly into sandy, puffin infested beaches and tickertape commercial jets nosedive into tower blocks. I suspect, Twitter in part, fulfils this role by constantly alerting people (to web 2.0 micro-events) and keeping them connected. I'm also sure it has it's own heirarchies and communities and people like to be in those (particularly at the top).

But how useful a resource is peer generated news after all? Does anyone still look at Digg these days? I still frequently read reddit, but more for diversion in times of boredom and most certainly not for news. Much like Reality TV left people gasping for salaried actors and scriptwriters, I predict Reality News will leave us sorely missing real editors and chain-smoking, drunken, opinionated columnists.

So, what else does Twitter achieve? Well, it doesn't have any apparent way of making a profit. I use the word apparent because it's not always immediately obvious how these kind of ventures plan to make a profit. I'm sure that if they can solve the problem of adding more users without their servers falling over then there are plenty of ways to sell the user database they're creating. There have been rumous that the US Central Intelligence Agency uses (and possibly sponsors) Facebook and vast databases of 'who's who' and 'who knows who' will almost certainly be of interest to someone.

Collecting data seems to be one of the passions of our age, however if Twitter posts were Java fields I'd probably mark them @Transient (@Best).

The title for this post was taken from a piece of art made by an old friend of mine Mr. Captain Wardrobe.

Monday, March 31, 2008

CCC publishes the fingerprints of Wolfgang Schauble

Lifted from a glass he drank from the Chaos Computer Club managed to get a copy of the German Secretary of the Interiors fingerprint and make biometric device fooling molds.

Original article - translated by Google

How to fake fingerprints (CCC)

So, what does this mean for biometric security? It demonstrates one of the biggest flaws with the 'something you are' approach to authentication, if it's copied or taken how to you change it? Generate some new fingerprints and make molds perhaps?

Also, I'd like to thank the CCC for continuing with this and other efforts. It is only by exposing flaws such as this that we can all profit from increased security and privacy.

Tuesday, March 25, 2008

Book Club

Since I've moved my life and business over to France I've been making an effort to learn the language. So far je me débrouille bien (I get by pretty well) but, you know, it's quite humbling to be stuck at the linguistic level of perhaps a ten year old (on a good day!).

So I've decided that from this day forth, I'll only be reading fiction books in French (I'm not quite prepared to swap all my cocoa/java books over just yet...)

The first one I've decided to wrestle with is Farenheit 451 by Ray Bradbury
- mostly because it's something I've always meant to read in English and never managed to get around to it. I'm not sure wether it being a translation of an english book will help or hinder my progress, however they do note in the preface that a bad translation is just another form of book burning, so I'm remaining optimistic.

Monday, March 17, 2008

Korg DS-10 Pocket Synth

I really, really, need to get me one of these for my Nintendo DS :)





(For those of you that didn't know, I've been a synth fanatic for a long time and when I'm not hacking out software for fun and profit I'm often fixing up old Moogs and Rolands for fun and profit.

Tuesday, March 4, 2008

Electric String

Once upon a long ago, I worked in a 2nd hand hi-fi shop and did my best to uphold the tradition of being a miserable bastard who knew more than the customer, although my rather unique position was to declare a lot of expensive equipment as junk and push the customers towards quality value stuff which performed just as good if not better most of the time.

Anyway, turns out the internet has come out in force against Monster cables and declared it impossible to identify the difference between them and coat hanger wire in A/B tests. Although I don't think the method of testing was scientifically valid, they're probably right.

I did, however, find this interesting article on wire which explains what makes a good speaker wire.

http://www.roger-russell.com/wire/wire.htm


Oh, the picture for those of you old enough to remember is from Not The Nine O'Clock News (Gramophone Sketch)

Saturday, March 1, 2008

Playmobil Security Check Point

This initially filled me with sadness, however upon reading the comments and tags my faith in humanity has been restored.



Wednesday, February 27, 2008

Email nirvana...

Inspired by the recent lifehacker post on Your Ultimate Email Setup I decided that it was time to do something about my increasingly difficult to manage and tedious email setup.  


I took the plunge and set up one GMail account to rule them all, the idea being that using the IMAP support in GMail I could still use Mail.app (as god intended), but also check messages from my phone and reply to any account from any internet connection (kind of thing).

Setting up GMail to fetch mail and reply from different accounts was easy and is widely documented.  

What is not so obvious was how to set up Mail.app to reply from different aliases or email addresses when using the same GMail account.

It turns out that what you need to do is enter each of the multiple addresses or aliases you want to use as a comma separated list in the Email Address field on the Account Settings screen.  So something like this....

All these different addresses will then appear in the From selection box when you're composing a new mail. 

Another top tip, is to set the IMAP Path Prefix (under Advanced) to Inbox.
This will make sure that all your mails go only to your Inbox, rather than being duplicated in another mysterious IMAP Mailbox.

I'd never used Mail.app with IMAP before but had heard people mention about it's lack of multiple account support and having to mark messages as read twice and so on.  Hopefully this will help!

Old Blog Posts

Oh, I forgot to mention that the old blog posts are all still available here : http://wiredupandfiredup.co.uk/blog/index.html

Bienvenue!

As you can see I've moved the blog over here..  My previous blogging workflow was, well, insanity.   


I use the incredibly brilliant RapidWeaver to create and maintain the site and it has a really neat blog tool which can be set to publish in all kinds of sane and sensible ways. 

However... My site is running in a Java application server so every post required me to package up the entire site as a .war file and upload it to the server. This provided just about enough inertia to ensure that posts were kept to a minimum and were usually about product updates or something similar.

As you can see I've made some attempt to port my RapidWeaver theme (Sprout, if you're interested) to Blogger as well.  I'll continue to tinker with this and of course I'll continue to use RapidWeaver for the rest of the site because it's GRATE (did I mention that?)

Hopefully this will be a much more cromulent approach allowing me to fire off missives whenever I feel like it.  I'd like to hope that this will also see a change in the style of posts.  I plan to : 

1. Post much more frequently 

2. About much more random stuff including but not limited to; Indie Mac Software Development, Freelancing and Consulting, Living in France and pretty much anything that comes to mind.



© 2007 Wired Up And Fired Up