Author Archive

First experiences with the Doubango Project

Doubango looks to be a very promising young project & stack for mobile video and audio. I took the time in the last week to experiment a little bit with the stack and see how it held up against their non-open source competitors such as Skype, Vidyo and FaceTime.

The first thing that looked extremely promising in the stack was OpenVCS, which acts as a Video conferencing server

To trial out this stack I decided I wanted to try each of the clients on their respective mobile platforms, (iDoubs for iOS and IMSDroid for Android). My end goal was to have some sort of mobile conferencing platform for video where a user could talk to another user via Video and voice.

The first thing I did was spin up a VM and install OpenVCS. The install was relatively painless and being quite familiar with .NET it was rather easy. One of the things I was intrigued about was pairing OpenVCS with a SIP Stack such as Asterisk or FreePBX, however there was no documentation at all on offer at the project site so for the purposes of testing I left OpenVCS on its own.

Next up was installing the IMSDroid. This was also relatively painless as they have a beta available in their downloads section which I can download straight to my Android phone.

In the options section, under Identity I set my realm to the IP of my VM running OpenVCS (sip:192.1682.81). and I also set my proxy-cscf host to this IP under network.

Next step was to sign into the server. This all worked as intended. No problems here.
I then used the dialer inside the application to call the bridge I had set up in OpenVCS and select call out.

After this set up it was finally time to give the bridge a test call and see what doubango’s video quality was like!
It wasn’t pretty. On my HTC Evo phone, after turning on send video I was getting some extreme delay on video play back.

The UI itself with IMSDroid is relatively simple, in the bottom left corner it shows what you are sending and in the big pane it shows what is showing up on OpenVCS. The status of the call was still Ringing and I still heard a Ring tone (perhaps this was an aspect of having openVCS on its own without a sip stack like asterisk)

With just one user in the call, I received 5second delays and extreme distortion and differences to what my little  camera in the bottom left was receiving. Not good.

I decided I needed to add another client to continue my tests. Choosing to continue on the mobile platform I visited the iDoubs project to attempt to check out performance on my development iPod Touch.
After following the steps to clone the project and then manually fix up the paths, I recieved quite a few problems with compiling. After fixing up a few of these I ran into a time constraint and decieded to instead source another person to do a two person test that had an existing android device.

After setting up IMSDroid on my collegues device, we proceeded to enter a video conference together.

My original test was on profile Baseline H.264 level 3.
We proceeded to enter and were greeted with a green background, split into 4 panes. In the top left pain was my collegues camera, complete with 20-30second delay. I would estimate the framerate was close to 2fps. Extremely bad. There was also a large warping of  the picture I was taking to what was going to OpenVCS. Again, the call was still set to ringing, even though I could see both participants by Video.

After testing with different levels of H.264 on the local network I must say that the results were just not feasible for any type of conferencing.

I’m hoping in the above steps I may have missed something rather major that could be the reason for these performance problems and I’m reaching out to anyone else who has used the above stack for video with any degree of success.  Overall the project looks like a promising start for the open source community at a reusable video calling stack but ultimately much work is still required from the community to get it to a usable level.

Yet another example of TDD’s Brilliance.

I woke up this morning and checked my phone, 7 Tests failed.

My initial reaction was anger,  wondering which poor developer I would smack for this change (Luckily the developer was located in poland so smacking is out of the question).
However, as I pulled up my teamcity page, located the exact build and exact line of code that caused these tests to fail, and fixed the bug almost immediately, I began to reflect on what could have occurred had we not had CI or Tests written in this case.

Flash forward, 6months from now.
Client uses the system and calls our support line to say its ‘broken’. They repeat what they did and the task is assigned to me to fix this problem. The support person immediately blames me for this problem.
I pull up the old code from this project, as i’m working on a new project now. I hesitantly attempt to reproduce this problem, breakpointing away until I can find the exact cause of the bug.While pulling this up, my manager asks me how long it will take for me to fix – hinting a bit of anger that I caused this whole mess in the first place. I reply like I do with all bugs – It depends how long it takes me to find it.

