Life wants me to stay at home today…

Oh, well. It promised to be a nice day, good weather and am feeling a bit better since the shitty feelings I had yesterday. So I get in my car, want to drive out of the garage and poof!

 

Yes, this is what a garbage truck looks like in the Netherlands. And yes, yo pick up the container containing the garbage, it has to go backwards in the street that leads to my garage door. The crane on top will pick up the container, empty it in the back-end and then put the container back in its hole in the ground.

And to do so, the driver has to step out of the vehicle to keep an eye out on the whole thing. And every day this goes well and tales about 30 seconds or less.

Not today As I am writing this, it’s still parked in front of the exit of my garage. A few other cars are actually blocking me from taking an “off-road” route around it. So I have to sit down and wait for it to be removed somehow.

Why? Because today, the driver had a copilot whom she was explaining how it all works. And when she got out of the truck, he too got out of the truck. And if only one of them had remembered to take the key with them, they would have been gone in 60 seconds.

Funny, isn’t it, that when you forget your key in your car, the door will always lock itself magically, leaving you standing outside, desperate to get inside again…

Oh, well. Shit happens. I went back inside my house, took a cup of coffee, took this interesting picture and started to work at home. At least one of us can still do something useful while being locked up here…

The search for non-sweet snacks.

Recently, I decided to cut the amounts of sweet food-items that I eat every day. And, as it turns out, that turns out to be an interesting challenge when you’re looking for something to snack. Because most snacks seem to be made of mostly sugar with some other flavors.

But first of all: why? Well, I have a weight problem and I am a diabetic. Those two things are related to one another so I just have to bring down my glucose level to average levels. And well, pills will do this for me, but I hate to take those pills every day. So I need to adjust my food pattern to take less things that contain (lots of) sugar.

Of course, there are snacks that are sweetened with artificial sugars, that won’t increase my glucose levels but they don’t take away the craving for sweet food. It fools my body with fake sugars and my brain continues to think I’m just eating sugars, but it also maintains my addiction to sweet food. And it’s amazing when you realize that people can get addicted to the tastes of sweet foods, especially snacks.

My daily meals are already avoiding most of the sweet food items. Bread, for example, is slightly sweet but add peanut butter or cheese to it and you barely taste it. Dinner is often a piece of meat with additional veggies and/or potatoes and those don’t really taste sweet either. No sweet-tasting desserts and well, I admit… I like to start the day with a bisquit and raspberry jam, or marmalade. Then again, I also start every day with a cup of coffee, black with one sugar. But I consider this okay since people need sugar, especially when you’re starting the day. But basically, after breakfast I will try to stay sweet-free.

But the real problem is when you feel hungry in-between breakfast and lunch, or in-between lunch and dinner. Or worse, after dinner when you’re looking at a good movie. Popcorn can be an option if it’s the non-sugared version but that’s a salty version. Too much salt isn’t good either, which is why potato chips aren’t that good either. So, peanuts and other nuts make okay snacks. I could consider all kinds of fruits but fruits tend to taste sweet, and it’s the sweet taste I’m trying to avoid, not the sugar.

So, what other kinds of snacks are there? I could eat a piece of cheese, some sausages, nuts, carrots, chips or just turn on the fryer and bake something we Dutch people call “bitterballen“. Fatty, but not sweet. But after these, I tend to run out of options and besides, none of these seem to be available in local shops in small half-pound bags for a nice-sized snack. If you want snacks that are packed in small portions, you tend to end up with a lot of sweet stuff, including cookies, lots of candy an even certain kinds of sweetened chips. And although they do sell sugar-free products, most of those are still sweet.

And as I said, I don’t want sweet snacks.

So, here’s my dilemma… I want non-sweet snacks, not sugar-free snacks. And those are hard to get. Supermarkets are basically selling just sweet snacks. Such a shame…

Getting the eyes just right.[NSFW]

