The day I got smart…

I still remember the day I wanted to throw my old mobile phone in the river. It’s funny story now, but it was not so funny then. It was really early in the morning, I was running near the river, listening to music on my phone, and enjoying the scenery. The sun was about to rise and I saw two beautiful swans dancing on the river. I stopped to take a picture, but the phone froze. No music, no picture, no anything. It took me few minutes to make it work again, but in the meanwhile swans flew away. I was so cross with the phone that I wanted to throw it into water. This ‘freezing accident’ was just a tip of an iceberg. My old phone had Symbian on it, but a lot of people switched to smart phones already. There were tons of cool applications for smarties, but almost none for Symbian. I really wanted to finally use this new Foursquare app!

Of course I didn’t throw the old one in the river, I got smart instead. Shiny black display greeted me on a hot summer day. My precious. I named it SparkPhone.

To be honest – I had good times with my old phone, too. Photos are worth a gazillion words:

Smart phone is not the only gadget I own and use regularly. Please welcome to the family one Kindle, two iPods, one powerful Polar RS300X ( sports watch on steroids, one Olympus dictaphone and one notebook. Which one is the favorite one?

Well, when I think of my gadgets I must say that mobile phone has always been my best friend and my worst enemy: it is the instrument for capturing the beauty of spontaneous moments (check the photos below), it was the weapon of love for announcing the (foreseen but premature) break-up, it connects me to the world when I need it, it captures my creative flashes, stores my forget-me-not-notes…

… oh, yes, and I can make/take phone calls with it.

Every friendship is booby trapped and this one is no exception. Gadgets, especially the new ones, have the tendency to enslave their owners. I’m aware of this and that’s why I don’t use it 24/7. I could go on and on about this, but I have to go now and play with my SparkPhone.

Catch me if you can: uncaught TypeError undefined, Twitter bootstrap and LODGrefine

While thinking about a presentation I’m preparing for SemTech2012 conference I noticed that LODGrefine is… a bit dry in appearance.

Fact #1: LODGrefine needs a face-lift.
Fact #2: Twitter bootstrap is super simple eyecandy magic available to the (web) masses.
Fact #3: sometimes errors are not what/where they seem to be.

LODGrefine (LOD-enabled version of Google Refine) client side already uses jQuery, so adding boostrap script was trivial. If you’re not familiar with the Google Refine framework – client-side scripts are located in main/webapp/modules/core/ folder. First I copied bootstrap.js to /externals folder inside /core, which contains other external scripts (hence the name), including  jquery-1.4.2.js. Then I added reference to boostrap.js in main/webapp/modules/core/MOD-INF/controller.js:

ClientSideResourceManager.addPaths(
"index/scripts",
module,
[
"externals/jquery-1.4.2.min.js",
"externals/jquery.cookie.js",
"externals/jquery.eventstack-0.3.js",
"externals/jquery-ui/jquery-ui-1.8.custom.min.js",
"externals/bootstrap/js/bootstrap.js",
...
]
);

At last I changed css classes of buttons to bootstrap button classes and voila! LODGrefine buttons got a new look. Kinda. JavaScript console in Chrome was not so happy about the face-lift, I got this error: “Uncaught TypeError: Object [object Object] has no method ‘on’ in bootstrap.js”. I must admit I didn’t think much about this error (shame on me); I just changed the order of imports in controller.js and forgot about LODGrefine for few days.

Today I noticed boostrap.js is still causing trouble, this time the error was: “Uncaught TypeError undefined is not a function”. Of course I googled it I nailed down the possible causes for this error. The closest one was the order of importing scripts, so I put bootstrap.js after jquery script (again) and … got the first error. I googled it and… you know the drill.

Long story short:  I had to update from jQuery 1.4.2 to the latest version of jQuery. Now everything works just fine. :)

LODGrefine before:

LODGrefine after:

Enhanced by Zemanta