Archive for 2008/07

Favicon

I’ve added a favicon to the domain. It was a lot simpler than I thought it would be :)

W3C How to

RSS Subscriber

I’ve never gotten into the whole RSS subscription trend until recently. The main reason for this being the lack of a decent notifier when the feed is updated.

When I released my photo site I decided to add a couple of feeds to it and with that I also decided to find my self a decent application to subscribe to them (yes, I do subscribe to a bunch of my own feeds so that I get notified when people comment on my work :) ).

I didn’t want a standalone application since it means yet one more item in the taskbar och somewhere else consuming memory and precious CPU so I started looking for FireFox plugins. It didn’t take me long to find a couple of plugins and one in particular looked interesting so I installed it and now, after a couple of weeks, I love it. Easy to use, just enough configuration and very easy to add new feeds once you have it setup the way you want it. The plugin? Brief. Try it out :)

Javascript debugging in Internet Explorer

Javascript debugging has been a tedious task for a very long time. Then, suddenly, FireBug came and made it simple.
With logging, variable dumps and linked errors it became quick and painless to debug your faulty javascript, as long as you use FireFox.

I use FireFox all the time but everyone who has written javascript sometime knows that even though a script may work flawless in one browser it can crash in another and when the other browser in Internet Explorer you’ve basically been fcked. The debug output IE gives for javascript errors is worthless at best and leaves you second guessing what line might have caused the problem. The only way to find out for sure is to alert-debug the script until you find the right row, if you’re lucky.

Today was a big day though. I’ve finally found the perfect tool to debug javascript, not only in FireFox but in any browser from IE to Safari and the name of it is … *drumwhirl*… FireBug Lite!

Yes it’s true! FireBug acctually has a light version in Javascript that gives you most of the tools of the FireFox plugin. What a tremendous little treat for us front end developers. Happy days!

Mobile (d)evolution?

Ericsson announced their results so far this year and their stock dropped quite a bit because the market was expecting more. I heard an interview with Carl-Henric Svanberg where he explained the main reason why the results aren’t as good as they used to be. He claimed that people simply aren’t buying as many mobile phones now as they did in the 90s because everyone already has a phone today. This might sound as a very good reason, it can even make sense unless you dig a little deeper into the current situation.

The truth isn’t quite as simple as just saying that people no longer have the need to buy a new phone. The statement in itself is true, I’m not arguing that, but with this fact in mind you as a company have to address the issue and this is the point where it gets interesting.

A quick search on the big mobile phone producers websites will let you see pictures and information about most of their newest phones as well as some of the older models. What strikes me as quite strange is the lack of innovation in these phones. In essence, Ericssons newest mobile phone is the same phone they released 2 years ago. It looks pretty much the same way, the hardware has been slightly upgraded and the user interface has been remodeled with new icons. Ericsson isn’t the only company where things look like this. You’ll notice the exact same trend with Nokia or any other large mobile phone producer. In fact, I dare to say, without having looked at them all, that Apples iPhone is the only innovative mobile phone in 5 years, maybe even more. That’s one phone amongst the hundreds that has been released over the past years.

Sony Ericsson has been using the same idea for a long time now. They have their 4-axis stick, or sometimes a square button which you can push in four different places, the phone profiles look pretty much the same and the user interface, horrible as it is, haven’t changed much in years. The same goes for Nokia, actually, I could cut and paste the above text to describe Nokias phones. Not even Samsungs new “touch” buttons impress me because they are still nothing but buttons.

Sure, they are giving us more juice in the phones. Nowadays we have a 5 MP camera and several gigabytes or memory. Some phones have built in WLAN and GPS. The list goes on, they are indeed upgrading the phones all the time, supplying us with more and improved features for every release. The mobile phone isn’t just a phone anymore, it’s a slimmed laptop. But what difference does the 3 or 5 MP camera do when the phones lack the ability do supply you with a usable interface because this is really what I’m talking about.

Navigating in the menus of a Nokia, Sony Ericsson, Samsung or whatever other brand there is is always the same tedious chore. They all look alike and function alike. And they all share the same short comings. You can compare this to the one phone I previously mentioned as innovative: Apples iPhone. Here’s a user interface that’s usable. It’s innovative and simple, you’ll learn how to use it in a matter of minutes. Of course it’s far from perfect but perfection isn’t something anyone should strive for because once you get there you’ve reached the top with nowhere to go but down and what fun is that?

I’d like to make a comparison here to really highlight the issue and my point here: Mobile Phone User Interfaces and the WWW. I work with the web on a daily basis and I am especially fond of building User Interfaces that doesn’t only look good but also usable.

If we go back 5 years and look at where the web was at the time and compare that to where the web is today and where it is going you’ll see a rapid evolution towards rich applications with the user in focus. You no longer build your websites to inform your customers, users or whoever might visit your site. You build your website to give them an experience they want to come back to, again and again and when you really compare today’s web with the one we had a few years ago the change is stunning. Or at least the potential is.

The same comparison on the mobile phone market isn’t quite as exiting. It takes about one minute to see that the User Interface in today’s mobile phones are the same as a couple of years ago. They have improved the graphics, given us a few more options so that we can configure the new hardware but in essence it’s the same UI. And it sucks.

