Groupware options for small companies or organizations

(tbd – work in progress… Advice welcome…)

Over the last weeks and months I’ve had multiple people asking for advice about groupware software. For me that is still kind of an open issue and I’m not sure what the best answer would be. These are the options I know and would consider using at this point in time (in Germany):

  • Google Apps – expensive, not everybody wants their data hosted at Google
  • Zimbra OS – on some virtual server
  • OpenXchange (I never understood the licensing/pricing options there)
  • 1&1 MailXchange – hosted OpenXchange service, pricing ok
  • Microsoft Exchange (too expensive for small business)
  • atmail – looks promising, haven’t tried yet

The following list contains the requirements that I would put on such a system:

  • Mailbox for each user with delegation mailbox options
  • Calendar
  • Contacts
  • Mobile sync for Mail, Calendar & Contacts on Android & iPhone, preferably without having to install additional apps
  • Web-mail user interface with Google Mail as a reference “gold standard” – keyboard shortcuts and labels are the killer features of Google Mail for me

Additionally these requirements need to be met regarding server-side and administration:

  • “Domain-level” administration of mailboxes and permissions
  • Automated online backup possible

Actually these two points are the major constraints of Zimbras Open-Source edition which I have been using for some years now. Besides these limitations, Zimbra OS also lacks support for mobile devices (except for IMAP), which is another deal breaker. zextras may help with all of these and I will try it out as soon as I’ll have time for that.

Other options and comments welcome…

Install rails >=1.9.3 on Ubuntu 12.04 (for Redmine) with RVM

Quick reference on installing specific versions of rails on an “older” version of ubuntu without the need of having all packages in the ubuntu repositories.

\curl -L https://get.rvm.io | bash -s stable --ruby
/usr/local/rvm/bin/gem install ... (all needed gems)
/usr/local/rvm/bin/gem install passenger
apt-get install libcurl4-openssl-dev apache2-threaded-dev
/usr/local/rvm/gems/ruby-2.0.0-p247/gems/passenger-4.0.10/bin/passenger-install-apache2-module

The Apache 2 module was successfully installed.

Please edit your Apache configuration file, and add these lines:

   LoadModule passenger_module /usr/local/rvm/gems/ruby-2.0.0-p247/gems/passenger-4.0.10/buildout/apache2/mod_passenger.so
   PassengerRoot /usr/local/rvm/gems/ruby-2.0.0-p247/gems/passenger-4.0.10
   PassengerDefaultRuby /usr/bin/ruby1.8

After you restart Apache, you are ready to deploy any number of Ruby on Rails
applications on Apache, without any further Ruby on Rails-specific
configuration!

After doing so, you can continue to install redmine as described in http://www.redmine.org/projects/redmine/wiki/RedmineInstall

/usr/local/rvm/gems/ruby-2.0.0-p247/bin/bundle install --without development test

This will fail if the environment is not set correctly – this helped me a lot:
http://stackoverflow.com/questions/12127603/usr-bin-env-ruby-noexec-wrapper-fails-with-no-file-or-directory

source /usr/local/rvm/environments/ruby-2.0.0-p247

And finally the last missing gem:

/usr/local/rvm/bin/gem install rake -v=10.1.0

That’s it.

Typesafe viewmodel for MVC frameworks

Ever since I was working with MVC projects, looking at sample code even from Microsoft, I always wondered why everyone is using ViewBag and other “unsafe” techniques for the data to be displayed. I would have sticked to developing PHP applications if I wanted to do that. (And maybe even some PHP frameworks might do a better job than MS from this perspective.)

Now I came up with a very simple solution that I will be using in the future whenever possible: The view-model basically consists of three classes:

  • ViewBase
  • PageBase
  • ContentBase

With this simple setup, there is no need to use the dynamic ViewBag or other constructs that can lead to runtime errors when changes are done to the controller or to the model. Every property can be checked at compile-time for the template _Layout.cshtml as well as for every view.

Continuous improvement

I started writing most of this article back in January and did not have time to finish it since – because I was stuck in doing exactly the things that I wanted to avoid. Now it’s time to finish the article so I’ll be able to compare my recent experience to my oh so nobel goals. This is what I wrote:

The week before Christmas was the last week in the office of a customer I have worked for for a little more than two years – which until now is the greater part of my working life. So at the moment I am thinking about the things that I have learned over that time to being able to apply that in my future work. I write this article as a reference to check against when I will look back at it in a few months to identify things that I have been doing different from the way I wanted to do them.

