The Polynomal: Space of the Music

by Administrator 31. Dezember 2010 09:38

I spotted the demo for this game on Steam. I did not really dig into the music, but the visuals are the most stunning ones I've seen in years. Everything relies heavily on bright colors and calculated particle systems. It's quite hard to believe that pure math does just a good job at looking awsome.

Tags:

Evoke

by Administrator 25. Dezember 2010 10:38

So I decided to finish my album for christmas since I got nothing else to do :P

I fixed some harmonies on the last 3 songs and packed it up to Jamendo. You'll find it here when being moderated. I took the opportunity to remove some old stuff from my songs page to save web space.

 

Tags:

Music | My Stuff

Song_15

by Administrator 24. Dezember 2010 07:48

New song added.

Enoy & happy X-mas!

Tags:

Music | My Stuff

Song_14

by Administrator 20. Dezember 2010 10:36

New song added.

Enoy :P

Tags:

Music | My Stuff

About C++

by Administrator 15. Dezember 2010 07:42

... from a university script.

How C++ is like teenage sex:

It is on everyone’s mind all the time.
Everyone talks about it all the time.
Everyone thinks everyone else is doing it.
Almost no one is really doing it.

The few who are doing it are:
A. Doing it poorly.
B. Sure it will be better next time.
C. Not practicing it safely.

Tags:

Fun Stuff

Bubble Ring Bottle Cap Trick

by Administrator 12. Dezember 2010 09:54

Tags:

Fun Stuff

Tim Minchin-The Pope Song

by Administrator 8. Dezember 2010 02:59

I heard this one on NSFW #18. Unfortunately someone tagged this video is "inappropriate for some audiences" so you have to login. For just the mp3, check out this link.

Tags:

Fun Stuff

Redirecting Unity Xml Configuration

by Administrator 4. Dezember 2010 03:31

One of the nuisances with unity is, that is expects it's Xml configuration to be physically present in the app.config/web.config. I saw a post on the discussion forums, where someone asked, whether it's planned to implement a hook allowing to provide other sources and the clear answer was no. The standard approach they take has some drawbacks:

  • Your App.config/Web.config get's seriously cluttered up when having hundreds or thousands of registrations.
    Since there is also no way of doing includes, this will turn into a pure nightmare, especially considering that there might be other vital configurations in the file (e.g. the connection string).
  • App.config/Web.config are prone to contain installation specific data (e.g. connection strings). If you deliver an update you probably have to include the file to update the IoC settings and need to deal with preserving the other configuration settings.
  • There is no real way of dealing with scenarios, where the configuration gets dynamically compiled (this is the reason why I looked into this).
    Let's assume, you have configurations you need to merge, e.g. you have a standard configuration and can provide overrides specific to a customer installation. In that case you could use some sort Xsl transform of handcoded approach to generate the real configuration from different sources. This also gives you a good way of integrating different configuration files making development much easier.

The only thing I found that pointed into the direction of using another file is, to change the name/location of the configuration file that the configuration manager will use to get Unity's configuration. Take a look at this post to see how it's done. Though this works and solves problem 1 & 2, problem 3 is still present.

After some tweaking I found out, that the solution is easier than expected. Btw. this should work for any configuration you want to get out of the app.config/web.config.

First I created a class that inherits from Unity's configuration section.

using System.Xml;
using Microsoft.Practices.Unity.Configuration;

namespace UnityExtension
{
    /// <summary>
    /// Provide a way to read configuration sections from an xml reader rather than
    /// from a physical app.config/web.config file.
    /// </summary>
    public class StreamSourcedUnityConfigurationSection : UnityConfigurationSection
    {
        /// <summary>
        /// Deserialize from a given xml source.
        /// </summary>
        /// <param name="reader">Xml source.</param>
        public void DeserializeFromXml(XmlReader reader)
        {
            // Call into base deserialisation mechanism.
            DeserializeSection(reader);
        }
    }
}

The only thing that this inherited class provides for us, is to expose the desirialisation to a public method. The reader argument can source it's content in a physical file or somewhere else (e.g. a memory stream).

To consume the configuration I used the following code to set up the container:

IUnityContainer container = new UnityContainer();
XmlTextReader reader = new XmlTextReader("unity.config");
StreamSourcedUnityConfigurationSection sec = new StreamSourcedUnityConfigurationSection();
sec.DeserializeFromXml(reader);
sec.Configure(container);

One important thing to know, is that the config file you use has to directly start with the <unity> tag. Even an <?xml> descriptor will raise an error. Here's the beginning of the unity.config file:


<unity xmlns="http://schemas.microsoft.com/practices/2010/unity">
  <containers>
    <container>
      <register
        name="TestClass"
        type="UnityExtension.ITestClass, UnityExtension"
        mapTo="UnityExtension.TestClass, UnityExtension">
      </register>

I hope you'll find this somehow helpful in your projects. Feel free to give me some feedback.

Tags: ,

My Stuff | Unity

Autowireup Extension for Unity

by Administrator 2. Dezember 2010 14:36

I added an autowireup extension for Unity that allows using autowire by name/by type. Check this page for more information.

Tags: , ,

My Stuff | Projects | Unity

End to comments

by Administrator 2. Dezember 2010 11:26

I had to deactivate comments due to the amount of spam coming in (about 10 comments a day). Unfortunately BlogEngine.NET does not come with a Capta to prevent this, I'll check, what i can do in the next weeks.

Tags:

About the author

for comments and suggestions contact:

 

Month List