I wonder how long it will take companies such as Sony Ericsson to realize that the problem with decreasing sales doesn’t lie with the fact that people no longer have the need to purchase a new phone. No, it’s because the new phones are the same as their old phone. It’s simply not worth the money to spend on such small updates because they are simply not exiting enough. Apple managed to create a great hype around the iPhone and it wasn’t the hardware that did that. It was the UI. It was the feeling of something new, something cool, an experience in your pocket. Unless the others catch on soon they’re going to be in for some dark years on the market.

PHP: sprintf and %

sprintf is very often used in conjunction with mysql_real_escape_string to create secure MySQL queries with user embedded user input. I myself use this technique all the time and have found a very good and comfortable solution to work with.

The other day I stumbled across an interesting problem. Every now and then you tend to write MySQL queries with the ‘LIKE’ command:

mysql_query("SELECT field FROM table WHERE field LIKE '%keyword%'");

With the sprintf this would translate into:

$sKeyWord = 'keyword';
mysql_query(sprintf("SELECT field FROM table WHERE field LIKE '%%s%'", array($sKeyWord));

The code written above wouldn’t work. The ‘%’ is sprintf’s indicator that ‘here comes something that I should replace with something else’. It makes sense that my piece of code above would fail since I have 3x% and only one literal to describe the type of input.

I’d never run into this before so I opened the PHP manual to look for the proper syntax to tell sprintf that I actually want the ‘%’ to be interpreted as a ‘%’ and nothing else. Would you believe I didn’t find an answer? Well, I didn’t.
When PHP.net failed me I went to Google and came up empty once again. I figured it was a bit weird but I began wokring on the last resort for developers: trial & error.

After a lot of frustration and soul searching I found the answer to my question and, of course, it was so simple that it took me some time to think of it:

$sKeyWord = 'keyword';
mysql_query(sprintf("SELECT field FROM table WHERE field LIKE '%%%s%%'", array($sKeyWord));

The solution is to type the ‘%’ twice such as ‘%%’ so the snippet above did the trick. Hopefully this post might save someone else some time, or maybe I’m just that stupid, I don’t know.

PS. The answer to the problem can be found on PHP.net but only if you look hard enough and know what you’re looking for, I didn’t so I missed it.

The Bleeding – Unplugged

A good song and this guy really knows what he’s doing with that guitar :)

Haven’t I Written This Post Before?

We are this bad. 0-0 against FC Flora on our “home” turf. It’s magic. It’s miraculous. It’s damned pathetic. We wouldn’t manage the swedish second league the way we play now. We don’t deserve to win, we don’t deserve anything at all really.

We had two players on field that at least acted like they wanted to win: Jan “Golden Shower” Tauer and Sebastian “Raja” Rajalakso. They put up a fight against Flora but two players can only do so much. And even though they did put up a fight I wouldn’t give them any other judgement than passable in this game.

It’s been looking like this for quite some time now. We haven’t won a game since may 1st and the players are in a dark place right now. They don’t seem to believe in themselves and their self confidence has fled the field. I don’t honestly think we don’t have the expertise to beat Flora, or most of the teams in Allsvenskan for that matter but something is terribly wrong. We can’t blame it on poor form and we can’t blame it on the referees or anyone else. The problem is within the team and someone really needs to address that problem quickly or we won’t be playing in Allsvenskan next year.

Sorry Siggi, but I think you’ll be the first attempt to a solution to the problem. You should start looking for a new job.

Time to Cut Down?

SYDNEY (Reuters) – An Australian man convicted of his seventh drink-driving charge was spending about A$1,000 ($972) a week on beer — enough to buy more than 2,500 small bottles a month, a newspaper said Tuesday.

The heartbroken construction worker began drowning his sorrows after breaking up with his partner five years ago, the Northern Territory News said, quoting his defense lawyer as telling a court in Australia’s remote, tropical north.

The magistrate declined to jail the father of four, Michael Leary, noting he had quit drinking since his latest arrest, but he banned Leary from buying or even holding a beer for 12 months.

The magistrate also poked fun at Leary’s favorite beer, Melbourne Bitter, in a part of the country where drinkers can be as loyal to beer brands as they are to football teams.

“(That is) poor judgment on two counts there — drinking that much and drinking Melbourne Bitter,” magistrate Vince Luppino was quoted as saying.

Source

Härigt citat à la Vivi

Elin: Det låter så läskigt
Vivi: Det är bara för att han gör ljud ifrån sig

Om när Lucifer försöker hosta hårboll. No shit…

My New Ray-Bans

I lost my Ray-Bans in Australia after more than five years of companionship. I really liked them and I’ve been searching for a new pair of sun glasses since then but haven’t found a pair that I like, until now.

I was in Farsta yesterday and visited the two big stores that have sun glasses but again without luck. Then I saw a small store which I’ve never noticed before and figured I should try my luck there, you never know. So I went in and … there they were. I wouldn’t say they look as nice as my last pair but no sun glasses ever will.

They still look very good, they are Ray-Bans, which I have grew accustomed to, they have polarized glass and they cost way too much money. See for your self

« Previous Entries   Next Page »

10 Most Recent Twits

Loading twits...