Only recently two interesting thoughts have been stuck with me: The first was an article that has been linked on Hacker news with the title “Everything is my fault” (http://news.ycombinator.com/item?id=4895335). To me, this meant to always remember not to blame anybody else for the things that are not done in the way I like them to be. Instead, in most of the cases it is myself to be blamed for not changing things or convince the right person about it. The other very helpful thought comes from Eric Schmidt in an interview at the Computer History Museum: https://www.youtube.com/watch?v=NfalakTPsnE&t=3m15s “It was some really smart person who really thought this was really good, and maybe I should understand why, before I just willingly attack them without any basis. My architecture by the way was better, but theirs was good too.” To me this basically means: Don’t be a smart ass and respect people around you – and I am still in the process of learning that.

With these premises in mind I’ll now just document my experience of what I believe are important things that I have learned over the past months.

Project management – tools and processes

The most annoying task I had to do repeatedly was time booking. I think this is a widespread problem and most people in bigger companies experience this, but I won’t accept that in the future and will do everything I can to reduce the overhead. In my case there have been some months in the transition between multiple time-booking systems when I had to book every little task into 4 (four!) systems – the work-items (Team Foundation Server), the old management tool (can’t even remember what that was), the new management tool (Microsoft Project) and the system of my employer to write the bill. To keep track of the hours I had already booked, I kept the hours in a fifth system, an Excel sheet as a “master”. This really is not only annoying, but also is a lot of wasted time and money. I understand that it is necessary to keep track of the hours, even down to “workitem/issues” level, but hopefully I’ll be able to keep that simple. We will keep track of the time in an instance of Redmine and import the entries into the proprietary billing system at my employer.

Another issue that is directly related with the tools being used has been, that the project planning has been done in MS Project, while the work-items to be worked on and booked to were created in TFS. Unfortunately Microsoft hasn’t been able to make those systems compatible (at least not that I or the customer know of). This, too, will be done in Redmine in my future projects (or any other good system, but not distributed over multiple databases…).

Setting up a build-server and doing continuous integration with unit-tests is another thing that I plan to do. I believe that the time invested in early stages of a project pays of big time. The same goes for doing reviews on a regular basis!

Project documentation

Documentation has been an important thing at the recent customer. Most of the documentation has been pretty good and I have learned the importance of having a place to look up specifications at a later time. The hardest part of writing good documentation however seems to be to decide what’s important and what’s not. A good part of technical documentation will always be work in progress and therefore it should be as short and formal as possible. Having technical documentation as close to the source code as possible also helps in keeping it up to date. In one project we used Sandcastle as a doc tool, but I don’t like it because it ads great overhead and took a very long time to compile (over 20 minutes). I will have to look for a better solution for my next project. Suggestions?

Having too much documentation might even be hurtful because it will lead to not reading any documentation at all in the future as well as to outdated information.

Requirements are the most important part of the documentation, but obviously it is very hard to phrase them properly.

The craft – technologies and architecture

As a developer, the most interesting part is the technologies and architecture being applied. My main tasks where to develop front ends using WPF and database services using Entity Framework. Additionally, the communication between frontend and backend has been a part of my job. For one project we used WCF, for others, proprietary protocols have been used. Another home-baked protocol has been used for the communication between the different programs and modules. Communication and thread handling is being done in an internal framework that is being used in almost every component.
While that makes sense for the most part, there was a very strong tendency of creating own protocols, patterns and frameworks instead of using existing solutions. The main reason for that was not to be dependent on external development. Sometimes this may be a valid argument, however my opinion is that it is always better to stand on the shoulders of giants – use open-source libraries, use existing commercial solutions, but don’t roll your own!

Testing

Quality assurance was a very important part of the development process at the customer. It was pretty good – the question is how to apply that to other conditions when it is not possible to have a whole department for it.

People and working atmosphere

I have learned about the importance of knowing each other, transparency on both ends, management listening to “the people” instead of making decisions without being grounded. Also: find the right person for the job. (Keep “creative” (but good) developers on a tight (but not too tight) leash, check & follow up.) It’s important to introduce a new colleague into the environment – both, the people and the technical stuff. Not only should a new employee have time to adjust to a new environment but the entire structure should be optimized to be easily understood. This goes on the micro-level with having a software project structure that can be up and running within minutes as well as on the macro-level with processes within the company that should be as simple as possible.

Well, that’s it for now – I’ll keep this article primarily as a reference for myself to compare to future experiences…

Bézier curves

Some time ago I did some interview question that I just wanted to share mostly because I want to keep a backup of it.

The questions were the following:


  1. We start with three dots (green) on the screen.
  2. We need to connect these dots with a smooth line (blue) rather than direct lines (grey).
  3. What would be your approach if you can use only following methods: lineTo and curveTo?
    lineTo(X,Y)
    Draws a line using the current line style from the current drawing position to (X,Y); the current drawing position is then set to (X,Y).
    curveTo(controlX:Number, controlY:Number, anchorX:Number, anchorY:Number) : void
    Draws a curve using the current line style from the current drawing position to (anchorX, anchorY) and using the control point that (controlX, controlY) specifies. The current drawing position is then set to (anchorX, anchorY). The curve drawn is a quadratic Bezier curve. Quadratic Bezier curves consist of two anchor points and one control point. The curve interpolates the two anchor points and curves toward the control point.

When I first read the challenge and that I’m not bound to any technology, I thought of HTML5, Canvas and SVG. A while before that time I had stumbled upon some impressive samples of JavaScript drawing with Raphael Library so I gave it a try.
Since they stated: “Feel free to use any resources available to you.” I decided to take full advantage of the library, but still had to do the curves calculation.
I also decided to go with HTML5 and Canvas since that is the field of work I like the most – and in addition was the most simple way to deploy and show the code and results.

To get a simple and clean start I used the http://html5boilerplate.com/ template.

All the javascript code of the drawings can be found here: http://mattanjakern.de/share/bezier/js/script.js

So, here’s the result:

play! framework and Google App Engine

I just uploaded my first app to the Google App Engine – which is unbelievably simple with play! framework and the gae module. The application for my test is just 10 lines of code in the controller and all it does (for now) is to extract the URL of the latest Chromium Build from the download page.

The deployment of a play! application requires three pretty simple steps to be executed:

1. Download Google App Engine SDK für Java and extract the zip.

2. Install gae module

$ play install gae

Then the module needs to be registered in conf/dependencies.yml like this:

require:
    - play -> gae 1.6.0

There is one more command I had to run to activate the module (which I don’t know whether it is always necessary because I never had to do that before):

$ play dependencies

3. Deploy and run
And then to deploy the app all there is to do is to run one command, insert Google credentials and the files will be uploaded to the Google App Engine and can be served only seconds later.

$ play gae:deploy --gae=/path/to/your/extracted/appengine-java-sdk-1.6.3

Et voilà: http://kithelpers.appspot.com/

Synchronize a long-running task to the UI-Thread in WPF/.NET

This post explains how to process data from a task in WPF in a way I’d consider “best-practice”. The main code could or should be in the view-model.

Code-behind (keep it short or better yet use a delegate command)

        private void Button_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                // Get some parameters if necessary
                [...]

                this.SomeViewModelData.StartSearch([parameters...]);
            }
            catch (Exception ex)
            {
                log.Warn("Error handling...", ex);
            }
        }

