Apr 212013
 

As mentioned in “Broadcast on Bambuser from an IP-cam” I had a stability problem when streaming from a D-Link DCS-923L IP-cam to Bambuser. It turned out that the camera is doing something funny with the motion jpeg every 30 minutes that makes the mjpeg decoder in avconv crash.

I have no idea what is happening but since no obvious fix was available I decided to work around the problem using a simple python script that simply restarts avconv when it crashes.

Continue reading »

Apr 072013
 

I have mounted a D-Link DCS-923L IP-cam in a nesting box to watch birds nest and their home life. The IP-cam is a simple surveillance camera with night vision that allows it to capture video in complete darkness, and it is equipped with a built in web server that serves the live video feed. I set up the camera last spring and configured my firewall to allow friends and family to watch the birds. More and more people watched the feed and when the chicks were about to leave the nest (seems to be the most popular part of nesting) my connection to internet was completely choked. This year I figured I had to set up a mirror that could take the load off my network and I set out to find a solution. I found Bambuser (a free live video streaming service), why not use it?

So, how do you connect an IP-cam to Bambuser? It turned out that it can not be connected directly but with some some extra work it is possible, almost for free.

Continue reading »

Feb 172013
 

We have started a small project to build a web-ROTI, that is an app that can be used to measure how good your meetings are. After one day of hacking we have a MVP.

Web-ROTI (Return On Time Invested) is a tool to gauge the time spent on meetings and improve them.
ROTI can easily be measured on whiteboard or paper but you are running the risk of getting a biased result when the voters see other votes. In Web-ROTI the vote is given without bias, as a bonus it calculates the average as well.
A vote is a number between 1 and 5
  1. A complete waste of time
  2. Not so good
  3. Break even, my gain is equal to the time spent
  4. Positive
  5. Superb, I could not have used this time better Continue reading »
Sep 212012
 

Of course you unit test your code! Everybody does that. Your company, your co-developers and your conscience tells you it’s the right thing to do. We’ve been practicing this for years: at work, in conferences, during code dojos, and even at home hacking sessions. But do you unit test your PL/SQL packages? Well I don’t believe you do. Or at least I didn’t. But in my last assignment I actually found a way to do it. This post suggests a way for creating unit tests inside PL/SQL packages.

Continue reading »

Sep 062012
 

In scrum we usually answer the three questions on the daily scrum meeting:
* What did I do yesterday?
* What will I do today?
* Are there any impediments in my way?

The way this goes is that the first person answers the questions, then the next one and so on.

Now what’s wrong with that? Well, when the first person is answering the three questions, he or she has no clear picture of the problems that the rest of the team is facing. So how is this person supposed to make a good decision of what to do today?

A better way of doing it is to first find out the current situation, that is that everyone answers the questions “What did I do yesterday?” and “Are there any impediments in my way?”. After that, when everyone has the full picture, we can decide what to do by answering the last question “What will I do today?”.

This method encourages teamwork and moves focus from the individuals to the team.

May 222012
 

I’ve been hacking up a remote shell for our actor based broadcasting system. It’s a read only shell with commands like cd, ls, stat etc. It uses Akka, Netty and Scala with its parser combinators. I was thinking a bit about how to resolve a path. By resolve I mean how to combine the current path with one provided for one of the commands above and making it absolute. My goals was (as always) to only work with immutable data structures (if possible) and make it as tight as possible. By the way, the path that I’m parsing looks like a regular UNIX path. I.e. /foo/bar/../xyz. Here’s the implementation I chose:

def resolvePath(path: List[String]): List[String] = {
  path match {
    case Nil | ".." :: Nil => Nil // Root
    case x @ _ :: Nil => x // Only one element. Not '..'
    case xs =>
      (xs :\ 0 -> List.empty[String]) { (x, acc) =>
        val (skip, ys) = acc
        if (x == "..") skip + 1 -> ys // An element to skip
        else if (skip == 0) 0 -> (x :: ys)  // Prepend element to list
        else skip - 1 -> ys // Decrement skip count
      }._2 // Return path
  }
}

As you can see the method takes the path as a list of strings. The path /foo/bar would be the list "foo" :: "bar" :: Nil after it’s been parsed. I use a right fold when building up the resolved path. I could have used a left fold which would have made it a bit tighter, but then I would have to reverse the list when done to get the path elements in the correct order. It wouldn’t be that much of an overhead in most cases but I think that a right fold is more appropriate. Why don’t you show me your implementation? Choose your language of choice.

May 012012
 

One way to be creative and find solutions to a problem is to use provocation. A provocation is basically a some weird, probably unrealistic statement that is thrown out. The statement in it self is not useful but it helps us to come up with new ideas. It is important that we don’t start to analyse the provocation and block our selfs but instead accept any ideas that follow. Just go with the flow, and record all you come up with. Analyzing and jugement can be done later.

Three easy ways to create provocations are
1. Reverse something we take for granted. We expect cars to be mobile: “Lets build a car that is stationary”
2. Exaggerate. “Everyone is a millionaire”, “Each phone call can only last 10 seconds”
3. Distortion of a normal sequence of events. “You close the letter after you post it”

Edward de Bono has written lots of books on the subject.