Hiro, the World’s Fastest IOC Container

The creator of the LinFu-library is working on the ‘world’s fastest IOC container’, called Hiro. Basically Hiro reads  once the configuration and then it compiles everything to a fixed, immutable container. The compiled container has then ‘burned in’ the wiring of all components in IL-Code. So there’s no state, no map lookups and no locking required. This makes Hiro a whole magnitude faster than traditional IOC-Containers like AutoFac, Ninject etc.

Of course, due the container is compiled, it isn’t as flexible as a non-compiled container. But I think it will serve its purpose well. Most of the fancy features aren’t that important.

That said, I think most of the projects don’t really care about the speed of their IOC-container. The average application doesn’t create hundreds or thousands of service-instances per second. So for the average application there’s no need for a faster container. However  I can image application which will benefit massively from a faster one.

So for my projects I’ll continue to use the wonderful AutoFac-container.

More info on Hire:

, , ,

No Comments

Hustle

- Danny: …..25′000£!
- Mickey: Hmm, so how is it going, Danny?hustle
- Danny: What?
- Mickey: The score. How do you think it’s going on a scale of say one to ten?
- Danny: Well I thought it’s going ok.
- Mickey: So what? Nine maybe?
- Danny: Nine-ish? … no?
- Mickey: Ask your question!
- Victim: How do you know how much money is in the case?
- Danny: Haven’t been counted yet?
- Mickey: *shakes the head*
- Danny: Shit!
- Mickey and Danny:*running away*

Danny and Mickey are con-artists. Normally nothing goes wrong, an if, Mickey has always a plan-B. Mickey and his crew are specialized in long-cons. First they look for a marked (victim). Then they analyze the weaknesses and the behavior of the victim. Then they create a fake scenario in which the victim feels in control and thinks he or she will make a excellent deal. And finally when the victim has paid lots of money the scammers disappear.  To ensure that the victim doesn’t report them to police they always pick people which are involved in illegal deals. So the victim won’t go to the police because he or she has to hide his or her own doings. ‘You can’t cheat a honest man’.

BBC’s Hustle (IMDb, Wikipedia) is like Ocean’s Eleven in serial. It’s all about tricking the victims, having clever plans etc. So Hustle hasn’t a great story and isn’t a touching drama. Its a lightweight show which is just a pleasure to watch. It absolutely doesn’t require any knowledge of previous episodes, so you can jump into any episode and have fun. Like typical crime-shows Hustle is pretty limited in variety, but nevertheless it entertains with each episode.

One of the unusual things is, that the show breaks  the fourth wall all the time. Often a actor just blinks into the camera. Sometimes an actor explains something to the audience or the whole scene freezes in matrix-style and the actors walk around in it.

For far five seasons have been aired and a sixth season is announced.

Star-O-Meter: (4.5/5)

Trailer Season 4:

Time-frozen-scene:

Dog-con:

, , , ,

No Comments

Project Natal

Project Natal is the vision to interact with video-games without a controller. Cameras  are used to captures movement, recognize people etc. Basically an EyeToy version 2.0. This is a very ambitious project for the XBox 360, but in my opinion its possible.

However there is this Milo-demo, where the game character recognizes emotions, remembers stuff and interacts very naturally. In my opinion this is clearly a nice demo, but won’t work in reality. Because having such a precise recognition is an extremely difficult task. But there’s also the AI part. An ‘game’-AI can feel quite natural at first sight. But it certainly fell unnatural as soon as you interact heavily with it.

Milo-Video:

Motion-Capture-Demo:

Via:  www.irrlicht3d.org

, ,

No Comments

Star-O-Meter

I’ve finally introduced a star-rating-system for my little reviews =). Of course the rating represents my opionion and isn’t objective at all. So all reviews have a nice little ‘Star-O-Meter’. Together with my new useless ‘review-cartoons’ the posts are more visual. So you don’t need to read all the bla-bla \o/

