Zynapse Is Out
by Jim Myhrberg – tags: , , ,

So I finally bit off my own sense of perfection in regards to my Zynapse web-development framework for PHP5 which I started developing in 2007. It was never perfect, never ready, so I never released.

Now after close to two years of hardly working on it, and doing most things with Ruby on Rails, I've decided to push it up on GitHub as is.

So check out Zynapse on GitHub if you're interested.

Comments

Built-in Sudo for Ruby Command-Line Tools
by Jim Myhrberg – tags: , , ,

I was looking through my gists today on GitHub, and decided I'd do a couple of posts on some of the pieces of code I've put up there. The first of which is the sudome Ruby method.

Ever written a command-line tool in Ruby that requires root access for one reason or another? The simplest way to achieve this is to have the end user call the command via sudo. It's not the most elegant solution there is, but it works.

A more elegant solution might be what the Fink Project is doing with their fink command. It doesn't need to be run via sudo, as it calls it within itself. Meaning that when you run fink, you'll be prompted to type your password, just as if you had used sudo. Some might argue that this is not good practice, and they are probably right. But it all depends on the details of what you're doing.

A while back I was working on something which the best solution was to make sure the tool always runs as root. To get identical functionality as Fink, I wrote the very simple method shown below:

def sudome
  if ENV["USER"] != "root"
    exec("sudo #{ENV['_']} #{ARGV.join(' ')}")
  end
end

Simply call sudome as early as possible in your code. If needed it will re-run your script with sudo, requiring the user to type his password, at which point your script then has full root access to the system.

» Original Gist on GitHub

Comments

JavaScript Performance Wars
by Jim Myhrberg – tags: , , ,

Is the difference between Chrome's V8 engine, and WebKit's SquirrelFish Extreme (SFX for short) significant enough that we need to care if we use Chrome or Safari/WebKit?

After some quick Googling for recent posts and comparisons of V8 and SFX, it seems nobody has bothered doing any comparisons after late 2008. Maybe I'm just completely outta the game, and the performance of the two engines is now common knowledge. If that's the case, it's knowledge I sure don't have.

I set out to do a quick (and unscientific) performance test between the latest released beta/development build of Chrome, and the latest WebKit nightly. I decided to use SunSpider as it's still highly respected from what I know, and a test only takes 2-4 minutes instead of 15 minutes with Dromaeo. For good measure I also threw in the latest alpha build of Opera, and the latest shipping versions of Safari and Firefox.

The Results

SunSpider Results

I don't know about you, but a 4.6 ms difference between Chrome and WebKit is something I really don't care about. I don't even care about the 54.6 ms difference between Chrome and the latest shipping version of Safari. Specially not since I've been using WebKit nightlies the past 8 months with no more or less issues and/or crashes than with the standard Safari release.

Something that did grab my attention however was how well Opera 10.50 Alpha did with it's new Carakan JavaScript engine. With that said, Carakan was eating about 80-90% CPU time during the tests, while all other browsers only used about 30%. Firefox's TraceMonkey engine was unsurprisingly the slowest.

I'm looking forward to see what Opera does over the next couple of years with their desktop browser. Both in terms of performance, and in terms of page rendering. If you're following me on Twitter, you may know that from a web designer's point of view, I've had more issues and headaches with Firefox 3 lately than with Opera 10.

Detailed Results

I ran all tests with a freshly relaunched browser, with no pages open aside from SunSpider. The test system was my 2007 MacBook Pro with a 2.4GHz Core 2 Duo processor and 4GB Ram running Mac OS X 10.6.2.

Below is a list of the specific browser versions I used, and the detailed SunSpider results.

Don't take my findings too seriously however, cause I didn't have time to do multiple repetitive tests, rebooting the system between tests, or really much of anything to properly ensure the tests are 100% accurate. If you need seriously accurate numbers, run the tests yourself.

Comments

To Caffeinate, Or Not To Caffeinate?
by Jim Myhrberg – tags: ,

I used to be a caffeine junkie. My caffeinated poison of choice was Coke, the legal kind, not the illegal one.