This scenario is wrong for so many reasons – and I cannot see why anyone would not want to catch a bug as soon as possible. It takes a lot longer for a developer to catch a bug that is not fresh in their mind, let alone the possibility that end users will have to suffer in this scenario. When we first started the entire re-writing of this project and porting to ruby, to use a BDD/TDD Approach to development, management initially thought I was mad – but when situations occur like this, that could have taken days to fix something so simple – is when it just makes plain sense.

Hosting Cassandra on Windows

If you’ve been following all the action on github – a colleague (krisw) and I have been building a high level cassandra client for C# & .NET (Hector Sharp).

We’re still quite young in development and you can see our to-do list is full of funny things such as ‘make compile’.

One of the things I love about cassandra is that being built in java, We can run a little dev server on windows to test this. Below are the steps to install Cassandra on a Windows environment & Set up a basic server.

  1. Install Java 6 on your machine (Sun Repo)
  2. Download Cassandra ( Version is 0.5.1 at time of writing ) & Extract to a directory (I used C:\cassandra)
  3. Set the following Path variables
    - JAVA_HOME (To the directory where you installed java [ note not that bin directory ]
    - CASSANDRA_HOME (to the directory you extracted cassandra to, in my example C:\cassanda\)
  4. Modify your cassandra config file as you like ( in my example c:\cassandra\conf\storage-conf.xml)
  5. Run cassandra! Open a cmd or powershell and run the batch file in your cassandra\bin folder
  6. Verify Cassandra is running, open a cassandra-cli from the cassandra\bin folder and try connecting to your new server.

Automating your build process with Capistrano & TeamCity

I have been using a beta version of JetBrains TeamCity for the past six months and i’ve come to love and loathe some of it’s features. For the past few months, one of the primary uses for using TeamCity has been the ability to run the entire projects tests immediately as someone checks in.

This is a vital component to our development cycle as we are using a TDD approach. This enables not only developers to see how close a feature is to complete but also managers and business people to see exactly whats going on in the project instead of having to rely on what has been said in a ticket.

Recently I was using TeamCity for deployment also, using the simple rake task – however after the project became more and more complex we found the need to implement Capistrano. Capistrano is a quick way to deploy your projects and when combining it with TeamCity you have the distinct advantage of not having to install java on your staging or production servers. The process works by running a Capistrano script, which SSH’s into your staging or production machine and then executes your commands through ssh. This enables you to do alot of things such as run shell scripts and all the other bits and pieces you generally need to do in a typical deployment.

Setting up capistrano on teamcity is actually really simple – and you can even use your one worker machine that you had for testing purposes to do this task also.
Firstly you need to set up a user on your staging or production machine to have ssh passwordless authentication and ensure that your dev/staging machine has access to your git or svn repository. This won’t be covered here but I can wriite an in detail guide for these steps if it’s requested.

Secondly you need to make sure your dev machine can ssh (passwordless) into your staging or production server and test that you can pull down git or svn repository on this particular machine, also make sure trivial things are working – like you can write to your build path.

Next it’s all pretty easy. Make your Capistrano configuration file.
One little caviet to note is that you should put the following line in your config

default_run_options[:pty] = true

This will avoid some really odd :: err] Host key verification failed. messages.
From here, set up a new build in team city and point it to your test machine.  You can then have it point to your VCS Repository, from there the build runner selected should be Command Line.

Under the variables you can use the following:

Command executable: * cap
Command parameters: <environment> deploy

Note: If you want to use environment you can use the following capistrano plugin

Flash 10 with Google Chrome on Linux 64bit

Here’s the quickest way I found to enable flash 10 support on google chrome for x64 linux.

Get the latest version of flash x64 for linux from http://labs.adobe.com/downloads/flashplayer10_64bit.html

