2008-12-23

Amazon, you're a large part of my Christmas Depression

I used to think quite highly of Amazon, after all, they are pretty much the poster face of pioneering online shopping. However, this year, I feel they've let me down a lot.
You see, on the 9th December, I decided to get my "and you're done", done. I basically went online to get all the Christmas presents that I could remember. I spent a good time online, populating my shopping cart. I made extra special sure that a) the items I picked were sold by Amazon and not one of their affiliates, I also made superduper mega extra sure that b) all the items I picked were in stock. That was very important.
As I bought quite a few items, I was eligible for the "Super Saver delivery", basically free, but with a much longer delivery time. Five to seven days, I seem to recall. But I didn't choose this cheapskate option, because I figured that 5-7 days from the 9th December would be cutting it too close to Christmas.
The reason is that some of these presents were for my family in Sweden. This mean that I needed the items quite in advance before Christmas, which, by the way, is on the 24th in Sweden (and Finland). I needed the items delivered, then I needed some time to wrap them, write some pressie-poetry, put ribbons on them, labels etc. To stick them back in a box, and then to march off to a post office filled with other Christmas-posters. I anticipated congestion, delays, everything going wrong (how wrong I was! - Read on!).
This negative attitude (or is it realistic!?) meant that I stuck my hands in my virtual debit card pocket and paid the measely £8 extra for a "First Class" delivery (not "Express Delivery"). This had a lead time of 1-3 business days. On the 9th, that would have meant that, since all items being in stock, I might even have the parcel from Amazon on Saturday 13th. Giving me the weekend to do the wrapping etc. Even if the parcel arrived on Monday, I would have ample time to repackage and send the Christmas pressies off.
But time passed...
... And yet more time passed...
... My attention was focused on other Christmas things...
... and still more time passed by...
And suddenlty it was the 17th, Wednesday and I hadn't heard a peep from Amazon. This is where I got really depressed, because I knew that I'd have virtually no chance of doing this properly. Caz noticed this and offered to give Amazon a call. She got through but wasn't really able to hurry things up without a) paying £18 extra (!!! for an already delayed delivery!) or b) starting to be "very annoyed customer". To cut a very annoying story shorter, part of the goods arrived Friday 19th. I dropped everything, wrapped things up, badly, and stuck them back in the same box they arrived in, and rushed to the local post office. To my surprise I was 2nd in line when I arrived. Awesome. Which in turn is a totally different feeling to what I felt when I was told that the parcel would cost me just a tad below £40 to reach Sweden within time for the evening efforts of the merry guy in red and white. Yes, fourty squidderinos, four-zero... forty!! That's a huge percentage of the value of the goods within the box. Annoyingly I could have gone cheaper, should I have placed the items in a smaller box. Which would have take time. Time that I had given away to Amazon.co.uk. Time I couldn't get back.
Top this off by the fact that I'm sitting here, increasingly annoyed by the fact that it is, today the 23rd of December. It's now some 30 odd hours away from St. Nick to knock on the doors of the Swedish homes to deliver presents to the anticipating children and children-in-adults-disguises. I still have not recieved the other part of my order. There's no f**king way I will be able to get all my presents to Sweden before "the event". Thanks so f**king much, Arsemazon! If you would have kept me informed, I would have been able to cancel the order, go to a real friggin shop with real items and real people in it and buy things with real money - which brings me to the next point. Part of me doing this on the 9th was so that I'd get to spend all my money whilst I actually had them in my account. But, you see, dear readers, when you order with Amazon they only screw over your debit card once they have the items shipped/picked or something. Not when you order it. Which does make sense in one way, but in this case it now meant that my account has been hit by the Amazon fees (and the Post Office fees), when I have "already spent" my money. Friend of order will point out that I should keep better eye on my finances, which is true to an extent. I would however like to point out that I'm, by profession, not a banker or accountant. Keeping an eye on my money isn't my primary concern in life. I have therefore arranged to be served with regular text messages and I have an overdraft so I don't have to play accountant all the time. My point is, if things would have gone the way I wanted, I wouldn't be overdrawn at the moment. Friggin annoying!

Top this all of by the fact that I really don't want to have Christmas, I'm merely stepping into the character because I'm more or less demanded to do so by the society. Top this off by my feeling of being poor, because I should spend my money, say, fixing my (french!) car, paying off my credit cards, saving money for doing, the downstairs toilet, garage flat roof, and the front garden.

