Jan Kubr

Archive for January, 2008|Monthly archive page

If you miss Venture Voice, try this (great podcasts)

In Uncategorized on January 25, 2008 at 14:40

If you are interested in entrepreneurship, you must know the Venture Voice podcast, the best podcast on Earth. Unfortunately there haven’t been many episodes of it lately.  I know the old ones are so good you can go listen to them again, but if you want some fresh stuff, you might try iinovate or From Scratch, both having smart hosts interviewing great people.

Advertisements

A book read: Defensive Design for the Web

In Uncategorized on January 22, 2008 at 21:56

This is a terrible book. After you read it, you’ll feel lousy, lose your self-confidence, and make your to-do list longer than ever. In other words, this book is very useful and contains some great tips.

The authors of the book suggest that you plan for situations when things go wrong on your site. That you should care about the user’s experience even (especially?) in crisis situations. If things go wrong (and it’s far from “they never do”), it is an unpleasant situation for the user, but you have a great chance to show him the way out and make her happy again.

The structure of the book is very simple and straightforward. Each of eight (main) chapters talks about a specific aspect of (almost) every website and contains a few guidelines on what the most common mistakes are and how to correct them. Each guideline is accompanied by examples of site that follow the guideline and those that don’t. These chapters talk about:

  1. Displaying obvious error messages and alerts
  2. Providing clear instructions
  3. Creating friendly forms that are easy to complete
  4. Overcoming missing pages, images, or plug-ins
  5. Offering help that’s actually helpful
  6. Eliminating obstacles to conversion (e.g. unnecessary ads, registration, navigation etc.)
  7. Delivering the rights results with smart search engine assistance
  8. Making sure unavailable items don’t become dead ends

If you don’t feel bad enough after all this, you have the chance to take a Contingency Design Test in the next chapter which will help you evaluate your site. If just by any chance it doesn’t turn out that good, the next chapter contains some great tips on how to make “error recovery and prevention part of your long term design process.”

And this book is even a quick read! Recommended.

Do you check your work e-mail at home?

In Uncategorized on January 19, 2008 at 10:50

Having read the Freedom = Success article I pointed to, I continued with an NYT article about “falling-down professions.” I especially liked this part of it:

“Especially among young people, professional status is now inextricably linked to ideas of flexibility and creativity, concepts alien to seemingly everyone but art students even a generation ago.

‘There used to be this idea of having a separate work self and home self,’ he said. ‘Now they just want to be themselves.’ “

My dream has always been not to have the work and “real” lives too separated. I mean you spent one third of your life working, so does it make any sense to detach it from the other third you’re awake? It’s just weird, I am one person, not two. This is what Paul Graham has to say on this topic in his Why to Not Not Start a Startup:

“The thing that really sucks about having a regular job is the expectation that you’re supposed to be there at certain times.

(…)

In a startup, you skip all that. There’s no concept of office hours in most startups. Work and life just get mixed together. But the good thing about that is that no one minds if you have a life at work. In a startup you can do whatever you want most of the time. If you’re a founder, what you want to do most of the time is work. But you never have to pretend to.”

Yes, “Work and life just get mixed together,” that’s what I mean. But does everyone who wants to live like this start a startup? Everyone has families, relatives, friends, hobbies, aka “life.” Now why can’t you do something you love (or like, at least) and mix it with the other things you are passionate about? Why do you need to sit in the office every day from 9 to 5, then shut your computer down and never check your e-mail before the next shift (how awful) starts?

Let’s say it’s an early afternoon and there’s nothing major you need to do, but you’d like to take your girlfriend out. Now, watch the brave and oh-so-daring part: You do it! And then there might be an important e-mail you need to take care of that came in Saturday morning (let’s say from another timezone). So many people would wait till Monday morning to answer it. Which I don’t get, but I think it’s just the company culture. You force me to work certain hours, I won’t work outside of them. But you should just work when there’s work to be done, no? With some balance of course, but it doesn’t have to be that rigid, does it?

It seems like a no-brainer. Then why can’t most companies do what Best Buy was able to do?

‘Our whole notion of paid work was developed within an assembly line culture,’ Moen says. ‘Showing up was work. Best Buy is recognizing that sitting in a chair is no longer working.’

(…)

‘For years I had been focused on the wrong currency,’ says Thompson. ‘I was always looking to see if people were here. I should have been looking at what they were getting done.’

because today

