A Safe String.SubString Extension Method

The String.Substring method in .net is useful, but has one slight quirk: If you try to read too much (i.e. “123”.Substring(1,5)), you get an ArgumentOutOfRangeException saying that “Index and length must refer to a location within the string.”. Here is an extension method that will not throw an exception, but instead return a truncated string, even it it is shorter than desired. That way, you can use it as a way to always Truncate longer strings while leaving shorter ones unchanged.

public static class StringExtensions
    public static string SafeSubstring(this string input, int startIndex, int length)
        // Todo: Check that startIndex + length does not cause an arithmetic overflow
        if (input.Length >= (startIndex + length))
            return input.Substring(startIndex, length);
            if (input.Length > startIndex)
                return input.Substring(startIndex);
                return string.Empty;

This was inspired by a Question on StackOverflow, and since I needed this so many times now, I’ve decided to write it.

Note that this requires the .net 3.5 Compiler.

DAZ Studio and Victoria – a crash course in terminology

I am currently trying to create some illustrational videos for the Roller Days 2009 Documentation. Those videos are supposed to serve as tutorial, explaining how the competition works and explaining the rules. Now, everyone who worked with 3D Animation may agree that Character Animation is the supreme discipline in the field, or at least it’s in the top tier. I then remembered that I’ve heard about programs like Poser before and decided to look at it again. When I looked at Poser 4 or 5 years ago, it was essentially low quality models mainly used to create 3d porn. Well, the year is 2009 now, and while Poser is still used to create 3d porn, the figures increased in quality to the point where they are really usable for serious stuff, and there is a huge Third Party market selling Add-Ons for them.

The only problem is that this super high level of customization leads to unclear and confusing terminology – how is someone supposed to know what a Morph does, how a Magnet works and which requirements there are actually. So after spending 3 days to dig through the whole topic, I’ve decided to make a little posting describing what this actually is. Keep in mind that I am not an expert and that this is to the best of my knowledge, but I claim the right to be slightly wrong in some places.

There are many vendors, but I’ve decided to stay with DAZ 3D to begin with. I just want to point out that I am not affiliated with DAZ 3D or any other vendor that I am linking here to. All the links are for explanatory reasons, I don’t get anything if you buy stuff through these links.

The starting Point: A Figure

Okay, the first thing that you need is a Figure. This is essentially a 3D Model of a Person (or animal) that has everything set up for Animation. Essentially, you load a Figure and then you can take i.e. the Arm and move it, which will automatically adjust the shoulder, chest, hip etc. If you look at the various online stores, it may look like there are hundreds of figures, but in reality there is only a handful – most “Figures” are really just addons to an existing Figure (more on that later).

In the Example of DAZ 3D, Figures would be Victoria 4.2 (or V4 or V4.2 for short), Michael 4 or Stephanie Petite 3.0. In the case of DAZ 3D, you may wonder what the weird Version numbers mean, and if you browse the store, you may see that there is also a Victoria 3.0 and wonder how they relate. Well, the second question is easy: They are not related at all. They are completely different figures. DAZ 3D created Victoria years and years ago, and as time moved on, they decided that they needed a better 3D Model (PCs got faster, so they could do more). So they took Victoria and created a more Modern Version of it. When it came to naming, they decided to just call her Victoria 2.0, because of the popularity that the Brand achieved. Then came Victoria 3.0, Victoria 4.0 and two updates to 4.1 and 4.2. Other companies decided instead to rename their figures with every generation, and there is a small Overview of the various Poser Figures on Wikipedia.

To summarize:

  • There are relatively few Figures, and you need one to start with
  • Figures are usually incompatible with each other, so when you buy addons like clothing or skin textures, make sure that it’s compatible with your figure
  • Try to find out if there is a common abbreviation for your Figure. In the Case of Victoria 4.0, it’s usually V4. That helps to decipher stuff like “HighBoots2 For A4 V4 V4Elite

Customizing the shape of a Figure: Morphs

If you clicked the link to Victoria 4.2 in the previous paragraph, you may have seen that this is called “Victoria 4.2 Base” and is available for free. When you install it into Poser or DAZ Studio, you may understand why: The Base Figure is not very customizable. First off, it only has a relatively low-res texture, no hair and you cannot easily change her body shape, i.e. to turn her into a body builder or into an obese person. You can customize the expression in her face a bit, but that’s it.