I love creating images using Poser and Vue. Poser is great to create a model based on existing models that’s imported in Vue. And Vue will add the additional landscape, larger objects, plants, water, cloud and lights. The final result can sometimes be very stunning. Unfortunately, there are always some small problems in each item because of flaws while posing the model in Poser. Or because the landscape in Vue overlaps the Poser model.

One flaw tends to be the eyes on models. Each model has two eyes and you need them to look in the same direction. And you’d prefer them to look in a specific direction. So, what’s my trick for this? How to get a model to point her eyes e.g. upwards, because she’s under water, on a huge hook and surrounded by fish? Or have three girls in the grass looking at the same point?

Well, it’s not too complex. I just add a simple primitive, often a ball, to my models. Just one. I also make it invisible so it won’t appear in the rendered result. Once done, I select the left eye of the model and using the “Objects/Point at” menu, I point the eye at the ball. I repeat this for the right eye and the eyes of the other models so all eyes are pointing in the same direction.

Next, I have to move the ball in the direction that I want all models to look at. This means moving it over the X- and Z-axis, preferably far away from the models, else they will become a bit cross-eyed. Then, move it up and down to point them upwards or downwards, and don’t be afraid to put it at -100 on the Y-axis to make them look a bit down.

When dealing with multiple models, like in my image below (which has nudity, thus it’s not suitable for work environments), you might have to do more adjustments. Often, this means that you have to twist and bend the necks and heads of the models while looking if their eyes are put in the correct locations. Since the eyes already point at the right direction, all you have to do is adjust the heads and neck.

A drawback is when you have to re-position the model because that often means re-positioning the ball too. This is something important when you create an animation because you would then have to move the ball to the locations that your model is supposed to look at. But it does make your animated models look more natural during animations. It allows them to quickly move their eyes and even though it’s a very minor detail in animations, it’s still a very simple trick to make their looks more natural. Because the most important part behind this trick is that the eyes are both pointed at exactly the same spot.

And well, as you can see, the eyes aren’t the first things that you’ll notice. Most will notice the nudity in the image, which just happens to be very casual and peaceful. Others will notice that one model, Aisha, happens to be a cyborg with nice, shining body parts. And people will notice the background, the trees, and probably several flaws too. But when you look at their eyes, they’re all looking at the same point, since they’re all pointing at a ball that’s behind the camera. This makes them look straight at the camera.

The Jewish Samurai

There once was a powerful Japanese emperor who needed a new chief samurai. So he sent out a declaration through-out the entire known world that he was searching for a chief.
A year passed, and only three people applied for the very demanding position: a Japanese samurai, a Chinese samurai, and a Jewish samurai.
The emperor asked the Japanese samurai to come in and prove why he should be the chief samurai. The Japanese samurai opened a matchbox, and out popped a bumblebee. Whoosh! went his sword. The bumblebee dropped dead, chopped in half.
The emperor exclaimed, “That is very impressive! “The emperor then issued the same challenge to the Chinese samurai, to come in and prove why he should be chosen. The Chinese samurai also opened a matchbox and out buzzed a fly … Whoosh, whoosh, whoosh, whoosh! The fly dropped dead, chopped into four small pieces.
The emperor exclaimed, “That is very impressive!”
Now the emperor turned to the Jewish samurai, and asked him to prove why he should be the chief samurai. The Jewish Samurai opened a matchbox, and out flew a gnat. His flashing sword went Whoosh! But the gnat was still alive and flying around.
The emperor, obviously disappointed, said, “Very ambitious, but why is that gnat not dead?”
The Jewish Samurai just smiled and said, “Circumcision is not meant to kill.”

My thirteenth post!

Well, this is post number 13. Fortunately I’m not superstitious so I’ll just post this one. I don’t mind black cats that walk past me. I’m not afraid to walk under a ladder. And when I break a mirror, all I do is to make sure I don’t step in a splinter with my bare feet. So I’m not afraid. Nothing bad is gonna happ7%$#@…

