Mikael's blog

A developers seventh time trying to maintain a blog

Cleaning up

I’m starting to have quite a few views in CouchDB and I’ve done my best to name them in a logical way so that I can easily see what they do by reading their names. Today I created a couple of new views and I decided that I needed to rename some old ones for clarity. Just when I was about to hit ‘Save’ on one of my design documents I felt a cold shiver going down my spine. I stopped and thought about it for a second and I realized that I don’t have a separate database for my development environment, nor do I want to have one.

This made me take a different strategy. At the moment I have a lot of views that does the same thing but are named differently. That’s because I created new views, with better names, instead of removing the old ones. I will remove the old ones after I’m done making sure that the development environment only uses the new views. That way I (hopefully) won’t break my production environment all of a sudden.

by Mikael Lofjärd

Hope

I was very happy when I saw this the other day.

I knew it was bound to happen, but for it to happen so soon was a nice surprise. Hopefully the ROM for the Galaxy Tab 8.9 won’t be far behind.

Samsung recently hired the founder of CyanogenMod, Steve Kondik, and since Samsung tends to take some time releasing their own ROMs, this seems like a nice way to speed things up at least for rooted Samsung device owners.

I’m really looking forward to using client certificates on my tablet.

Someone also managed to cram ICS onto his G1 today.

Now that’s impressive. This bodes well for my not-as-aging-as-a-G1 HTC Desire. It will be interesting to see if it can run Android 4.0 in any usable way.

by Mikael Lofjärd

Stupid admin

Sometimes I go to bed at night with an open ssh session running the server in the foreground. If that times out, so does the server. I really need to pay more attention to what I’m doing.

Sorry about the down-time… *ashamed*

by Mikael Lofjärd

Overhaulin'

Tomorrow (actually today when I write this) my daughters day care is closed and I get to spend the day with her at home. That meant that I could stay up late tonight and do some work on the blog.

The last few days I’ve felt that the file sizes were beginning to get out of hand. This easily happens when you’re writing JavaScript since it’s kind of a cowboy language. I love that I am able to twist and bend the language to my will, but the same thing that makes JavaScript so powerful can also be its worst enemy. It’s way to easy to loose control of yourself and before you know it you end up with a 1000-lines-of-code monster file and your head starts spinning every time you want to make a change to it.

So today I rewrote the blog. Not all of the logic, but basically all of the architectural stuff, and I’m quite pleased with the result. I’m going to write some more tomorrow (or later this afternoon, depending on your point of view) about what I’ve done and a bit on architectural patterns in JavaScript in general.

I was really excited about writing about it right now, but I need to get to bed now.

by Mikael Lofjärd

Programming Flu

This weekend I’ve been at home with some kind of wierd illness. At first I thought it was angina bacterial tonsillitis since that’s what my daughter came down with right before I left for Øredev. But now I’m thinking it’s something viral. Not in the Internet pretty-pictures-of-kittens way but an actual virus.

I’ve been having some fever but it hasn’t been that serious and my throat has been really soar, but it never really took of the way my daughters angina tonsillitis did.

However, I’ve been totally knocked down by it. I spend half the day in bed and the other half knocked out on the couch. So far it doesn’t sound all that different from my normal weekends but trust me, it’s different.

I’ve decided to name this illness “Programming flu”. What this programming flu does is take away all of your creativity. I’ve been staring at my blog this whole weekend without having the slightest idea of what to write about.

I usually have 5-6 things I wanna try out and at least one of them usually gets done and then written about. These are some of the things I planned to do this weekend:

  • Finish coding the administration interface for the blog
  • Try out some new layout stuff on the blog (maybe a side bar)
  • Get my new USB server hooked up with my Tellstick
  • Write some software to control my lighting and home theater equipment
  • Continue working on SplitCode for my next Tuesday tutorial at work

I’ve managed to get half way through the first one. In fact this is the first post written in the blog’s administration interface instead of in Couch’s.

But every time I’ve sat at the computer thinking of getting started on one of the other things and then blog about it, something keeps making me do something else. Programming flu is not fun.

