So, is the world really faster?

Every now and then I hear people complaining that the world is now much faster than it used to be in time of our grandparents. But is it really so? Did people complain about that very fact in their time? Another common complain is that parents now have less time for their children or their partners. I don’t agree with this. I think that generally we work less now, don’t we have 8 hours long work day? Problem is that we have now too many options to choose from. It is difficult to choose and be happy with your choice, when choosing one option means saying no to all other tempting options. We have twitter and facebook statutes, google reader, rss.. and so on and so on. The amount of information is so overwhelming, that we always miss something. We just can’t catch up on it all. Therefore the world seems so fast. It’s not that much about the progress and innovation pace but about the number of small choices and distractions you face every day.  So why not just slow down and enjoy simple (offline!) things?

As a programmer I tend to follow what’s going on in the industry. I love learning new stuff. So I read about new technologies, I try them, dream about using them. And I often feel kind of guilty that I can’t learn them all. I always feel quite behind. Incapable of following. I guess that lot of people have similar problem of trying to do too much.

After reading that sleep is more important then food I decided to try to slow down and really sleep more. Yes, it does help :). I don’ t always manage to get those recommended 8 hours per day, but when I do, I can tell the difference. I just focus much better when I am fully rested (surprise:) ).  One of the requirements to get more sleep and feel better is to drop something off. Make more free time for yourself. Then your world will be slower again as it should be.

Environment and productivity

What kind of environment is best for work? Do you work in such? When I worked for IBM I was confined in a cubicle in a big open-space.  It was an experience I don’t want to go through again. The environment was “noisy by default”, there was a continuous sound-spam of chatting people. It was really difficult to concentrate and be productive.  The only way how to avoid it was to put on headphones and listen to some music.  But still I was disturbed by IM notifications and other crap.

Now I work in a small office in a team of five people and I am totally happy.  Most of the time nobody talks and if then it is mostly work related.  There is often silence, the only thing you hear is fingers tipping the keyboard.  I guess I sound quite nerdy, but I really like it this way. I believe this is the only way how to be really productive. Talk little, avoid being disturbed (if possible) and focus on the task at hand.  Then take a break, read some short article, have a cup of tea, or a little walk in the office.  That helps. If I deliver nice code, I am happy. If I don’t then I don’t like myself. Really.  I am far from being a perfectionist, but I like good work. I find it satisfactory 🙂

What helps me focus and create something is good music.  I can not play any musical instrument but I am an enthusiastic listener. I am particularly fond of jazz music. I know it may sound as a contradiction because jazz is often difficult to listen to, but it helps me to write code. Jazz is so full of energy and surprising ideas, that it lifts me up. It inspires me.  I love Pat Metheny for example. Listen here. Is it beautiful?

So .. this is the kind of music I listen to when I code. Or when I need to get new ideas. Or just to sit back and relax 🙂

What kind of music do prefer to listen to when you work? Or do you prefer silence?

I’ve started using Memolane

Recently I have stumbled across an interesting startup called Memolane. It is an unorthodox aggregator of various social media sites, YouTube, RSS feeds et cetera. I find it very useful. We all publish and share bits of our life to various sites, with different groups of friends, and Memolane collects them all back together, so everything is lucid and “defragmented”.  Everything on one place. You can see what you did in the past, how your interest changed, or what things have influenced you on your way…. Your tweets are there, facebook statuses, favourite videos, everything.  And their UI is simple and intuitive, as a user and programmer I appreciate that. It is quite challengig to make things simple 🙂

PS: See my Memolane here.

Look at the stars … and see code

starryNight plugin API

This is an update to my previous post. I wrote nice to look at animation on top of jQuery called starryNight. It takes a <div> element and add moving stars on top of it.  Stars are slowly floating across the sky, and when they finally flow out of the sky (or <div> in our case), they are automatically reborn on the other side on some random position.  That sounds pretty straightforward, and indeed it was until I complicated it by adding slider, more on that later.  Now to the API.