Customizations to the Body shape are called “Morphs”. Essentially a Morph hooks into the Figure and changes the underlying 3D Model. Morphs are essential to create different people from the same Figure. So when you browse the store, you may see Morphs for sale that allow you to fine-tune a certain part of the figure. For Victoria, there is an essential product called Victoria 4.2 Morphs++ which allows you to manipulate almost any part of the figure easily. In the full list you can see that there are options to manipulate the full body, i.e. “BodyBuilder” or “PearFigure”. But there are also a lot of fine tune options, like NeckThickness or FeetArch.

There are more morph packages available, but just keep in mind that a) Morphs change the underlying 3D Model and are thus very essential to create variety and b) Morphs are usually sold separately but c) The base character usually contains at least some morphs already.

Pre-Made Customizations: Character Presets

As said, there are only relatively few Figures, but many different characters. Now that you know that a Figure is the 3D Model and that Morphs are manipulations to them, you can possibly imagine how those Character presets work: They are fine-tuned packages of Morph Settings for the body and face. Usually they contain a lot of other Add-Ons, but the main feature is really that they customize Victoria through morphs. Take a look at Aiko 4.0, which is a character for Victoria 4.2. Aiko is really a character with her own personality and style, yet it’s not a figure because she builds on top of Victoria.

Make sure to check the Requirements of a Character Preset! Aiko only requires Victoria 4.2 Base, but for example ZhangXi requires Aiko 4 Base, the Morphs++ Package for Victoria 4.2, and then even another pack of Morphs, the Elite Body Shapes. So if you buy the ZhangXi character, you may see that she is not usable because you need to purchase another product as well. And again, let me remember you that figures are not compatible, so a Character Preset for Victoria 3.0 will not work on Victoria 4.x (well, actually I think there is some way to make them at least somewhat compatible, but that is more like a pro topic).

Character Presets include more than just Morph Presets though, they may include any or all of the features listed next.

Skin Textures and Makeup

When you load Victoria, you may see that her skin does not look really detailed. After all, the base only comes with a low-res texture pack. This is where Texture Packs come into play. Texture packs are Skin Textures that can be applied to the model, and nowadays you usually get high res textures (4000×4000 Pixels, although 2000×2000 and 3500×3500 are also common) that also include bump and specular maps to have realistic lights and shadows. Skin Textures are extremely important, because they make your Figure look realistic, or cartoony, or whatever you want. They also add the variation – for example, there is Maya, an Asian skin texture, or there is a special Wet Texture if you want to create pool scenes.

Skin Maps (that’s the official name) are usually not sold separately, they usually come with the Character Presets. For example, if you look at the Bianca preset, you can look in the “What’s Included & Features” Section to see which Textures are delivered.

There is a special addition, and that’s makeup. Usually, the Skin Textures are completely natural, to offer the best base for customizations. Sometimes, Skin Maps and Character Presets come with Make Up Options, which are essentially just another set of skin maps, but with makeup applied. You can of course also grab your favorite graphic program, load in the skin map of your choice and apply makeup yourself (hence many users prefer to have a completely natural base skin map), but Make Up skin maps already did the work for you.

Skin Maps are usually compatible to morphing and should always stay in a proper shape (that is: If you change the size of the navel, the texture of the navel usually gets resized properly as well), but there are times when skin map creators decided to violate the boundaries to create more interesting skin textures, but they may look weird when morphing. That’s a rare case though.

Hair and Clothing

Okay, so Victoria 4.2 Base is essentially a bald girl in a Bikini. Enough to start with, but you won’t get very far. Unless you want to do love stories that is, but that’s another subject. Anyway, you now need hair and clothing. They work essentially the same, and it’s important to differentiate between a base product and an extension.

Let’s start with Hair. Hair is usually a 3D Model, some Hair-Morphs to control things like length and number of Hair, and some Textures. For example, the Natsumy Hair for V4 comes with Morphs to control the position of the two bangs, and there is several colors delivered with it. When buying Hair, make sure that you are actually buying the actual Hair Model. For example, there is also an add on called Real Hair Textures for Natsumy Hair, which are just textures – a nice addition, but if you don’t have the Natsumy Hair to start with, they are useless.

Clothes work the same way. For example, there is the Tiffany Dress which is the 3D Model and some Textures, and then there are some extra textures available for purchase, for example the Breakfast for Tiffany Dress. For Clothing, it is very common to sometimes have 3 or 4 additional Texture sets available for the more popular ones.

There are two Gotchas with Clothing and to a lesser extent with Hair. The first one is that the “Requirements” in the Daz Shop are sometimes showing too many items. For example, the Verona Hair lists Aiko 3, Aiko 4, Victoria 3.0 and Victoria 4.0 under Requirements. This does not mean that you have to have all 4 figures. It merely means that the Hair is compatible to those Figures. If you only have Victoria 4.2 you are obviously not able to use the version of the hairstyle for Aiko 3, but there will be a style for Victoria 4.2. In doubt, check the What’s Included and Features panel.