It’s O.K. to take a nap on a Tuesday afternoon, grocery shop on Wednesday morning, or catch a movie on Thursday afternoon.

It is much easier to be flexible and have work freedom if you’re an independent contractor or work for yourself. In companies, this is apparently much harder than it seems. But it’s coming.

A link visited: Freedom = Success by Polly Labarre

In Uncategorized on January 17, 2008 at 12:20

I just changed the copy on the Flempo homepage yesterday to show better the point. Check it out.

And then I read Freedom = Success (And Not The Other Way Around). It is coming. Maybe not very very soon (especially here in Europe), but not only am I ready, but I am so so excited about it. Highlights:

“The really interesting shift isn’t from one profession to the next, but from one way of thinking about the arc of a career and working life in general to the next. It goes something like this:

Old version: work hard (for a very long time), achieve success, earn freedom (to retire and do all the things you missed out on while you were working)

 

New version: find work that affords you freedom = success

(…)

Our assumptions about how work works, where we work, and when we work are relics of the industrial age. That’s not a new problem. ROWE finally addresses it.

The basic principle: people can do whatever they want, whenever they want, as long as the work gets done. Period. You can come in at 2pm on Tuesday. Leave at 3pm on Friday. Go grocery shopping at 10am on Wednesday. Take a nap or go to the movies anytime. Do your work while following your favorite band around the country.

(…)

The results have been spectacular: an average 35% boost in productivity in divisions working in ROWE and a decrease in voluntary turnover by 52-90% depending on department. “

A link visited: Zeitgeist, The Movie

In Uncategorized on January 5, 2008 at 10:55

Another eye opener you shouldn’t miss. The movie Zeitgeist shows us what really is behind the myths we believe in.

Its first part shows that The Bible is nothing than a literary astrological hybrid by pointing to the huge number of similarities of the story about Jesus with earlier (especially) Egyptian religion that was based on astrology. Three kings, the cross, and Maria are in fact stars in the sky, did you know that?

Second part talks about the problems the official explanation of the 9/11 tragedy has. Well, I’ve known already there are many suspicious things.

Third part concludes basically with: You’re lied to all the time. Wars are extremely beneficial for people with power and especially bankers in the modern age (state has to increase their debt to finance war). And the reasons why wars have been started often were not what we were told. (The movie says Pearl Harbor was known about before the attack, the Vietnam war was started after a staged incident and so forth.) The next war is about ourselves. All the “homeland security” laws in the States are here to control us (I mean Americans, but might not be that far from happening in the EU). Because what these elites want most is power and to control the whole world.

OK, I’m not sure about all the things from the last one and I’ve heard about the second one already. The first one was very interesting though. I considered The Bible to be just a regular thick book full of tragedies and murders, but now I know it’s also a collection of older stories from various other sources.

The important part though: In the very end, the movie says that what these people (with power that lie to you) want you to do – is to be afraid. Afraid of God punishing you, of Hitler, or terrorists. Because if you are afraid, you obey. If you are not scared, you live your life with passion and love and you tend to revolt. Think about it, isn’t christianity about you not revolting and obeying the whole life and then (after you die that is!) maybe just maybe you get to heaven where you finally will be allowed to enjoy your existence? Well maybe just maybe screw that and live every day as if it was your last.

Memory leaks in Ruby 1.8

In Uncategorized on January 4, 2008 at 15:10

I’ve found two Ruby methods that seem to leak memory. At least according to dike.

[Update: Might be I just can’t use dike or there’s some problem with it. Make sure you read the comments for more information.]

[Update2:

On Jan 9, 2008 4:12 AM, ara howard <ara.t.howard..> wrote:

so i do think that dike is causing the issue, but i do not think it’s a bug ;-) 

More info coming, too early now.. ]

First example:

require 'rubygems'
require 'dike'
Dike.logfactory './log/'

class Leak

 def http_call
	puts 'making http call'
	url = URI.parse('http://www.google.com')
	Net::HTTP.start(url.host) do |http|
		puts http.get('/').code
	end
	''
 end
end

5.times {
	leak = Leak.new
	leak.http_call
	GC.start
	Dike.finger
}

The get method leaves the Net::HTTPFound (HTTPResponse) objects in memory. Replace it with request_get and the leak is gone.

Second example:

require 'rubygems'
require 'dike'
Dike.logfactory './log/'

class Leak

  def http_call
	url = URI.parse('http://www.google.com')
	puts 'making the call'
	Net::HTTP.start(url.host) {|http|
		http.request_get('/') do |response|
			response.read_body do |segment|
			end
		end
	}
	''
  end
