2012 in review

The WordPress.com stats helper monkeys prepared a 2012 annual report for this blog.

Here’s an excerpt:

600 people reached the top of Mt. Everest in 2012. This blog got about 3,700 views in 2012. If every person who reached the top of Mt. Everest viewed this blog, it would have taken 6 years to get that many views.

Click here to see the complete report.

2012++

Well, it’s that time of the year again where the year ends and a new year starts. It’s a time to look back on things that we’ve archived and to think about the things we still want to archive in the next years. And to be honest, there are still a lot of things I want to do but when I look back, I know there’s already a lot that I’ve done already…

But first: Happy New Year to everybody, because while I’m writing this, the new year has already started somewhere on this planet…

DSC03334First of all, I hope my dogs won’t be too stressed by all the fireworks in our area. Lasja, my small female dog is already unsure about all those loud noises so to comfort her, I just put her in bed next to me where the sounds aren’t as loud. Just letting her sleep seems to help against her fears.

Cees, however, was just barking loud against every loud noise he heard. So, after a few minor corrections he’s just in guard-mode now. Then again, he too now sleeps through most of the noise.

No, I didn’t give them something to calm down. But trying to keep two dogs calm means that I have to be calm too. So, not too much celebrations now but just a lot of rest, next to my dogs. Teaching them by example that they can be calm, because I’m calm too. I hope they’ll rely on my confidence to get through the upcoming celebrations.

As a pet lover, I think it would be a good idea if fireworks would be banned. This stuff can be pretty dangerous, as is proven by the many accidents that have already occurred in the Netherlands. Already a few people have lost their ability to count to ten and I wonder how many more people will lose that ability this year. How many will not be able to see the fireworks next year? Fireworks is dangerous and should be handled by professionals. Instead, the pretty fireworks tend to be handled by adults, who like to look at pretty things while the things that go BOOM! tend to be in the hands of adolescents who are also very happy to experiment with it.

I remember when I was young and my father would go with me to light fireworks. I was about 11 years old and my dad decided to light a Roman candle, then threw it in the streets, expecting it to explode. Well, that’s not what Roman candles do and if he had read the manual he would have known that. Then again, my dad could never read Chinese which made it so much harder to read it… For about two minutes everyone in the street had to dodge fiery balls of colored light that were shooting in random directions. Sure, it was pretty and gave us all a great exercise, but what if one such bolt would hit an open bag full of fireworks?

After that incident, I became more careful with fireworks, although I did continue to play with it for a few more years. But I learned that it’s expensive and generally it’s just a short-term pleasure. And the result is never as pretty as is advertised.   So I decided that it’s just not worth the effort. I’d rather spend the money on a great meal, that’s interesting to cook, tastes great and which keeps my belly filled for hours. A meal shared with someone else makes it even better.

So, personally I don’t mind that I don’t play with fireworks anymore. And my pets are very happy when there are no loud noises or colored flashed in the area. But why should others also stop playing with fireworks, even though they seem to enjoy it and don’t mind spending thousands of Euro’s on fireworks? What gives me the right to decide for those others?

Well, in a few days we will have a good reason. When hospitals fill up with fireworks victims again, people who have lost an eye, some fingers or who end up with horrible burn marks. Then the discussion will most likely start up again about banning fireworks, with an exception for those who are professional enough to handle it with care. A discussion that will be forgotten when those victims start to heal again until it bleeds to death and the next new year approaches. It’s an everlasting circle of discussions that don’t seem to end as long as no one decided to really put a ban on fireworks.

Well, banning fireworks is just my opinion. An opinion that is shared by more people here in the Netherlands. But as long as it’s just an opinion, it’s like a toothless lion. It won’t change anything. So I hope that this will change before we’re at 2014. I hope we can start 2014 with such a ban, where only experienced people will be allowed to play with fireworks and communities will put their resources together to get such a safe display of fireworks in their area. That way, people will be joining hands more often, getting closer to one another and best of all, people will start celebrating more with their neighbors. And pet owners will know that their pets will just be exposed to loud noises for a few hours instead of nearly three days. They would still be scared, but not as long as they are now.

