Archive for the 'Development' Category

Why I use vim editor for programming

August 15, 2009

programming in vi

Ever since I ditched “joe” editor, I use “vim” as my main programming editor. Here’s some recent screenshot of developing Rails application.

What I particularly like is the windowing system inside vim. It’s all so close to my fingertips…

Ok, back to coding…

Importing Outlook.nk2 files into Zimbra

August 1, 2009

I’ve just spent 7 hours  trying to import Outlook .nk2 files into Zimbra contacts. It took me great deal of nerves and some unix hackery to get it done. Looking back, it’s seems so simple…

Here’s how I did it:

I used free program called NK2 to get .csv from .nk2.

  • I’ve made two Zimbra accounts and send one test email from one account to another. This way I had one person in my contact list
  • Next I exported this Zimbra contact list (of just one person) into a .csv file (this got me proper .csv structure I knew Zimbra would eat back up)
  • I used NK2 proggy to convert all my Outlook.NK2 files into .csv

Now I had one .csv file from Zimbra and few from Outlook.NK2 files.

All I did was match structure of Outlook’s .csv files with Zimbra one. I wrote small ruby script to do this for me, but you can easily use shell or maybe even Windows batch scripting to do this mundane task for you.

The proper Zimbra .csv file format for importing contacts is this:

“email”,”firstName”,”fullName”,”lastName”,”middleName”

This must be on the first line of your new .csv file (the one you will feed Zimbra with). Below this line is data, structured to match first line description.

I’ve imported 4.500 contacts from 10 different Outlook.nk2 files in about 3 minutes using Zimbra Desktop client.

While I was thinking about how to solve this problem (good 7 hours) my friend was importing .pst files into one Zimbra (open source version) server from 14 different Windows computers – simultaniously.

From what I just saw tonight, I must say kudos to Zimbra! In the last 10 hours it has proved itself as a rock solid platform to host emails on.

And the best part – it just works! Keep pushing, Zimbra team!

I hope I saved you some time with this post. It’s 4.30 am here, I’m off.

One of the best tools in web development

May 22, 2009

While developing web pages, I always check how they look in different browsers. I used to check regularly, after every new addition or change, but found out that it’s a waste of time. Now I develop web page to look great in Firefox and only after that is done, I check how it looks in Safari, Opera and IE. Since I’m developing on Linux, my biggest problem was finding out how my pages looks in various versions of IE.

The far leader in difficulty of proper design is clearly IE. Seems like Opera and Safari are paying more attention to RFC’s, like FF is. One of the tools I find indispensable is this web site: http://ipinfo.info/netrenderer/index.php

What this site allows you to do, is to check in almost real time, how does your web page look like in various versions of IE – from IE 5.5 to IE 8. Just paste your URL at the top of the page and hit Render button. Few seconds later you’ll have your page displayed as it’s seen in IE. This is freaking awsome, if you ask me!

Oh, and the best part – it’s FREE!

Erlang in practice screencasts

February 5, 2009

Few months ago I ordered Erlang in practice screencasts from Pragmatic by Kevin Smith. Watched all six of them (now there’s 8 of them) for at least 3 times. They are absolutely awsome.

It starts slowly explaining how to build message dispatcher, then goes on with adding users so you can send messages to users mailbox instead of id’s. It continues with some code refactoring and unit testing and ends with implementing RESTful messaging trough Mochiweb, connecting Erlang with web.

All in all very educational and easy way to learn Erlang. Hands on and practical. If you’re interested in learning Erlang this screencasts are good investments. Thumbs up Kevin, please keep on recording.

Reblog this post [with Zemanta]

Modeling web store with Smalltalk

January 30, 2009

Last few days I’ve been playing with Aida/Web trying to model a web store. I’ve done this before with RubyOnRails and MySQL so relations and what data should be where is known ground. What was unknown to me is how to represent this in Smalltalk object system. No SQL, only objects.

I’ve started with basic class named Store with sections and items as OrderedCollection’s:

 

Object subclass: #Store
	instanceVariableNames: 'name caption sections items'
	classVariableNames: ''
	poolDictionaries: ''
	category: 'WebStore'

 

Then I’ve added Section, Item and Image classes. The idea is one store can have multiple sections and items. Items can belong to none, one or many sections. All items belongs to the store.

 

Object subclass: #Section
	instanceVariableNames: 'parent name caption items'
	classVariableNames: ''
	poolDictionaries: ''
	category: 'WebStore'

 

 

Object subclass: #Item
	instanceVariableNames: 'parent name caption'
	classVariableNames: ''
	poolDictionaries: ''
	category: 'WebStore'

 

 

Object subclass: #Image
	instanceVariableNames: 'parent name height width content-type caption url'
	classVariableNames: ''
	poolDictionaries: ''
	category: 'WebStore'

 

 
The parent instvar is there for back linking to parent object. This way web store can have nested sections (ie. sections within sections) and items as supplemental to items (ie. item variations on price, design, …). 

With this model setup done I’ve added methods for adding items to web store. First one is addItem: and second one is class method newNamed:

 

addItem: anItem
	self items add: anItem.
	anItem parent: self

 

 

newNamed: aName caption: aCaption
	^self new
		name: aName; caption: aCaption

 

With this in place, basic web store model is done. At first glance this might not seem much better then building SQL relations. It is practically the same except some minor details (primary keys, indices, etc).

What I’m expecting later on is easier updating and managing this model. With growth, model will become more complex. Managing complexity like this should be one of Smalltalk advantages.

Google or Stackoverflow? Macbook or Lenovo?

January 16, 2009

I’ve spent almost 3 hours on stackoverflow today. It’s amazing site if you’re into computers and specially into programming.

Usualy, when coding and needed to look something up, I used google with great success. Lately there’s maybe a bit more noise with lots of sites cross linking answers. It can be annoying, but weeding those out is usualy a snap. I never had an issue I could not find an answer for, or at least pointers in the right direction, on google.

But from what I’ve seen today on stackoverflow just blew me away. For example, I’m looking for cheap notebook for doing web development on. Something with a decent CPU, gig or two of RAM, some 100GB of disk space and usual network accessories (bluetooth, wifi and ethernet). I could simply buy the cheapest Macbook and it wouldn’t be a bad deal. But the thing is, I really like linux. Im using linux for the last 12 years and I really like it. I’m used to do web development on linux and to all the tools availailable. My fingers are fast on the keyboard shortcuts and apt-get is just unbeatable champion for installing and upgrading software on linux.

So I’m looking at Ubuntu (probably 8.10) on Lenovo N500. It comes under $1000 so is the cheapest Macbook. I was just typing the title of the question on stackoverflow and similar, already answered questions, popped up. Few clicks later I’ve found out people are pretty happy with Lenovo laptops running Ubuntu 8.10. So I’ve got my answer. Quick, easy and what matter most to me is quality of answers. Top rated answers are moved up, so you see the best answers immediately. Using google, I would have to click through multiple forums and blogs to get similar answer quality. I think I saved some time.

While I don’t think stackoverflow could beat google (I don’t think this is their intention) in being the place to get the answers for computer related stuff, but you can have your guesses confirmed quite easily. Thumbs up, stackoverflow.

Reblog this post [with Zemanta]