My New Blog

In case anyone is wondering. I moved my blog to Medium. You can now read me at: In due course I will be moving over some of my better blog posts.


Notes On SharePoint Business Connectivity Services

The past 2 weeks I had an opportunity to develop a solution with SharePoint 2010’s Business Connectivity Services. I found working with SharePoint BCS to be a delicate process, with a few things not behaving entirely as expected. Here’s a few quick notes to help clarify some of the things that confused me most about BCS:


For each BCS Entity’s Identifier, its Specific Finder must have an equivalent In Parameter. In other words, for example, if you have 2 Identifiers, then your Specific Finder method must have 2 corresponding input arguments.


All the other methods have a dependency on the Entity’s Specific Finder. If you change the fields, or their Type Descriptors, of Specific Finder’s return parameter object, then you have to update the update and create methods accordingly. The principle is explained in the Implementing an Updater article on MSDN: “If there are multiple specific finders, the Updater view should be equal to, or a subset of, at least one SpecificFinder view.” I know it refers to “multiple specific finders”, but it found it to work the same whether there’s one or more specific finders.


Your permissions are removed from the BCS Service Application (in Central Admin), and you get the “Access denied by Business Data Connectivity.”, when you deploy a new BCS model, after changing the methods, Type Descriptors or any other part of the model. This didn’t always seem like it happened consistently. At times, it seemed like it was removing the permission at random, even when I just updated the code of my entities or services.


Make sure you activate SharePoint Server Enterprise Site Collection features for your Web Application.


Whenever I modified a Creator method, and refreshed the page, I started getting strange errors on the list page, and had to recreate the List to fix it.



Playing With Gimp

Playing around with Gimp, using some awesome free ultra high quality images from

Cloudy Shore

Cloudy Shore

Get Up and Running With SQL Server Express, Clojure, SQL Korma and Local Jars

Just a sweet and short little post to help others get up to speed accessing SQL Server Express 2008 with Clojure’s SQL Korma library.

Set Up SQL Server Express

I’m using SQL Server 2008 Express. To configure your DB server go to Start > All Programs > Microsoft SQL Server 2008 > Configuration Tools > SQL Server Configuration Manager. Under SQL Server Network Configuration select Protocols for SQLEXPRESS. On the panel on the right size of the screen, make sure TCP/IP is Enabled, then right click it and select Properties. Select the IP Addresses tab, and make sure you have the following settings:

  1. For IP Address
    • Active: Yes
    • Enabled: Yes
    • TCP Dynamic Ports: Make sure this entry is empty.
    • TCP Port: Make sure this entry is empty.
  2. For IPAll:
    1. TCP Dynamic Ports: Make sure this entry is empty.
    2. TCP Port: 1433

Enable SQL Server mixed mode authentication (SQL Korma doesn’t do integrated/Windows authentication). Run regedit.exe and go to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL10.SQLEXPRESS\MSSQLServer. Change the LoginMode to 2, and restart the SQL Server Express service.

Okay, so we can now create SQL accounts on SQL Server Express, so let’s enable the SA account with SQLCMD:

  • sqlcmd .\SQLEXPRESS -E
  • GO
  • ALTER LOGIN sa with password=’aPassword’
  • GO
  • exit

Maybe you don’t want to enable the SA account, but rather create a new non-sysadmin account, as it’s a security risk to use SA for your apps. I just used it here, as it was the shortest way to get a SQL account ;-)

Load The SQL Server JDBC Driver Into a Local Artifactory Repository

Download JFrog’s Artifactory. Go to Artifactory’s bin folder and run InstallService.bat. Then launch Artifactory with  artifactory.bat, and browse to http://localhost:8081/artifactory/webappGrab Microsoft SQL Server JDBC Driver 3.0 and load it into a local Artifactory repository with the following settings:

  • GroupId: sqljdbc4
  • ArtifactId: sqljdbc4
  • Version: 3.0

The reason we’re using Artifactory, is that Leiningen demands that all your dependencies come from a repository somewhere. Since Microsoft’s JDBC driver isn’t available on a public repository like Clojars, is make it available from a local repository. You’re other option is to directly load it into a Maven repository, but trust me, this is time consuming and something you want to avoid.

