Archive for November, 2010

All choices are bad

Thursday, November 25th, 2010

In programming you often have the choice between  quick and dirty (often copy/paste)  and  smarter and DRY (don’t repeat yourself).  The assumption is that the latter will save you time in maintainance at the cost of some more initial effort.   However, I am convinced that independent of what you choose it will haunt you at some point in time.

It’s not difficult to imagine how copy and paste will haunt you:   things will change… and if it’s one of those things you’ve copy and pasted a million times over the place,  you’re not going to be happy.  Especially if the initial code is not yours, you will have no idea where it has spread and if changing it in one place will fix it everywhere.  (Not to mention the slightly altered cases in some place, which will render a simple search useless)

However, the smarter way can also haunt you. First of all,  ‘smarter’  is also  often harder to understand at first glance.  You need to find out where stuff is defined, as code is less straight forward.  Also, DRY often means generating some output based on a more abstract specification. (either a configuration structure or maybe even a DSL (Domain Specific Language)   That’s all great, until there is a feature that doesn’t fit your framework. (and you WILL encounter this at some point)  You either have to spend a  lot of time to incorporate it cleanly or fix it in an even less elegant way than the one you were trying to avoid.

I’m not going to say you need to stay away from smarter programming, however you must realize that it will not protect you from having to do more work than anticipated for what are essentially minor changes.   Every line of code that you put in, will make it harder for some unknown features to be added later on as you can’t foresee everything.

Why Time Management Methods Work

Monday, November 22nd, 2010

I strongly believe that energy levels, focus and productivity are related and come in closely related cycles. I’ve always had weeks I can get done great amounts of work, followed by weeks of procrastination and inactivity.

Now at some point in this cycle, energy levels start to rise, but you are still in the habbit of low output. This will make you you feel guilty of not outputing, while your mind does want to. You are starting to imagine all the work you want to get done and does not seem to come along at all.  This is where time management methods come in. The promise of beating procrastination and the overwhelmed feelings. So you try to follow them and it helps you get your thought in order and get more work done. Up till the point that everything is going well,  you’re on a roll. If you are like me, you have already abandoned the time management method, because it feels more like a chore and everything is moving along without it.

The Productivity Cycle

My feeling is that time management does not actually help you that much,  you just try it at the time that your productivity is already bound to rise up the cycle again.   The real problem comes when your energy levels are dropping again.  First you overcome it by moving to simpler tasks, but slowly procrastination creeps in.  The problem is, you don’t notice it, until it’s to late. At which point you don’t feel like doing much at all, most certainly not some complicated time management method.

I do believe that you can influence the whole cycle, but it’s way outside the scope of time management and has everything to do with your general well-being and the habits that influence it.

Why helpdesks will always suck

Saturday, November 20th, 2010

As a small business we don’t have the luxury of dedicated support staff. This means that for some products I am both the creator and support desk at the same time.  So,  in theory  contacting the support desk should give you access to all available knowledge and answer any question.         Unfortunately, that’s not the truth.  There are always cases that  I do not have an answer to.

  • Sometimes users want to know stuff we have never even considered (e.g. certain policies)
  • Or I will have to dive deep into code or configuration to find an answer
  • Other times I just don’t know (e.g. when a certain feature will be added)

If I can’t answer all questions about our product? How will support staff ever be able too?

Now imagine any company of reasonable scale.  Those will have separate support staff that is at best a user of their product. So the best thing they can do  is  answer problems that have been answered before. Which might not sound that bad, as similar questions keep being asked, as they have lots of customers. However, this is also what creates the dreaded queues and even more support staff, that is even further away from the product.

Now, recently I heard someone say that Google  does support right, so it must be possible.   Let me tell you,  Google does not do support right.  It is almost impossible to contact Google and get a timely response.  However, nobody knows about that, because almost nobody wants to contact Google.

This all leads up to a single conclusion: If you get the same question more than once, you’re doing it wrong.   You cannot fix the helpdesk, because a helpdesk is just repeating the same bandages over and over again. What businesses need to do is fix the product itself.      The only fix for a helpdesk is to render them useless.

Fixing ffmpeg aac hiccups

Thursday, November 18th, 2010

First thing you probably want is a recent version of  ffmpeg.  For me it was on debian lenny, for which there is this excellent and clean guide:
http://www.adminsehow.com/2009/07/how-to-install-ffmpeg-on-debian-lenny-from-svn/
(just remove the  -with-libfaad  option, because it no longer exists)

However, this left us with stuttering audio, hiccups and noise for some videos encoded as MP4. Fortunately, there is almost no problem that has not been solved before, so I found: http://e-mats.org/2010/01/fixing-stuttering-audio-with-ffmpeg-and-quicktime/ It comes down to updating libfaac, because the version you’ve got is most likely very outdated.

That’s all good, but not that easy if you don’t know exactly what you are doing (I didn’t)

First: get your  FAAC 1.28 source code from here:  http://www.audiocoding.com/downloads.html (I assume you extract it using tar -xf to a dir named faac-1.28)

You probably will not be able to compile this,  again the problem has been encountered before:
http://sourceforge.net/tracker/index.php?func=detail&aid=2894310&group_id=704&atid=100704

What you need now is get mp4v2 from:
http://code.google.com/p/mp4v2/
get the latest version and extract it. Then build it like the instructions on the site tell you:

cd mp4v2-trunk-r355/
rm -fr build/
mkdir build/
cd build/
../configure
make
make install
cd ../../

Then you need to patch faac to work with this new external libmp4.  (get the patch from:
http://sources.gentoo.org/viewcvs.py/*checkout*/gentoo-x86/media-libs/faac/files/faac-1.28-external-libmp4v2.patch?rev=1.1 )

$ patch -p0 < faac-1.28-external-libmp4v2.patch

Before you can recompile faac you need a few additional steps:

apt-get install automake autoconf libtool
aclocal
automake
autoconf

And then the well known:

cd faac-1.28
./configure
make
make install

And for some reason:

ldconfig

Done.

(On one of my systems, somehow  libtools could not be found properly and the make file  supposed it was in “../libtool”  which I fixed by using a symlink instead of finding out the actual problem)

http://code.google.com/p/mp4v2/downloads/detail?name=mp4v2-1.9.1.tar.bz2

Open-Source Animation and Video Editing

Sunday, November 14th, 2010

These last few days I needed to create an animation, but most obvious tools don’t work for Linux. I just needed something simple for 2D animation. Initially just changing the transparency on a few images and  zooming/panning/clipping it a bit while doing that.

I quickly encountered Synfig, it was a bit overkill, but also triggered my imagination and an immediate desire to play with it. The user-interface is a bit typical. It reminds somewhat of early versions of Macromedia Director, without the interactive tools.  You are wise to read the manuals and tutorials, because it does not speak for itself. However it does provide a very complete set of tools to create animation and I had something resembling what I wanted quite quickly.

As I used Synfig to create the seperate scenes, I now needed something to compile it together into a video.  The ‘Pitivi’ editor did not work as expected and after some searching I ended up picking Kdenlive. I think it looks amazing.  The user-interface looks nice and has everything you expect from it:  title screens, adding audio,  effects, transitions and various rendering options.

Using these tools video editing and 2D animation is very well possible on an open-source platform.

P.S. I also encountered Freesound.org which seems to have a very large database of creative-commons licensed sounds. I still have to try that though.

Waves of Productivity

Wednesday, November 10th, 2010

Another reality is that energy and productivity come in waves.  Although those hyper-productive days feel great,  there is no substitute for steady output if you really want to move forward.  However, I do suspect that those hyper-productive days are probably also the cause of the low-energy weeks that will follow.    It are these low-energy weeks that are plagued with  procrastination (in all sorts and shapes).

I wrote about procrastination before, this time I’ll tell you what I found out doesn’t work:

“I’ll do it tonight” – Although it seems a good idea (and feels good at the time) to fix a time to do a task in the near future, it’s actually the worst idea and it is the essence of procrastination:  postponing things you could and should do right now.
There is an exception:  urgent tasks that come in while you are already really actively working on another task. However, make sure that you commit to it, by telling the other party as well that you WILL do it today.

Other times I try to trick myself in doing something: I tell myself I will do project A after I’ve finished (hard) project B, because B is more important. However, instead of speeding up B, this will usually result in feeling very busy and besides B still moving forward slowly, nothing happens on A either.  So:   if you are not really actively working on B RIGHT NOW, there is no reason not to work on A as well. There is just no way that you are dedicating all your effective time to that single important project, unless you are really close to a deadline.

Blurred Lines: Work, Idle or Leisure

Monday, November 8th, 2010

Being a business owner working from home makes the Seven Day Weekend very real to me. Although the book by Semler considers it as a positive thing,  I merely see it as a fact of my life.    As I started my business at 16 as a sidetrack while I was in school, since then I never had a clear separation of work days and weekend.    I spent time working on my business in the evenings,  spent time studying in the weekends, etc.

The last three years business has become a full time activity and without the structure of having to go anywhere the lines between work, idleness and leisure have blurred beyond recognition. This has serious consequences:  I feel busy all the time, but at the same time I feel I could create much more value in the same time.     If I look back, we have produced immense amount of work, but at the same time it does not live up to my ambition.  Which leads to the question:  how am I spending my time? The answer:  I have no idea.    Because all boundaries are gone,  I just lost track of time.

After this conclusion I decided it was time to really rethink everything. In order to feel confident about the choices I make considering the time I spend I need to be more aware of how I actually spend them.

My first observation: Sitting behind a computer does not equal work. As I started to develop some RSI related discomfort I believe I need to cut down on time behind the screen and therefore improve efficiency when I am behind the screen. Therefore I have invented a new rule:   You should only be behind a computer if it is either something you like to do, something that will increase revenue or something that is required by law.

Now I will have also have to live with the fact that not all work will move projects forward. Stuff like bookkeeping, recovering servers, etc. just needs to get done and will always take some of your time.

So, there are different categories of time spending:
Recharging – Sleep, Eat, Walk, Staring out of the window
Chores – Bookkeeping, Shopping, etc. (stuff that need to get done even if you don’t want to)
Tasks – Anything that moves a project in a predetermined direction, with a verifiable output
Urgent – Handling incidents
Expression – Writing, painting, drawing, etc.
Communication – Chatting, calling, etc.
Stuff – Checking E-mail, News, Stats, etc. without an immediate benefit

Now I assume that the best way to move forward it to maximize the time spend on tasks without cutting time from other important areas.   The amount of time spend on urgent matters and chores is probably roughly unchangeable. Although they feel like interruptions to your productivity, in reality I don’t think they are. They are just the easiest excuse for not having completed something more useful.

However, I won’t be sure until I measure.  Using the Pomodoro Technique I now have a fairly accurate way to measure the time spend on real tasks. And these first days,  it’s not that much, even though I am more productive than before, the actual time spend on the tasks is not that much.   Hence, there is room for improvement. Of course I’m doing some stuff that I not yet handle in a task-oriented way, but there is also time that seems to disappear and I really want to find that, so I will try to be much more aware of the time I spend besides finishing my tasks. One of them is obviously the busy/idle behaviour I described earlier. In order to find out more, I will ask myself often:
- What is it that I’m doing?
- Why am I doing this activity?
- Why am I doing this now?
- Is this an absolute requirement (e.g. by law)?
- Will this contribute to our revenue?
- Would there be a better way to spend this time?
(I believe some of these questions also appear in the Getting Things Done method)

In a few weeks I will update you on the results.