Basic HTML structure – provided by you – should look something like this

<style>
 #starryNightExample {
  background: url('/path/to/your/image_of_starry_sky.jpg') no-repeat;
  width: 500px;
  height: 400px;
 }
</style>

<div id="starryNightExample"></div>

I think that’s quite self explanatory. Without specifying width, height and background image it will look just ugly 🙂

Once you have your HTML structure ready just call .starryNight() to get the stars moving.

$(function() {
  $('#starryNightExample').starryNight();
});

The public API methods are:

  • count (int) – sets number of stars
  • addStars (int)
  • removeStars (int)
  • generateSlider (bool) – whether UISlider should be generated

Both addStars() and removeStars() are called internally by count() and all three of them accept positive integers only.

The methods are called like this:

$('#starryNightExample').starryNight('count', 150);

So that’s basically it … Next time I’ll write something more serious, I promise 🙂

See the live demo here.

Don’t forget to play

Sometimes I need to do something what is not useful at all, just for the fun of it.  Someone plays World of Warcraft as a hobby, someone listens to music, drinks, draws.. whatever. I make animations in javascript.  It’s half fun and half learning. I can try new things, I can experiment, discover …and what is most important: I create.

After one rather bad day at work I needed to do something what I would really enjoy.  Not that I don’t like my work, I do love it, but there are sometimes days that are just bad… I had a lot of small trivial tasks which were not very creative, but as one wise guy said “work is not supposed to be fun, work is supposed to be done”, so there was no other option than to do my job 🙂  So I completed my tasks and when I came home I started to work on this.

Click to go to demo of StarryNight plugin

It is a rather useless but nice to look at piece of “art”. As I already mentioned I had two reasons to do this. One was to play with animations and the other was to learn how to use properly jQuery’s recommended plugin architecture. As it turned out the playful part did not last much long – just 50% of the time,  I thought I would have it done in two evenings but I ran into issue with array manipulation and the whole thing took me eventually two times longer.

What I have learned during the development process? Never remove items from an array you are iterating on.  You may end in an infinite loop, consume all CPU resources and freeze the browser.  And more importantly that the public API of jquery plugins is a really nice feature. My script would be much more complicated without it. If you  still write your plugins without public API (as I used to do) then go, read some documentation and try it yourself. It’s worth it.

And try my StarryNight plugin. It’s worth it too 🙂 More on it in the upcoming post. For now just check the demo and source code.

HistoryGraph – Introduction

At IPO48 2011 in Prague I introduced my idea of HistoryGraph – web based educational app displaying historical events sorted by topic in interactive timelines.  The idea did not get enough people to start up at IPO48, in fact there was only me in the team and the minimum was 3 people 🙂 I have since then revised the idea, simplified it and came to terms with the fact that it will not make me rich.  The simplified version will only read data from tables on a web site and render a visualisation graph. In this approach it will be similar to Filament’s jquery visualize plugin. Filament’s plugin focuses on displaying statistical and business data, my goal is to visualize connections of historical events.

Usage

If you are for example writing a blog article on current revolution in Egypt or Libya and need to see what was happening in these countries at any given moment in time, how other governments and media reacted to those events, then HistoryGraph comes in handy.

My original idea was that there would be one central database of historical events which would be labelled classified and tagged, and users would be able to filter and display only the topics they are interested in to spot the not so obvious connections between events in different parts of the world. The idea is nice, I still believe in it but there is no business plan in it. Now I don’t think  it is possible to make money by working on it, but I would probably develop something like this anyway so why not to offer it to public for free? I believe HistoryGraph will find its users. We will see … 🙂

Circus Cermaque

February, the last month of winter, is the worst one. I am tired of winter, of the ever clouded sky, of lack of sunshine.  And in these grey days I have met by chance three shining guys. At first all I could hear was distant sound of clarinet. I came closer and saw these guys playing joyful-melancholic music.