Extract the libflashplayer.so file to your chrome plugins directory.
Mine is /opt/google/chrome/plugins

In your launcher for chrome add the following
–enable-plugins %U

That’s the skinny

Build servers in a TDD environment

Being a bit a tiny bit obsessed with continuous integration I had set up a automated daily build to hit the staging environment every day.
One fatal mistake I have made with this is to ensure all tests pass before running the build.

While this might seem like a good idea at first, having a staging/qa environment that has the most up to date code is more important then having one that is essentially stable.
The reason this works is, in the work flow for test driven development, when a new feature is started the first thing that is created is your unit tests. This will create red lights on your CI server, and prevent your latest staging build from deploying for that day.

Why is this bad?

1. Delays an entire day of QA, working in larger teams this can become a problem.
2. Features that are not entirely yet coded, but have tests written for the entire of the features cannot have aspects of that feature that are finished hand QA’d.

Solution?
Very simple. Don’t require you’re QA server to have your tests pass. Leave that for your production environment.

Rubymine + Linux

I haven’t posted on here for so long i’m going to attempt a new approach which is – shorter posts, maybe this will be less daunting for me.

Anyway, i’ve been having alot of trouble with stability on rubymine on my machine which is running fedora 12 so I just did a refresh and decided to write a quick how to make it work properly:

- install Sun Java JDK 1.6
(make sure to set your alternatives to use the latest version of sun java you just installed)

- download rubymine from rubymine website
- edit bin/rubymine.sh and add the following line:

JDK_HOME=/usr/java/jdk1.6.0_17

You could also add this to your path variables if you like.

Now remove the following file from your bin folder: libyjpagent.so

This has solved almost all my rubymine errors and it’s running significantly faster on my fedora box. I’ll post here with updates if I find any other fixes.

OR/M Descisions, where to go from here?

My co-worker (Kris) and I have been evaluating several OR/M apporaches for our current refactoring of a system that is very clumsy. The current system is an artifact of poor design and uses a very clumsy EF apporach in which business layer information is skewed across all layers on the project. This ends up with a very spagetti like peice of software, and as neither myself or Kris created the project initially, leads us to very long and frustrating episodes to try and fix even the most trivial of bugs. We have tried multiple things to help this and to put off the inevitable, we introduced sophisticated logging, we introduced minor refactors, but all has unfortunately lead us to the one solution – a major code refactoring.

While this is a great way to clean out the code and start from scratch – It’s a very daunting process, and no-one likes refactoring entire projects (especially one as big as this) from scratch. After spending a few weeks and months investigating and playing with different options I am in the process of evaluating a few OR/M’s for the new project.

Wanting to take a DDD approach this times we have spent a bit of time actually building a few different Model Layers (to be consistant with our overall MVC approach for the websites). Which utilise good DDD Practices for testing our total solution. As the final solution is going to be providing an ORM layer for many facets of our solution (MVC Website running on 3.5, WCF 4.0 In Development Workflows) we wanted to make something as scalable as possible.

So we started evaluating how Entity Framework 3.5, 4.0, nHibernate (with fluent nHibnerate and nHinbernate.Linq), ActiveRecord & Subsonic would adapt to our solution. I come from a Ruby background, and while being very familiar with ActiveRecord, the lack of PI and ineffective ability to adapt to the DDD model that myself and Kris wanted to apply unfortunately wrote that model of the list first. Also the fact that Castle ActiveRecord hasn’t recieved a checkin since 2007 was something that really worried us. The current project uses EF1.0 and so for pure use of familiarity we started on this first.

At the time of writing we are yet to choose which ORM we are going to use, so suggestions would be very helpful. Here are some of the advantages and Diadvantages we have come up with for each OR/M thus far (To be updated as I find more).

Entity Framework 3.5
Pros

  • Can already work on .NET 3.5

Cons

  • No Poco
  • Poor Enum Support
  • Projection Transform not Supported
  • No PI

Entity Framework 4.0
Pros

  • Poco Support
  • PI

