FOWA day 1

Day one was really great. A lot of awesome talks. The most interesting guy was perhaps Umair Haque talking about edgeeconomy.  I havn’t  heard the economic  perspectives of open  distributed  production, really interesting. Steve Souder showed a very nice tool called Yslow, that can really help you find speed bottlenecks in your web apps. Anyway next up is Paul Graham so I better stop here 🙂

UI design

Saw this very interesting UI-video today called Away with Applications: The Death of the Desktop by Aza Raskin (part of the google tech talks). It shows an interesting application enso, very similar to quicksilver. The interesting part is of course the abstract (what it is a solution to) and the conclusion (and why). Especially things like application silos and how enso marries the CLI with the UI gives some food for thought.

Finally skip-free audio playback in Linux

Stumpled upon this story the other day. Finally a tool where you can actually decide which things get prioritized instead of the kernel relying on heuristiscs. I did a test with alsaplayer playing back using through jackd (very sensitive to not getting enough time slices). To stress the system I did a emerge sync together with a fetchmail process sucking down the days mail. I don’t really care if it takes 5 seconds longer to fetch my mail or if it takes 2 minutes long to emerge sync as long as I can be sure that my music doesn’t skip. And guess what? With DeskOpt you can 🙂

Boost part 2

In the quest for improving the quality of the MMS code in 1.1.0 I’ve done several things, one of which was to convert all the source to the boost foreach statement. Since I liked the result of the foreach cleanup so much, I decided to see what other libraries could be of use. I quickly found the function and bind library which allowed me to remove the internal function pointers framework we have currently been using. While converted I was surprised to see how cleaner the code became. The bind function is truly easy to use and read and made it possible to remove several helper classes which only purpose was to capture state to create a uniform interface.

So instead of:

class FP
{
  std::list numbers;

  FP(std::list n)
    : numbers(n)
  {}

  call(int t)
  {
    int total;
    foreach (int i, numbers)
      total += i*t;
    return total;
  }
};

(I saved the part of actually creating the function pointer object). One gets:

call(int t, std::list numbers)
{
  int total;
  foreach (int i, numbers)
    total += i*t;
  return total;
}

boost::bind(&call, _1, list_of_numbers);

Voila. Now if only the wordpress code formatting didn’t suck so much 😉

The future of C++

Recently I’ve been looking a lot into boost and it’s really a great set of libraries. Although the syntax of some of the libraries could use a helping hand (assign library). Luckily I was watching a presentation by Bjarne Stroustrup on the next C++ standard and it appears that they will finally add a way to construct containers such as vectors with elements as construction time. I think it was called initializer lists and the syntax was the following:

      vector v {1,2,3}

So you can now initialize them just like regular arrays 🙂 Furthermore it appears that we’ll get threads and perhaps a common filesystem + network abstraction. Now if only they could be a little quicker at bringing forward these new standards 😉