When I say I was a junkie, I don't use those words lightly. At most, I was drinking about 3-4 liters per day. I kid you not. On average though it was around 1.5 liters per day, seven days a week, 365 days a year. The recommended liquid intake per day for adults is 2 liters (of water). This had been going on roughly since I was 16 or 17 years old, or 7-8 years ago.

Why Caffeinate?

I drank Coke for two reasons. Firstly cause I loved the taste of it. Secondly, and most importantly, cause the caffeine and sugar gave me energy. Being a developer, I spend all my time on the computer thinking a gazillion different thoughts at the same time all day long. Thanks to this, my brain eats up enormous amounts of glucose (sugar), and Coke is the perfect counter agent for this, as it contains both sugar and caffeine.

Also, I never really sleep a full night's sleep, so I'm always tired throughout the day. If I didn't have any Coke in the morning though, or there was a too long gap between one glass and the next, I'd get extremely tired, to the point of almost dosing off and not being able to get much work done. So I'd have another glass of Coke to counter these deep swings in my alertness.

Going Cold Turkey

So let's jump to last spring, April 16th 2009 to be exact. While on a road trip, I decided to stop drinking Coke, cold turkey style. Originally I wanted to do it over the weekend just to see how I'd feel without any caffeine in my system. Which was something I hadn't experienced for years. I was honestly a little surprised that after being a bit more tired than normal the first day, I was fine the second day.

The Withdrawal

After the weekend ended, I kept away from caffeine, and around day three or four, I started getting light headaches multiple times per day, everyday. And I never have headaches, except for when I'm dead sick with some flu so I can hardly stand on my own two feet. So I figured that the headaches were from caffeine withdrawal. According to Wikipedia, withdrawal symptoms can last for one to five days. My headaches didn't let up for about two weeks.

The Aftermath

I didn't drink a single drop of caffeine of any form for the next two months. And since then, it's a rare event which generally only happens when I go to the cinema and buy popcorn and Coke for the movie. I generally feel better, I think. I'm still generally tired throughout the day cause I don't get enough sleep, but I never get the deep end energy swings I used to get if I didn't have any Coke for a while.

My wallet is also feeling healthier. I used to spend between 50 to 100 EUR on Coke every month, now that money is going to paying my cell phone bill instead.

Conclusion

I don't need caffeine. I wanted to quit drinking caffeine cause I was curious. I knew it couldn't be that good for me to keep drinking as much Coke as I was, and it was kinda expensive as well.

If you do consume a lot of caffeine, I'd suggest you try quitting cold turkey style for a week – or even just a weekend – to see how you feel without it. Cause chances are, that you can at the very least save a decent pile of cash over the course of a year or so, without feeling any worse than we all naturally do in our fragile human condition.

P.S.

I bought a bottle of Coke the other day, cause I felt like having some. After half a glass, I realized that I don't really like the taste of it anymore. So this bottle will probably sit in my fridge indefinitely, and might be the last bottle I ever buy for myself.

Ten months after quitting Coca Cola, I don't like the taste anymore. It's lame, but for me it's a pretty big event, as I used to consider Coke the best tasting thing on the planet in liquid form.

Comments

Was I Really “That” Social?
by Jim Myhrberg – tags: , ,

As some of you might have noticed the last couple of days, I haven't been online much on IM networks. I'm not sure what originally kept me from launching Adium the other day, but along the way I've come to a realization.

The Problem

I realized that IM has been taking up way too much of my time, and constantly distracting me from both work and personal matters. You just can't hide from the tsunami of Growl notifications, bouncing and flashing Dock icons, plinging sounds, and more that almost all IM clients spew out in one form or another whenever you receive a message.

A friend of mine gave up on IM networks almost a year ago, for pretty much same reasons. — Yes, I'm linking to Sugarenia again. She always seems to have the same opinions as me, just days/months before me. Dammit!

The Solution

Unfortunately I couldn't bring myself to completely disconnect from IM networks, so I took a slightly different approach than Sugarenia. I've gone out of my way to make sure my IM client — Adium of course — doesn't notify me via Growl, Dock icon, sound, telepathy, or even alien abduction. This means, I'm online, I can chat, but unless I manually switch to the space/virtual-desktop where my IM client sets up camp, I don't even know if I have any new messages.