Circus Cermaque

It suddenly felt like summer. Sun was shinning and it was unusually warm for end of February. There is one thing I love on summer and that’s the street artists. They bring poetry to dull day-to-day life. Unfortunately I can’t play music at all and I found it quite difficult to dance in rhythm but I am an enthusiastic listener. This music was exactly of my taste: playful but with sadness and melancholy underneath, and one can’t say what style it actually it. It was a mixture of folk and jazz and improvisation. I could not resist and bought their CD. Every peace looks different, every peace is original 🙂

Circus Cermaque Booklet

Later I found out that Cermaque already released two albums and Jakub Cermak released two garners (at quite young age). It is not an easy listening like ABBA, it is fragile, gently disturbing and fascinating.

Listner here:

http://bandzone.cz/cermaque

jQuery datepicker improved

I like jQuery’s datepicker a lot, but I miss two things – one is some kind of mask on the input field so I can write date directly without worrying about the correct date format, and the second is customisable trigger (the thing you click on to toggle the calendar widget 🙂 )

Masked input

This is a screenshot taken directly from jqueryui.com. As you see you can write anything to the input field.  Then you have to validate it, display error message, prevent form from submit… etc. It’s not nice.  Luckily there is a nice solution, a jQuery plugin called maskedinput. (and yes, I use it in durationPicker plugin). I definitely recommend you to use it, it’s very handy, saves lot of work.

I typed a date, right? ... or didn't I?
This is what I wanted!

So, that’s the first thing. Masked input is great, but there is a conflict with the new jQueryUI datepicker. Both of them listen on keypress event. Masked input in order to position entered digit in front of or behind given delimiter and datepicker listens in order to automatically update selected date in a widget as you type.  It works fine until you type the first digit indicating year – maskedinput will insert delimiter in front of your digit, which is perfectly fine, but datepicker expects number, and as a result you get year 1900 (or something else same crazy).

Custom trigger

To prevent this conflict you need to toggle datepicker not when user enters input field, which is the default behaviour, but when she clicks on some trigger, in most cases icon or a button.  Datepicker has an option for it

$( "#datepicker" ).datepicker({
   showOn: "button",
   buttonImage: "images/calendar.gif",
   buttonImageOnly: true
});

Do you see the path to image file embedded in js code? It should not be there, it’s not flexible and makes it very difficult to style.  Not mentioning that you can’t use themeroller. Wouldn’t it be nice if you could use any DOM element as an trigger with themeroller-ready classes, and not just an image? Well…. You can 🙂 Use something like this:

var el = $('.datepicker');
el.parent().addClass('hideCalImage calImgWrapper'); //add class to hide 'native' image triggers
//add themeroller ui classes
	var calImgController = $('<div class="calImg ui-icon-calendar ui-icon"></div>').click(function () {
	if (el.attr('data-hasDPVisible') == 'true') {
		el.attr('data-hasDPVisible', 'false');
		el.datepicker('hide');
	}
	else {
		el.attr('data-hasDPVisible', 'true');
		el.datepicker('show');
	}
}).appendTo(el.parent());

I add some css class to hide the <img>, and then replace it with my own <div> element with attached click listeners.  Notice the use of data- attribute hasDpVisible. I have to use some kind of indication whether datepicker is on or off to be able to show / close it as needed.  And that’s basically it. For the full source code see the DEMO.

IPO48 – (personal) summary

There was a big event on 11-13.2.2010 in Prague called IPO48. One hundred people gathered there to compete who has the best idea for a startup. One had to explain his idea in 90sec long “elevator speech” in front of a jury and his peers in order to get their attention and recruit a workforce to join his project. It is called an elevator pitch because these 90 seconds is the approximate time you will have if you ever happen to be in elevator with you potential business partner or investor. If you don’t manage to grab their attention – you have lost, they are not interested, they will not give you (read: invest) their money… You really need to know how to present your idea because all business is about marketing and communication  skills.