end

5.times {
	leak = Leak.new
	leak.http_call
	GC.start
	Dike.finger
}

The read_body methods leaves Net::ReadAdapter objects in memory and because of them other objects remain in memory, too. This happens only when you pass a block to read_body, without it the leak does not happen. This is not that easy to fix because without the block the whole body of the response is read into memory and if are downloading a large file, that is not what you want to do. My solution was write my own read_body method. I looked at the net/http.rb file for inspiration:

def read_chunked(dest)
	len = nil
	total = 0
	while true
		line = @socket.readline
		hexlen = line.slice(/[0-9a-fA-F]+/) or
			raise HTTPBadResponse, "wrong chunk size line: #{line}"
		len = hexlen.hex
		break if len == 0
		@socket.read len, dest; total += len
		@socket.read 2   # \r\n
	end
	until @socket.readline.empty?
		# none
	end
end

Hmm I must say I didn’t really get the code much, so I just wrote this (which might not work in all the cases, I warned you!):

def read_body(response)
	socket = response.instance_variable_get(:@socket)
	bytes_left = response.send(:content_length)
	read_size = calculate_read_size(bytes_left)
	while bytes_left > 0
		line = ''
		socket.send(:read, read_size, line)
		yield line
		bytes_left -= read_size
		read_size = calculate_read_size(bytes_left)
	end
end

def calculate_read_size(bytes_left)
	bytes_left > BUFFER_SIZE ? BUFFER_SIZE : bytes_left
end

To try the examples, paste the code in a file (named leak.rb in my case) and run it with a following command:

ruby leak.rb && dike log

I don’t see anything wrong neither with the examples nor in the code of the library, if anyone does, please let me know.

I tried to run the examples with Ruby 1.9 and there are “only” some String objects leaking (I can show you what changes I had to do in dike to make it work). So there might be only something minor with Strings in the new (development) version of Ruby. I’ll need to look at this soon again. Oh and by the way, your tests are leaking memory, too.

A book read: Palestine by Joe Sacco

In Uncategorized on January 4, 2008 at 11:38

Palestine by Joe Sacco is not a novel I’d look for myself. Which is quite a shame actually. Fortunately I have great friends who give me interesting books like this one.

Palestine is a comics which makes this rather thick book a fun and quick read. The plot takes place in 1991 and 1992 when Sacco traveled around Palestine and met and interviewed many people there. I had been’t really familiar with many of the facts about the Israeli-Palestinian conflict, but I had been kind of on the Israeli side. Why? That’s a good question. I think it’s because of the media that present Palestinians as terrorists and Israel Jews as victims. Well, this book might be biased the other way, but at least helped me open my eyes a bit.

What it shows is people whose country has been taken over in 1948 by someone who may have lived there in the past (a long time ago), but never actually had had a regular state there. So basically you live in your village peacefully and then some soldiers come and chase you out. To make sure you won’t come back, they burn your house down. Then you live in a refugee camp for almost 60 years and your kids and grandkids have never seen anything else apart from it. You can’t leave your house at night because of the curfew.

And if you haven’t been in prison, you certainly know someone close to you who has. You know many people that have been shot or hurt by the Israeli army. Eeach small protest is punished big time. Did your kid throw a stone on a soldier? Might have been your kid, actually. We’ll saw off branches from the olive trees your income depends on (and that take at least 5 years to grow up again). Often people are tortured to confess even if they are innocent.

It reminds me what I heard about communism a lot.  Now imagine you’re 15, you live in a refugee camp, and all the above is part of your everyday life. What would you do?

Just something to think about when you read the news..

A link visited: Why are we charged for Wi-Fi?

In Uncategorized on January 1, 2008 at 20:06

A while ago I was wondering why you need to pay for a Wi-Fi access at the Amsterdam’s airport. Seth Godin explains the idea behind it in Nickel and Diming:

“Wifi is a great example. The marginal cost of hosting one more person on a wifi network is as close to zero as something can be. Charge people more than $10 a day and suddenly you’re making hundreds or thousands of dollars of extra profit.”

(…)

“I have no doubt that this works in the short run. It might even work out to be a viable marketing strategy in some markets. However, the alternative is worth considering. Not only do everything you say you’re going to do, but do more.

Offering low marginal cost items for free is a shortcut to generating word of mouth, which is a lot cheaper than buying ads.”