Jul 27

What does it take to be a software developer?

I have been interested in electronics for the past 30 years or so. Before that I was interested in chemistry, particularly chemical warfare. I gassed moles and other garden pests; eventually I almost gassed myself. I decided that Chlorine was not for me and I turned to electronics. I did a lot of HF stuff, first with valves, then turning to semiconductors. When computers became affordable, I dug into those, too. 6502 was my pin code for years…

I now work for a big corporation. I kind of do niche work, stuff that is not the main stream business of “my” company. It is challenging, rewarding, and enlightening, in a sense. Now “my” corporation thinks that I was born with this knowledge, or magically was indoctrinated with it since I joined the club. Well, I forgot, big corporations only hire folk who have a genetic disposition to do the job, like developing software; in other words: it comes automatically, much like the pay check every month.

That means, off course, that buying computer magazines, the latest hardware, subscribing to news lists, spending hours and days of your private time to keep abreast of developments are a complete time and money waster, as all this knowledge is already in my genes, or is it?

Well, I am not sure. I always thought that having a job that interests me privately, as a hobby, was the ultimate fulfilment. But that is not recognised by “my” big corporation. If you weren’t born a software developer, you’ve got to be damn grateful to be able to call yourself one; at least as long as you are part of a big corporation…

Jul 19