Cons

  • Can not already work on .NET 3.5
  • Some Pollution involved for Enum Support
  • Projection Transform not Supported

nHibernate 2.1.0 + nHibernate.Linq + fluent nHibernate
Pros

  • Can already work on .NET 3.5
  • Lots of DDD Documentation (In books & Blogs).
  • Projection Transform Supported
  • PI

Cons

  • Pollution in Poco needing to use Virtual
  • Pollution in Poco with relationship Fixups
  • Some LINQ features may not be supported (TBA)
  • Composite keys with Fluent nHibernate is tedious beacuse we have to override GetHashCode() and Equals()

Subsonic (Yet to be evaluated)
Pros

  • Exceptional LINQ Features

Cons
ActiveRecord
Pros

  • Ruby on Rails style OR/M
  • Easy to define models

Cons

  • Does not fit with DDD Patterns
  • No PI / Persistence Pollution in Business Objects
  • Can be sluggish and sloppy in complex systems.

Time warner cable – fails!

Sadly this entire weekend i’ve been living at the speeds of dialup – you know those speeds where you can’t even attach an image to your blog post or email because it fails?

I’ve been reduced to doing most of my important browsing through my iPhone – can anyone recommend any decent alternatives in the santa monica area to time warner cable? I’ve had nothing but horrible service from them!

I would swap to fios but alas it’s not quite available in my area yet – what else would you recommend?

Self-learning, DDD?

domain driven design

So it feels like it’s been an eternity since I was fortunate enough to recieve a greencard in the Greencard lottery, and the following actions occured after which; I quit my well paying job at Internet Software provider Channel Advisor and set out to discover the rest of the world.

After a short stint/holiday in europe I finally arrived in Los Angeles to start looking for a job. It took me two weeks, but somehow I had miraculously found myself in a situation where I had a car, an apartment and a few job offers, finally settling for my somewhat Dream Job at Doctors on Demand an Incubator company located in Beverly Hills, California.

So it’s been 6 months since i’ve become adapted to the new and challenging working environment that is the USA Software Development Lifecycle (USDLC). And i’m at a point where I can actually say I love what I do. I’ve worked on various projects from working in Ruby on Rails, PHP (including various frameworks, cakePHP and whatnot) and now i’m on a fantastic project that involves ASP.NET MVC. I must admit that before coming here I was not at all fond of working in any kind of .NET / Visual Studio environment.

While i’m getting pushed to learn new things, especially in this new and evolving world that is MVC (which seems like an atempt for microsoft to finally embrace the advances in web technologies in the last few years, ala Ruby on Rails, jQuery, etc)

Before going too far off point here – let’s get back to the Title – Self Learning, what is it – why do it?

In the past few weeks i’ve been on a bit of a self learning drive – Starting to learn the Guitar is a hobby I have put off for a long time, but I can say now I have a guitar and have started the process. The other thing that I had on my list for a long time was Surfing. I managed to go out one day, get a lesson and I now have 2 surfborads (a 6’6Fish and an 8ft foamie) sitting near my door, and i quite frequently get a surf in before work in the morning!

So now after my two successful attempts for self learning in my ’3rd place’. I want to apply the self-learning process to my pride, my career. I asked two of my co-workers who I consider to be very skilled programmers what they thought I would best need improving on – and I also kinda hinted some things that I needed to improve on myself (I’m a little rusty at my software patterns).

So it has started, I’ve ordered a book from Amazon.com on software patterns to read at the beach while working on my Tan, and to sit beside me at work whenever I run into trouble with them, ala the days before google could solve the worlds problems in one search.

So I guess the next thing i’m going to be learning here along with revisiting software patterns, is DDD. This topic seems to come up quite a bit with the blogs I read about ASP.NET MVC and one of my co-workers has strongly suggested me to learn it! I’m going to be posting my findings on domain driven design and how I can implement it into my Ruby, .NET and PHP projects along the way.

Next Page »