Oh, and this'll be the first Christmas when my Father isn't with us. That's scarred by my 80 year old grandmother telling how, last Christmas, he was adamant about preparing the Christmas meal for both of them, but being in such bad shape that he had trouble eating the food he had cooked. Something nobody told me, until after he had passed away, which would be about 2 months after last Christmas.

So, you know what, Amazon, you've partially screwed up my Christmas - and potentially the Christmas of those who aren't receiving their presents - but frankly, you didn't have much of a chance to make it into a good one anyway.
I sincerely hope that, whoever reads this, will have a really nice warm and cozy Christmas. And finally, Caz, I'm sorry for being such a sh*t about this all.
.... And I'm done....

2008-12-10

Forward linking in Rails with Users and Roles

One of my gripes with Rails is that it doesn't come with a basic permissions system that incorporates users and groups or roles. Show me the modern web application that doesn't have at least an admin user and a public user. Anyway, away from that rant...
The most common way to incorporate users into Rails is to use Restful Authentication (RA). On top of that you can add roles with Role Requirement (RR). Together these two provide you with a very good base wich includes both users (login, logout etc) with roles in a Many-To-Many relationship. Sweet!
I was wondering how to do forward linking (don't know if that's the 100% correct term). And by that I mean, I want to link to a page (Controller/Action) from the current page. But depending on whether the current user (available as current_user within RA and RR) has got permssions to see the page I want to either disable the link or just hide it. I was facing a nightmare, but luckily I started studying the code, and Tim, the author of Role Requirement has already implemented this. Unfortunately Tim didn't name it very eloquently. In fact, I don't think there's a perfect way to name it. He called it 'url_options_authenticate?'. I've created an "alias" (not a real Rails alias; I tried, but failed, and I'm a bit lazy) of it and I've called it 'current_user_can_access?'.
To do this alias, I simply created a new method in /lib/role_requirement_system.rb like this:
def current_user_can_access?(params = {})
url_options_authenticate?(params)
end

But you also have to add this line to the top of the file:
klass.send :helper_method, :current_user_can_access?
Just below the line that activates 'url_options_authenticate?'. Now you should be able to do this in your views (I'm omitting the ERB tags as Blogger hates them):
if current_user_can_access? hash_for_contactss_url
and you can thus decide whether you should show something or not.
You can also use it in conjunction with link_to() and link_to_if()
link_to 'List contacts', :controller => :contacts, :action => :list if current_user_can_access? hash_for_contacts_url
and
link_to_if current_user_can_access?(hash_for_contacts_url), 'List contacts', :controller => :contacts, :action => :list
But as you can see, that's not very D.R.Y, so application_helper.rb to the rescue.
def access_link_to(name, url_hash)
link_to(name, url_hash) if current_user_can_access? url_hash
end

and
def access_link_to_if(name, url_hash)
link_to_if(current_user_can_access?(url_hash), name, url_hash)
end

Use access_link_to() if you only want to show the link when the user can access the page. If he/she can't access the page, there's nothing displayed. Use access_link_to_if() you want the link to be plain text if the user can't access the page, and naturally a link if the user can access the page.
I wanted the non-link to be "greyed out", and as I've already got a helper called "discrete()" my access_link_to_if() now looks like this:
def access_link_to_if(name, url_hash)
if current_user_can_access? url_hash
link_to(name, url_hash)
else
discrete(name)
end
end

Isn't that just happy-dandy-wonderfully-cute-and-cuddly!?
Slight disclaimer: In the code, Tim says that there might be some problems. He also verifies in this discussion. I tried to figure it out, couldn't be bothered, and what testing I've done, it seems to be just fine. Mileage may vary.

2008-12-08

F**k censorship!

It was just a question of time wasn'tit...?! One should have seen it coming when UK was using anti-terrorist laws to seize the assets of the Icelandic bank.
Either way, an estimated 95% of UK residential Internet users are now censored, including me, and quite likely, you. The worst thing about this censorship is that it's been conducted in secrecy. If I try to access the censored page I get a standard looking 404 - page not found error. No message about the resource being censored, or why.
You can read more abou this on BBC News: Wikipedia child image censored, then on Wikipedia itself: Wikipedia:Administrators' noticeboard/2008 IWF action.
Neither IWF nor my ISP has got any rights to censor what I'm to read or see on the Internet. That business is left to the long arm of the law. Unless you're part of the Police force, let me do my browsing as I see fit.
What's next...?! Is my Finnish bank going to be put under censorship as I'm trying to move finances over there at the time of the financial crisis..!? (Just FYI, crisis or no crisis, I still need to pay off my student loan!!).

Free my Internet now! F**kers!

2008-12-03

An MP3 album for £3..?! Yes, it's true!

It's finally here! It's true! Amazing! I've ranted about the digital music business before. And my bottom line has been that we need DRM free music, and it needs to be cheap. I am of the opinion that the physical media is still viable, and that the physical media is worth more than the digital media.
I've also stated that digital music is good for music that we want to listen to, but perhaps not own. It's also good for speed. Say you're heading off for a long flight in the morning and you want some new music, MP3 player and a good download service will be good here.
Let me elaborate on the first category though; I like rock music, but I'm not a fan of certain bands, however, I do want to have the songs in my catalogue, but I don't care about the albums on my shelf. Led Zeppelin is one such. They are a rock giant, a legend, classic! But I'm not sure I'd go out and go "Oooh, look, bargain Led Zep album", but I could turn the volume up if my random playlist would chuck it up.

Aaaanyhoo.

Without much fuzz, Amazon's UK MP3 service has launched. I thought it was going to be "the usual rubbish", i.e MP3 files (goood!!!) but priced at £7.99 or so. I was quite sure I wouldn't be interested. But I was wrong! Albums start at £3 (that's three pounds zero pence only). But I thought those £3 albums would be rubbish indie type music that I gladly never heard of, and gladly never would have to hear of... I was wrong! Amazing! It's not the best music that's that cheap, but I did found some stuff worthy of buying.

... Including three Led Zeppelin Albums... Led Zeppelin, Led Zeppelin III and Led Zeppelin IV. Sweet... three albums for £9, and they've downloaded whilst I've typed this! My ISP won't like that, but we're moving on anyway.

Goforth and download!

Oh, and if you live in Finland you might try my friends MP3 Download shop; Meteli.net/Downloads. Sadly these guys aren't big enough to push the prices down to the Amazon level, but they deserve support (to grow and to then push the prices down!)

Migrating from Eclipse Internet ADSL

We've had it. When we joined Eclipse Internet they had a fairly cool Internet Usage policy. It basically stated that during peak hours, 09:00 to 18:00 you should not abuse the bandwidth usage, other hours they didn't "give a toss". This changed to that the peak hours were capped to a certain bandwidth per month. 20GB in our product's case.
Then they decided to change peak hours to 09:00 to 23:00. This means, that during my waking hours (which are pretty much 90% of the Eclipse peak hours), our whole house hold is restricted to use 20GB per month. If I'm saying that we have 5 computers running, and we're two persons, of one who works form home all the time, using the computer most of the time, then you'll see that this is a very slim allowance.
Let's assume that every computer needs 500MB of updates per month. That leaves us with 17.5GB of free usage per month. Spread out per day that's about 580MB per day.
I know that my girlfriend isn't a very high-bandwidth-user, but she does enjoy some YouTube clips and other such things that most of us "click about".
I'm not a very high-bandwidth-user either, but I do tend to consume when I'm awake. You see, I like to listen to Absolute Classic Rock, use Last.fm, and YouTube too, but I also have huge IMAP mailboxes that are online too, not to mention my chat software. But not only that, I tend to download trial software and screencasts associated with that. Add to this that I host some smaller sites on my network, which means that you might be accessing my ADSL without even knowing it. Now you don't have to do much math to see that the 580MB per day is quickly consumed.
In the future, I would like to add to my consumption streaming video, something like Apple TV or the Blockbuster box. This would pretty much kill my usage dead. One HD movie twice a month and almost no other usage... no thanks.

This all lead us to looking into switching and when we once again got an "Amber status" and the net was down for 2 hours today (from 9am sharp to 11am sharp - coincidence?!?!) it was time to make a move. I logged into the control panel, and there it was the "MAC Code [request]"-link. That link only took me to a page trying to explain to me why I should stay, and then it asked me to ring them. Fxxkers! Then I tried to open up a support ticket stating that I wanted my MAC code. Before I clicked submit there was a fairly rude message telling me again to ring them or to write them a letter at the specified address, and the text "No other means of communication will be accepted" - they are deliberately making it difficult to migrate away from them. I left them an arsy complaint about the difficulties of reaching them and then I rang them up.
Funnily the first option on their "selection menu" is "If you want to migrate away, press one". I got through to a nice lady who asked me why I wanted to move. I stated that 9am to 11pm is when I'm awake and that that's when I want to use my Internet, and she suggested using a download manager. I stated I didn't want to listen to Internet radio when I was asleep, nor would I update my computers when I am sleeping.

Goodbye and good riddance! Eclipse Internet does not understand Internet Bandwidth Consumption. I hope you run out of customers, because this is not a way to treat customers.