But as I said, a side effect of such a ban would be that neighborhoods would have to join together if they do want a pretty fireworks display. They they could e.g. hire a professional and set up a nice site for the display, and they could come together celebrating the new year, drinking, dancing and getting to know each other better. A ban on fireworks might do this, because we would change from individuals who each have about 50 Euro’s worth of so-so fireworks into a group with 500 Euro’s worth of spectacular stuff. (Or more.)

But, it would be a change in the ways how we celebrate the new year. And if there’s one thing very difficult then it’s changing things. People don’t like to change things. But I hope this change will happen in the new year…

 

[UPDATE]

And the first information about the fireworks devastation’s in the Netherlands are in the news already. Some Dutch news articles about this damage:

  • A ten year old boy was critically injured with heavy burns on his back when a piece of fireworks got inside his collar.
  • A metal slide was blown on top of the roof of some building because of some heavy fireworks. Also, a lot of broken windows.
  • A home in Velp is severely damaged by heavy fireworks. Doors and walls are damaged and a small fire broke out. Fortunately, no one was at home at the moment of the explosion.
  • And about 70 eyes have been damaged. They expect the number to rise to somewhere between 200 and 300. And half of those will have some permanent damage. Maybe even permanent blindness in one or both eyes.

As expected, a lot of damage again. Let’s hope the discussion about a ban of fireworks will finally have some effect…

Visual Studio 2012

Today, around dinner, the mailman arrived with a special package for me. An expensive one, but one that also makes me very happy. It was a big box containing a second box. The second box contained about 8 CD/DVD’s with Microsoft Visual Studio 2012 professional on it. And two with Windows 8, one for 32-bits systems and one for 64-bits systems. Also a DVD with SQL Server 2012 and one with Team Foundation Server 2012 on it. One with Windows 2008 Server and finally one with .NET 4.5 SDK/DDK on it.

Too bad it isn’t weekend yet, because I definitely want to start using it all!

Anyways, I’m now installing Windows 8 on an Asus EEE PC with touchscreen and Windows 7. That promises to become very interesting! I already had a netbook with Windows 8 RT with touchscreen but RT isn’t Windows 8 Professional. I hope the upgrade goes well, since I’m considering to upgrade my desktop system too, if I like Windows 8 well enough. I don’t like the Metro-look, though. But that’s something I’ll have to get used to.

Visual Studio 2012 will allow me to develop Metro-applications. That’s very interesting, but only if Windows 8 will have a reasonable large market-segment. Right now, it’s less popular than Linux on the desktop so that’s a bad start. But things will change. Windows 8 will grow sooner or later. I do wonder if it will be powerful enough to be used as a tablet-system, since the competition with Android and Apple is very tough. The Microsoft App market isn’t very large at this moment either so it’s difficult to get some nice applications for my netbook. My laptop will be able to use older Windows applications so I don’t have a problem there, but the tablet-version is limited in the applications it can support. That’s because it’s build on a different processor than the regular Windows versions.

Included in the box is also a subscriber ID for my MSDN account. That’s important since I can download a lot more free applications and development tools from the Microsoft site. Older Windows versions, older SQL Server versions, even MS Office 95 and Embedded C++ 4.0! Or Visual Basic 6.0 and 2003. Or Visual FoxPro 7, 8 or 9. Or a few Windows XP, XP Embedded, Vista and Windows 7 licences. But I’m more interested in Windows Server 2012, since I also have a web server at home. Do I date to upgrade it? Better try it first in a virtual machine!

Anyway, I’m busy this weekend!

Spam: Once more, with feelings…

Sometimes, a spam message can look very tempting to the reader. I recently received the following message that’s just too good to be true. Fortunately, my spam filter did move it to spam already…

Dear Friend,

This is a personal email directed to you.

I and my wife won a EuroMillions Jackpot Lottery of Ј148m EuroMillions in August.
We have decided to donate the sum of Ј2,000,000.00 Pounds to you as part of our own
charity project to improve the life of 5 lucky other individuals all over the world.