Now add your local repository to Lein’s defproject, :repositories {“ext-release-local” “http://localhost:8081/artifactory/ext-release-local/”}. You can see I chose to load sqljdbc4.jar into the ext-release-local repository. Also add the SQL Server JDBC driver as a dependency: [sqljdbc4/sqljdbc4 “3.0”]

Make a Nice Clojure SQL Korma

And finally drop SQL Korma as a dependency into your Leiningen project, and do the rest of its configuration as specified on Git Hub:  [korma “0.3.0-RC4”]. If you’re new to SQL Korma, like I am, you might think that (defentity …) will also create your database objects for you. Not so! SQL Korma doesn’t have this feature currently (version 0.3.0) – hopefully they’ll add it in future. So make sure you’re DB objects exist and that the defentity statements correctly map to them.

Sounds like a few simple steps, but I took me unnecessarily long to piece all the above together, and get to the point of accessing SQL Server Express 2008 with SQL Korma. Hopefully the above will help others to reach SQL Server and Korma Nirvana, one time!


Vietnam: A Journey Begins

My wife and I recently spent about 3 weeks in central Vietnam, and a few days in Singapore. As I’m absolutely hooked on history, our trip largely revolved around exploring the history of Singapore and Vietnam, and Vietnam’s in particular is vast and very colorful. Over a series of blog posts, I will be giving a personal account of the history of central Vietnam and a little bit of Singapore, that we explored during our recent holiday. As the first blog post in the series, I won’t discuss any history, rather just give a very quick overview of the things that most South Africans ask about, when we discuss our holiday in Vietnam.

From Singapore, we flew directly to Da Nang, where central Vietnam’s airport is located, then moved to Huế, and finished our holiday in Hoi An. Also keep in mind that my opinions are based on my experience in central Vietnam. The bigger cities in the far north, Hanoi and south, Ho Chi Minh, might be quite different, just like Cape Town is vastly different from Johannesburg.

Why We Chose Vietnam

It was an inspired, intuitive decision, based on the Vietnam Eyewitness Travel Guide . My only criteria for our overseas holiday, was that I’d like to visit any country with an ancient, rich and vibrant history. I think a further motivation was the exchange rate with the Rand and the fact that things are just cheaper in Vietnam (in comparison I realized South Africa isn’t such a cheap place), which made things a lot more affordable for us. I would say, on average, things are about 50% cheaper in Vietnam than in South Africa. That goes for everything from hotels to buying things at a street market. I envy how cheap a holiday in Vietnam must be for the Europeans and British.

By the way, about the Eyewitness book. It’s a wonderful little book to get inspired about the country, but don’t depend on it to get around Vietnam day-to-day. Your Swiss army knife of info, to survive in Vietnam will be the Lonely Planet’s guide on Vietnam. That book was essential to ensuring an enjoyable stay in Vietnam.

The American War in Vietnam

The first thing most people asked, is if they have yet fully recovered from the war against America. The answer to that is an unequivocal, Yes! There are absolutely no signs in any of the cities, that there has ever been a war like that in Vietnam. And I would hope so, the American war in Vietnam ended almost 40 years ago. At historic buildings and sites some signs of the war are still visible. This is hardly surprising, since these buildings are historically significant and a heritage, therefore major restorations are not really possible or allowed.

When South Africans ask me this question, I realize just how little we know about Vietnam (and the same is true of them about Africa), and that the only, outdated, knowledge South Africans have of this amazing country and people, is that which they got from western news back in the 1970s and American war movies.

Socio Economics

In short there are few rich people in Vietnam. But, there are very few people that are desperately poor. Unlike South Africa, where there is a small group of people earning a decent living, and then a massive number of people struggling to make ends meet. Something that really got my attention, was the fact that there are no informal settlements in central Vietnam. Almost everyone has a pretty little house to live in, and many even have a small holding, that they can cultivate. There are also none of those characterless, mass cloned, little matchbox houses, that the South African department of housing builds. Each little home has it’s own style. The main buildings all have the same narrow, rectangular structure, but each building has been given its own unique style by its owner. Everyone wants to sell you something, but you won’t find any beggars at the street corners.


As anyone that has spent some time with South Africans would know, we are always obsessing about crime. I’m therefore pleased to announce that Vietnam is a very safe place indeed. Safer than South Africa. We’ve heard of people’s wallets being pinched, and someone might try to scam you in a transaction at the market, but there are no armed robberies, where peoples’ expensive valuables are stolen at gun point or knife’s edge. For example, you can walk around in the street, late at night, taking pictures with your expensive camera, without fear of being robbed.

The People

The Vietnamese people seem to be a happy bunch, that’s content with life. Everyone was extremely friendly, and helpful (especially if they have something to sell you). Compared to the Singaporeans, I found the Vietnamese to let more of their emotions show. Warm, hearty laughs and smiles, frowns and even arguments in public were more frequent. Whereas the Singaporeans kept an efficient straight face most of the time. In Da Nang we even saw an older lady (I’m guessing the mother) have a massive argument with a younger lady (I’m guessing her daughter), where she later took off her sandals and started hitting the younger woman.

I got a strong sense that the average Vietnamese really doesn’t know a lot about the world outside their country’s border. From the confused expression on their faces when we answered that we’re from South Africa, it was obvious that most Vietnamese would struggle to find South Africa on a map. Most of them thought we were German (but I don’t blame them for this, I would draw the same conclusion listening to Afrikaners talking), and then some went on to tell us, after realizing that there is “Africa” in our country’s name, that we can’t be from South Africa because we are, you guessed it, white!

Twice Vietnamese were so amused to see some westerners, that they started taking photos and videos of us, right in our faces. Now that was a strange, and slightly awkward, experience.


No surprises here: Vietnamese speak and write Vietnamese. However, I was expecting the English conversations to be a much bigger problem, but it turned out that most people’s English is good enough to get the job done. English of younger people from cities are actually good enough to allow a decent conversation.

You Can Also Have A Resort Holiday In Vietnam

As I’ve already mentioned, I’m completely addicted to history. So our holiday was specifically targeted at exploring, experiencing and learning about Vietnam’s history, mainly until about the 1920s (i.e. we didn’t really pay attention to the anti colonial revolution against France, and the American war in Vietnam). We visited as many historical places as we could, and often had to walk or cycle long distances in +35°C temperatures. This isn’t very comfortable, and sometimes even a little stressful to find your way, by yourself, in an unknown place. We also stayed in the heart of each city’s centre, which isn’t always the sexiest location, but it’s closest to the action.

However, if you prefer to have more of a resort type holiday, where you relax all the time and enjoy long walks on perfect white sandy beaches, then Vietnam can offer you that as well. There are a large number of modern, luxurious beach resorts to choose from, on the beach from Da Nang to Hoi An (called China Beach). So if you’re thinking of spending a holiday at a Thailand resort, maybe also check out its equivalent in Vietnam. I can highly recommend the Hoi An beachfront for those looking for a hassle free, chill holiday. Hoi An is an old town, that has been beautifully maintained and restored. So if you stay at the Hoi An beachfront, then you will get the best of both worlds – the beach resort and classic town lifestyle. Personally, I found Hoi An to be a little boring, and too much tourist focused. For example, in Hoi An’s old town, there are literally more tourists, than Vietnamese.

What An Absolutely Amazing Country

We absolutely loved Vietnam. It was one of the most profound experiences of my life. The vibrant history, people, temples, pagodas, tombs and natural beauty was unforgettable. During a three week stay we hardly scratched the surface of what Vietnam has to offer. We will definitely return in a few years (permitting finances allow it), probably to Hanoi, as that is the heart of Vietnam’s northern history.

The Other Side Of Job Creation

It astonishes me to see how everyone buys the ‘job creation’ story the state and media sells them, without considering the bigger picture. What I believe most people fail to ask is how many jobs were not created elsewhere, where there is a greater need or bigger demand. In order for new businesses to flourish, it will require reallocation of capital and people and their skills to higher yielding industries and businesses. This process is very important to the agility and livelihood of a healthy economy, where unproductive businesses close down to make way for new ones that can use the resources (capital and people) better, because they can better provide things people really want at prices they’re willing to pay. When government (and the labor unions) intervenes in this process, they waste capital by not directing resources to the most desirable industries and businesses, and applying it to their political agenda.

Consider this about private businesses: If they fail to produce in the cheapest and best possible way those things which people most need, they suffer losses and are eliminated from the economy. Other businesses who know better how to deliver the right things, at the right price, replace them. This is how inefficient businesses get eliminated from the economy, a kind of survival of the fittest. If you take the wrong decisions in business, you get punished very quickly. Do it long enough and you’re out.

Now consider this – government’s ‘capital’ comes from tax or debt. Debt is just borrowing against a government’s future income, that in turn comes from tax. Therefore, ultimately, all government’s income comes from tax. But in government’s case there is absolutely no incentive or threat to use it efficiently. Because government doesn’t get eliminated from the economy when it makes the wrong decisions about how and what to use resources for, it continues to do so at a much greater cost to the economy.

With every new ‘job creation’ project government funds, that same amount of money was previously taken away from productive businesses. Because of government’s inefficiency and misallocation, it is very likely that a lot more could have been done with the resources elsewhere, including hiring people. Also, based on what criteria does government direct resources? Yes, a lot of it is probably for the “greater good” and altruistic in nature, but an enormous part of the criteria is determined by political, emotional, subjective and selfish factors.

Another thing I find quite amusing to read is how the competition commission hunted down and punished the latest business cartel that is hurting the man on the street by manipulating prices. What is a cartel other than a type of monopoly? And we all know how much our beloved socialist government loves their state controlled monopolies: Eskom, Transnet, Telkom, PetroSA and Infraco. And what they don’t already control under these state enterprises and government departments, I’m sure they are planning to take over soon. By the sounds of it, mining and banking is next on the cards. So on the one hand government continuously seeks to end anti-competitive behavior, but on the other it’s recommended as the best solution to the nation’s problems. If there’s one thing the South African economy needs is more competition, but not only in the form of a reactive central watchdog that runs around trying to police the 3 or 5 big players in each industry. Instead we need to focus on growing the size, quality and number of entrepreneurial businesses in each industry.

At this stage government and the labour unions, are blocking the free readjustment and reallocation of resources to new businesses that can use it to better produce that what is required more. Government sucks more resources out of the economy, in the form of tax for their ‘job creation’, and labor unions force artificial labor costs on businesses. Instead of addressing the true underlying problems of our economy, government chooses to prop up ailing industries and expand the public sector. In the long run this will do very little to solve the dysfunctional structure of our economy:

1. There is poor separation of concerns between the labor unions, Cosatu, and the government. Cosatu helps the ANC government stay in power. Let’s not forget they were the big reason Zuma was elected as president, and election after election tell their members to vote for the ANC. This makes government unlikely to make the necessary labor and economic reforms, needed to pursue a true growth strategy.

2. Labour unions and the ANC government must accept, that it’s impossible to keep all current jobs, with increasing salaries, and have meaningful success in creating new businesses. Rather focus on creating new businesses, making current ones more competitive and allowing labour to adjust to the industry’s natural cost and employment structure. This means there will be jobs lost, before new ones can be created.

3. The ANC government must also realize that the free market economy is better at determining how to use resources. Resources are still wasted in a free market economy, but not for long. Expanding the public sector payroll, increasing grants, and so forth, requires more tax money, which in the end defeats their original purpose of improving living conditions.

Government Covers Up Underlying Problems by Increasing Public Sector Employment

By April 2010 the private sector (excluding agriculture) lost some 377,000 jobs from a peak in October 2008. Since then the private sector has only been able to add a 94,470 jobs, and the public sector added 106,503 or 53% of 201,000. In July 2011, private sector employment has grown 0.5% since a year before, and the public sector 3.3%. I’m just wondering what all these new government employees are doing? What are they creating that other people need? What new industries, technologies,and specialized skills are they mastering?

National departments’ wages also increased by 11.3% for the year to July 2011, and increased by more than 10% for the past 2 years. Private sector wages only increased by 7,4%. So clearly the place to work in South Africa is at government departments. This has to mean that these people are making the most important contributions to our economy, or does it? The figures seem to suggest they own specialized skills that are in high demand, because not only is the country hiring more of these people, but we’re also paying them more.

To get a picture of the SA government’s debt, I quote a sentence from the SA Reserve Bank’s Quarterly Bulletin for December 2011: “As a ratio of gross domestic product, national government’s total gross loan debt increased from 35,4 per cent to 37,3 per cent during the period under review.” So quite an innocent figure really, especially considering that America’s debt to GDP is 100% and Greece’s is 150%. But as in all things finance, it’s the trends that reveal the truth. In 2007 this figure was 27.4%, and except for 2008, has grown every year since then. Makes one wonder if South Africa isn’t maybe Africa’s version of a Greece in the making?


My New Chomma, Clojure

A few months ago I decided that it’s time to learn a new programming language that’s completely outside my normal frame of reference. After watching a video on InfoQ about the future of programming languages, I decided Clojure would make an interesting choice. I bought the Pragmatic Programmer book, and what can I say, we’ve been becoming good friends these days.

I think I’m taking to the functional programming paradigm, and like the idea of pure functions, without shared state. Even when I program C#, I tend to make heavy use of its closures like delegates, events, anonymous methods, and lambdas, using methods as data. Learning Clojure is quite a challenge if you’ve been conditioned by years of static typed, imperative programming.

A Very Basic Clojure Work Flow For Beginners

What I’ll describe here is a very basic workflow that will enable you to write some trivial Clojure apps and work through some of the examples you might find in books and on the web. Some of these tasks aren’t that clear reading the available material, as the authors usually skip to the more exciting parts of the language.

1. Get Counterclockwise for Eclipse
2. Create an executable command line script (in my case I called it to launch Clojure REPL (Read Evaluate Print Loop or Interactive Console) with the required libraries referenced in the class path (Clojure runs on the Java VM):

java -cp .:src:lib/JLine/jline-0_9_5.jar:lib/clojure-1.2.1.jar:lib/clojure-contrib.jar jline.ConsoleRunner clojure.main

This adds the necessary packages to the Java class path, and launches Clojure. JLine adds functionality to the Clojure REPL, like being able to press the up arrow to retrieve the previous command.

3. Compose your Clojure application by grouping related functions in the same namespaces. The first difference you’ll notice between Clojure, and an imperative language like Java or C#, is that it doesn’t have classes, only namespaces or packages. You define a namespace with the ns function:

(ns algorhythm.test.geometry.trigonometry-tests)

This tells Clojure to switch to that namespace, and if it doesn’t exist to create it, and to create all consecutive functions defined under it. To import another namespace to make its functions available you use the “(:use”:

(:use clojure.contrib.test-is algorhythm.geometry.trigonometry algorhythm.geometry.geometric-vector)

4. Start by writing some unit tests for your Clojure application. Or if you don’t do Test Driven Development (TDD), you can skip straight to 7, writing your actual implementation.

(ns algorhythm.test.geometry.trigonometry-tests
(:use clojure.contrib.test-is algorhythm.geometry.trigonometry algorhythm.geometry.geometric-vector))

(deftest find-longest-vertex-should-find-the-longest-vertex
(def triangle {:vertex-y (struct-map geometric-vertex :length 65 :link (struct-map vertex-link :angle 90 :vertex-name “vertex-x”)),
:vertex-x (struct-map geometric-vertex :length 99 :link (struct-map vertex-link :angle 20 :vertex-name “hypotenuse”)),
:hypotenuse (struct-map geometric-vertex :length 91 :link (struct-map vertex-link :vertex-name “vertex-y”))})

(is (= 99 (find-longest-vertex triangle))))

First create and switch to the namespace where we’re going to define our unit tests. Then we tell Clojure to reference the Clojure.contrib library, where Clojure’s unit test framework is located. You then declare your unit test functions, with (deftest …), and do assertions with (is …).

5. Launch Clojure’s REPL from terminal and load your unit test .clj files with (load-file …).

jacquesd@ubuntu:~> ./

Clojure 1.2.1
user=> (load-file “source/algorhythm/test/geometry/trigonometry_tests.clj”)

6. Run all loaded unit tests on the Clojure REPL with (run-tests). They will fail.

user=> (run-tests)

7. Now, write your required functions and repeat the cycle from 5. More specifically in our example, we should be writing algorhythm.geometry.trigonometry and algorhythm.geometry.geometric-vector, that’s required by our example unit test.

Okay, that’s my 2c to help your Clojure baby steps along. Preferably you’d opt for a proper project build system, like Leinigen, instead of manually loading and executing files through the Clojure REPL. But that’s a story for another day…