Confrontation with reality

When I arrived to IPO48 I thought it was gonna be an hackaton. The main motto clearly stated “Get you idea off the ground in 48 hours”. I was sure it was about programming. Well…, I was wrong. I had my speech ready, I trained it in front of my colleagues (one of them actually did not understand it at all for the first time, which was great feedback for me).  I printed business cards, the first one I have ever printed, I also printed a poster with my idea explained.  I did everything I could think of to succeed. I event dreamt about leading people in my team working on my idea. And I did not succeed. My presentation was a total failure. I got nervous, I did not say what I wanted, I forgot the speech I trained… I had all the symptoms of stage-fright. That’s one reason I failed. The other one is that I had no business model. As I found out it was really needed:) IPO was not a hackaton as I expected but more like a competition to win investor’s attention. It was more about communication skills than programming. One of the criteria was to get your project up and running but many people arrived already having some prototype.  For me, this was a great lesson. I am a developer, and I thought that developers are the heart of any project’s success. But they aren’t. Programmers are just programmers, lost somewhere deep in the internet unless they have someone who knows how to promote their excellent (???) ideas.  You can have an excellent application, but if you don’t have customers or users, it’s just like as if you don’t exist at all. (Or to be precise: if people don’t use your app it’s just like it doesn’t exist).

My favourites

The ideas that won were actually very simple, nothing you couldn’t live without, but they offered a lot of fun (two of them) and had clear business plans. Personally I loved the idea of the GPS Social Game, even though I will probably never play it.  But if they the make it similar to WoW with a good story, levelling, probably with guilds, parties and so on, it could be a huge success.

My favourite was Relbit – PHP cloud hosting. I participated on it, and I like the idea of simple cloud hosting for PHP. There is a lot of people developing in PHP in Central Europe, about 60% and the guy who came with it already has the infrastructure, an angel investor and I believe we will hear about him in the near future. We did not win, but he has interest of investors, which is great. Thumbs up! Man I wish you good luck 🙂

Other winning ideas  were these:

TopMonks – application for crowd sourcing. Nice idea.

DrinQuest – Get drunk with your friends and get some experience points for every place you visit. Great idea with a lot of potential customers. Epic win,  but otherwise useless:) See the video, it’s fun.

So.. that’s it.  If you will ever have the chance to attend IPO like event or some hackaton go for it. It is definitely worth it. And with investors involved … where do you go from there? The sky is the limit:)

Photos

https://picasaweb.google.com/david.votrubec/IPO48Prague2010 (taken by me)

http://www.flickr.com/photos/fleveo/sets/72157625935644979/with/5448502405/ (taken by Fleveo)

Why I love my work

I consider myself lucky to have work that I love. I work as Javascript / C# developer for a company where I can be creative, I can try new technologies and constantly learn new stuff. In short: I grow, I develop myself. That’s great. I left my previous post not just because of low salary, but mostly because it just sucked. I did not trust my boss, as nobody did, he was that kind of person who tries to avoid responsibility. He had a gift to demotivate people by randomly checking what they are doing, peeking over their shoulders and so on.  Everyone hates that. No wonder people started to leave the company…

But back to topic: in my current company nobody checks how long I am at work, what sites I am visiting, I can go to town if I need to. If I need anything, like better keyboard, books to study, it’s not a problem I can just ask for it and I will probably get it.  I feel free and welcomed, and I feel that my work is appreciated (not just by money but by respect of my peers). That’s very motivating.  Another big motivating factor is enthusiasm of my co-workers.  It creates great atmosphere, so it’s pleasant to work with them. And not just to work, but to go to pub, get stoned and have fun… that’s part of team building 🙂

PS: I know that I probably suck at writing because English is not my native tongue, but it is an exercise for me, a part of kind of self development plan.