The second point is a bit of a bigger problems: Clothing is not automatically compatible with all Morphs! What this means is that when you Morph the Character, the clothing may not fit anymore and the skin of the Character will poke out. This is one of the biggest and most common problems. Usually, you can check if the Clothing contains Morphs. For example, on the Tiffany dress, you can see a list of Morphs (FBM or PBM, which is short for Full/Partial Body Morph). For example, there is a Morph called FBMPearFigure, which means that the dress will still fit if you decide to change the Pear Figure Morph on Victoria. Sometimes, there are morphs for clothing to make them compatible with other Morphs. For example, there is an Elite Upgrade which makes the Dress compatible with the Elite Body Shapes Morph, or there is an upgrade to make it compatible with the Aiko 4 character (Remember: Aiko 4 is just a Character Preset on top of Victoria V4.2).

You don’t have to buy additional Morphs – you can usually finetune the clothing to make them look good even on a non-supported morph. Just keep in mind that a) this usually only works on still images since you may have to cut some corners to have the dress look good from the given camera angles and b) that this is very tedious if you have to do it more than once.

Magnets – not only to fit clothing

As said before, Clothing may not always work with a morphed figure. Changing the rotation and scale may work often, but is not always the best choice. There is another feature, called Magnets. I can’t say too much about them because they are an advanced topic and I do not have much experience with them, so I will just link to the Fitting clothes with Magnets tutorial and then to the Using Magnet Sets for Clothing fits one. Magnets essentially something to be attached to something else, i.e. a piece of clothing to a figure. If you have a set of Magnets, you are theoretically able to fit any type of incompatible clothes. There are Magnet Sets available, i.e. for Victoria 4, but as said, that is an advanced topic that I have no experience with.

To me, it seems like Magnets are the cheap way if you don’t want to buy an upgrade or if there is no upgrade available, and they seem to be quite labor-intensive, but they give you all the flexibility to customize any piece of clothing.


The other big topic are Poses. When you load a figure, it will stand with the arms extended and look a bit like the vitruvian man painting of Da Vinci. You can now grab the Arms and twist and bend the Figure to bring it into the Pose that you like. When you do that, you will notice that it’s actually quite a bit of work to get the character exactly into the desired pose, without anything looking awkward (and believe me, you will eventually discover more about the human body than you ever wanted when you try to find out how the stomach should bend when you try to jump or one other complicated poses).

Poses are presets than can just be applied to a figure. You twist the figure like you want, save it as a pose, and when you need it next time, you just apply the pose and you are done. Needless to say, there are pre-made poses for sale, for example the Yard and Pool Poses, and sometimes character presets come with poses.


Okay, let’s just summarize:

  • A Figure is the base 3D Object
  • A Morph is something that allows you to easily manipulate the 3D Object through settings
  • Character Presets are Add-Ons for Figures which contain pre-made settings and accessories
  • A Skin Map is a Texture that applies to the Figure’s skin. This gives you various ethnicities, tattoos, make up etc.
  • Hair and Clothing allow you to render more than just nude, bald figures, but may not be compatible to all morphs
  • Magnets can be used to fit clothes to incompatible morphs
  • Poses save you from having to twist the limbs of the character manually every time

So if you look at the Victoria 4.2 base again and then at one of the Bundles (i.e. Victoria 4.2 Complete), you should be able to understand what the differences are, and why the free Base package is not really that free, because there is no clothing, no hair, and only a low res skin texture. The huge third party market allow you to get anything you may want or need, but of course, it can get very expensive very fast. If you want a recommendation, I’ll recommend starting with the Victoria 4.2 Complete or Pro Bundles, the free DAZ Studio, and then just ignoring any other offers and start modeling until you get a feel for how the parts and components interact. That allows you to make better estimates on what you can and cannot do, and which additional products you may want to buy.

But quality-wise, I am seriously impressed with what is possible nowadays, the textures became really photo-realistic and with proper lights and a good background, you can build so much more than just 3d erotica.

A Tale about Dinosaurs, Meteorites and Music

The year is 2009. A recent invention has blurred the borders between countries. The so-called “Internet” was recently released and allows people from all over the world to communicate, to share information, and to exchange data.

While many big companies still see the Internet as some fad that will surely soon go away, some smaller companies embraced the opportunities that the Internet offers. Companies like YouTube or Dailymotion emerged and allow people to share Videos that they have created themselves.