It’s official! I’m a Pirate! Har! Har!

Well, I’m official a member of the Dutch Pirate Party! (PiratenPartij in Dutch.) Why? Because, as a software engineer, amateur CGI artist and hobby photographer, it is important for me that the current copyright laws are adjusted. I do think that copyright is important for artists, but the current laws are abused, and abused in a very bad way. They’re abused to prevent new works, to prevent innovation and worst of all, to enrich those who aren’t artists themselves but who employ artists and then take the profits.

Yes, copyright can be important but there are several large organisations who have a lot of cash to spend on lawyers who are stifling new developments out of fear that they lose profits to the competition. Musicians are complaining about other musicians because a word from their lyrics is used by the others. Photographers are complaining about other photographers because those others also took a picture of a cloud in the shape of a cloud. Movie directors complain about other movie directors because the competition also made a movie where the main character happens to be a woman in jeans. These silly claims have nothing to do with copyright. These things are meant to kill off the competition since these organisations can’t handle any competition!

The same is true with patents. Pharmacies create medicines for several rare diseases but these medicines cost what I make in a year to keep a patient alive for a month. Yes, some pills are that expensive! And sure, the costs of developing it might have been high but pharmacies use dirty tricks to keep patents on these pills for longer than they would normally have. Normally, the patent would last 20 years. But by making minor adjustments to the formula as “improvement” they create a new medicine with a new patent for another 20 years.

And then there’s this annoying thing called “privacy”. Well, we all think we have nothing to hide. But if this is true, then why do many people still wear swimming trunks at the beach and in the local swimming pool? Why do people turn off the light when they have sex? Why do people hide their diaries? People always have things to hide, things they’re either ashamed off or that might hurt the feelings of other people. Privacy is important! I want to keep my email address secret, else spammers will fill my mailbox every day with all kinds of malware, advertisements for blue pills and notifications that there’s one million dollars waiting for me in Nigeria. I want to keep my bank account a secret, else someone else might visit my bank and empty the content of my account. I want to keep my phone number a secret so strange people won’t call me in the middle of the night just to have a talk with someone they’ve never spoken with before. And I want to keep my name a secret because… Wait a minute! This blog is under my name so it’s not a secret. So okay, you can know my name…

The Pirate Party in the Netherlands wants a few things that I would like to support, so I do support them now as a member. Can’t do much, since I also have a life sometimes but still, I support them. These issues are actually the only ones on their political agenda. There’s nothing about the financial crisis or the War on Terrorism or whatever else. Just a simple-themed political party. I support them and am not ashamed to support them. I know they’ll never become a big party. But they have a message that I consider very important. A message about some things that most people don’t seem to think about.

 

Oh, well. Now I need a hook, a wooden leg, an eye-patch and a parrot. Already have the beard and wild hairstyle. Maybe a matching hat since a pirate in a Stetson just isn’t right. I like my Stetson, but still…

A generic data model.

A lot of developers will work on software that is doing some administrative tasks. And each and every developer will have to come up with a data model (or object model) which would contain everything they need. And most of the time, they will choose a model that solves their own specific situation but which is hard to change if something new is required. And that’s because developers are too busy looking for details and thus they won’t see the general image.

The general image is that you basically deal with just four kinds of data. No matter if you’re building a web-shop, in-house banking solution, patient record administration or complex financial applications, you always have just four kinds of data: items, relations, transactions and contracts. So let’s take a closer look at these data entities…

Items

Items are just what the name suggests. It’s something physical in general, although electronic data and other things could also be considered items. Persons are items. A complete household is an item. Companies are items, so are products. Animals are items. Phones are items. And most importantly, money is an item. Items are the things you’re going to administer.

Items can be unique. For example, a person is unique. But when you just keep track of the number of employees without looking at the individual, then you basically have an infinite amount. The same with money since each coin is unique, but your bank account can technically hold quite a lot of those coins. Or none at all. Basically, you could subdivide items into two parts: singular and plural items. But this is just a special property for the Item entity. You could add a field called “IsPlural” to the entity or create two child classes that you derive from the Item object. (SingularItem and PluralItem.)