All you have to do is get back with us so that we can send you details to the payout bank.

You can verify this via the two link below.

http://www.dailymail.co.uk/news/article-2187999/
http://www.national-lottery.co.uk/player/p/goodcausesandwinners/winnersgallery.ftl

Adrian And Gillian Bayford
Email: adriangillian-bayfords@maildx.com

Strangely enough, the sender happens to be adrian.gillian.bayforddonationdesk@hotmail.co.uk but the email in the message claims otherwise. A check of that MailDX address shows that it’s just another free email provider, like Hotmail, Yahoo or GMail. Since the sender is also a free mail account, I just consider these throw-away accounts. They use it to get your attention and they hope to collect enough information before the free providers will close the account again. And, the trick here is that they use two providers, so one account is closed for sending spam reasonable fast, but the other will continue to work a bit longer. A simple trick, but reasonable effective.

Also interesting is that they did not include any fake URL’s or made up a fake story. The real Adrian And Gillian Bayford did win a nice amount in the national lottery. A nice 148 million in British pounds. Not bad! And sure, they could decide to give away a small part of that amount to a few lucky others, but how would they chose those people? Ask yourself: if you would give away a large sum of money, how would you decide the person who should receive it?

Right! You would not pick a random person from a mailing list. Especially not when that mailing list happens to be used by spammers to spam people. I know it’s on a spam list since I tend to receive several other spam messages on the specific mail alias that has received this message. Anything I receive on that list is most likely spam anyways. Doesn’t bother me, though. My mailbox has a powerful spam filter and the account is just an alias that I can close and discard. It’s just fun to see the kind of tricks spammers will use. And some of their tricks are very sophisticated! Besides, it helps me to recognize those spammers.

So, except for the fact that it was already marked as spam, what other things told me it was spam? And most likely a phishing mail? Well, first of all it sounded too good to be true. Also, a quick Google-search revealed an article on SpamFighter warning people about this message! It never hurts to just search on Google to check if some message is spam or not! The two different email accounts also warned me, especially since both are free accounts. Registering a domain name is not expensive. And by using Google Apps you can also add a mailbox with unlimited aliases to your domain, again for a low price. So this couple could have easily created a real domain with extra information for those people with whom they would share their price.

Also, the lack of the British Pound symbol in the email was a clear clue, since it’s supposed to be British. It tells me that it was sent by someone with a non-British keyboard! That’s very common outside the UK but people inside the UK prefer to type the proper symbol for their currency.

Sending the spam to my honey pot mail account was also a dumb move.

Software development…

Today, I want to talk about designing software. Basically, I want to explore my principle of items-transactions-contracts (ITC) that I’ve discussed before. But let’s look back on those first.

An item is just that. It’s something that you have to work with. It can be a person, or it can be a currency. Maybe it’s a product or just a description of a product. Whatever it is, it’s something that has data that you need to use. Items can be containers for other items, thus items have children and one parent. Like a box of matches that has two matches. Or a person who is part of a household.

Transactions will handle amounts and describe movements of items. Basically, a transaction is nothing more than a message saying that an x amount of item A is moved from item B to item C. A could be a bike that is moved from the shop to its new owner. Or it’s a crate that’s moved from shore to a boat. Or it’s an amount in Euro’s that’s deposited in your bank account from your employer. Transactions allow you to move around data, but also to create or remove items from your system by moving them from to towards the void. (The null container, meaning either recipient or sender is null.) Transactions are also related to time, since a transaction will happen at a specific moment.

Contracts are used to group transactions together. Most transactions are part of a collection of transactions that are related to one another for a special purpose. For example, your savings account will give interest but to get that interest, you first need to put money in your account, and wait for a while. You do a transaction and your bank will follow-up with transactions. Another example is when you send a package overseas. First you deliver the package to the post office, which will give you a receipt back, confirming your delivery. The post office will then move the package around by truck to the harbor, then by boat to cross the sea to the next harbor where a truck will pick it up again to bring it to the post office nearest to the delivery address. And then a mailman will deliver the package. And in every step the post office will send transactions back to keep track of the package so it won’t get lost.