People are happy, because this new “Web 2.0” gives ordinary people like me and you the opportunity to create content and to actually share it with other people. While this leads to a lot of sub-par quality content, this new freedom also gave birth to some high quality or otherwise excellent content. This Web 2.0 grew and pospered, and everyone was happy.

Everyone? No, a small percent of people were not happy. Those people, let’s call them “Major Music Company Managers” or MMCMs for short could not cope with this new freedom. You have to understand their point of view: They were born and raised in a world where the border of a country was a wall, impassable for all but the most wealthy and important people. When the MMCMs grew up, they learned that their products needed separate licensing in every country and preferably for every occasion. They learned that in order to maximize Shareholder value and Profit, they needed to make licensing complex and expensive. And who can really critisize them? Weren’t we all told that creating content is reserved for the elite of our society? Wouldn’t it be total chaos and anarchy if the mob would get the power to create content?

But the MMCMs realized that they would need henchmen to make sure that only the Elite gets access to their content. Of course, they needed to make sure that the mob can sip from their fountain of high class content, but at the same time they need to protect it from the very same mob. So they made sure to have local authorities, and so they went and instituted the RIAA in the US, the GEMA in Germany and many other similar henchmen companies.

You have to understand that these MMCMs and dinosaurs and that they are unable to evolve. So when this new Web 2.0 thing came up, they did not know how to react, they were never trained to do so. They are used to act and control, not to react and collaborate. So while they do see the meteorite that will make them extinct, they are not realizing it. Instead, they fell back to their primary instinct, the habits that all humans share: Hunt, kill and devour their prey.

If they would be able to evolve, they could see the opportunities that are suddenly open to them. The mob is suddenly creating it’s own content, and it’s not just some fad that will go away. User-created content may not make the high-budget content go away completely, but it has successfully established a market share that is too big to ignore. But the most important gotcha: User-Created content is on the Internet, and the Internet knows no country borders (except maybe the Great Firewall of China, some Parts of Germany, and some other third world countries that are ruled through oppression).

The MMCMs could have embraced the opportunity just like the common mob did. They could have taken the chance to allow easy and painless world-wide licensing of their content, and they could offer fair pricing and clear legal conditions. They could get advertising not only for free – they could actually have people advertise their content AND get paid by them for it.

Unfortunately, they decided to go down the road to extinction. Instead of trying to find out how they could profit and evolve, they instead decided to cut off the mob from their content. They stopped producing Audio CDs and instead started to offer weird Data CDs that somehow resembly Audio CDs. They decided to offer their music on the internet, but only for rent, not for sale. And they decided to sue people in an attempt to convince people to not advertise their content anymore. They call it “protecting their assets”, and again: It’s hard to criticise them for it if you just keep in mind that they are primal creatures from a different era.

But, there is hope. Others have seen the inability to evolve as well, and decided to breed a new race of music licensing people. The Web 2.0 gave birth to Creative Commons, to Magnatune, to Opsound and to many more. The Web gave birth to more advanced ways to make sure the mob gains legal access to music, and it also allows musicians to get paid properly. The dinosaurs may still have a bit of an advantage because of their existing back catalogue, but if they stay unable to evolve and work together with us common people rather than beging against us, they will become extinct within this or the next generation.

A loss? Not more that the loss of Mammoths or Bluebucks.

TLDR Version: Dear major record companies, please stop being idiots and finally create the foundation for fair and easy worldwide licensing, or at least stop crying about how bad the economy is, because the economy is perfectly fine, the problem is you. Thank you.

PS: Save some Love is quite cool, I think I’ll license it.

T minus 5 Days – Roller Days 2009 Mönchengladbach!

On this Week-End, 4WheelFreestyle will hold its second freestyle event, the Roller Days 2009. Featuring Roller Disco, Fun Skating, Speed Slalom Competitions, Slide Contests and a WSSA Freestyle Battle. 

Once again, Skaters from all over the world will meet in Mönchengladbach, Germany to compete, learn from each other, meet and greet and have a lot of fun. Do we care about bad weather? No, we don’t, since it’s an indoor event. Come hell or high water, on this week-end, Cones will be kicked, Wheels will roll and Trophies will be awarded.

Entry to the Event is free on all days and spectators are highly welcome. Participation in the Battles (which are official WSSA Battles counting towards the World Ranking) will cost 8 Euros, which also includes an Event T-Shirt. Of course, the T-Shirt is also available for everyone else who wants one (or two or three…) for the same price until stocks last. 

We also organize two diners. On Friday at around 22:00, we will go to the Mokka in Viersen, who exceptionally keep their kitchen open for us. The translated menu is at the bottom of this post. On Saturday, we will visit the Chinese Restaurant near the Hall. 