Relations

Relationships are what connects two items with one another. And there can be quite a lot of relations. A person has a father and mother and most have four grandparents, although some might not be alive anymore. Many people also have children. Other relationships could be a bank account that’s owned by a person, a certain amount of money in this bank account and you could also think of the relationships between an employee and his employer.

Relationships can be very complex but keep in mind that there are just two sides on any relationship. examples: I have 10 dollars. Mary-Anne works for McDonalds. This envelope contains a letter. By keeping it simple, the data model stays simple, although you might need multiple relationships to describe certain situation, like employment, your bank account or perhaps even your mortgage.

Contract

This is where you will need a contract, although that might sound a bit of strange when talking about family relations. Basically, it’s just something that will connect items to other items through relations. And, often enough, the word matches the collection of relations just fine. For example, when you work for an employer you will deal with several different relations. First of all, the direct relation between employer and employee. But also the relations between employee and salary, plus employer to salary. But also you and your colleagues will be related, although that would be implied because the generic relation between employees and employer. And of course there’s a relation between you and the office where you work, you and the desk that you work on, or the computer that you use at work. There are plenty of relations that you can define but in general, stick to just those relations that matter.

Contracts not only maintain relationships but in general will contain some logic to change those relations or that are related to specific actions that need to be taken to maintain the relationship.

Transactions

However, there’s one more thing we have to be aware of. And that’s time. And time changes things. People might have a divorce, lose their job or easier: spend money. In the employment example, there are many transactions to think of. Salary happens to be a regular transaction where the employee receives an amount of money. The employer will have to spend this, and the tax office will also have a small claim on the amount the employer pays out. Again, just focus on the transactions that are considered important within your solution.

In general, there are two kinds of transactions. One that creates a relationship and one that breaks it. But a transaction also occurs on a certain moment in time, be it the past or the future. And often the connection between items will require multiple transaction to describe a complete situation. We have the employer who loses a certain amount to pay salaries. We have the tax office (and other offices) that will receive money related to the salary. And the employee will receive an amount related to the salary. And these relations are linked to a contract. The same contract that defined the relations between the items.

Transactions don’t have to involve money, although they often do. But if you buy a steak at the local butcher, you not only have two transactions for you losing money and the butcher earning money (who will lose some again for VAT) but there’s also the transaction of the butcher losing a steak and you gaining a steak.

Conclusion

When you’re doing the financial administration for a company, you will deal automatically with items, contracts, relations and transaction, even though you might not realize it. When you’re building software for a library to keep track of book loans, you also have a similar setup, where transactions determine who is lending which book and when it’s expected to be returned.

Even when you’re baking a cake, you could apply this data model. All ingredients and utensils would be items. The recipe would be the contract. The relations are basically simple since the item is either an ingredient of the final cake, it it is used to bake the cake. And the transactions are just describing how you should put the ingredients into a bowl, mix them, fill the pan, put the pan in the oven, remove it from the oven, remove the cake from the pan, add ingredients to give cake some color and additional taste and then use a knife to slice the cake and eat it. Each of those steps should be taken at a specific moment in time and the transactions will specify when it’s time.

It is a strange example but it shows how flexible the data model actually is. So look at your own projects and see if you can recognize these entities that I’ve just described. Most software will have entities with multiple functions, where e.g. a Person record contains a link to parent records or child records. Or links to employer, bank accounts or whatever else. In general, such constructions would severely limit your options. And although a person won’t have more than two parents in general, a person could have two or more employers. So sad if your system can only handle one employer…

And while you don’t have to use this data model for your own solution, altering your data model to match this one will improve the flexibility of your whole design.

Spammers learn new tricks…