I’ve updated nearly all review-posts with the shine stars. Furthermore I’ve added a cartoon to the Breaking Bad review.

breaking-bad

No Comments

Spooks

-I’ll stick to what we’ve agreed.
-To tell the truth…
-…the whole truth and nothing but the truth.spooks
-The truth is a highly elastic concept.
-No, we make it elastic.

Manipulating the truth, breaking law, making life or death decisions is the daily business for “Section D” at MI-5. The team led by Harry Pearce is kept busy defending the United Kingdom. The team is confronted with terrorists, disloyal military, Russian mafia, corrupt politicians, ex-spies, other secret services etc etc. They sometimes even fight against their allies like MI-6 or spy on their own agents. No one can hide from MI-5.
Working for the secret service isn’t easy. The agents cannot trust anyone, have to lie to everyone and risk their life. No wonder they struggle maintaining a private life. Despite the burdens Harrys team keeps fighting for queen and country.

BBC’s Spooks (or MI-5 outside UK) (Wikipedia,IMDb) is a well done spy thriller/drama series. Spooks has everything you’d expect from this genre. Sci-fi like high-tech gadgets, double agents, traitors, ticking bombs, explosions etc. Also has the series no mercy. Agents get killed or fired, so after season 3 no one of the original team is left. Families get destroyed, people are tortured, other secret services are misused whenever possible, the media is censored and manipulated. At the end the ‘heroes’ aren’t heroic at all.
Most of the time Spooks is thrilling to watch. You never quite know what’s going to happen, which characters are honest, who is betraying whom.
Each episode has its own self containing story. Starting with Season 6,  a background-story is told through all episodes, so you have to watch them in order.

There is a cancelled spin-off series, Spooks:Code 9, but as far as I known is sucks so badly, I won’t watch a single episode. Season 8 is announced and will air this year.

Star-O-Meter: (4/5)

Trailer Season 6:

Trailer Season 7:

Where’s the bomb?

Death of Fiona:

Harry spying on his daughter:

, , , , , ,

No Comments

Depoy a ClickOnce-App from a Build-Server

ClickOnce (Wikipedia, MSDN) is an easy way to deploy and update your .NET-application. Its also easy to set it up in Visual Studio and run it from there. It increments the version-number, compiles and deploys the application in one and simple step. But I really don’t want to publish software with my IDE on a developer-machine. Of course I want initiate the deployment from a build-server. While ClickOnce-deployment works nicely within Visual Studio, it can be a real bitch running stand-alone.

Visual-Studio uses MSBuild to build stuff, so the first step is obvious. The ‘publish’-target creates the ClickOnce-Installer etc. Go to your project, open the console and try it.

%windir%\Microsoft.Net\Framework\v3.5\msbuild.exe /target:Publish /property:Configuration=Release

However running the ‘publish’-target won’t update the version-number nor copy it to the target (documented here). This only works within Visual Studio. But this isn’t necessarily a bad thing, because now you have full control over it. The revision is set with the  ApplicationRevision-property:

%windir%\Microsoft.Net\Framework\v3.5\msbuild.exe /target:Publish /property:Configuration=Release;ApplicationRevision=42

This way you can set this property with your build-server. So its possible to synchronize application-versions with build-runs or something else. The published files are in the “%Project%/Release/app.publish/”-Directory, ready to copy to the server. So the best way is to write a little MSBuild-script. In my example I invoke just the ordinary-build-target and copy then the files to a server. The ApplicationRevision-property is set externally by the build-server or command-line:

