23. Dezember 2008
I stumbled over a set of pictures which shows the US and allied troops in Afghanistan. The webpage I found shows a photo collection of coalition troops over the course of the last seven years in the country. I think the pictures are quite impressiv!
http://blogs.denverpost.com/captured/2008/11/
Tags: Afghanistan, Pictures, War
Kategorie General | 0 Kommentare »
22. Dezember 2008
Some time ago we were moving from ncover to partcover because ncover is now a commercial product and also we had a lot of problems on our cruise control server. Here are the scripts and also transformations that I made to make the partcover report look like the ncover report. This is presented without much explanation. Contact me if you have any questions.

NAnt Buildscript
<property name="partcover.exe" value="C:/Program Files/Gubka Bob/PartCover .NET 2/PartCover.exe" />
<target name="coverage" description="compute coverage statistics for all unit tests defined in project.nunit" depends="create-nunit">
<property name="date" value="${datetime::now()}" />
<property name="acceptable" value="75" />
<mkdir dir="${results.dir}" unless="${directory::exists(results.dir)}" />
<exec program="${partcover.exe}" failonerror="true">
<arg value="--target=${nunit.exe}" />
<arg value="--target-work-dir=${project.dir}" />
<arg value="--target-args=project.nunit /exclude:${unit_test_exclusions}" />
<arg value="--include=[Project.*]*" />
<arg value="--exclude=[*Test*]*" />
<arg value="--exclude=[*Other]*" />
<arg value="--output=${results.dir}/project.coverage.xml" />
</exec>
<style style="..\path\PartCover-NCover-Like.report.xslt" in="${results.dir}/project.coverage.xml" out="${results.dir}/coverage-report.html">
<parameters>
<parameter name="DateTime" namespaceuri="" value="${date}" />
<parameter name="ProjectName" namespaceuri="" value="${project.name}" />
<parameter name="Acceptable" namespaceuri="" value="${acceptable}" />
</parameters>
</style>
<!-- This generates the extension data which is needed for cruise control, the attribute "in" is just used for validation reason -->
<style style="..\path\PartCover-Extension.xslt" in="${results.dir}/project.coverage.xml" out="${results.dir}/project.coverage.ext.xml">
<parameters>
<parameter name="DateTime" namespaceuri="" value="${date}" />
<parameter name="ProjectName" namespaceuri="" value="${project.name}" />
<parameter name="Acceptable" namespaceuri="" value="${acceptable}" />
</parameters>
</style>
</target>
Download
Tags: CruiseControl, Ncover, PartCover
Kategorie General | 0 Kommentare »
11. Dezember 2008
This is one piece of a cool video. Check it out:
Tags: Mapple, Simpsons
Kategorie Fun | 0 Kommentare »
6. Dezember 2008
JetBrains (the once who also developed the fabulous product ReSharper) released a new version of their distributed build management and continuous integration server. I have never had the possibility to test this integration server but it seems to me a fairly cool product. Especially the web interface is a lot more advanced than cruisecontrol.net.
The professional and opensource version is free of charge. Here is the licensing overview:
http://www.jetbrains.com/teamcity/buy/index.jsp
You can check out installation videos and live demos on this site:
http://www.jetbrains.com/teamcity/documentation/index.html
-
Fastest build feedback in the industry
Adaptive tests re-ordering, on-the-fly test results reporting, configurable notifications, and even making build artifacts accessible before the build is ready — TeamCity keeps you in the know with the most recent build updates and intermediate results, and shows how well your changes integrate into the project sooner. Learn more about TeamCity Continuous Integration.
-
Faster builds, better scalability — with grid computing
Distributed build management helps optimize your hardware resources utilization by parallelizing product builds within the build agents grid. With build chains support, you can even break down a single build procedure into several parts to run them on different build agents — both in sequence and in parallel — using the same set of sources in all of them. Learn about TeamCity Build Grid.
-
Clean and error-free code base
TeamCity automates over 600 Java code inspections, code coverage and duplicates search — out of the box. It also builds, checks and runs automated tests on the server even before committing your changes — keeping your code base clean at all times. Learn more about Pre-tested Commit.
-
First-rate control over large-scale environments
Administer your large-scale build infrastructure from a central Web 2.0 interface. Monitor your team performance and track responsibilities. Easily manage all your builds and hardware resources with detailed statistics and trends reports. Quickly add more build agents, when needed. Learn more about Build Management and Administration.
-
Easy setup and adoption
TeamCity is at home everywhere. It supports both Java and .NET development. Setup is quick and easy under any platform, and offers out of the box integration with the most popular IDEs, build tools, testing frameworks and version control systems. Installation is a breeze — only 3 minutes from free download to a fully deployed and functional server.
-
Extensibility
TeamCity encourages improvements by providing Java API for all sorts of user modifications, from integration with other version control systems and build tools, to creating specific Web UI elements and custom reports. Learn more about developing TeamCity plugins.
http://www.jetbrains.com/teamcity/index.html
Tags: cruisecontrol.net, JetBrains, Resharper, teamcity 4.0
Kategorie Tools | 1 Kommentar »
3. Dezember 2008
Now it’s almost official:
[...]
We’re making significant investments in the Entity Framework such that as of .NET 4.0 the Entity Framework will be our recommended data access solution for LINQ to relational scenarios. We are listening to customers regarding LINQ to SQL and will continue to evolve the product based on feedback we receive from the community as well.
Tim Mallalieu
Program Manager, LINQ to SQL and Entity Framework
http://blogs.msdn.com/adonet/archive/2008/10/29/update-on-linq-to-sql-and-linq-to-entities-roadmap.aspx
Tags: Linq to Entities, Linq to SQL
Kategorie Programming | 0 Kommentare »
1. Dezember 2008
Have you ever had the need to develop your own configuration section handler for application configuration files (app.config) in C#. Everybody that has been doing this lately knows how tedious this can be. But there is a quick and easy way to implement simple configuration section handlers in C#. This post shows you how…
Sample
In the sample we are going to implement a simple configuration section handler which will input an enumeration and a simple string constant. I quickly define the interface:
1
2
3
4
5
6
7
| public interface ITracelightConfigurationSectionHandler :
IConfigurationSectionHandler
{
LanguageEnumeration Language { get; }
string SomeInput { get; }
} |
And the enumeration. Now here comes the first trick into the play. We are going to define our enumeration as a DataContract with the DataContractAttribute from the System.Runtime.Serialization namespace. Every enumeration member that we want to be able to serialize must be marked with the EnumMemberAttribute. This allows us later to transparently deserialize the enumeration from the application configuration file.
1
2
3
4
5
6
7
8
9
| using System.Runtime.Serialization;
[DataContract]
public enum LanguageEnumeration {
[EnumMember]
German,
[EnumMember]
English,
} |
Next we need the concrete class which implements our configuration section handler interface. The class itself are we going to mark as DataContract with the DataContractAttribute. Important here is the Namspace property in the DataContractAttribute must be set to “” (see Line 7). In the Create Method from the IConfigurationSectionHandler interface we are going to use the DataContractSerializer and instantiate it with our concrete class (which implements the ITracelightConfigurationSectionHandler interface). In Line 19 we specify that we want to read the object out of the serializer and must also specify false as second parameter (this surpresses name checking while deserialization). Then we can read the properties out of the configSection instance. Set it on the properties on the instance and return a reference to ourself (this). And we are done!
You only have to remember to set the DataMemberAttribute on every property you want to serialize or deserialize. With the datamember property you can also define how the name looks like in the configuration. If you don’t define a name, the configuration file section must be exactly named as the property.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
| ...
using System.Configuration;
using System.Runtime.Serialization;
using System.Xml;
...
[DataContract(Namespace = "")]
public class TracelightConfigurationSectionHandler :
ITracelightConfigurationSectionHandler
{
// From IConfigurationSectionHandler
public object Create(object parent, object configContext, XmlNode section)
{
var xs = new DataContractSerializer(typeof(TracelightConfigurationSectionHandler ));
XmlNodeReader xnr = new XmlNodeReader(section);
try
{
var configSection = xs.ReadObject(xnr, false) as TracelightConfigurationSectionHandler;
if (configSection != null)
{
Language = configSection.Language;
SomeInput= configSection.SomeInput;
}
return this;
}
catch (Exception ex)
{
string s = ex.Message;
Exception iex = ex.InnerException;
while (iex != null)
{
s += "; " + iex.Message;
iex = iex.InnerException;
}
throw new ConfigurationErrorsException(
"Unable to deserialize an object of type \'" + GetType().FullName +
"\' from the <" + section.Name + "> configuration section: " +
s,
ex,
section);
}
}
// Automatic property for the language
[DataMember(Name = "language", Order = 1)]
public LanguageEnumeration Language
{
get; private set;
}
// Automatic property for the input, which can be omitted.
[DataMember(Name = "input", Order = 2, IsRequired = false)]
public string SomeInput
{
get; private set;
}
} |
And how looks the App.config file?
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<section name="tracelightsection" type="Fully.Qualified.Namespace.TracelightConfigurationSectionHandler, MyAssemblyNameWithoutDllExtension"/>
</configSections>
<tracelightsection>
<language>German</language>
<input>SomeTextualInput</title>
</tracelightsection>
</configuration>
And how can the data be read from the configuration file? That’s pretty easy…
var configSection = (ITracelightConfigurationSectionHandler)ConfigurationManager.GetSection("tracelightsection");
This works even with complex collections. All you need to now is how to handle the data with the DataContractSerializer. But this is fearly simple to learn.
Remarks:
When you see strange behaviour such as the data is not deserialized althoug set in the configuration file you need to specify the order property (especially if you are using non required properties or default values with EmitDefaultValue…).
Tags: ConfigurationManager, ConfigurationSectionHandler
Kategorie Programming | 0 Kommentare »
30. November 2008
Jon Sket is arguing on his blog about having static methods in interfaces. I think his article is really good and worth reading. What do you think about this topic?
http://msmvps.com/blogs/jon_skeet/archive/2008/08/29/lessons-learned-from-protocol-buffers-part-4-static-interfaces.aspx
Tags: Static methods
Kategorie Programming | 0 Kommentare »
29. November 2008
Kategorie Fun | 0 Kommentare »
28. November 2008
First of all I must say I’m watching a movie and at the same time I’m writing a blog post on my computer. I really miss my multi monitor environment I have at my office
Back to the topic…
I just stumbled over two really cool programs you can install on your windows mobile device with G-Sensor. The first application is BeMario. BeMario is a cool implementation of the lovely Super Mario Game we all played till we had wound fingers. So you might asking yourself what is new with this game? The cool thing is that Mario only jumps in this game if you jump with your phone in your hands (or shake it accordingly)
http://forum.xda-developers.com/showthread.php?p=2934494
The second one is the old game called spin-the-bottle. This romantic game should not be played with your work colleagues
Every shake with your phone will make the bottle spin. Hopefully the bottle will point to a nice cute person standing in front of you
http://blog.lieberlieber.com/2008/11/13/warum-programmieren-und-trinken-so-gut-zusammen-passt/
Tags: BeMario, G-Sensor, Spin-the-bottle
Kategorie Mobile Development | 1 Kommentar »
26. November 2008
Recently (exactly eight days ago) I ordered some vitamines and mineral supplements in the United States. I’m a huge fan of the Nature’s Plus product line. In my point of view Nature’s Plus manufactures the best products on the market. They are not artificially flavored, do not contain preservative agents and are mainly containing amino acid chelats. Amino acid chelats are as close as possible to the form the body can almost instantly process the vitamines and minerals and also offer the highest bioavailability. That means if you have for example 50 mg tablets of zinc in amino acid chelat form the body should be able to gain 50 mg zinc out of these tablets. Other forms of zinc would only free between 10-15% of the zinc rate contained in a tablet (in this example only 5 to max. 10 mg with 50 mg tablets). The rest would be left “untouched”…
The cool thing is that I ordered these vitamines and minerals on betterlife.com. First I was a little bit suspicious because the website does not look very nice. But the service they offer is fantastic. Low prices and absolutly fast delivery via American Postal Service. I mean eight days from the U.S. is really impressive. Here are pictures of my products I bought:
Links:
Pss: For those who are wondering what the shipping costs were… Exactly 24 dollars. I will keep you posted how high the customs bill is…
Tags: Calcium, Enzymes, Magnesium, Natures Plus, Ultra Source of Life
Kategorie Fitness | 1 Kommentar »