Ok, this post has nothing to do with the old Biblical story of the suffering Lazarus, nor is the information presented in this post anything new. However, I was amazed (again, after some years of absence) that a) the Lazarus project is alive and kicking (something that cannot equally be said about it’s commercial brother, Delphi), and, b) that it so wonderfully easy to write a Linux application. I had used Free Pascal and it’s IDE Lazarus in the past, both under Windows and Linux (OpenSUSE and the Fox Board embedded Linux), but I had kind of forgotten about it :-( .

However, I needed quickly a programm that connected an embedded machine via TCP/IP to my Windows PC, and in less than an hour I had it working perfectly. I can only recommend this great tool to anybody who needs small footprint application on Linux (you could say that about Windows, too, I guess), whithout the overhead of Mono (.NET) or Java. I have never tested this, but common sense tells me that such natively compiled applications should also be faster than anything based on an underlying framework (be it .NET/Mono or Java).

So, give it a go, enjoy, and provide some feedback on your experience…

Jul 18

1. Cevapcici

2. Friendly Officials ;-(

3. Toilets without lighting

4. Beautiful women

5. Good and plentiful food, all the time, everywhere, any occasion

6. Rakija before breakfast (urrgh)

7. Karaoke, combining every possible Balkan language with every possible foreign accents.

 

More on all of that as time moves on…

Jul 17

From http://www.marcclifton.com/DbTheFutureIsComing/tabid/134/Default.aspx

Now, I think this is absolutely brilliant. So, to test your comprehension of satire English, read the following...

Db – The Future Is Coming

Download Full Demonstration Application – 1 byte
Download Full Documentation And Examples – 4.01 Terabytes
Introduction

This article describes the next generation object oriented programming language, called Db (pronounced D-flat), which is a minor but key improvement to the C# (pronounced C-sharp) language. I’m not going to cover all of Db’s improvements, just a few to get you started thinking about what’s down the road.
Classes

First off, classes have always been confusing with all those pubic, protected, and private fields, properties, and methods. To make it easier for simple-minded programmers, and to make it more visual (since we use visual tools), the creators of the Db language have decided to create three different kinds of classes: lower, middle, and upper classes.
LowerClass

The LowerClass is differentiated from all other classes in that they have no property and all their interaction is done in fields. Another differentiation is that a LowerClass has no methods. Other classes interact with a LowerClass only through its fields, which of course are publicly accessible to the UpperClass instances. A typical LowerClass would look like this:

LowerClass SomeDemocrat
{
int rent;
int debt;
int[] children;
bool education=false;
}

MiddleClass

A MiddleClass has some methods and some private property. The distinguishing feature here though is that a MiddleClass doesn’t have any fields. A MiddleClass however can own a LowerClass, providing the necessary access to fields. For example:
MiddleClass Libertarian
{
Apartment rentals[100];

void ManageRentals();
}

UpperClass

An UpperClass has completely private property and methods. In fact, an UpperClass is so private that its property and methods are completely inaccessible to other class types. All property is not only private but also secured and insured. An UpperClass only interacts with other UpperClass instances, usually through design patterns such as CountryClub and BoardRoom. For example:
UpperClass BigShotRepublican
{
Investments portfolio;
Yacht coasts[6];
Lobby inPocket;
}

In C++, classes could be “friends”. Db has a similar concept, automatically applied to UpperClass instances, called the “Lobby”, allowing UpperClass instances to communicate with each other.
Exception Handling

In C#, exception handling is used to unroll the stack with the “throw” keyword. In Db, this is again made more visually intuitive with the following keywords:

* throwUp
* upChuck
* puke
* ralph
* hurl

These convey different levels of exception severity and can be used by your application to determine the size of the bucket needed to catch the exception.
System Exceptions

Db includes two exceptions that are used by the .TEN framework to convey exceptional severity:

* drivingThePorcelainBus
* technicolorYawn

You will need a very big bucket for these exceptions, as they generally connote a total system failure of the .TEN framework. Sometimes the bucket can overflow, so you’ll need to stack buckets so they catch the overflow.
Delegates And Events

A LowerClass object never has any delegates, but usually has many events. For example:
LowerClass JoeShmoe
{
event CarBrokeDown;
event LostJob;
event CheckBounced;
event BillCollectorCalled;
}

whereas an UpperClass object never has any public events, but many delegates. For example:
UpperClass JosephHenryDickensTheThird
{
delegate Maid;
delegate Butler;
delegate Driver;
delegate Cook;
anonymous delegate Wife; // mistress
}

Generics

Db gives you access to generic Hash, Pot, Coke, Crystal, and other useful collections. These are cheaper implementations than those found in C#, reducing (if not actually eliminating) memory requirements, and in fact, the new generics actually accelerate the performance of your application. All the generics are handled in the StreetCorner.Pharmacy namespace. Another benefit to the new generics is that they automatically spawn additional threads. The programmer should be careful that these other threads do not result in schizophrenic or psychotic behavior of the application. However, used in moderation, they can definitely enhance your end-user experience.
Value Types

The creators of Db took the advice of “Nine Reasons Not To Use Int” to heart, and have therefore omitted the integer value type. All numbers are expressed as rational factorials, in the form of n! + m! … / a! + b! … This approach handles real, imaginary, rational, and irrational expressions. It seems those monks were right. By the way, generics are useful when working with these value types. It makes the concept a lot more understandable.
Serialization

The creators of Db also took the advice of “Nine Reasons Not To Use Serialization” to heart, by omitting all ability to actually save any of your data in any format whatsoever. There is absolutely no serialization support in the .TEN framework, and in fact, it actively ensures that you do not write your own. This completely eliminates any issues with versioning, mysterious operations, etc., and should be welcomed by all programmers. No more serialization hell!
Other Keywords

The following keywords, found in C#, have been replaced with better ones.
Abstract

All classes in Db are automatically abstract. If you really need to do something real, you have to use the “concrete” or “cement” keywords.
As

In C#, the “as” keyword is way of casting, and will return null if the object cannot be cast to the desired type. In Db, the “like, you know” keyword is used instead. This keyword will only fail if you are actually working with concrete classes.
Catch

The catch keyword has been replaced with “bucket”, so that throwUp can be properly handled.
Lock

C#’s lock keyword has been replaced with lockdown. This immediately prevents any I/O from occurring, safely ensuring that nothing can come in or out of your application until the security administrator removes the lockdown. This also prevents non-concurrent threads from simultaneously accessing the same fields and creating mass confusion and hysteria among the LowerClass instances.
Try

The C# try keyword has been replaced with “hope” (alternatively, “pray”), as in (see below for brace syntax):
hope
{}
// this works
{}
bucket
{}
// ewwww.
{}

Syntax

All the “C” languages have been plagued with confusion regarding brace style. Db completely and forever resolves this problem by enforcing different brace styles depending on what the code is doing. For example, there are three kinds of loop expressions, “for”, “do”, and “while”. In Db, these require different brace styles:
For
for (something)
{
}

Do

do
{{
// something
}}

While

while (foo)
{{{
// something
}}}

This has the wonderful advantage of not needing to put those stupid // end “for” comments at the end of a loop, because know you know what kind of loop is being used by the brace format! This format is enforced by the compiler and will generate a syntax error if you do not comply.

To differentiate with other code blocks, like “if” and and “hope-bucket”, the following brace styles are used:
If
if (something)
}
// do something
{

Bucket

hope
{}
// something
{}
bucket
{}
// eww.
{}

As you can see, the bracing style now conveys useful information.
Lamb-huh?

This extension should only be used if you, and everyone on your team, speaks with a lisp. Otherwise, mixing Lamb-huh and Db will simply result in a lot of confused looks.
Linq

Linq stands for Language INtegrated Query. We prefer that you simply don’t ask. That way, we don’t have to tell you. Ignorance is bliss, as they say. What do you want to query anyways that you don’t already know if you just meditated?
Refactoring

Refactoring–sounds like a remake of a B-rated movie. OK, so maybe your code is a B-rated movie. But do you really want to just remake your code with some MaxFactor lip gloss? The Integrated Everything Environment! (IEE!) provided with Db comes with a revolutionary new technology called NEUROFACTOR (trademarked, patented, copyrighted, we’ll sue your unborn child before he’s a bulge in your pants. Some restrictions may apply. Works only on the male brain. The male rodent brain to be precise. No animals were harmed in testing). With NeuroFactor, simply type what you mean, and the IEE! will automatically translate it into beautiful, fully functional, no need to test, code. Throw away your unit tests, improve productivity by 10000%! Warning. Entering Visual Basic code with NeuroFactor enabled will permanently damage the heuristic AI algorithms.
Conclusion

We hope this has given you a taste of the advancements coming your way in computing languages! And as a final note to the Db language, we’d like to thank the language creators for writing this article in time for the April Fools Day deadline.

Jul 15

I notice that blogging takes some time. After all, I do not want to relay any odd thought to the world, but a little of any substance. During the week my head is full of work items, which I am not allowed to blog about. The weekend takes some time to calm down, but towards the end of Sunday the thoughts are beginning to assemble. So bear with me, if you are expecting frequent uploads. It is like painting, I guess, one day it flows, next days you just cannot get an brush stroke the way you want it to.

Now, does that mean, us internet bloggers are artists? I think, in a way we are. It is a bit like writing prosa or poems, just that blogging is kind of immediate. That is why blogs seldom rhyme. To create rhymes you need to sit down and assemble carfully, what your thoughts are, and squeeze them into the corso of what is a scheme for a rhyme. I used to be pretty good in producing Sonnets, even in English. In fact, I pride myself in passing a university exams for a Kiwi doing remote studies from Berlin. She was rather lazy (pro-crastinating – is that the proper word?), so I went ahead and did much of her homework and exams stuff for her. Was she annoyed that I ( as a German) got better marks for English stuff than her…

Well, do not expect me to blog in Sonnets in the near future. I don’t think in Sonnets, but I like the fact that my thoughts can just flow.

Another area I got myself invloved with was the translation of German recipes into English. Was that funny: Schokoladen-Knusper-Kuchen. I cannot remember what I translated that into, but it was hilarious and got the candidate in question an ‘A’.

Have you ever thought of writing software in Sonnets? Wouldn’t that be a challenge? I have to sleep over that and come up with an idea. I think Sonneting software would revolutionise the industry…

Maybe I am just a little mad….

Jul 12

(from Eurozine)

Niels Kadritzke
Cyprus – Kypros or Kibris or both?

More than four years after the failure of the UN-sponsored Annan plan, the Greek Cypriot president, Dimitris Christofias, and Turkish Cypriot leader, Mehmet Ali Talat, are to re-open negotiations on 3 September. But in spite of their declared aim to agree a bi-zonal federation by spring 2009, the political crisis in Turkey may undermine their efforts to reunify their common homeland

This article was first published in Le Monde diplomatique (English language edition) 08/2008.

Visitors to Cyprus are bombarded all the way from the airport at Larnaca with leaflets and posters encouraging them to move to the island – Welcome to Cyprus! – and to buy a home in the sun, as if the only problem were to persuade foreigners to invest in property. But that isn’t the only problem. When they reach Nicosia their mobile phones make it clear that Turkcell controls the airwaves here, giving a stronger signal: Welcome to Turkey!

The problem of Cyprus has been a problem for the world since the 1950s, and for Europe since 2004, when the Republic of Cyprus joined the European Union. The republic’s writ doesn’t run in the northern part of the island, the Turkish Republic of Northern Cyprus (TRNC) established in 1974.

Turkey, which has 40,000 troops stationed in the TRNC, is the only country to recognise this international legal curiosity. The UN and Greek Cypriots regard it as occupied territory and it is outside EU jurisdiction. This does not prevent Turkish Cypriots from enjoying all the rights of EU citizens, including freedom of movement in the 27 states of the Union, provided they have Republic of Cyprus passports, which most do.

Cyprus is the most complex, extraordinary and intractable problem in the EU – but there is hope. This spring, the border crossing on Ledra Street in the very heart of Nicosia was opened to pedestrians. They can now move directly between the Greek and Turkish parts of the old walled city and 110,000 did so in the first month. The formalities are minimal: a form to be filled on the Turkish side, and questions about meat imports on the Greek side.

This has advantages for both sides. Turkish shops now display their prices in euros, the Greek branch of Debenhams employs Turkish-speaking staff, and shoppers have a symbolic promise of good times in their pockets: the Republic of Cyprus joined the euro zone in January, European currency is accepted everywhere and new coins carry the country’s name in both languages, “Kypros” and “Kibris”, the first Turkish word to appear in the euro zone.
A green line
Ledra Street is where the division began 35 years ago, when a British officer drew a green line through the middle of Nicosia after clashes between Greek and Turkish Cypriots in 1963. The following year UN troops were called in, and the demarcation line was extended right across the island after the Turkish invasion in 1974. The problem has defeated five presidents of the Republic of Cyprus and five UN secretary generals. Progress on Ledra Street is a direct result of the defeat of the former president of the Republic of Cyprus, Tassos Papadopoulos, in the elections in February. He was mostly responsible for the Greek Cypriots’ rejection of the peace plan proposed by UN Secretary General Kofi Annan in 2004[1]. He persuaded them that time was on their side and that they would be able to exert more pressure on Turkey once Cyprus joined the EU. The decisive reason for Papadopoulos’s defeat was that most Greek Cypriots realised that he was wrong: time was working against reunification. So, this time, two-thirds of them voted in the first round for Ioannis Kasoulides and Demetris Christofias, who promised to reopen negotiations with the Turkish side. And in the second round they elected Christofias, a leftwinger and a patriotic Cypriot, not a covert Greek nationalist.

The left in Cyprus was always dominated by traditional communists, even under British colonial rule. But despite its impressive Marxist-Leninist rhetoric, the leading Progressive Party of the Working People (AKEL) was a Mediterranean variety of Labour Party, based on strong trade unions and farmers’ cooperatives[2]. The communists appealed to both sides and many Turkish Cypriots were party members. The Republican Turkish Party (CTP), to which the president and head of government in the north belong, was affiliated to AKEL for many years, the party leaders were good comrades, and AKEL is still trusted by many in the north.

Christofias represents another break with the past in that AKEL did not play an active part in the civil war started by the Greek Cypriots in 1963, whereas Papadopoulos had a bad reputation as a former leader in the campaign for unification with Greece (Enosis) and as an organiser of illegal Greek militias.

Papadopoulos and Christofias represent two opposing visions for the future of the Republic of Cyprus: Papadopoulos wants a sort of second Greek state with some rights for the Turkish Cypriot minority; Christofias has a Cypriot vision of a federation of two states with equal rights.
First apology
So observers were surprised and leftwing Turkish Cypriots were shocked when they joined forces in the 2003 elections and Christofias helped Papadopoulos to win. When Christofias stood against Papadopoulos five years later, many saw it as a belated confession that he had made a mistake in 2003 that had sealed the fate of the Annan plan. On taking office, Christofias apologised, the first president of Cyprus to do so, for the crimes against Turkish Cypriots committed 35 years before. Ferdi Sabit Soyer, prime minister of the TRNC and head of a government based on president Mehmet Ali Talat’s Republican Turkish Party (CTP), has no doubt about the new president’s good intentions, but he does not think he will be able to get the Greek Cypriots to accept a “realistic solution”. As he says, Christofias is still harbouring in his government representatives of the no camp, committed to the Papadopoulos line[3].

Soyer is right. But it is ironic that he should point out that Christofias is saddled with enemies of compromise. The enormous desk in Soyer’s office is flanked by the TRNC and Turkish flags and there is a portrait of Kemal Ataturk on the wall. The Turkish Cypriot government has a political partner that it cannot influence or defeat in elections: Turkey is a guarantor power of the Republic of Cyprus with internationally disputed rights of intervention, but the real power in the north is the Turkish army, which also controls the police, the fire brigade, and the intelligence service. The Turkish Cypriots are right to call the prime minister “pasha”. The pasha was the sultan’s representative under the Ottoman empire.

The Turkish army will be an unseen presence in the negotiations between Christofias and Talat scheduled to start in September. The general staff in Ankara regard the problem of Cyprus as a national issue on which they must have the last word. This was made very clear to the president of the TRNC when he tried to open the Ledra Street crossing in January 2007 without permission from the Turkish army. He was summoned to Ankara and lectured by the chief of the general staff, General Mehmet Yasar Büyükanit, on the limits of TRNC “sovereignty”.

The good relations between the TRNC government and Recep Tayyip Erdogan’s government in Ankara are a source of concern to the military. The current power struggle between the Kemalist camp and the Justice and Development Party (AKP) in Turkey also creates problems for Talat and Soyer. The army was behind the move of the Constitutional Court to have the AKP banned, and though the ban was averted, the power game in Ankara is far from over (see “Turkey’s coup that never happened”).
Army scepticism
The generals, unlike Erdogan, were always sceptical about the Annan plan because they knew it would mean withdrawing all their troops from northern Cyprus. The commanders of the navy, air force and police even planned a coup to stop the negotiations, but the chief of the general staff, General Hilmi Özkök, would not allow it because it would end Turkey’s prospect of joining the EU[4].

The military authorities in Ankara are still resolutely opposed to any solution to the problem of Cyprus because it would entail the withdrawal of Turkish troops. After Talat and Christofias announced new talks beginning 3 September, General Büyükanit declared his anxiety about the talks and warned the Turkish Cypriots on the need for caution. So Talat needs to be careful about what he says regarding the current conflict in Ankara[5]. Asked whether he might ask for some Turkish troops to be withdrawn, as a gesture of goodwill to the Greek Cypriots, he referred to an article in the constitution confirming that the Turkish army is responsible for security in the TRNC, omitting to mention that, before he took office, he and his party wanted the article repealed.

The question now is whether the Annan plan will be the basis for the forthcoming negotiations. And if not, what is to replace it? Christofias thinks the plan is dead. Talat thinks not. Officially, both have stated that they are prepared to negotiate on the basis of any “relevant” UN plan, including the Annan plan but not precluding others.

Things have changed. Under the Annan plan, land belonging to Greek Cypriots in the north was to be returned or compensation had to be paid. But building permits have been issued since and most of the land has been snapped up by Turkish and British investors who have sold thousands of “homes in the sun” to foreign buyers. Talat admits this but says the Greeks knew what they were doing when they rejected the plan. This is not a good start.

For many Greek Cypriots, property is the key issue. They rejected the Annan plan and they are not about to accept an even less satisfactory solution. Some Turkish Cypriots feel betrayed. Ali Erel, chairman of the Cyprus EU Association in the north, is critical. He notes that Turkish companies funded by the Development Bank in Ankara are responsible for most of the investments in Greek land, “non-solution investments” as he calls them because the companies concerned do not want the problem of Cyprus to be solved.

Businessman Serdar Atai notes that “the so-called economic miracle and the sudden rise in per capita income in the north which the politicians are very proud of is merely the outcome of multiple exploitation of Greek Cypriot property”. On the Soyer government’s promise to pay compensation for Greek property out of the state budget in the event of unification, he said: “They steal the undeserved wealth and everybody in the community will be obliged to pay”[6].

Greek land is not the only point on which the Turkish side rejects the Annan plan. It is claimed in Nicosia that the Turkish side has no intention of accepting the proposal that it give up Morphou, where there has been massive investment since 2004.
What form of state?
The main issue is what form the “united republic of Cyprus” should take. Ankara, in accordance with the Turkish National Security Council (MGK) decision of 24 April, confirmed by the Turkish prime minister during a visit to northern Cyprus on 20 July, is calling for a solution “based on the realities of life on the island and the de facto existence of two separate peoples and two republics”: a confederation of two states with separate rights of self-determination. The Annan plan proposes a federal republic of Cyprus: a common federal state with two equal components. For the Greek Cypriots, the EU and the UN, there is a big difference. A confederation is a structure which any member state can dissolve at any time, whereas a federation is a state like the Republic of Cyprus established in 1960, in which the component parts have certain powers but the state itself has permanent and unitary sovereignty. The communiqué signed by Christofias and Talat on 1 July said the presidents had “discussed unitary sovereignty and citizenship and had agreed in principle”. The nationalist parties in the north immediately called on Talat to resign and the newspaper Volkan, which is controlled by the Turkish intelligence service, accused him of abuse of power and treason.

Another issue is continuity with the Republic of Cyprus, which is still a recognised entity under international law despite the 1974 partition. The Greek Cypriots insist that it should continue to exist, so that the proposed federation would be in a sense the second Republic of Cyprus, an idea that the foreign minister, Markos Kyprianou, finds acceptable[7]. But Ankara insists that Turkey must continue to be the guarantor of the united republic of Cyprus. This would be unthinkable for the Greek Cypriots and would put the EU in an absurd position: the guarantors of an EU member state would be a state which is barred from EU membership for the foreseeable future because of a democratic deficit and an army which is a law unto itself.

The Turkish Cypriots’ room for manoeuvre with Ankara is crucial to the success of the forthcoming negotiations. The important issues can be settled only if Talat takes a firm line against the excessive demands of the military and Kemalist extremists. Christofias can subscribe to the painful concessions that a settlement would entail for the Greek Cypriots only if the concessions benefit Turkish Cypriots, not the Turkish army.

Even if a solution were reached, who could guarantee that the Turkish generals really would withdraw their troops from a reunified Cyprus? Certainly not the AKP government in Ankara. Mehmet Ali Talat said: “It would be impossible. It would be the first time ever that an army refused to implement a political agreement.” It sounds plausible. But so does the rejoinder: if there is any military anywhere in the world who might dare to, it is the Kemalist generals.

So the solution to the problem depends more than ever on the situation in Turkey. If the Kemalist camp continues its fight with the AKP, Ankara could be heading for a crisis that might end all hope of Turkish accession. Membership of the EU is the main incentive for Turkish politicians to accept a solution in Cyprus. And if there were no longer any possibility of Turkey joining the EU, there would be no hope for Cyprus, at the moment when for the first time in years all the conditions for achieving a solution are about to be met.

A solution would help solve many other problems in the island, on both sides. The future of all Cypriots depends on tourism, which has been in crisis for years in the north and south. Water is already in very short supply and if this worsens because of climate change, it will be impossible to sell those homes in the sun. Since June, southern Cyprus has depended on water delivered by tanker from Greece, which costs much more than it would if it came from Turkey. There are plans to run a pipeline from Anatolia, where there is plenty of water, but work can start only when the problem of Cyprus has been solved and the new federation has established normal relations with Turkey.

To subscribe to Le Monde diplomatique in English, see www.mondediplo.com

Jul 12

I currently work for a company that is rich, I mean mega rich. At the moment virtually hundreds of computers get replaced by more modern ones (which off course everybody needs, doing the odd word processing …). In the past a lot of these machines have been donated to schools in the area, but they seem to be pretty much saturated with stuff, and owning old, I mean very old hardware can be more of a liability these days.

Anyway, my idea was to get a good number of these machines and set up a computer cabinet in the village that I live in, Dipkarpaz, or Rizokarpaso in Greek. In this village we have four schools, two for the Greek speaking kids, two for the Turkish lot. Since Easter this year the village has a very fast internet connection, so my idea was to teach the kids from both sides on web development, not independently, but together, in English (since my Turkish is rudimentary and my Greek practically non-existent).

Well, my enthusiasm was very much dampended when I approached this mega-rich company, asking, if I could have twenty or so systems for the stated purpose, releaving the corporation of having to scrap them. Hooray, the initial reaction was positive. What a good idea is was, how good it would be to bridge cultural and deep rooted emotional gaps and bla bla bla. The outcome was, well, very very disappointing: Since the TRNC (the Turkish speaking and administered North of Cyprus) is not a recognised country, and as such “does not exist”, there shall be no (NO) assistance with anything there.

Now I am stuck: How am I going to explain this back in “my” village? Here is me, a German, on a peace mission, and I am not even allowed to take scrapped computers for an ever so tiny project for kids.

I cannot do much for the grown-ups, they grew up with the civil war, the occupation, the separation etc., and many families still do not know, where their loved ones are buried. But, for heavens sake, the children are building the future, and I would have hoped that anything that can help making the kids get along and talk to each other, would have been greeted with enthusiasm. Not so.

I shall think of something else. Watch this space!!!

Jul 12

So you want to add your own data? – DataProviders

There are off course several ways to add your own data to the map. You could write your own dialogues, data handlers etc. and add the resulting data to the map as a featureset or raster. In MW4 one needed to do it like that. MW6 offers a neater solution: It lets you integrate your very own data provider for as exotic data formats as you like to a list of available data providers and these appear as valid data sources in the standard open file dialogue.

The principle way to do this is to add your provider, which must implement the IDataProvider interface, to the list of data providers. This is done by registering it with the data manager that handles all data addition. Using this mechanism you can concentrate on the implementation of your data provider, rather than waste time on the UI elements. Data is also correctly added to the legend and symbolised accordingly.

There is a tutorial on how to add your own RasterDataProvider to MW6 (http://www.mapwindow.org/wiki/index.php/MapWindow6:Examples:IntRasterDataProvider). To complement this tutorial, I shall extend on how to develop a sample XYZ vector data provider, which shall take any file format similar to
X,Y,Z
630014.833,4905371.152,47726.031000000
630014.608,4905371.224,47725.793000000
...

and add it to the map as a Point feature layer.

The shown format is quite arbitrary. In my own implementation I have added a dialogue, where you can specify a number of properties of the file format, such as the field separator, the order of the fields, whether the file has a header line, and whether it contains line numbers or ID fields. Often this format is called CSV; I prefer to call it XYZ, to emphasise the spatial nature of the file, and also, because the comma (as in Comma Separated Values, hence CSV) is by no means common. Often a semicolon is used instead, especially, if data originates in Europe, where the comma often serves a decimal separator. I leave it to your own creativity to accomodate any format that you wish.

I have not yet found the correct way of dealing with unrecognised data, i.e. returning a null-dataset. This will crash the application at the moment. Also, at the time of writing this, I have not found a way to add more than one file at a time, making it a very boring task of adding several to many files of the same kind.

(to be continued)

Jul 12

Just on a side note: I tend to use British English for my write-ups. So an organization on my site will be an organisation, and I will also be colourful, rather than colorful.

However, I admit, being a non-native speaker, there might be (will be) the odd oddity in my writing. Rather than being annoyed please remember that generations of American movie makers have tried to make the baddies sound German, sometimes with rather hilarious results. And, those of you who frequent Fawlty Towers: “Don’t mention the war…”, He, you just mentioned the war / No I didn’t… ;-) .

I remember the only ever programming language (of which I know!) that was truly British, was AMOS Basic for the AMIGA. I loved that programming language and used it a lot for TV-overlays for our Amateur Television Repeaters in and around Berlin.

Jul 12

I am rather a fan of GIS (Geographic Information Systems). I started off many years ago with ESRI’s ArcView® 3.x, then progressing to ArcGIS® 8.x / 9.x. Almost all of my projects I based on the extensions idea that makes ESRI’s GIS products so powerful. There are a number of applications for the E.O.D. (Explosives Ordnance Disposal) that I started off, such as the various modules of KMRPAS, a QS/Controlling application that can be used in the field for documentation of the ongoing work, and in the office for the bill of quantities and generating maps for the client. As the name implies, the prototype of KMRPAS had been coded with a PASCAL derivate: Delphi 5. The project was later converted to VB.NET, when the further development was commercialised.

Since then I had not been able to afford to keep up with the yearly updates necessary to stay in tune with ESRI’s new versions. If you are free-lance you just cannot pro-actively invest 2000 or so Euros in a software that might or might nor generate revenue.

So I was looking around for alternatives: I tried SharpMap, but I had the feeling that development somehow stalled a little when the originator of the project himself joined ESRI’s team. Also, SharpMap was (or is) more a framework that you use building your own application from scratch. What I did, though, use some of the extensive sources to gain more insight into spatial implementations.

Some time ago I purchased a book that elaborated on the use of open source products for desktop GIS (forgot the exact name, though). Amongst all the candidates from the pre-dominatly Linux world (QGIS, Grass) and their (much hated by me) C/C++ API’s, one mentioning caught my interest: MapWindow 4. This is a product that can be used in a variety of different scenarios: As a stand-alone desktop GIS, giving you a broad set of functions, both on raster and vector data, and, which can be extended by plug-ins, a lot of which are freely available on the web. Secondly, you can use MapWindow 4 as the basis for your own extensions, pretty much like the good old ArcGIS® stuff I wrote some years ago. By implementing a plugin interface by any language that is able to utilise ActiveX, you write your own application on top of MapWindow 4, and through some internal magic the plugin appears in the list of available plugins and can there be activated. Thirdly, you can use any COM-aware language to write your own application from scratch, embedding MapWindow 4 functionality by using the ActiveX control. This is a little more (or even more) work that the plugin/extension approach, but you end up with an application that looks truly yours.

Since MapWindow 4 is open source, it would also be possible to extend the source code itself and recompile your very own version of MapWindow 4. However, I consider this bad practise, as you potentially en up with a myriad of concurrent versions of the same product. Plus, Version 4 is based on C++ sources, counting me out for source code manipulation, anyway ;-) .

With the advent of Version 6 of MapWindow the developer team has migrated to .NET as their development environment, utilising the C# language. Development is volatile and things get broken, re-assembled, re-broken etc., often. But I decided to base all my future development on this version. I my solution for my magnetic utilities I have added MapWindow 6 straight from the project’s SubVersion directory, keeping it current from within the IDE (I use SharpDevelop 3.1 for this now). There are a couple of tutorials on the web, however, they are a little hard to find and cover only a tiny proportion of what is already possible using MapWindow 6. There is also very little documentation as yet; understandable, though, as the team is obviously wanting to distribute a halfway stable version first, before indulging into the boring old word processing.

To build a first runnable application using the MapWindow 6 framework, create a new Windows forms application from within your favourite .NET IDE. As said before, I use SharpDevelop 3.1, mainly for the ability to make use of solution folders, which I extensively use. However, Visual Studio 2008 in its Express edition is also available at not cost, but doesn’t support solution folders (a minor flaw, I’d say…).

If you want to keep it simple, add the MapWindow6 assembly as a reference (MapWindow.dll in the /Releases/ folder). Also, import the available toolbox items, in order to build your application with drag and drop components. Again, to do that add the MapWindow.dll assembly to your tool box manager (Using SharpDevelop the procedure is a little different from VS2008). You will find that by the time of writing this 57(!) toolbox items are added. A lot of these seem to be items to aid the core development of MapWindow 6, but a two handfuls of components can well be used in your own application (off course, so can the others, but I suspect that they will eventually disappear from the publicly available components. So, I’d rather stay away from them).

At this point a word of criticism: Why on earth some of the Components have small letters at the beginning of their name remains completely non-obvious to me. They are not private, nor internal, but published on the toolbox. There are a number of other code formatting and naming issues, but then, maybe I am prejudice from my experience with ESRI-stuff, which has deeply influenced my own coding style (I still call classes that implement an interface XxxxClass / IXxxx. If they don’t, I don’t call them …Class. I also count up my interfaces, if I decide to extend my implementations. Examples: IPoint / IPointClass / IPoint2).

Let’s move on to creating our first MapWindow6 application. These are the steps:

1. Create a new Windows forms application and give it whatever name.
2. Add a menu strip to it and call it menuMain or whatever you like. You could implement a number of menu items and attached some event handling to it, such like providing and Exit function to leave the application.
3. Add a statusStrip. You could use the one provided by .NET, but the MapWindow6 team has implemented its own version of a statusStrip, called mwStatusStrip (see above!). This neatly fits into the other MapWindow components by providing a couple of automatic features for displaying Map and Legend statii.
4. Add a .NET ToolStripContainer to your form and make it dock in filled mode. You don’t actually need this, if you are not planning to be able to dock your toolbars in other locations than the design one.
5. Add the mwToolStrip component to your toolstrip container. This is a preconfigured tool strip adding basic functionality to your map without any implementation efforts on your side.
6. Now add a SplitContainer filling the rest of your form’s area automatically. Again, this is not a requirement, but if you like the MapWindow4 application’s layout, this is achieved best using the SplitContainer.
7. In the SplitContainer’s left area add a Legend from the MapWindow components. Make it dock in filled mode.
8. Do the same on the right, but this time adding a Map component.
9. Make sure that you go through the properties of each MapWindow6 component that you added to your form (i.e. mwStatusStrip, mwToolStrip, Legend and Map), and ensure that the mutual references are properly set. For example: the map component has a property called Legend. This should be set to your Legend component. The toolstrip will certainly give you an “object null reference” exception, if you do not correctly set its Map property. I fell over that to begin with and was looking for the reason for hours.
10. Build and run your Form. It should do this without errors and you get a basic MapWindow6 application to which you can add raster (bitmaps) and shapefiles already. Also, you can zoom, pan and select, without having written a line of code yourself.

I hope you had success following these suggestions and I have awoken your interest for GIS in general and MapWindow6 in particular. Once I mastered the mechanism to upload screen shots to my site, I shall certainly include some of those in the future.

Until then,

Stay out of mischief!.

Herman the German

preload preload preload