Each of these are governed by templates. You can have templates describing specific types of items or specific types of transactions. You would generally also use templates for contracts. Most object-oriented developers are already familiar with templates and refer to them as “classes” or “object types”. But if you create dynamic objects, you would have to deal with dynamic templates to describe the layout of the data.

When you look at your design, you should try to see if you can divide your data in these four groups: Items, Transactions, Contracts and templates. You will notice that many systems won’t match this pattern. You will also notice that projects that don’t match this pattern might have some limitations on what you can change about them without doing a lot of re-factoring. So, does this pattern work for real-world solutions? Well, let’s set up a design.

The case: a movie theater wants a completely new system to do its administration. So the first step would be to find the items that you would need. Of course, you’d be dealing with persons, with movies, with merchandise and snacks and soft-drinks and of course with tickets. But you would also have to work with chairs, since people want to sit while watching the movie. And the theater hall where you will play the movie. Maybe you also want to keep track of the equipment. But that latter thing isn’t very important. One more thing that is important is money. Money is a strange item but you still need to keep track of your money…

Well, the persons can be divided into multiple groups. You have employees who you need to pay and who collect tips from visitors. They might also receive commission from the sales of snacks and drinks. You will need a lot of data about your employees.

You would also have visitors, but in general a simple headcount would be enough. You could have special visitors like movie directors or actors who visit your theater so your system might want to keep track of some special visitors. (It would also allow visitors to subscribe to your theater.)

And then the contacts that you’re in business with. You need to buy the movie rights, buy the food and drinks from distributors, maintain the address of your accountant and other important persons and maybe even keep a list of important actors and directors whose movies you want to show. This would be a generic address book, but you might want to link these to specific items in your system through transactions. If you use Microsoft Outlook, these would be in your Outlook Contacts, but your system could link to it and e.g. send an order when your stock runs out of soda.

So, we have a list of item templates already, and it’s already growing fast. The next step would be determining the transaction and contract templates and link them to the item templates. For example, your employees work for you so you have contracts with them. For every specific amount of time they give you, you will give them a specific amount of money. This is their salary. Also, the commission means that for every amount of products that they sell, they will receive a small percentage of the profits on those items. So if they sell a soda for 2 Euro’s, they might receive 4 Euro-cents in commission.

Next the visitors, who also have a contract with you. They buy a ticket which will give them access to a specific hall at a specific time for a specific duration. In the most complex situation, you have a transaction for the payment, one for giving the ticket and one for the visitor to move from the void to a specific chair in your hall. And another move of the visitor from the chair back to the void when the movie is over.

And then you have the transactions with your distributors and suppliers. You need to buy movie rights and maybe you have a specific contract with your distributor which provides you with 12 movies per year for a fixed price. So one money transaction from you to the distributor and 12 transactions from the distributor to you. Your suppliers will also have plenty of transactions. You pay them for a crate full soda drinks, which they deliver. But they will also pay you back for the empty packaging, which would be the crate and the empty bottles.

To put this all in a design, you would at least need three tables. One for items, one for transactions and one for contracts. You would also need a place to keep the templates, but those could be just part of your code. There’s no need to make things more complex if you don’t need the extra flexibility.

The tables should not be simple database tables. You need a more object-oriented database system. In Visual Studio you have such an option by using the entity framework. This framework will allow you to add inheritance to your tables so the Persons table would inherit from the Items table. Thus, a person would still be an item, but an item isn’t a person. By using inheritance you could set up a simple, generic system for all the things I’ve described above and once you’re done, you have a great engine for your administration project. You can easily expand it with more functionality and depending on how you’ve set it up the migration to newer versions would be very simple. The entity framework will give you a powerful data layer and your next step would be to build a business layer and GUI for this project.

When you follow the ITC principle, then any developer should have no problems recognizing the purpose of any data item in the project. You might replace your complete development team with a new team, and the new team would easily see the layout of your datamodel. No complex documentation would be required since the hierarchy of your data tables would give more than enough information already. Just be aware that no one should step away from this principle or else your project becomes more complex again…