<?xml version=”1.0″ encoding=”utf-8″?>
<Project ToolsVersion=”3.5″ DefaultTargets=”Publish” xmlns=”http://schemas.microsoft.com/developer/msbuild/2003″>
<PropertyGroup>
<ProjectName>MyExampleProject</ProjectName>
<DefaultBuildProperties>MyExampleProject</DefaultBuildProperties>
<ProjectPublishLocation>.\bin\Release\app.publish</ProjectPublishLocation>
<ProjectClickOnceFolder>\\TargetServer\deployments</ProjectClickOnceFolder>
</PropertyGroup>
<Target Name=”Publish” DependsOnTargets=”Clean”>
<Message Text=”Publish-Build started for build no $(ApplicationRevision)” />
<MSBuild Projects=”./$(ProjectName).csproj”
Properties=”$(DefaultBuildProperties)”
Targets=”Publish”/>
<ItemGroup>
<SetupFiles Include=”$(ProjectPublishLocation)\*.*”/>
<UpdateFiles Include=”$(ProjectPublishLocation)\Application Files\**\*.*”/>
</ItemGroup>
<Copy
SourceFiles=”@(SetupFiles)”
DestinationFolder=”$(ProjectClickOnceFolder)\”/>
<Copy
SourceFiles=”@(UpdateFiles)”
DestinationFolder=”$(ProjectClickOnceFolder)\Application Files\%(RecursiveDir)”/>
</Target>
<Target Name=”Clean”>
<Message Text=”Clean project” />
<MSBuild Projects=”./$(ProjectName).csproj”
Properties=”$(DefaultBuildProperties)”
Targets=”Clean”/>
</Target>
</Project>

After running, testing and improving the deploy-process, try it out on your build-server. If it runs your lucky. But, your build will probably fail with a message like: “setup.bin” not found in “ExampleProject/Engine”.
Now things start to get ugly, really really ugly. You need the ‘bootstrapper’-files to build the click-once-setup. This files are located normally under ‘C:\Program Files\Microsoft SDKs\Windows\v6.0A\Bootstrapper’. (And installed by Visual Studio. But I really don’t want Visual Studio on my build-machine). So copy them to your build-machine. Then you add this registry-key:

Key Name:          HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\GenericBootstrapper\3.5

Value:
Name: Path
Type: REG_SZ
Data: c:\CopiedFiles\

Run the build-scrip again on the server. If it works now, well done. If it still fails with an error like this: “Signtool requires CAPICOM version 2.1.0.1” it gets even uglier!
Download the CAPICOM SDK here. Install/Extract it. There will be a ‘capicom.dll’ in it. You can copy it to the %windir%/system32. Then you need this register it. Run with administrator-privileges “REGSVR32 capicom.dll”. Finally your build should run.  \o/

If you know a better way to run ClickOnce-deployment without Visual-Studio and without hacks, please tell me. Its really ugly at the moment.

Sources and references:

, , ,

No Comments

Being Human

being-humanAnnie is talking exited with the pizza-delivery-boy who just brought her pizza, but the pizza-guy doesn’t share Annies enthusiasm for small-talk. After the chat Annie closes the door and returns to her flat, which is covered with cups of tea and coffee. Annie is relieved that finally ordinary people can see her…
George has a serious lack of self-confidence. He’s uncertain about what he is doing, he’s uncertain in every conversation and he avoids any relationship. He tries to hide his ‘curse’ from everyone. No one should ever know what he really is and should better keep a safe distance from him…
Mitchell believes that he manages his life quite well. He tries to have a normal and quiet life. However sometimes he struggles or even fails to keep his ‘condition’ under control…
Annie, George and Mitchell are sharing a house in Bristol and try hard Being Human (Wikipedia,IMDb). But that’s not easy if you’re a ghost like Annie, a werewolf like George or a vampire like Mitchell.

I really like BBC Threes fantasy-dramedy about the strange flat-sharing-community. The three ‘creatures’ have each there own ‘special’ problems and needs. So it’s fun and entertaining to watch them dealing with there conditions and environment. Each episode shows the small steps the characters take torwards a better life.
The story is straight forward and simple. The strength of the show its good mix between fantasy, comedy and drama. The show mostly spares with special effects which is fine. There are some werewolf-transformation-scenes  with rather bad special effects.

There are only six episodes and one pilot. The pilot has a different cast, so its a little confusing. I hope that BBC shoots  a second season next year.

Star-O-Meter: (5/5)

Trailer:

