Scala by e-Learning

I’ve seen my share of programming classes over the years (some of which were really good), but I found a new favorite just a couple months ago. The online learning site Coursera was offering “Functional Programming Principles in Scala” by Martin Odersky. Aside from wanting to take a closer look at Scala for quite a while, it was also pretty interesting for me to try out the online class format.

The lecture material was presented in on average 15 minute long videos. They were either showing progress through a set of slides (the recording is showing Odersky’s hand + pen guiding through the bullet points and adding handwritten notes) or screen casts of programming in the IDE. Both formats were very well recorded, clear sound, no annoyances. Slides and videos were downloadable (pdf and mp4) — great for watching on the phone during my morning commute.
The classes were complemented by a total of seven quite crisp assignments that were submitted to an automatic grader after completion. The assignment packages shipped with a set of unit tests that made it easy to check what was expected and also helped to catch how to write additional tests. You would also get feedback from the tests the grader engine ran and could resubmit up to 4 times with improvements. Again, everything nicely documented and well organized.

Overall my main takeaway is, that the simple option of rewinding a lecture like this is pretty priceless. In traditional classrooms, when you don’t understand something on the first try, you are stuck with following the rest of a lecture and catching up offline somehow. Even worse, part of your attention gets split off and tries to figure out in parallel what you missed, making it more likely that you will run into even more problems. Here you just jump back as often as you need. And even better, if you need to stare at a slide for a few minutes before progressing, you do so without getting on anyone’s nerves.

This was my first try with an online class — I hope that I did not just happen to find the best one out there on the first try… 😉

GUI Mockups with Pencil

I came across a nice little free tool for building quick GUI Mockups: Pencil. It certainly has anything you might need for getting a flat prototype done—which is what I am using it for—but you can also go crazy and link multiple pages, export to multiple HTML pages, etc.
The only feature I am missing so far is selecting all elements in an area with the mouse, but overall things work out better for me with Pencil than with Viso or alike.

IIS Timeout on JBoss Transaction

Working more with our setup we started encountering “502 – Bad Gateways” errors when allowing users to run expensive queries on our database and give them the option to export the results. A temporary solution was to increase the ARR timeout as described in this blog post; the server farm settings are relevant for this case.

However, this still leaves us with the problem of some browser timing out on lengthy requests, so that we are now looking into an AJAX solution for decoupling the JBoss transaction from the front-end.

Cygwin Errors with Git SVN

When venturing out into Windows Land, I mostly use Cygwin as command line interface. Unfortunately the Win7 64 bit version has the habit of throwing rather cryptic errors from time to time:

[code lang=”bash”]
$ git svn rebase
0 [main] perl 5248 C:\cygwin\bin\perl.exe: *** fatal error
– cygheap base mismatch detected – 0x61242860/0xD72860.
[/code]

This, and what appears to be its slight variations, can usually be resolved by:

  1. Closing all Cygwin windows
  2. Running C:\cygwin\bin\ash.exe as Administrator
  3. Executing
    [code lang=”bash”]
    PATH=.
    rebaseall -v
    exit
    [/code]

Not overly pretty, but fixes the problem for a while.

MS SQL Reserved Keywords and Hibernate

Surprise of the day, it turns out that User is a reserved keyword in T-SQL. You are still allowed to use keywords as identifiers, but you will need to escape them with square brackets:

[code lang=”latex”]
CREATE TABLE [User] (Id int);
[/code]

So far, so inconvenient. But things start getting really pretty when you clicked your schema together with SQL Server Management Studio, which will hide the keyword restrictions from you. Unfortunately Hibernate is not equally generous, so if you go from there and use your generated Hibernate mapping, you will be presented with a beautiful exception:

[code lang=”java”]
org.hibernate.exception.SQLGrammarException: Incorrect syntax near the keyword ‘user’.
[/code]

The solution for my case was to escape the table name in the related User.hbm.xml to table=”[user]”. Mildly annoying caveat: now the file has to be edited manually each time you generate your mappings, since there is no option to wire this type of adjustment into the reveng.xml.

JBoss and IIS 7

I have spent some quality time today with moving a web application from a temporary development environment (Windows 2003 x86, IIS 6) to a production server (Windows 2008 R2 x64, IIS 7). The IIS-JBoss integration on the development servers has been set up based on mod_jk and worked without causing and troubles. However, reproducing the setup in the new environment was failing miserably. The first impression I am getting from IIS is that even logging is a science for itself, so it was even hard to determine why.

Luckily a forum post finally pointed me in the direction of Application Request Routing (ARR) module for IIS 7 as an alternative solution. Performance might be still a subject to be determined, but the installation and configuration is worlds cleaner compared to the mod_jk version.

Citing Web Pages with BibTeX

When writing reports I frequently want to include references to web pages of organizations and alike into the bibliography. Unfortunately BibTeX does not have a proper entry type for web pages up to date, but there is a whole selection of workarounds. I finally settled for using the natbib package with @MISC entries. Overall I made the following adjustments to my documents:

Including the natbib package and the unsrtnat bibliography style.
[code lang=”latex”]
\usepackage[numbers]{natbib}

\bibliographystyle{unsrtnat}
[/code]

Example for a @MISC entry:

[code lang=”bibtex”]
@MISC{Medicare2011,
author = {{Centers for Medicare and Medicaid Services}},
title = {{EHR Incentive Programs}},
month = aug,
year = {2011},
url = {www.cms.gov/EHRIncentivePrograms}
}
[/code]

Setting the reference with \cite{Medicare2011} finally yields this result:
Citation
Note that natbib allows you a wide variety of citation styles via the \citet and \citep commands, but for simple number references and a display of the URL field in @MISC entries the above will do just fine.

Essential Software Architecture

Essential Software Architecture

Computer science is a field in which you often enough get nervous about about picking up a five year old book because it might be already outdated. Well, either I am behind on the topic or Ian Gorton‘s work is aging pretty well so far; a nice to-the-point cover-to-cover read that might not teach you a world of new technologies, but certainly helps with sorting the ideas about software architectures and architects you might have floating around in your head. In addition to that, it puts concepts such as Web Service, SOAs, MDAs, and Semantic Web nicely into perspective without being afraid to point out where they can’t hold up to marketing promises. I will be looking into getting a copy for my bookshelf.

[UPDATE]

It appears that a 2011 2nd edition has been published in May.