I’m still not well so I’m calling in sick tomorrow. But my wife is going to work tomorrow and my daughter has day care so I’m hoping my programming flu will have eased off a bit tomorrow so I can finally get some work done. Hopefully there will be some code for you by tomorrow evening.

UPDATE: Some people pointed out the fact that angina probably wasn’t the transalation I was looking for and that what I really meant was tonsillitis. Never trust the first translation dictionary you find on the web.

by Mikael Lofjärd

Oh Crap!

I just realized that comments had stopped working. I had forgotten to upload the new JavaScript file with the SyntaxHighlighter code removed after I implemented it server-side. Silly me.

Comments are now working again.

by Mikael Lofjärd

WiFi Channel 13 and Android 2.x

A friend of mine told me about how a program called inSSIDer helped him get better performance from his wireless network at home. A few days ago I decided to try it out.

inSSIDer is this nifty little profiling tool that allows you to see visually all the wireless networks in your vicinity, what their signal strengths are and what channels they’re occupying.

It turns out I have a 14(!) networks interfering with mine. The best way to minimize interference is of course to use another channel. The problem is that 802.11g/n networks use approx. 20 MHz of bandwith and the 13 channels allowed (only 11 in the States/Canada) are spaced only 5 MHz apart.

802.11b networks used approx. 30 MHz of bandwidth which in turn made room for only 3 non-overlapping channels in the spectrum (1, 6 and 11). There aren’t that many 802.11b devices left nowadays so in reality we could have 4 non-overlapping channels in europe (1, 5, 9 and 13) but all networking hardware is made in Asia and made for the world market so most wireless routers come with a default to channel 1, 6 or 11.

This turned out to be the case in my neighbourhood to. 4 networks fought over channel 1, 8 networks (including mine) fought over channel 6 and one luncky bastard had channel 11 all to himself. I decided to use channel 13 since it had the least amount of overlap with anyone.

Now normally all your devices just switch to the new channel automatically, but for some reason my Android phone couldn’t find my network anymore.

A quick google lookup the next day led me a “hidden” settings menu.
Settings -> Wireless & network settings -> Wi-Fi settings -> Press menu-button -> Advanced -> Regulatory domain -> 13 channels

I don’t know if it was set to 11 channels for international compliance or if it was my CyanogenMod 7.1 installation that set it to 11 channels by default, but now it works like a charm on channel 13.

by Mikael Lofjärd

Coding on stage

I held a tutorial on HTML5 today at work and my preparations led me to think about coding while doing a presentation. This was done a lot at Øredev, but everyone did it in the same two ways. Either you duplicate your screen and let your attendees see everything that goes on on your desktop, or you extend your desktop, keeping your notes on the computer screen and your code on the projector.

The problem with the first option is that you need to have your notes on paper. The problem with the second option is the strain it puts on your neck when you have to look at the projector while coding and at the same time facing the attendees.

What I wanted was a window on my desktop that I could write code in and another window on the extended projector screen that would show the code in realtime while I was typing it.

“To the google-mobile batman!”
As usual someone has already done it, but only on Mac.

I’m a Windows person most days so that wouldn’t work for me. I decided to write my own. The first prototype, which I used today with some success, was a web page with two big textarea-elements which I dragged out across both screens. I wrote in the one on my computer screen and it replicated the text on the other textarea on the projector. It worked but it wasn’t pretty.

Enter node.js and socket.io

This is what I will try tonight: a kind of server/master/slave solution with socket.io/node.js on the server side and html/socket.io in the clients. This will allow me to have separate windows and even separate computers if I want to.

Stay tuned for my failure/success story tomorrow.

by Mikael Lofjärd

The Archive

While looking at my Google Analytics statistics I noticed that my empty archive page had almost as many hits as the front page.

And so, with little to loose, I set out to create a dynamic archive.

Now I don’t even have paging on my front page yet, but since this is my 10th post I really should make that my next priority.

by Mikael Lofjärd

Bring in the spammers!

And the blogger said; “Let there be comments!”, and he saw that it was good.

I just finished a first ‘draft’ of a commenting system. Please don’t abuse it.

by Mikael Lofjärd

Sorry, sharing is not available as a feature in your browser.

You can share the link to the page if you want!

URL