I’ve recently posted a rant about spam and today, I’m going to add another one. This one about a spammers trick that might fool a lot of people. Especially those people who don’t use a good spam filter. And I’m doing this because it might have fooled me, if there weren’t two flaws with it. First of all, it ended up in my spam folder, which suggests that something is wrong. Second of all, it was sent to the wrong email address.

First, let’s take a look at the spam itself:

What the spam looks like

Well, it looks good enough. LinkedIn does send these kinds of emails on a regular basis. I get plenty of those on my real LinkedIn account. But as I said, I received this one in my spam filter and on the wrong account. So, let’s look at the email a bit more, starting with the headers…

Delivered-To: address@example.com
Received: by 10.14.174.6 with SMTP id w6csp66709eel;
        Wed, 29 Aug 2012 08:00:37 -0700 (PDT)
Received: by 10.60.11.34 with SMTP id n2mr645244oeb.18.1346252436700;
        Wed, 29 Aug 2012 08:00:36 -0700 (PDT)
Return-Path: <heemali@snmz227.leaseweb.com>
Received: from SNMZ227.leaseweb.com ([82.192.78.107])
        by mx.google.com with SMTP id zm6si23150147obb.199.2012.08.29.08.00.35;
        Wed, 29 Aug 2012 08:00:36 -0700 (PDT)
Received-SPF: neutral (google.com: 82.192.78.107 is neither permitted nor denied by best guess record for domain of heemali@snmz227.leaseweb.com) client-ip=82.192.78.107;
Authentication-Results: mx.google.com; spf=neutral (google.com: 82.192.78.107 is neither permitted nor denied by best guess record for domain of heemali@snmz227.leaseweb.com) smtp.mail=heemali@snmz227.leaseweb.com
Date: Wed, 29 Aug 2012 11:00:36 +0000 (UTC)
From: LinkedIn Reminders <reminders-noreply@noreply-linkedin.com>
To: address@example.com
Message-ID: <52203955.7448783.1913884201422.JavaMail.app@ela4-app2581.prod> Subject: There are a total of 1 messages awaiting your response MIME-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit

I’ve replaced my address with address@example.com, a dummy address. But if I look at these headers I noticed that it’s sent from a leaseweb.com mail account, and not from LinkedIn itself. Leaseweb is a hosting provider with a bad reputation as being one of the worst hosts since they seem to host a lot of malware on their sites. So was the Bredolab botnet hosted on Leaseweb servers. Leaseweb also hosted part of MegaUpload. But Leaseweb is just one of the biggest hosts in Europe so it’s no surprise that you can find lots of malware there. Such sites are always a small percentage of sites for any host.

But why would LinkedIn use Leaseweb? Well, they would not! This is just another sign that this is a real spammer. But let’s look a bit further, which is the HTML code behind this email:

The source code behind the spam.

This shows the true intentions of this spam. The spammer wants to fool to visit some specific site. The site itself has nothing to do with the spam, except for the site has been hacked without the site owner knowing this. But it’s not a malware URL but a redirection to a Canadian pharmacy website. They want to sell Viagra and Cialis to the unsuspecting visitor. (Oh, dear! Those two words will most likely put this post in each and every spam filter!)

Well, not all spammers will send their victims to malware sites. In this case, they just want to get more visitors to buy little blue pills. They prefer to target American visitors since the sale of these pills are more limited in the USA than in Canada. In Europe, unknown to most, you can just buy similar products at the local pharmacy. That is, if you need them.

Anyways, the URL has the word “stupid” which tells us how the spammer thinks about those who are fooled by this. Well, I wasn’t fooled but instead I investigated it a bit and contacted the site where the redirect was hosted. I’ve warned them about this URL on their domain and I expect it to be gone within a few days. If not, they might be held responsible for this spam, and for the (illegal?) sale of these types of drugs. Since they are a clinic of some sorts, it could cost them their license if they don’t take additional steps against this.

But for now, let’s wait on their response on this post, and on my warning…