And the code in the view-model:

  • StartSearch() is a method in the view-model class and sets the properties of the view-model that are bound to the UI
  • this.IsWaiting is some bool property to indicate the waiting status in the UI
  • this.ResultData is not bound but contains data to be processed
  • ProcessResultData() processes the result and sets the output (for example it might fill an ObservableCollection)
        public void StartSearch([parameters...])
        {
            try
            {
                var uiScheduler = TaskScheduler.FromCurrentSynchronizationContext();

                this.IsWaiting = true;

                Task.Factory.StartNew(() =>
                {
                    this.ResultData = DatabaseService.GetComplexData([parameters...]);
                }).ContinueWith((t) =>
                {
                    // Invoke in UI Thread via scheduler
                    this.ProcessResultData();

                    // Cancel waiting indicator
                    this.IsWaiting = false;
                }, uiScheduler // <-- This is the important part: Continue
                               // the task in the UI thread
                {
                    if (t.Exception != null)
                    {
                        log.Warn("Task exception handling...", t.Exception);
                    }

                    this.IsWaiting = false;
                }, TaskContinuationOptions.OnlyOnFaulted);
            }
            catch (Exception ex)
            {
                log.Warn("Do exception handling... ", ex);
                this.IsWaiting = false;
            }
        }

Howto: Task and issues tracking with Redmine and Eclipse Mylyn

While working on one of my current projects I came to realize the importance of good task management and issue tracking. Sadly the use of an expensive Team Foundation Server does not guarantee good task tracking when the tasks are only used to do the rough planning in MS Project. Much more important than the tool being used, is to use any tool in a good and efficient way. Even for projects with one single developer, using task management helps to keep track of the progress and to work and focus on subtasks.

Redmine

There are a lot of issue tracking and project management tools out there. I’ve been using trac for quite some time in different projects but then I have been looking for a tool that does the same stuff but allows to manage multiple projects within one instance. After installing Redmine the search was over 😉 Redmine comes with a big feature list and in addition there are some handy plugins, most mentionable the Stuff-To-Do plugin.

To enable synchonization between Eclipse Mylyn and Redmine, the Mylyn Connector plugin needs to be installed in Redmine. To do that, simply cd to your Redmine root dir and run

ruby script/plugin install git://redmin-mylyncon.git.sourceforge.net/gitroot/redmin-mylyncon/redmine-mylyn-connector

Depending on your type of installation, a webserver restart may be required. In addition to the plugin, also make shure that “Enable REST web service” is activated in the Redmine Authentication Settings.

Eclipse & Mylyn

Two Features need to be installed in Eclipse in Order to use the Redmine task integration: Mylyn and the Redmine Mylyn Connector. These Features can simply be installed using these Update Sites:

Mylyn: http://download.eclipse.org/tools/mylyn/update/helios

Redmine Mylyn Connector: http://redmin-mylyncon.sourceforge.net/update-site/N/

After installing these Features, open the “Task Repositories” view and add a Task Repository with these self-explanatory settings:

When the settings have been successfully validated and the new task repository has been created, a new dialog is presented to create the first query for the task repository. The task list can be filtered by every available field of the Redmine task repository. As a result of the query the Task List view gets populated with the task items of your Redmine instance.

The combination of the Eclipse Mylyn and Redmine also provides a bunch of additional features such as time-tracking of individual work items, to filter displayed items by the active working set linked with the selected task and a whole lot more…

And always remember: The most important point is to use project and task tracking in the first place 🙂