He Can See Me!

Shell I heat it up:

, , , , ,

No Comments

Mocks for internal interfaces

Maybe you’ve already seen an exception like this:

Castle.DynamicProxy.Generators.GeneratorException: Type is not public, so a proxy cannot be generated. Type: SpielWiese.IReportSender
…stack-trace…
at SpielWiese.TestSomething.ExpectReportsSend() in Program.cs: line 64

What I’ve tried is to create a mock-object with Rhino-Mock. Since this interface is only intended for usage within the assembly it’s declared as internal interface. So Rhino-Mock fails and I really don’t want to create a mock manually. The quickest and dirtiest way would be to make the interface public. But I really don’t want to leak internal stuff just for tests.

So the second approach is to make the internals visible to Rhino-Mocks.

[assembly: InternalsVisibleTo("Rhino.Mocks")]

But it will fail as well. Since Rhino uses Castle-Proxies, I tried:

[assembly: InternalsVisibleTo("Castle.DynamicProxy")]

It still won’t work. The reason for this is simple. The Mock-Factory has to generate code. The generated code is hosted in a separate assembly. So you have to make the dynamic assembly visible to your code under test.

[assembly: InternalsVisibleTo("DynamicProxyGenAssembly2")]

This is similar with other mock frameworks or proxy-frameworks.

Source: http://ayende.com/Wiki/Rhino+Mocks+-+Internal+Methods.ashx

Demo-Code: demo-code

, , ,

No Comments

Dollhouse

Dollhouse

Dollhouse

- Hello Echo, how are you feeling?
- Did I fall asleep?
- For a little while.

Routine conversation when Echo, an ‘active’ in the Dollhouse (IMDb, Wikpedia), just got her memory wiped out. In her Dollhouse state, Echo and the other ‘actives’ are like ‘dolls’, vulnerable, helpless and without any idea what the real word is. But sooner or later someone with lots of money rents a ‘doll’. Then the ‘doll’ is imprinted with the character and skills the client wants, a killer, a lover, a thief, a anti-blackmail-expert, a caring mother or even a karate-master. The ‘dolls’ are programmable people. They do whatever they programmed for and have no real will. But, something isn’t quite right, some ‘dolls’ seam to build some kind of self awareness.
From the outside, Paul Ballard investigates the disappearance of Caroline. He picks up that there exist a Dollhouse. But the more he investigates, the more he finds himself in trouble. His boss fires him, but Paul doesn’t stop. He’s obsessed to find the truth.

Joss Whedons (Buffy, Firefly) new TV-show is a solid sci-fi drama/thriller. A slowly progressing background story and different operations for the ‘dolls’  in each episodes give the show some variety. The quality of the episodes varies from some average episode to hilarious and thrilling ones.
Well, Dollhouse doesn’t do anything obviously wrong. But I’m still not really convinced. I think it’s partly because there aren’t any likeable characters in it. The ‘dolls’ are reset for each episodes, the other characters don’t have much screen time or are cold as stone. It’s not that the actors are bad, they just play roles of people I don’t want to meet in real life.

The first season is nearly finished. Fox won’t air the last episode, it will be released only on DVD. Well, maybe another Fox series which will be cancelled.

Star-O-Meter: (3.5/5)

Trailer:

, , , , , , ,

1 Comment

Lang.NET Symposium 2009

The videos of the Lang.NET are online. Again wonderful  geeky talks about programming-languages and other programming-related stuff: http://www.langnetsymposium.com/2009/talks.aspx

One of the best talks is again from Erik Meijer. He explains his LINQ-to-Events stuff with coins and his talk is really fun to watch. Sadly the video only includes the slides: Silverlight, WMV

Additionally there are some back-stage talks on channel9Gilad Branchas Newspeak is most interesting. The concept with no global scope, objects as services etc. is fascinating. However it’s currently only in a experimental, partly in a conceptual  state. And event if it will become usable in like 5 years, I don’t see it adopted by the masses.

, , ,

No Comments