After a couple of days, I have to say it's a quite nice change. I only get distracted when I choose to check if there are any IM messages to respond to.

So now you know why it might take me 8 hours to respond to a chat message. I simply didn't want to check for new messages, or I completely forgot cause I was hopefully working along all excited on my next attempt at building an awesome online service which will hopefully pay my rent, and maybe even food.

Comments

About That “Pad” Thing
by Jim Myhrberg – tags: , ,

So I was gonna write a post with my opinions about the iPad, but a cup of tea and staring at wall of wet paint is almost more tempting. If you don't get why the iPad is important, and why it will succeed, I'm not even gonna try convincing you otherwise, time will just prove you wrong and make you feel stupid.

By this point you're then thinking “What the fuck is this post about then?”. Sugarenia just wrote up a quick rant regarding her opinions on the iPad, which pretty much sums up my own opinions to the letter. Only she's written and explained herself much better than I most likely would have.

The iPad is not made for you and me, fellow geek. It’s primarily targeted to people that are still afraid of interacting with PCs, those that don’t have a clue about drivers and web apps and Wi-Fi setup. And this is exactly the kind of people that won’t buy a Linux netbook, dear Open Source zealots – because as much as Ubuntu has made Linux user-friendly, there’s still much filling that shows between the seams.

Read the full article, please.

Update: I just noticed a post by another friend of mine which is also good:

I think the main reason why self-described geeks are throwing a fit over the iPad is that it's a shiny new toy that's not meant for them.

Read the full article.

Update 2: Seems using Jekyll can have some downsides. I accidentally named the file for this post 2010-05-06-[...].md without noticing that it was labeled as posted “06 May”. I've corrected it, but the permalink to this post has changed. *facepalm*

Comments

New Avatar, Same Old Fugly Face
by Jim Myhrberg – tags:

Today marks the day I update my online avatar/profile picture. I've had the same sepia colored half-face avatar for 4 or 5 years now. So it was about time for a change. However, the biggest reason I changed it, was cause I cut my hair short in November, after having long hair for about 10 years.

But why the heck am I blogging about it? Cause I wanted to have an excuse to add Fancybox to my newly redesigned site. And the previous post was looking lonely after two days in solitary here.

So without further ado, I present my old and my new avatar in complete Fancybox glory with fading animations and all. If you're reading this in a feed reader, click here (if you're really bored).

Old Avatar: jimeh 1.0 (2005) New Avatar: jimeh 2.0 (2010)

Because I'm a perfectionist and decent bit insane, here's the 50x50 pixel versions too, so you can see how they both look in really small sizes, which is the most common size they appear in on different sites anyway.

Old Avatar: jimeh 1.0 (2005) New Avatar: jimeh 2.0 (2010)

And incase you're wondering, I'm 18 or 19 in the old photo, and 24 in the new one. If I shave though I can easily fool people into believing that I'm 17. In fact, some people think I am 17 :P... I guess I'll appreciate it more when I'm 30-40 and people think I'm 26, hehe.

Comments

Automated Profile Picture Update Service?
by Jim Myhrberg – tags: , ,

After I updated my profile picture today, a friend of mine responded with:

Build a service that changes your profile picture in all social networks!

He also didn't like the new profile picture, but that's his problem. My first response was fuck off “Gravatar?”. Obviously he didn't mean Gravatar, I just mentioned it to annoy him.

A service which automagically just updates your Facebook, Twitter, Flickr, YouTube, Vimeo, Gravatar, ... profile pictures would be quite cool. Thinking about it a bit more, there are three problems with building such a service:

  • A lot of these sites you will need to crawl programmatically using some kind of web-crawler library. It will be a pain to write, and even bigger pain whenever they change anything in the HTML layout of their pages.
  • Some sites have specific and/or strange restrictions for image dimensions, file size, and even file format.
  • Will people actually trust such a service with passwords for all of their online social networking accounts?

The later problem, trust, is definitely the biggest one. And I'm not sure you could overcome it unless the service is officially sponsored and/or operated by Google or somebody. I do think it could be a fun project to undertake, but I think it's pretty doomed right from the start unfortunately. Although if I updated my profile pictures more than once every 4-5 years, I might just build a prototype for myself at least.

Comments

← older newer → archive
rss