Catering during the Event is also been taken care of, with Sausages, Sandwiches, Yoghurt and other Sweets being available, along with Soft-Drinks, Water, Hot Chocolate, Coffee and Sport Drinks. 

If you cannot attend the Event, we will have a Live-Webcam, an Event-Ticker on our Forum and on Twitter. 

Registrations for the Battles are still open until Saturday, 13:00. No registration is required for Spectators – come along, bring your friends, your family, your local skate-community, everyone is welcome! 

Feel free to contact us if you have any questions, if you want to register, if you want to have a T-Shirt put aside for you (highly recommended if you want one in your size) or really for anything else you’d be interested in, drop us an e-Mail at info(at)roller-days.de 


Time Table Roller Days 2009 
(All Times are CET, GMT+1) 

On all days, Entry for Spectators is free. 

Friday, February 13, 2009 
1800: Entry into the Hall possible 

1900 – 2300: Roller Disco (Free Entry) 
You don’t have to be a Pro, this Event is all about having Fun! Organized by GSRC and 4WheelFreestyle and open to everyone, we’re going to hit the Dancefloor on Friday Evening! 

2200 – ????: Dinner at Mokka 
See Menu. 

Saturday, February 14, 2009 
0900 – 1400: Free Training, Workshops, Battle Registration 
Saturday morning is all about free Skating and Workshops. You have the entire Hall available to practice, learn new tricks or prepare for the Battles. 
If you want to participate in the Battles, you can register on site until 1300. After 1300, further registrations may not be possible due to planning reasons. 

1400 – 2000: WSSA Battle Competitions 
Starting on 1400, we will hold the Battles. Currently, we anticipate to hold them in the following order: 
– Speed Slalom 
– Slide Contest 
– Freestyle Slalom Qualifications and First Rounds 

2000 – 2200: Fun Contests, Party Skating, Relaxing 
After a hard day of battle, the entire hall is once again available for fun skating. Depending on the remaining time and circumstances, fun contests (e.g. Free Jump) may be held, but essentially you’re free to do whatever you want. 

Sunday, February 15, 2009 

1000 – 1800: WSSA Battles 
Starting at 1000, we will hold the remaining rounds and finals of the Men and Women Freestyle Slalom Battles. 
Afterwards, the Mixed Team Battle will take place. 
Award Ceremonies will complete the Event  

Menu of the Mokka 
• Ciabatta bread with cherry tomatoes and mini-mozzarella, au gratin – 3.50 € 
• Roasted Ciabatta with tomatoes, onions, olive oil and garlic – 3.50 € 
• Grilled Turkey Hen pieces in chili sauce, sesame and curry – 4.50 € 
• Warm Goat Cheese on steamed chicory with tomatoes and pignolias – 4.50 € 

Main Dishes 
• Miscellaneous Salad with grilled turkey hen pieces – € 8.00 
• Tortellini in Tuna-Olive Sauce with Tomato-flavor and Parmesan – € 6.00 
• Baked Potato with a crème of herbs with vegetables on salad – € 6.00 
• Penne with roasted vegetables in cream sauce – € 6.00 
• Penne with beef Bolognese sauce and Parmesan – € 6.00 
• Escalope on cream sauce with fried potatoes and miscellaneous salad – € 7.50

Adobe Dynamic Link is excellent – but costly!

One of the great new Features of Adobe’s CS4 Suites is Dynamic Link. In short, this allows the different programs of the suite to pass their project files to each other without needing to store them in an immediate format. In the case at hand, this allows to import Sequences from Premiere Pro into Encore without the need to render them before. The obvious advantage: Encore can decide on the quality when you output the DVD, which means you will not end up with hundreds of megabytes wasted on the DVD or – even worse – with just a little bit too much, having to render out everything again.

But this flexibility comes at a cost: For each Sequence that you import, Encore will launch a Premiere Pro process (PProHeadless), which will consume quite a bit of memory:


Do not underestimate this cost! My current DVD Project requires about 3 Gigabytes of RAM, bringing the machine well over the 4 Gigabyte border:


My recommendation: If you really want to use Dynamic Link, get a 64-Bit Operating System and as much RAM as your machine can handle. All CS4 Applications may be still 32-Bit (with the Exception of Photoshop) and thus limited to 2 GB per Process, but running 10 or 15 of those 32-Bit Applications will still fill your memory. Yet on the other hand, not using Dynamic Link seems now like loss of flexibility, because the integration between Premiere Pro, Encore, After Effects and Photoshop is excellent in CS4.