<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-1545943002454936764</id><updated>2012-02-10T08:40:25.523-08:00</updated><category term='Git'/><category term='Rake'/><category term='.Net'/><title type='text'>Java 2 C#</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://java2cs2.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1545943002454936764/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://java2cs2.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>tcmaster</name><uri>http://www.blogger.com/profile/12229570806153597807</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>26</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-1545943002454936764.post-8191988041359160300</id><published>2012-02-04T06:12:00.000-08:00</published><updated>2012-02-04T06:51:59.761-08:00</updated><title type='text'>Configurations of application using IoC, Spring.NET</title><content type='html'>I have being using Spring when I worked in Java world. Now that I'm in C# part of the world, I'd naturally go with Spring.NET. To be honest, before using Spring.NET, I did not even heard about StructureMap, Windsor, Autofac, NInject, let alone the Funq, Munq, Light.Core, etc. In general, I could live with XML configuration, and some configuration feature derived from XML really makes passing configuration data much easier, by putting below object definition in the container, you can isolate your often changed settings to a file without writing any glue code:&lt;br /&gt;&lt;br /&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;  &amp;lt;object id=&amp;quot;SYSTEM.ConfigPropertyHolder&amp;quot; type=&amp;quot;Spring.Objects.Factory.Config.PropertyPlaceholderConfigurer, Spring.Core&amp;quot;&amp;gt;&lt;br /&gt;    &amp;lt;property name=&amp;quot;LastLocationOverrides&amp;quot; value=&amp;quot;true&amp;quot;/&amp;gt;&lt;br /&gt;    &amp;lt;property name=&amp;quot;ConfigSections&amp;quot; value=&amp;quot;config.app&amp;quot;/&amp;gt;&lt;br /&gt;    &amp;lt;property name=&amp;quot;Locations&amp;quot;&amp;gt;&lt;br /&gt;      &amp;lt;list&amp;gt;&lt;br /&gt;        &amp;lt;value&amp;gt;~/Config/config.app.xml&amp;lt;/value&amp;gt;&lt;br /&gt;      &amp;lt;/list&amp;gt;&lt;br /&gt;    &amp;lt;/property&amp;gt;&lt;br /&gt;  &amp;lt;/object&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;now I can use a file named "config.app.xml", in folder Config, to hold my config settings:&lt;br /&gt;&lt;br /&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;&lt;br /&gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot; ?&amp;gt;&lt;br /&gt;&amp;lt;configuration&amp;gt;&lt;br /&gt;  &amp;lt;configSections&amp;gt;&lt;br /&gt;    &amp;lt;section name=&amp;quot;config.app&amp;quot; type=&amp;quot;System.Configuration.NameValueSectionHandler, System&amp;quot; /&amp;gt;&lt;br /&gt;  &amp;lt;/configSections&amp;gt;&lt;br /&gt;&lt;br /&gt;  &amp;lt;config.app&amp;gt;&lt;br /&gt;    &amp;lt;add key=&amp;quot;value1&amp;quot; value=&amp;quot;some data&amp;quot; /&amp;gt;&lt;br /&gt;    &amp;lt;add key=&amp;quot;value2&amp;quot; value=&amp;quot;other data&amp;quot; /&amp;gt;&lt;br /&gt;    ...&lt;br /&gt;  &amp;lt;/config.app&amp;gt;&lt;br /&gt;&amp;lt;/configuration&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;and in the container definition xml file, I can use the settings defined in the config file:&lt;br /&gt;&lt;br /&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;  &amp;lt;object id=&amp;quot;obj_id&amp;quot; type=&amp;quot;type.name&amp;quot;&amp;gt;&lt;br /&gt;    &amp;lt;constructor-arg name=&amp;quot;para1name&amp;quot; value=&amp;quot;${value1}&amp;quot;/&amp;gt;&lt;br /&gt;    &amp;lt;property name=&amp;quot;pro1name&amp;quot; value=&amp;quot;${value2}&amp;quot;/&amp;gt;&lt;br /&gt;  &amp;lt;/object&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;And since most of Spring.NET's objects are defined with an id, there is even a further way to do the customization, using another class "Spring.Objects.Factory.Config.PropertyOverrideConfigurer, Spring.Core". Put such an object definition in container, &lt;br /&gt;&lt;br /&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;&lt;br /&gt;  &amp;lt;object id=&amp;quot;SYSTEM.ConfigPropertyOverride&amp;quot; type=&amp;quot;Spring.Objects.Factory.Config.PropertyOverrideConfigurer, Spring.Core&amp;quot;&amp;gt;&lt;br /&gt;    &amp;lt;property name=&amp;quot;IgnoreResourceNotFound&amp;quot; value=&amp;quot;true&amp;quot;/&amp;gt;&lt;br /&gt;    &amp;lt;property name=&amp;quot;ConfigSections&amp;quot; value=&amp;quot;config.system&amp;quot;/&amp;gt;&lt;br /&gt;    &amp;lt;property name=&amp;quot;Locations&amp;quot;&amp;gt;&lt;br /&gt;      &amp;lt;list&amp;gt;&lt;br /&gt;        &amp;lt;value&amp;gt;~/Config/config.sys.xml&amp;lt;/value&amp;gt;&lt;br /&gt;      &amp;lt;/list&amp;gt;&lt;br /&gt;    &amp;lt;/property&amp;gt;&lt;br /&gt;  &amp;lt;/object&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;you gain the capability to directly change object properties in config.sys.app:&lt;br /&gt;&lt;br /&gt;&lt;pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"&gt;&lt;code&gt;  &amp;lt;config.system&amp;gt;&lt;br /&gt;&lt;br /&gt;    &amp;lt;!--the key must be a &amp;lt;object_in_context&amp;gt;.&amp;lt;property&amp;gt;--&amp;gt;&lt;br /&gt;    &amp;lt;add key=&amp;quot;obj_id.someProperty&amp;quot; value=&amp;quot;12345&amp;quot;/&amp;gt;&lt;br /&gt;    &amp;lt;add key=&amp;quot;another_obj.anotherProp&amp;quot; value=&amp;quot;good!&amp;quot;/&amp;gt;&lt;br /&gt;    ...&lt;br /&gt;  &amp;lt;/config.system&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Ugly or not, it's really convenient and powerful. In general, Spring.NET is really a feature rich software package, not only a IoC container. And also the document is really good, comparing to most other OSS projects. &lt;br /&gt;&lt;br /&gt;So what's the problem? The problem is I'm getting more and more tired with the angle brackets, and I would like to try something new, like NInject, Autofac.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1545943002454936764-8191988041359160300?l=java2cs2.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java2cs2.blogspot.com/feeds/8191988041359160300/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java2cs2.blogspot.com/2012/02/configurations-of-application-using-ioc.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1545943002454936764/posts/default/8191988041359160300'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1545943002454936764/posts/default/8191988041359160300'/><link rel='alternate' type='text/html' href='http://java2cs2.blogspot.com/2012/02/configurations-of-application-using-ioc.html' title='Configurations of application using IoC, Spring.NET'/><author><name>tcmaster</name><uri>http://www.blogger.com/profile/12229570806153597807</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1545943002454936764.post-7738740863395369010</id><published>2012-02-02T07:29:00.000-08:00</published><updated>2012-02-02T07:34:23.396-08:00</updated><title type='text'>SubWCRev.exe and its dependencies</title><content type='html'>Our team is using Subversion as CVS, and thus it's natural to use SubWCRev.exe to retrieve source code version and embed into VersionInfo.cs file, so we can already rebuild the software when we get a bug report.&lt;br /&gt;&lt;br /&gt;The problem is when the build process is running on build server, there is no TortoiseSVN installed on the server and I don't want to install it on all the build agents. So I took some time to find out the dlls that SubWCRev.exe depends on, in case I forget it:&lt;br /&gt;&lt;br /&gt;#       intl3_tsvn32.dll&lt;br /&gt;#       libapr_tsvn32.dll&lt;br /&gt;#       libaprutil_tsvn32.dll&lt;br /&gt;#       libsasl32.dll&lt;br /&gt;#       libsvn_tsvn32.dll&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1545943002454936764-7738740863395369010?l=java2cs2.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java2cs2.blogspot.com/feeds/7738740863395369010/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java2cs2.blogspot.com/2012/02/subwcrevexe-and-its-dependencies.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1545943002454936764/posts/default/7738740863395369010'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1545943002454936764/posts/default/7738740863395369010'/><link rel='alternate' type='text/html' href='http://java2cs2.blogspot.com/2012/02/subwcrevexe-and-its-dependencies.html' title='SubWCRev.exe and its dependencies'/><author><name>tcmaster</name><uri>http://www.blogger.com/profile/12229570806153597807</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1545943002454936764.post-6129098767867964450</id><published>2012-01-21T05:16:00.000-08:00</published><updated>2012-01-21T05:49:37.792-08:00</updated><title type='text'>tell Git to do ignore your changes to some files</title><content type='html'>Normally Git is so powerful with its branching capabilities, that you seldom need this feature. But sometimes it can be handy if you can simply tell Git to "pretend" that you have not changed some files, even they have really been changed.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;If you are using Git as a SVN client, like I do, you will know that Git refuses sync with SVN with local changes. In a large project, it can be that there is a common development environment with a common deployed application server so the client developers can connect and debug without worrying about setup their own instances. So it's also common that when you checkout codes out of the server, in my case it's a SVN repository, the config file contains URL pointing to that common server. If you are the server side developer, then you have to start your own instance and use a client to connect to it. Then you have to change the config file to point the URL to your instance and remember never commit the changes ,otherwise your colleague will kill you :)&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;There are a bunch of ways to overcome this. You can first only check in your changes without the config files, then stash the config files and then commit to SVN. Or you can create your own local branch with your config files, checkout and rebase the branch each time you want to debug with your config, which is what I'm doing now. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;A new way I realized today while reading &lt;a href="http://kozmic.pl/2012/01/18/testing-framework-is-not-just-for-writing-tests"&gt;this post&lt;/a&gt; was, I can tell Git simply ignore the changes you have made to some files, with below command:   &lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;blockquote&gt;git update-index --assume-unchanged somefile.txt&lt;/blockquote&gt;&lt;/div&gt;&lt;div&gt;this way Git will assume the file is never changed and will perform happily whatever command you want that can normally only be performed to a clean copy. So what happens that the file is changed in upstream repository? By manual, "Git will fail (gracefully) in case it needs to modify this file in the index  e.g. when merging in a commit; thus, in case the assumed-untracked file is  changed upstream, you will need to handle the situation manually."&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1545943002454936764-6129098767867964450?l=java2cs2.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java2cs2.blogspot.com/feeds/6129098767867964450/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java2cs2.blogspot.com/2012/01/tell-git-to-do-ignore-your-changes-to.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1545943002454936764/posts/default/6129098767867964450'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1545943002454936764/posts/default/6129098767867964450'/><link rel='alternate' type='text/html' href='http://java2cs2.blogspot.com/2012/01/tell-git-to-do-ignore-your-changes-to.html' title='tell Git to do ignore your changes to some files'/><author><name>tcmaster</name><uri>http://www.blogger.com/profile/12229570806153597807</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1545943002454936764.post-1146946063245590804</id><published>2012-01-20T01:59:00.000-08:00</published><updated>2012-01-20T02:05:00.857-08:00</updated><title type='text'>Trick to make LiveMeeting addon for Outlook 2007 automatically connected.</title><content type='html'>Yes, my company uses Microsoft Office and related tools to handle normal communication. But some times it happens that the add-on is loaded but not really activated. You'll still see the LiveMeeting toolbar in outlook toolbar, but just one button "Enable LiveMeeting" there. This is annoying since you have to remember to push it each time you start outlook.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;There is a simple solution to it: go to "start-&amp;gt;all programes-&amp;gt;microsoft office-&amp;gt;microsoft office tools" and select the "microsoft office 2007 language settings", change the language to some other value, save it. Then open it again and change it back to your preferred language. Then start outlook again, you'll find the add-on is activated automatically with 3 buttons.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1545943002454936764-1146946063245590804?l=java2cs2.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java2cs2.blogspot.com/feeds/1146946063245590804/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java2cs2.blogspot.com/2012/01/trick-to-make-livemeeting-addon-for.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1545943002454936764/posts/default/1146946063245590804'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1545943002454936764/posts/default/1146946063245590804'/><link rel='alternate' type='text/html' href='http://java2cs2.blogspot.com/2012/01/trick-to-make-livemeeting-addon-for.html' title='Trick to make LiveMeeting addon for Outlook 2007 automatically connected.'/><author><name>tcmaster</name><uri>http://www.blogger.com/profile/12229570806153597807</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1545943002454936764.post-4928637128607783581</id><published>2012-01-17T08:39:00.000-08:00</published><updated>2012-01-17T08:59:41.238-08:00</updated><title type='text'>Simple.Data, is it really a good idea?</title><content type='html'>I've been keeping an eye on &lt;a href="http://yobriefca.se/blog/2011/06/21/microorms-for-dotnet-inserts-updates-deletes/"&gt;micro ORMs&lt;/a&gt; for a while. Yesterday I decided to give &lt;a href="https://github.com/markrendle/Simple.Data"&gt;Simple.Data&lt;/a&gt; a try. From the introduction, it looks brilliant, the fluent API, the briefness, the simplicity,..., everything seems to be perfect... well, until I started coding.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Once I'm in VS, I immediately realized that Simple.Data might not be the one I wanted. Its magical syntax heavily depends on .NET's new dynamic feature (yes, it's .NET 4 and above only).  That means you loose the static language's best capability: compile time checking. And also you loose the productivity from your tool, there is almost no intellisense provided by VS. You might say, what's the big deal, the syntax is cool. Yes, it's cool. But the problem is, if you make an accident typing or a normal typo (who doesn't?), then compiler won't be there for you and you'll only get the null at runtime. Maybe through unit test coverage may resolve this. But from where I stand, it seems to be just a better alternative of HQL dressed with a new cloth named fluent API.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;But I did find some part that really make me happy. It seems Simple.Data recognizes fields separated by underscore. I've got a table with columns like CUSTOMER_ID, and Simple.Data can happily map it to a property named CustomerId. If I rename CUSTOMERID, then Simple.Data still works fine. This is clever!&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;There is a tool, Simple.Data.Pad, to address this issue. So far I haven't been able to make it work with sqlite yet.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;In general, I'm not so convinced yet, but I'll continue on the project to work with it, let's see where I'm going to end with.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1545943002454936764-4928637128607783581?l=java2cs2.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java2cs2.blogspot.com/feeds/4928637128607783581/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java2cs2.blogspot.com/2012/01/simpledata-is-it-really-good-idea.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1545943002454936764/posts/default/4928637128607783581'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1545943002454936764/posts/default/4928637128607783581'/><link rel='alternate' type='text/html' href='http://java2cs2.blogspot.com/2012/01/simpledata-is-it-really-good-idea.html' title='Simple.Data, is it really a good idea?'/><author><name>tcmaster</name><uri>http://www.blogger.com/profile/12229570806153597807</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1545943002454936764.post-6242226855192912393</id><published>2012-01-15T08:49:00.000-08:00</published><updated>2012-02-10T08:40:25.663-08:00</updated><title type='text'>.Net code contracts</title><content type='html'>I knew there is something new in .NET 4 called code contracts and I also saw some simple code snippets about it. Without digging in, I though it was just some fluent code sugar to help you replace assertions like &lt;div&gt;&lt;blockquote&gt;&lt;span&gt;  if (input_int &amp;gt; 0) throw new ArgumentException("some msg");&lt;/span&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;div&gt;with &lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;blockquote&gt;&lt;span&gt;Contracts.Requires&amp;lt;argumentexception&amp;gt;(input_int &amp;gt; 0);&lt;/span&gt;&lt;/blockquote&gt;&lt;/div&gt;and come on, this fluent sucks, requires an exception? I would have written a better one!&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;But I was wrong! &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I had some free time today and I opened a long bookmarked &lt;a href="http://msdn.microsoft.com/en-us/magazine/ee236408.aspx"&gt;url&lt;/a&gt; and took a look at it. After reading through the first section, I knew I was wrong. There was post compile code weaving and checking. Without it, there is not much virtual inside, but with the post process, everything can happen. And it turns out to be a very much valuable technology than I thought. Kudos!&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Some simple googling led me to &lt;a href="http://www.abhisheksur.com/2011/02/code-contracts-in-net-40-its-internals.html"&gt;this blog&lt;/a&gt; that provides some analysis I would also do, using Reflector on the generated code, to see the magic there. Also in their &lt;a href="http://msdn.microsoft.com/en-us/devlabs/dd491992.aspx"&gt;home page&lt;/a&gt;, there is a video at the bottom(?!) of the page, after some random comments!&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1545943002454936764-6242226855192912393?l=java2cs2.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java2cs2.blogspot.com/feeds/6242226855192912393/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java2cs2.blogspot.com/2012/01/net-code-contracts.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1545943002454936764/posts/default/6242226855192912393'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1545943002454936764/posts/default/6242226855192912393'/><link rel='alternate' type='text/html' href='http://java2cs2.blogspot.com/2012/01/net-code-contracts.html' title='.Net code contracts'/><author><name>tcmaster</name><uri>http://www.blogger.com/profile/12229570806153597807</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1545943002454936764.post-1361061719783158690</id><published>2012-01-11T08:51:00.001-08:00</published><updated>2012-01-11T08:55:22.565-08:00</updated><title type='text'>Differences between event and delegate in C#</title><content type='html'>I did not realized some of them until I came across &lt;a href="http://blog.monstuff.com/archives/000040.html"&gt;this article&lt;/a&gt;. In short, &lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;ol&gt;&lt;li&gt;event is a modifier and delegate is a normal type declaration&lt;/li&gt;&lt;li&gt;thus event can be used in interfaces and delegates can not&lt;/li&gt;&lt;li&gt;event can only be accessed by the class defines it, not even the child classes (an in-direct access through protected method is possible), while delegate is more like a member&lt;/li&gt;&lt;li&gt;normally event follows a convention on signature:  &lt;i style="color: rgb(51, 51, 51); font-family: palatino, georgia, verdana, arial, sans-serif; line-height: 26px; text-align: justify; background-color: rgb(255, 255, 255); font-size: small; "&gt;foo(object source, EventArgs e)&lt;/i&gt;&lt;/li&gt;&lt;/ol&gt;&lt;div style="text-align: justify;"&gt;&lt;span   &gt;&lt;span style="line-height: 26px;"&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1545943002454936764-1361061719783158690?l=java2cs2.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java2cs2.blogspot.com/feeds/1361061719783158690/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java2cs2.blogspot.com/2012/01/differences-between-event-and-delegate.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1545943002454936764/posts/default/1361061719783158690'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1545943002454936764/posts/default/1361061719783158690'/><link rel='alternate' type='text/html' href='http://java2cs2.blogspot.com/2012/01/differences-between-event-and-delegate.html' title='Differences between event and delegate in C#'/><author><name>tcmaster</name><uri>http://www.blogger.com/profile/12229570806153597807</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1545943002454936764.post-5505723976745802332</id><published>2012-01-08T14:20:00.001-08:00</published><updated>2012-01-08T14:49:48.039-08:00</updated><title type='text'>Start on Python</title><content type='html'>It's being quite a while since my last blog and I would like to have something really new to start the new year, Python.&lt;br /&gt;&lt;br /&gt;Recently I started teaching my son Python. I don't know Python before. So I have to learn it while teaching him. I intended to learn Python for quite some time, but time has always been my biggest enemy, together with my memory: it's getting worse every year. If I learn something and don't use it immediately, then it's quite possible after 3 months, I'm new to it again. So I start blogging it, trying to make my memory last longer.&lt;br /&gt;&lt;br /&gt;Python is an elegant language, it's very expressive and has very brief syntax - though this can be a double side sword - to a experienced programmer with long time Java/C#/C++/C experience, it takes some time to be used to it.&lt;br /&gt;&lt;br /&gt;Some points about Python I'd like to note down:&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Python started at 1989, and first public appeared at 1991&lt;/li&gt;&lt;li&gt;CPython is the C implemented version of Python, then standard Python&lt;/li&gt;&lt;li&gt;Python generally has 2 kinds of primary types: numbers and strings, though array/list and hashtable/dictionary is first class member of the language.&lt;/li&gt;&lt;li&gt;Python use space indention to indicate sub-scope. The indent does not have to be unified within program, but must be the same for the same scope&lt;/li&gt;&lt;li&gt;like most script languages, variables do not need to be pre-claimed before being used&lt;/li&gt;&lt;li&gt;Python can be compiled into byte codes, like Java class files, with extension .pyo or .pyc&lt;/li&gt;&lt;li&gt;using '''/""", you can have multiple line strings&lt;/li&gt;&lt;li&gt;raw string starts with a 'r': &lt;b&gt;r&lt;/b&gt;"c:\a\path\file"&lt;/li&gt;&lt;li&gt;unicode string starts with a 'u':  u"this is unicode"&lt;/li&gt;&lt;li&gt;raw_input() will return anything you input as a string, while input() will try to evaluate your input as Python code! For example:&lt;br /&gt;&lt;blockquote&gt;&amp;gt;&amp;gt;&amp;gt; a = 3&lt;br /&gt;&amp;gt;&amp;gt;&amp;gt; b = input()&lt;br /&gt;a+11&lt;br /&gt;&amp;gt;&amp;gt;&amp;gt; b&lt;br /&gt;14&lt;/blockquote&gt;&lt;/li&gt;&lt;li&gt;Python as +=, -=, *=, /=, similar to other languages, but no i++, ++i, i-- or --i. But ++i or --i won't give you any syntax error, since the +/- are treated two time sign prefix!&lt;/li&gt;&lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1545943002454936764-5505723976745802332?l=java2cs2.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java2cs2.blogspot.com/feeds/5505723976745802332/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java2cs2.blogspot.com/2012/01/start-on-python.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1545943002454936764/posts/default/5505723976745802332'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1545943002454936764/posts/default/5505723976745802332'/><link rel='alternate' type='text/html' href='http://java2cs2.blogspot.com/2012/01/start-on-python.html' title='Start on Python'/><author><name>tcmaster</name><uri>http://www.blogger.com/profile/12229570806153597807</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1545943002454936764.post-7004812114579902765</id><published>2011-10-04T07:30:00.000-07:00</published><updated>2011-10-04T07:43:39.767-07:00</updated><title type='text'>substring in unix shell scripts</title><content type='html'>Recently I need to handle quite some unix shell scripts and find &lt;a href="http://www.arachnoid.com/linux/shell_programming.html"&gt;some tricks&lt;/a&gt; about strings that is less known.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;&lt;b&gt;1. substring&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;Most of my searches resulted using awk. I don't mind using it, but it make the script less readable. Luckily there is a easy way:&lt;/div&gt;&lt;div&gt;&lt;blockquote&gt;&lt;span class="Apple-style-span"&gt;one_str="this is a string"&lt;br /&gt;sub_str=${one_str:5:2}  # ${org_str_var:0_based_index:length}&lt;br /&gt;# now sub_str contains "is"&lt;/span&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;&lt;b&gt;2. string search and replacement&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;Again, most search results say you should use "sed" or other external commands. But below line will also do the trick:&lt;/div&gt;&lt;div&gt;&lt;blockquote&gt;&lt;span class="Apple-style-span"&gt;alpha="This is a test string in which the word \"test\" is replaced." beta="${alpha/test/replace}"  #replace only the 1st insance&lt;br /&gt;beta="${alpha//test/replace}"  #replace all insances&lt;/span&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1545943002454936764-7004812114579902765?l=java2cs2.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java2cs2.blogspot.com/feeds/7004812114579902765/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java2cs2.blogspot.com/2011/10/substring-in-unix-shell-scripts.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1545943002454936764/posts/default/7004812114579902765'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1545943002454936764/posts/default/7004812114579902765'/><link rel='alternate' type='text/html' href='http://java2cs2.blogspot.com/2011/10/substring-in-unix-shell-scripts.html' title='substring in unix shell scripts'/><author><name>tcmaster</name><uri>http://www.blogger.com/profile/12229570806153597807</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1545943002454936764.post-7952723234855021694</id><published>2011-09-23T06:42:00.000-07:00</published><updated>2011-09-23T06:46:59.869-07:00</updated><title type='text'>.NET/windows Debugger list.</title><content type='html'>It's been quite a while since my last post. Anyway, I don't have any followers and this is just for myself to keep some ideas here.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;This &lt;a href="http://blogs.msdn.com/b/dau-blog/archive/2011/09/22/debugging-tools-survival-guide.aspx"&gt;link&lt;/a&gt; gives a description of several debuggers/tools and their best usage scenarios. Though it seems to be quite powerful, I really hope some tools that can do debugger record and play &lt;a href="http://www.infoq.com/articles/recording-jvm-debuggers"&gt;like the Java world has now.&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1545943002454936764-7952723234855021694?l=java2cs2.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java2cs2.blogspot.com/feeds/7952723234855021694/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java2cs2.blogspot.com/2011/09/netwindows-debugger-list.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1545943002454936764/posts/default/7952723234855021694'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1545943002454936764/posts/default/7952723234855021694'/><link rel='alternate' type='text/html' href='http://java2cs2.blogspot.com/2011/09/netwindows-debugger-list.html' title='.NET/windows Debugger list.'/><author><name>tcmaster</name><uri>http://www.blogger.com/profile/12229570806153597807</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1545943002454936764.post-7553805180614727338</id><published>2011-07-15T01:58:00.000-07:00</published><updated>2011-07-15T03:01:21.104-07:00</updated><title type='text'>Git as SVN client: rollback to previous version</title><content type='html'>Git is a very power content based DCVS. I use it as a SVN client, since my company is still using SVN. I've been quite happy until yesterday: I made a mistake in a commit and need to roll it back. The problem is I already checked in to SVN and it broke some unit tests I did not cover on my local run, but the CI server did. I'm used to local reset to revert some bad changes, but this will only help when you have not pushed changes to remote sites:&lt;div&gt;&lt;blockquote&gt;&lt;span class="Apple-style-span"&gt;  &lt;span class="Apple-style-span"&gt;git reset HEAD~&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;div&gt;Above command will reset your master pointing to the previous commit. From Git's point of view, it's done. The current HEAD (master) now points to the desired copy of the codes you want to have. But the problem is once you do a synchronization with SVN, it's going to be reset back to the copy you want to get rid of. This is because Git is treating master tag as a pointer. When you do the above reset, it just move the pointer back without doing any real commit. So here what we really need is a "real" commit, which "git revert" provides. &lt;/div&gt;&lt;div&gt;&lt;blockquote&gt;&lt;span class="Apple-style-span"&gt;git revert HEAD&lt;/span&gt;&lt;/blockquote&gt;After this, if you look at the history, you'll find a commit with the new result. Now synchronize with SVN and you'll find a new commit in it and the changes you made has been rolled back.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Note, &lt;span class="Apple-style-span"&gt;git revert&lt;/span&gt; should only use when you have pushed your changes to remote sites. Then it gives you a chance to fix the problem. If your change is still local, &lt;span class="Apple-style-span"&gt;git reset&lt;/span&gt; is recommended.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Maybe this is stupid, but it took me a while to figure this out,  hope this helps some one out there who is also bothered by this.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1545943002454936764-7553805180614727338?l=java2cs2.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java2cs2.blogspot.com/feeds/7553805180614727338/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java2cs2.blogspot.com/2011/07/git-as-svn-client-rollback-to-previous.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1545943002454936764/posts/default/7553805180614727338'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1545943002454936764/posts/default/7553805180614727338'/><link rel='alternate' type='text/html' href='http://java2cs2.blogspot.com/2011/07/git-as-svn-client-rollback-to-previous.html' title='Git as SVN client: rollback to previous version'/><author><name>tcmaster</name><uri>http://www.blogger.com/profile/12229570806153597807</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1545943002454936764.post-6344781954142311219</id><published>2010-09-28T06:02:00.000-07:00</published><updated>2010-10-04T07:52:04.208-07:00</updated><title type='text'>Installing Redmine on Windows</title><content type='html'>Redmine is an excellent project/issue/bug tracking tool. As of this writing, V1.0.1 is just released. I guess V2 is going to be based on RoR V3.&lt;br /&gt;&lt;br /&gt;Most of the installation is just no brainer, following the &lt;a href="http://www.redmine.org/wiki/redmine/RedmineInstall"&gt;directions in their website&lt;/a&gt;. I used a MySql and setup a initial DB is also very easy, though I did have to follow the installation instruction to download the &lt;a href="http://instantrails.rubyforge.org/svn/trunk/InstantRails-win/InstantRails/mysql/bin/libmySQL.dll"&gt;MySql Dll&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Now you should be able to start the application from command line. But wait, normally you should &lt;a href="http://noobonrails.blogspot.com/2006/06/how-to-setup-mongrel-as-native-windows.html"&gt;use mongrel &lt;/a&gt;or webrick as your webserver. A "gem install mongrel" will do the trick. And further, you might want to run your website as a service, following &lt;a href="http://noobonrails.blogspot.com/2006/06/how-to-setup-mongrel-as-native-windows.html"&gt;most of the advices &lt;/a&gt;to run mongrel as a windows service will require you build a native dll. I don't want to install cygwin or gcc to just compile those stupid dlls. Therefore I followed the &lt;a href="http://www.redmine.org/boards/1/topics/4123"&gt;advice in Redmine's website. &lt;/a&gt;Actually if you download the Win 2003 Res Kit, you can find the directions also in help on topic srvany.exe.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Another bloody experience, which took me 3 hours to figure out was, don't run the service under LocalSystem account, which will prevent network access. It seems this will block subversion access!&lt;br /&gt;&lt;br /&gt;Integrating SVN to Redmine can be a little tricky.&lt;br /&gt;1. You need the svn.exe file on system path. Don't forget to re-open a cmd window after you have changed the system path.&lt;br /&gt;2. If you use https protocol, another trick is, you have to run below command to accept the certificate (permanantly) from the server, then everything will be fine.&lt;br /&gt;3. And if you specify any special user rights to your repository, don't forget to grant at least read-only access to the user you specified in Redmine.&lt;br /&gt;4. If you are integrating to a repository with huge history, the intial importing can take a long time.&lt;br /&gt;&lt;br /&gt;Authenticating using Active Directory is also a little tricky. You can use this image as a reference.&lt;br /&gt;&lt;a href="http://2.bp.blogspot.com/_LaYimtxFULQ/TKHtmjBcFuI/AAAAAAAAABE/a3IPw0nsngg/s1600/Redmine-AD-Auth.PNG"&gt;&lt;img style="MARGIN: 0px 10px 10px 0px; WIDTH: 221px; FLOAT: left; HEIGHT: 320px; CURSOR: hand" id="BLOGGER_PHOTO_ID_5521955864625026786" border="0" alt="" src="http://2.bp.blogspot.com/_LaYimtxFULQ/TKHtmjBcFuI/AAAAAAAAABE/a3IPw0nsngg/s320/Redmine-AD-Auth.PNG" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1545943002454936764-6344781954142311219?l=java2cs2.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java2cs2.blogspot.com/feeds/6344781954142311219/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java2cs2.blogspot.com/2010/09/installing-redmine-on-windows.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1545943002454936764/posts/default/6344781954142311219'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1545943002454936764/posts/default/6344781954142311219'/><link rel='alternate' type='text/html' href='http://java2cs2.blogspot.com/2010/09/installing-redmine-on-windows.html' title='Installing Redmine on Windows'/><author><name>tcmaster</name><uri>http://www.blogger.com/profile/12229570806153597807</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_LaYimtxFULQ/TKHtmjBcFuI/AAAAAAAAABE/a3IPw0nsngg/s72-c/Redmine-AD-Auth.PNG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1545943002454936764.post-1652336253275721962</id><published>2010-08-09T13:41:00.001-07:00</published><updated>2010-08-09T13:55:33.056-07:00</updated><title type='text'>TDD, it's not about testing.</title><content type='html'>I subscribed a lot of blogs and it seems in their world, TDD is something that needs not to explain, at least the name it self is as clear as the name of "Unix". But sadly I discovered this might only be true in some software house, but not in most of the IT departments in normal companies. &lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Anyway, I found some &lt;a href="http://www.bigvisible.com/asroka/what-is-test-driven-development/"&gt;good explanation&lt;/a&gt; about TDD, which is very insightful. TDD is not about testing, it's about design. The tests to guarantee quality, to weave the safe-net is a valuable byproduct.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I recall one of the API for a report generator. The report format looks complex. I decided to design a model for the report, and once the model is done, generating the report should be straight forward. I started with some tests to generate part of the data the report needs, this forced me to think about the model structure and API in another angle. And finally it turned out a very different, if not completely different, but simple API. I reviewed it and was glad about its elegance. I would not be able to design such a nice API if I test after!&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1545943002454936764-1652336253275721962?l=java2cs2.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java2cs2.blogspot.com/feeds/1652336253275721962/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java2cs2.blogspot.com/2010/08/tdd-its-not-about-testing.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1545943002454936764/posts/default/1652336253275721962'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1545943002454936764/posts/default/1652336253275721962'/><link rel='alternate' type='text/html' href='http://java2cs2.blogspot.com/2010/08/tdd-its-not-about-testing.html' title='TDD, it&apos;s not about testing.'/><author><name>tcmaster</name><uri>http://www.blogger.com/profile/12229570806153597807</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1545943002454936764.post-5797080939770223007</id><published>2010-08-01T08:13:00.000-07:00</published><updated>2010-08-01T08:22:32.368-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Git'/><title type='text'>Setting up Git server using Apache on Windows</title><content type='html'>I posted &lt;a href="http://java2cs2.blogspot.com/2010/03/setup-git-server-on-windows-machine.html"&gt;an article&lt;/a&gt; to setup a Git server on windows using MSysGit, with Git's native transport protocol. Though it works good, the setup of SSH server and client is not a easy cake to some. Git's HTTP support on Windows was known to be less efficient. But given today's hardware and especially if you are using it in an enterprise environment, this can hardly be a problem than the complex setup process of SSH ways. Recently I found a way of creating &lt;a href="http://www.jeremyskinner.co.uk/2010/07/31/hosting-a-git-server-under-apache-on-windows/"&gt;Git server using Apache&lt;/a&gt; and it's both simple and comprehensive. So take a look.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1545943002454936764-5797080939770223007?l=java2cs2.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java2cs2.blogspot.com/feeds/5797080939770223007/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java2cs2.blogspot.com/2010/08/setting-up-git-server-using-apache-on.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1545943002454936764/posts/default/5797080939770223007'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1545943002454936764/posts/default/5797080939770223007'/><link rel='alternate' type='text/html' href='http://java2cs2.blogspot.com/2010/08/setting-up-git-server-using-apache-on.html' title='Setting up Git server using Apache on Windows'/><author><name>tcmaster</name><uri>http://www.blogger.com/profile/12229570806153597807</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1545943002454936764.post-1195447160765430299</id><published>2010-05-28T14:13:00.000-07:00</published><updated>2010-05-28T14:17:16.568-07:00</updated><title type='text'>Great FitNesse tutorial!</title><content type='html'>I was attracted by FitNesse recently and found this&lt;a href="http://schuchert.wikispaces.com/FitNesse.Tutorials"&gt; great tutorial&lt;/a&gt; from &lt;span class="Apple-style-span" style="font-family: 'Times New Roman', serif; line-height: 16px; "&gt;Brett who is working with uncle bob at ObjectMentor.&lt;/span&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Times New Roman', serif; line-height: 16px; "&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Times New Roman', serif; line-height: 16px; "&gt;The tutorial is great since it not only introduced the concept, but also a really good example to guide you through the door. Meanwhile, without bending rules by ugly codes.&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1545943002454936764-1195447160765430299?l=java2cs2.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java2cs2.blogspot.com/feeds/1195447160765430299/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java2cs2.blogspot.com/2010/05/great-fitnesse-tutorial.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1545943002454936764/posts/default/1195447160765430299'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1545943002454936764/posts/default/1195447160765430299'/><link rel='alternate' type='text/html' href='http://java2cs2.blogspot.com/2010/05/great-fitnesse-tutorial.html' title='Great FitNesse tutorial!'/><author><name>tcmaster</name><uri>http://www.blogger.com/profile/12229570806153597807</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1545943002454936764.post-6248429502443242215</id><published>2010-05-28T12:37:00.001-07:00</published><updated>2010-05-28T13:53:07.521-07:00</updated><title type='text'>Is public field still so evil in C#?</title><content type='html'>In Java, there is a rule: "never make your field public". This rule is borrowed by C# when a lot of Java programmers jumped to .NET. I'm one of them and I loyally kept that habit, you will find no public field defined in classes from my hand. While, not exactly. That changed recently.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;One of the main reason of "keep fields private" in Java was, field accessors and method calls are very different. If you expose your field as public, then all dependent applications will use &lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;obj.fieldName&lt;/span&gt;&lt;/span&gt; to access it; while if you encapsulate it using a access method, it's like &lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;obj.getField()&lt;/span&gt;&lt;/span&gt;. So if you have make the field public, and then you need to introduce some business logic on the field, then you've got a headache: you need to change all the depending source codes. With IDEs like IDEA and Eclipse, this kind of change can be much easier and robust than before, but still it's going to take effort, which is a waste.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Since the first day of C#'s birth, it has a special language feature, Property, which I believe was borrowed by the success of &lt;a href="http://www.embarcadero.com/products/delphi"&gt;Delphi&lt;/a&gt;. By this feature, a field can be encapsulated by a property and accessed in the same syntax as field, except under the hood, it's really a method call, and if you disassembly the IL code, there is really setField and getField methods generated. So in this case, is it still so evil to mark your field private and provide a property for it? In most of my applications (and I believe in most of most programmers' applications) the property is nothing but just a dummy get/set pair. And to make this pain less painful, MS invented the "auto-property". But the question is, is this encapsulate really necessary?&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I don't think so! For C# applications, the "private-field-rule" is not applicable any more. Since if you want to change a field to a property, none of the dependent codes should change (unless if you use reflection). The only thing a field can not do is, it can not be marked as virtual while properties can; and fields can not be put into interfaces while properties can be (you can make a property writeonly and not field, might be useful for setting injection by IoC). So if you need to make a NHibernate friendly entity, or if you need to define interfaces to other module, use property.  For most of rest, try to use field, until you find the needs to introduce property. This will help you get code clean.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1545943002454936764-6248429502443242215?l=java2cs2.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java2cs2.blogspot.com/feeds/6248429502443242215/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java2cs2.blogspot.com/2010/05/is-public-field-still-so-evil-in-c_28.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1545943002454936764/posts/default/6248429502443242215'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1545943002454936764/posts/default/6248429502443242215'/><link rel='alternate' type='text/html' href='http://java2cs2.blogspot.com/2010/05/is-public-field-still-so-evil-in-c_28.html' title='Is public field still so evil in C#?'/><author><name>tcmaster</name><uri>http://www.blogger.com/profile/12229570806153597807</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1545943002454936764.post-5088280058704713108</id><published>2010-05-14T08:54:00.000-07:00</published><updated>2010-05-14T09:04:30.633-07:00</updated><title type='text'>Content types if you deploy ClickOnce applications with non-IIS web server.</title><content type='html'>Found below info from &lt;a href="http://msdn.microsoft.com/en-us/library/ms228998(VS.90).aspx"&gt;MSDN&lt;/a&gt;. BTW, &lt;a href="http://code.google.com/p/mongoose/"&gt;mongoose&lt;/a&gt; is a very good candidate for this...&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"   style="  ;font-family:'Segoe UI', Verdana, Arial;font-size:13px;"&gt;&lt;table style="border-top-color: rgb(229, 229, 229); border-right-color: rgb(229, 229, 229); border-bottom-color: rgb(229, 229, 229); border-left-color: rgb(229, 229, 229); border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; margin-top: 5px; margin-bottom: 5px; margin-left: 0px; width: 925px; border-collapse: collapse; "&gt;&lt;tbody&gt;&lt;tr style="vertical-align: top; "&gt;&lt;th style="background-color: rgb(229, 229, 229); padding-right: 4px; padding-left: 4px; padding-bottom: 4px; color: black; padding-top: 4px; border-bottom-color: rgb(200, 205, 222); border-bottom-width: 1px; border-bottom-style: solid; text-align: left; "&gt;&lt;p&gt;File name extension&lt;/p&gt;&lt;/th&gt;&lt;th style="background-color: rgb(229, 229, 229); padding-right: 4px; padding-left: 4px; padding-bottom: 4px; color: black; padding-top: 4px; border-bottom-color: rgb(200, 205, 222); border-bottom-width: 1px; border-bottom-style: solid; text-align: left; "&gt;&lt;p&gt;Content type&lt;/p&gt;&lt;/th&gt;&lt;/tr&gt;&lt;tr style="vertical-align: top; "&gt;&lt;td style="background-color: white; line-height: 18px; border-top-color: rgb(213, 213, 211); border-right-color: rgb(213, 213, 211); border-bottom-color: rgb(213, 213, 211); border-left-color: rgb(213, 213, 211); border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; padding-right: 4px; padding-left: 4px; padding-bottom: 4px; margin-top: 1px; margin-right: 1px; margin-bottom: 1px; margin-left: 1px; padding-top: 4px; "&gt;&lt;p&gt;&lt;span class="code"   style="  color: rgb(0, 0, 102); font-family:monospace, 'Courier New', Courier;font-size:14px;"&gt;.application&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style="background-color: white; line-height: 18px; border-top-color: rgb(213, 213, 211); border-right-color: rgb(213, 213, 211); border-bottom-color: rgb(213, 213, 211); border-left-color: rgb(213, 213, 211); border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; padding-right: 4px; padding-left: 4px; padding-bottom: 4px; margin-top: 1px; margin-right: 1px; margin-bottom: 1px; margin-left: 1px; padding-top: 4px; "&gt;&lt;p&gt;&lt;span class="code"   style="  color: rgb(0, 0, 102); font-family:monospace, 'Courier New', Courier;font-size:14px;"&gt;application/x-ms-application&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style="vertical-align: top; "&gt;&lt;td style="background-color: white; line-height: 18px; border-top-color: rgb(213, 213, 211); border-right-color: rgb(213, 213, 211); border-bottom-color: rgb(213, 213, 211); border-left-color: rgb(213, 213, 211); border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; padding-right: 4px; padding-left: 4px; padding-bottom: 4px; margin-top: 1px; margin-right: 1px; margin-bottom: 1px; margin-left: 1px; padding-top: 4px; "&gt;&lt;p&gt;&lt;span class="code"   style="  color: rgb(0, 0, 102); font-family:monospace, 'Courier New', Courier;font-size:14px;"&gt;.manifest&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style="background-color: white; line-height: 18px; border-top-color: rgb(213, 213, 211); border-right-color: rgb(213, 213, 211); border-bottom-color: rgb(213, 213, 211); border-left-color: rgb(213, 213, 211); border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; padding-right: 4px; padding-left: 4px; padding-bottom: 4px; margin-top: 1px; margin-right: 1px; margin-bottom: 1px; margin-left: 1px; padding-top: 4px; "&gt;&lt;p&gt;&lt;span class="code"   style="  color: rgb(0, 0, 102); font-family:monospace, 'Courier New', Courier;font-size:14px;"&gt;application/x-ms-manifest&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr style="vertical-align: top; "&gt;&lt;td style="background-color: white; line-height: 18px; border-top-color: rgb(213, 213, 211); border-right-color: rgb(213, 213, 211); border-bottom-color: rgb(213, 213, 211); border-left-color: rgb(213, 213, 211); border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; padding-right: 4px; padding-left: 4px; padding-bottom: 4px; margin-top: 1px; margin-right: 1px; margin-bottom: 1px; margin-left: 1px; padding-top: 4px; "&gt;&lt;p&gt;&lt;span class="code"   style="  color: rgb(0, 0, 102); font-family:monospace, 'Courier New', Courier;font-size:14px;"&gt;.deploy&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style="background-color: white; line-height: 18px; border-top-color: rgb(213, 213, 211); border-right-color: rgb(213, 213, 211); border-bottom-color: rgb(213, 213, 211); border-left-color: rgb(213, 213, 211); border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; padding-right: 4px; padding-left: 4px; padding-bottom: 4px; margin-top: 1px; margin-right: 1px; margin-bottom: 1px; margin-left: 1px; padding-top: 4px; "&gt;&lt;p&gt;&lt;span class="code"   style="  color: rgb(0, 0, 102); font-family:monospace, 'Courier New', Courier;font-size:14px;"&gt;application/octet-stream&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1545943002454936764-5088280058704713108?l=java2cs2.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java2cs2.blogspot.com/feeds/5088280058704713108/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java2cs2.blogspot.com/2010/05/content-types-if-you-deploy-clickonce.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1545943002454936764/posts/default/5088280058704713108'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1545943002454936764/posts/default/5088280058704713108'/><link rel='alternate' type='text/html' href='http://java2cs2.blogspot.com/2010/05/content-types-if-you-deploy-clickonce.html' title='Content types if you deploy ClickOnce applications with non-IIS web server.'/><author><name>tcmaster</name><uri>http://www.blogger.com/profile/12229570806153597807</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1545943002454936764.post-8521948764292217806</id><published>2010-05-12T09:09:00.000-07:00</published><updated>2010-05-14T09:03:05.283-07:00</updated><title type='text'>Using Teamcity to build(publish) .net application</title><content type='html'>Since .NET 2, there is a nice feature to "publish" your application, called &lt;a href="http://msdn.microsoft.com/en-us/library/wh45kb66(VS.90).aspx"&gt;ClickOnce&lt;/a&gt;, to a website, file share or to CD/DVD. If your application only contains managed code (MS termed this smartclient), this feature is a easy way to simplify the deployment of the application and keep your users update date. I happen to have such a application with a group of users up to ~50 distributed from Europe to Asia, so deployment always bothers me. To make things worse (or better:), I follow the agile way of development. That means frequent change/deployment of software. If it is a website, there won't be a problem, but I'm still stuck to desktop and I need an easy way to handle this. Luckily there is a built in function named "publish" in VS2005 (the aged IDE I'm using), which can make a simple html page and some xml files so you can put them on a website and the users can just click the page and start the application. This only works for IE, unfortunately if you can only use .NET2. Since .NET 3.5, there is a Firefox plugin from MS, and there has always been a unofficial Firefox plugin, but I never tried. Anyway it's enough in my case. One thing to notice is, the application is not downloaded for every startup. The &lt;span class="Apple-style-span"  style="font-size:x-small;"&gt;&lt;span class="Apple-style-span"  style="color:#CCCCCC;"&gt;timestamp is used to check if there is a new version on server, and if the return value is 304, http-not-changed, then the copy from IE's local cache is used &lt;/span&gt;&lt;/span&gt;, deployment file (.application) is downloaded and the version embeded in is compared to the version installed in the local application cache. If the version on server is newer, then the application is downloaded again, or the local copy is used. So this suits local network perfectly, unless your deployment is too large (&gt;10MB?). And it seems the application is running in a full trusted mode, with user's confirmation through a dialog showing the publisher can not be verified (maybe a valid certification key would even remove this dialog, I did not tried).&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;BTW, it's better to use the context menu "Publish..." in project explorer. I've read/experienced unstable publish when using the "publish wizard"/"publish now" button in the publish tab of project properties page.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I have a build server using &lt;a href="http://www.jetbrains.com/teamcity/"&gt;Teamcity&lt;/a&gt; and each time there is a change in my source code, it will grab it and build the software, and notify some colleagues to deploy it. The tool has great web gui and is free if you limit your project to 20 and users to 20. With some money, you can get more "enterprise" features like active directory integration, etc.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I have been using the build server to build "normal" projects (with out "publish") for quite a while and it all worked fine, until I added publish as one of the targets. The actual build still runs well, but there was a wired error occurred when the publish target is running:&lt;/div&gt;&lt;div&gt;   warning MSB3155: Item 'Microsoft.Net.Framework.2.0' could not be located in&lt;/div&gt;&lt;div&gt;I searched through the net and found some &lt;a href="http://www.uphillriver.com/MSBuildOn64bitVista.aspx"&gt;solutions&lt;/a&gt;. But it does not fit all my situation. I could not find the folder specified in the article and copy the whole folder is a little overkill. In my case (VS2005+.NET 2.0), the folder is under &lt;/div&gt;&lt;div&gt; &lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;   %ProgramFiles%\Microsoft Visual Studio 8\SDK\v2.0&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;So the register key &lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: rgb(34, 34, 34); -webkit-border-horizontal-spacing: 3px; -webkit-border-vertical-spacing: 3px; "&gt;&lt;span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="white-space: pre;"&gt;    &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"   style="  color: rgb(34, 34, 34); -webkit-border-horizontal-spacing: 3px; -webkit-border-vertical-spacing: 3px; font-family:'courier new';font-size:small;"&gt;sdkInstallRootv2.0 under &lt;/span&gt;&lt;span class="Apple-style-span"   style="  color: rgb(34, 34, 34); -webkit-border-horizontal-spacing: 3px; -webkit-border-vertical-spacing: 3px; font-family:'courier new';font-size:small;"&gt;HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework&lt;/span&gt;&lt;/div&gt;&lt;div&gt;should point to this folder and I did not copy everything, only the "BootStrapper\Engine" folder, and the "signtool.exe" under the "bin" folder (keep the bin folder). Since the signtool.exe needs capicom.dll, I copied it from %ProgramFiles%\Microsoft CAPICOM 2.1.0.2\Lib\X86. Then build again and bingo, it worked!&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1545943002454936764-8521948764292217806?l=java2cs2.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java2cs2.blogspot.com/feeds/8521948764292217806/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java2cs2.blogspot.com/2010/05/using-teamcity-to-buildpublish-net.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1545943002454936764/posts/default/8521948764292217806'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1545943002454936764/posts/default/8521948764292217806'/><link rel='alternate' type='text/html' href='http://java2cs2.blogspot.com/2010/05/using-teamcity-to-buildpublish-net.html' title='Using Teamcity to build(publish) .net application'/><author><name>tcmaster</name><uri>http://www.blogger.com/profile/12229570806153597807</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1545943002454936764.post-9185244339391041552</id><published>2010-04-29T03:24:00.000-07:00</published><updated>2010-04-29T03:41:24.436-07:00</updated><title type='text'>When there is a language feature, you don't have to use it.</title><content type='html'>In my opinion, C# language pushed a lot of features that can help programmers do bad things. One thing I don't like is the "var" keyword. In some cases, it saves some typing, but a lot of miss-using of it can cause the code hard to read. Can you figure out what the type of below variable is?&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;  var key = retriveKeyToLanguage();&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Another one I don't like is the miss use of #region tag. Normally if you keep a good coding principle and design, your class should not be long enough to make use of this tag. But strangely, some people just like to use the tag to mass the code. I recently read some source code from NInject. In general the codes are well written and easy to read. The problem I had was, it seems the author likes those garbage parts from C# too much, even in small classes, he use it to mass the otherwise beautiful code. Take a look at below code, except the first 2 regions which wrap the license nonsense and using nonsense, the rest are miss using. On my not big screen, the class should be able to be fully displayed on one page (which is extremely good!), with the mess-around-tags-and-comments, it exceeds the screen.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;#region License&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;//&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;// Author: Nate Kohari &lt;nkohari@gmail.com&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;// Copyright (c) 2007-2008, Enkari, Ltd.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;//&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;// Licensed under the Apache License, Version 2.0 (the "License");&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;// you may not use this file except in compliance with the License.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;// You may obtain a copy of the License at&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;//&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;//   http://www.apache.org/licenses/LICENSE-2.0&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;//&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;// Unless required by applicable law or agreed to in writing, software&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;// distributed under the License is distributed on an "AS IS" BASIS,&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;// See the License for the specific language governing permissions and&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;// limitations under the License.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;//&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;#endregion&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;#region Using Directives&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;using System;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;using Ninject.Core.Infrastructure;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;#endregion&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;namespace Ninject.Conditions.Builders&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;/// &lt;summary&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;/// A condition that takes the input of a chain of converter delegates and passes the result to&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;/// a predicate delegate, determining the result of the condition. This class supports Ninject's&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;/// EDSL and should generally not be used directly.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;/// &lt;/summary&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;/// &lt;typeparam name="TRoot"&gt;The root type of the conversion chain.&lt;/typeparam&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;/// &lt;typeparam name="TSubject"&gt;The subject type that this condition will examine.&lt;/typeparam&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;public class TerminatingCondition&lt;troot,&gt; : ConditionBase&lt;troot&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;/*----------------------------------------------------------------------------------------*/&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;#region Fields&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;private readonly IConditionBuilder&lt;troot,&gt; _previous;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;private readonly Predicate&lt;troot&gt; _directPredicate;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;private readonly Predicate&lt;tsubject&gt; _predicate;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;#endregion&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;/*----------------------------------------------------------------------------------------*/&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;#region Constructors&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;/// &lt;summary&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;/// Creates a new TerminatingCondition.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;/// &lt;/summary&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;/// &lt;param name="predicate"&gt;A predicate delegate that directly examines the root of the condition chain to determine the result.&lt;/param&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;public TerminatingCondition(Predicate&lt;troot&gt; predicate)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;   &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;Ensure.ArgumentNotNull(predicate, "predicate");&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;   &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;_directPredicate = predicate;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;/*----------------------------------------------------------------------------------------*/&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;/// &lt;summary&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;/// Creates a new TerminatingCondition.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;/// &lt;/summary&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;/// &lt;param name="last"&gt;The last condition builder in the condition chain.&lt;/param&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;/// &lt;param name="predicate"&gt;A predicate delegate that determines the result of the condition.&lt;/param&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;public TerminatingCondition(IConditionBuilder&lt;troot,&gt; last, Predicate&lt;tsubject&gt; predicate)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;   &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;Ensure.ArgumentNotNull(last, "last");&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;   &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;Ensure.ArgumentNotNull(predicate, "predicate");&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;   &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;_previous = last;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;   &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;_predicate = predicate;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;#endregion&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;/*----------------------------------------------------------------------------------------*/&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;#region Public Methods&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;/// &lt;summary&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;/// Determines whether the specified object matches the condition.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;/// &lt;/summary&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;/// &lt;param name="value"&gt;The object to test.&lt;/param&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;/// &lt;returns&gt;&lt;see langword="True"&gt; if the object matches, otherwise &lt;see langword="false"&gt;.&lt;/returns&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;public override bool Matches(TRoot value)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;   &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;if (_previous == null)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;   &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;    &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;return _directPredicate(value);&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;   &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;   &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;else&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;   &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;    &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;TSubject subject = _previous.ResolveSubject(value);&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;    &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;return _predicate(subject);&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;   &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;#endregion&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;/*----------------------------------------------------------------------------------------*/&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1545943002454936764-9185244339391041552?l=java2cs2.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java2cs2.blogspot.com/feeds/9185244339391041552/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java2cs2.blogspot.com/2010/04/when-there-is-language-feature-you-dont.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1545943002454936764/posts/default/9185244339391041552'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1545943002454936764/posts/default/9185244339391041552'/><link rel='alternate' type='text/html' href='http://java2cs2.blogspot.com/2010/04/when-there-is-language-feature-you-dont.html' title='When there is a language feature, you don&apos;t have to use it.'/><author><name>tcmaster</name><uri>http://www.blogger.com/profile/12229570806153597807</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1545943002454936764.post-2415720437216050751</id><published>2010-04-28T01:54:00.000-07:00</published><updated>2010-04-28T03:16:39.530-07:00</updated><title type='text'>Passing external configuration data to NInject instantiated objects.</title><content type='html'>&lt;div&gt;I used to be a spring.net user and was quite happy about it. To me, the xml is the best advantage and the worst pain. It's good because it's straight forward, easy to embed external data in; it's bad because it make refactoring a pain, and verbose. With &lt;a href="http://www.jetbrains.com/resharper/index.html"&gt;Reshaper&lt;/a&gt;'s help, the pain is a little less. But still it's less pleasant. Therefore I have been searching for replacements, and &lt;a href="http://ninject.org/"&gt;NInject &lt;/a&gt;(referred as NI) is one of the candidates. The biggest problem to NI is the document. It has a lot of unit test cases, but very limited documents, samples. You can only find a very &lt;a href="http://wiki.github.com/enkari/ninject/dependency-injection-with-ninject"&gt;un-realistic sample&lt;/a&gt; from the &lt;a href="http://wiki.github.com/enkari/ninject/"&gt;wiki pages&lt;/a&gt; on the website. It reveals the tip of the iceberg, but too simple to be too much usage.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Before I make a migration, I need to make sure all my usage scenarios are covered by NI. I used spring.net's mostly as a IOC container, therefore I assume  NI should be able to provide most of the functions. In my case, some of my components needs some configuration data to startup, and if the configuration is wrong or invalid, the whole application should fail to start and administrators will know immediately (it's a server side app).&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;In real world applications, external configuration in xml, ini, yaml, json format is very common and will affect application behaviors. But I did not find any example, tutorial about that. I asked a question in stackoverflow, but no response yet. So I decide to help myself :).&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;span&gt;&lt;span&gt;&lt;br /&gt;The code in question is like below:&lt;/span&gt;&lt;/span&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;public interface IServer&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;  void start();&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;  void stop();&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;public class ServerImp&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;   IDictionary&lt;string,&gt; _config;&lt;/string,&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;   public ServerImp(IDictionary&lt;string,&gt; theConfig)&lt;/string,&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;   {&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;      _config = theConfig;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;   }&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;   public void start()&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;   {&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;      // ... logics&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;   }&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;   public void stop()&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;   {&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;      // ... logics&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;   }&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The problem is, the dictionary passed to the constructor is data from an xml config file. (Actually I use a dictionary to make it difficult. Most config data in my case are just simple string or numerics.)  In spring.net it's a breath to make it happen. But in NI, it turns out also a easy task:&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;public class ConfigData&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;public IDictionary&lt;string,&gt; dic;&lt;/string,&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;//...&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;public class ServerModule : StandardModule&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;ConfigData _config;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;public ServerModule(ConfigData data)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;_config = data;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;public override void Load()&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;            Bind&lt;span class="Apple-style-span" style="font-size: 16px; "&gt;&amp;lt;&lt;/span&gt;IServer&lt;span class="Apple-style-span" style="font-size: 16px; "&gt;&amp;gt;&lt;/span&gt;().To&lt;span class="Apple-style-span" style="font-size: 16px; "&gt;&amp;lt;&lt;/span&gt;ServerImp&lt;span class="Apple-style-span" style="font-size: 16px; "&gt;&amp;gt;&lt;/span&gt;().WithConstructorArgument("theConfig", dic);&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new'; "&gt;&lt;span class="Apple-style-span"  style=" ;font-size:small;"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style=" ;font-size:small;"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;In startup process, I just need to read the config data by deserialize the xml and pass the data to the moduel.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;// in main&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;ConfigData cfg = loadConfigData(); // deserialize xml.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;&lt;span class="Apple-style-span" style="white-space: pre;"&gt;using (IKernel kernel = new StandardKernel(new YodaModule(cfg)))&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="white-space: pre;"&gt;        {&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="white-space: pre;"&gt;             IServer transport = kernel.Get&lt;iserver&gt;();&lt;/iserver&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="white-space: pre;"&gt;&lt;iserver&gt;             transport.start();&lt;/iserver&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="white-space: pre;"&gt;&lt;iserver&gt;             transport.stop();&lt;/iserver&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="white-space: pre;"&gt;&lt;iserver&gt;        }&lt;/iserver&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style=" ;font-size:small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style=" ;font-size:small;"&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;And it works!&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1545943002454936764-2415720437216050751?l=java2cs2.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java2cs2.blogspot.com/feeds/2415720437216050751/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java2cs2.blogspot.com/2010/04/passing-external-configuration-data-to.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1545943002454936764/posts/default/2415720437216050751'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1545943002454936764/posts/default/2415720437216050751'/><link rel='alternate' type='text/html' href='http://java2cs2.blogspot.com/2010/04/passing-external-configuration-data-to.html' title='Passing external configuration data to NInject instantiated objects.'/><author><name>tcmaster</name><uri>http://www.blogger.com/profile/12229570806153597807</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1545943002454936764.post-5511824837810412716</id><published>2010-04-23T14:09:00.000-07:00</published><updated>2010-04-27T05:17:58.653-07:00</updated><title type='text'>The story that users are not ready for agile yet!</title><content type='html'>In most of the agile methods, on the spot customer is a very important roll. And the user stories are decided by him. He provides real time business consultant to the team. But is he really always correct on making business decisions? &lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I haven't  seen any discussion about this. All the materials I've read share the same sentences, the customer will decide which story will go into scope and in which sequence to be implemented, and so on and so on. But still, in a *lot* of companies, agile is just a normal word with no special meaning. IT are usually on the opposite side to the customers. The customers will try their best to push everything in, with the fear that they won't get anything if missed the chance. And normally in big companies, those who provide feature descriptions and use them, are not the same ones who provide money. So mostly it is a user, but not customer who is working with the team. He don't care about cost, he only needs features. Since he's not IT guy, he does not understand software has quality and needs to be maintained; he doesn't understand the more features in the more complicated the software is, the more bug will be. With the fear of getting nothing afterwards, he'd even imagine some feature to be implemented. Anyway, it's already paid, isn't it?&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;In one of my recent projects, I met such a case. The user needs a very special search feature. It's easy to implement. But there is a potential problem: by miss using it, it can bring a lot of load to database and application server. For this kind of search, DB must do full table scanning. We pointed out this and asked the user under which scenario this feature will be used, so we can figure out some strategy. And it turned out it's an imaginary feature. He *thought* it might be used in some future scenario.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;So the team needs to remember that the on the spot user should sometimes be questions, especially when the team is in a transition period from traditional way to agile methods. The users are not used to the transform yet!&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1545943002454936764-5511824837810412716?l=java2cs2.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java2cs2.blogspot.com/feeds/5511824837810412716/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java2cs2.blogspot.com/2010/04/store-that-users-are-not-ready-for.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1545943002454936764/posts/default/5511824837810412716'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1545943002454936764/posts/default/5511824837810412716'/><link rel='alternate' type='text/html' href='http://java2cs2.blogspot.com/2010/04/store-that-users-are-not-ready-for.html' title='The story that users are not ready for agile yet!'/><author><name>tcmaster</name><uri>http://www.blogger.com/profile/12229570806153597807</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1545943002454936764.post-8856445878473094905</id><published>2010-04-12T03:25:00.000-07:00</published><updated>2010-04-12T03:30:32.433-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Rake'/><title type='text'>Rake default tasks when namespace presents</title><content type='html'>Rake, the Ruby version of make, is really elegant and powerful. Given the power and terseness of Ruby, it's really easy to build building scrips.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Normally when you type rake at command line, give you have everything installed correctly and a rake file under the same folder, the :default task is executed. But when you have namespaces to help organize the tasks, specifying the default task needs a little trick.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;This is what you normally do&lt;/div&gt;&lt;div&gt;   task :default =&gt; :build&lt;/div&gt;&lt;div&gt;   task :build do ..... end&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;With namespaces, you have to use string, instead of symbol to specify the task name:&lt;/div&gt;&lt;div&gt;   task :default =&gt; "build:build"&lt;/div&gt;&lt;div&gt;   namespace :build do&lt;/div&gt;&lt;div&gt;       task :build do ..... end&lt;/div&gt;&lt;div&gt;   end&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1545943002454936764-8856445878473094905?l=java2cs2.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java2cs2.blogspot.com/feeds/8856445878473094905/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java2cs2.blogspot.com/2010/04/rake-default-tasks-when-namespace.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1545943002454936764/posts/default/8856445878473094905'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1545943002454936764/posts/default/8856445878473094905'/><link rel='alternate' type='text/html' href='http://java2cs2.blogspot.com/2010/04/rake-default-tasks-when-namespace.html' title='Rake default tasks when namespace presents'/><author><name>tcmaster</name><uri>http://www.blogger.com/profile/12229570806153597807</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1545943002454936764.post-2357109938162784164</id><published>2010-04-11T08:23:00.000-07:00</published><updated>2010-04-12T03:31:23.699-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.Net'/><title type='text'>.Net 2 remoting with security support, simplified</title><content type='html'>I tried a complicated way to initialize the channels to make the caller's identity pass through wire from client to the server. If you need to really impersonate the client or even delegate functions on behalf of the client user, then you have go through that tedious way. I don't like it. The parameters are in plain string and you have to make sure no typo is made. (What's wrong with a strong typed parameter objects?)&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Anyway, what all I need to is to know which user is calling some function. I don't need to impersonate or delegation. So there is a simpler way:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;On server, just use &lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:x-small;"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;            IChannel tsc = new TcpServerChannel(8888);&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:x-small;"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;            ChannelServices.RegisterChannel(tsc, &lt;b&gt;&lt;span class="Apple-style-span"  style="color:#FF6600;"&gt;true&lt;/span&gt;&lt;/b&gt;);&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;Note you have to specify &lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;ture &lt;/span&gt;&lt;/span&gt;when you register the channel. Then you are ready to publish objects, either by &lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;RemotingConfiguration.RegisterWellKnownServiceType&lt;/span&gt;&lt;/span&gt;, or by&lt;span class="Apple-style-span"  style="font-size:small;"&gt; &lt;/span&gt;&lt;span class="Apple-style-span"  style=" color: rgb(51, 51, 51); line-height: 19px; font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;RemotingServices.Marshal&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"   style="  color: rgb(51, 51, 51); line-height: 19px; font-family:'courier new';font-size:x-small;"&gt;.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"   style="  color: rgb(51, 51, 51); line-height: 19px; font-family:'courier new';font-size:x-small;"&gt;&lt;span class="Apple-style-span"   style="color: rgb(0, 0, 0);  line-height: normal;  font-family:Georgia, serif;font-size:16px;"&gt;At client side, you MUST register a &lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 0); line-height: normal; "&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;TcpClientChannel&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"   style="color: rgb(0, 0, 0);  line-height: normal;  font-family:Georgia, serif;font-size:16px;"&gt; also with &lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 0); line-height: normal; "&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;true &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"   style="color: rgb(0, 0, 0);  line-height: normal;  font-family:Georgia, serif;font-size:16px;"&gt;to the 2nd parameter before activating the server objects. If you forget this, or put false, the client will not be connected correctly.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"   style="  color: rgb(51, 51, 51); line-height: 19px; font-family:'courier new';font-size:x-small;"&gt;&lt;span class="Apple-style-span"   style="color: rgb(0, 0, 0);  line-height: normal;  font-family:Georgia, serif;font-size:16px;"&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:x-small;"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;            TcpClientChannel tcp = new TcpClientChannel();&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:x-small;"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;            ChannelServices.RegisterChannel(tcp, true);&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:x-small;"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;            _Server = (IService)Activator.GetObject(typeof(IService), "tcp://localhost:8888/ASvc");&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:x-small;"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"   style="  ;font-family:Georgia, serif;font-size:16px;"&gt;&lt;div&gt;&lt;span class="Apple-style-span"   style="  color: rgb(51, 51, 51); line-height: 19px; font-family:'courier new';font-size:x-small;"&gt;&lt;span class="Apple-style-span"   style="color: rgb(0, 0, 0);  line-height: normal;  font-family:Georgia, serif;font-size:16px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"   style="  color: rgb(51, 51, 51); line-height: 19px; font-family:'courier new';font-size:x-small;"&gt;&lt;span class="Apple-style-span"   style="color: rgb(0, 0, 0);  line-height: normal;  font-family:Georgia, serif;font-size:16px;"&gt;That's it, no ugly hashtable for parameter passing and still you can pass the caller's identity to server.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"   style="  color: rgb(51, 51, 51); line-height: 19px; font-family:'courier new';font-size:x-small;"&gt;&lt;span class="Apple-style-span"   style="color: rgb(0, 0, 0);  line-height: normal;  font-family:Georgia, serif;font-size:16px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"   style="  color: rgb(51, 51, 51); line-height: 19px; font-family:'courier new';font-size:x-small;"&gt;&lt;span class="Apple-style-span"   style="color: rgb(0, 0, 0);  line-height: normal;  font-family:Georgia, serif;font-size:16px;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1545943002454936764-2357109938162784164?l=java2cs2.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java2cs2.blogspot.com/feeds/2357109938162784164/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java2cs2.blogspot.com/2010/04/net-2-remoting-with-security-support_11.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1545943002454936764/posts/default/2357109938162784164'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1545943002454936764/posts/default/2357109938162784164'/><link rel='alternate' type='text/html' href='http://java2cs2.blogspot.com/2010/04/net-2-remoting-with-security-support_11.html' title='.Net 2 remoting with security support, simplified'/><author><name>tcmaster</name><uri>http://www.blogger.com/profile/12229570806153597807</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1545943002454936764.post-1230391548826513401</id><published>2010-04-10T14:59:00.000-07:00</published><updated>2010-04-12T03:31:45.484-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.Net'/><title type='text'>.Net 2 remoting with security support.</title><content type='html'>Yes I know there is clear statement in MSDN saying this is outdated technology and I should use WCF. But if you are like me who is stuck with .NET 2 on Windows 2000, you still  have to use this.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Normally I use spring.net to inject all my objects and control config through external config files, so I don't use the *.config files normal tutorials use. I need to get everything done by code. This is not hard, but needs a little search around.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Below code will create a secure tcp channel at server side:&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="font-size:x-small;"&gt;            IDictionary prop = new Hashtable();&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="font-size:x-small;"&gt;            prop["port"] = 9999;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="font-size:x-small;"&gt;            prop["secure"] = true;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="font-size:x-small;"&gt;            prop["impersonate"] = false; // when "secure" is true, this is by default, thus optional&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="font-size:x-small;"&gt;            TcpServerChannel tcp = new TcpServerChannel(prop, null, new AuthorizationImp()); // auth module can also be specified in property hashtable.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="font-size:x-small;"&gt;            &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="font-size:x-small;"&gt;            ChannelServices.RegisterChannel(tcp, true);&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="font-size:x-small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="font-size:x-small;"&gt;            IService svc = new ServiceImp(); // this makes the server  a singleton.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="font-size:x-small;"&gt;            ObjRef or = RemotingServices.Marshal(svc, "&lt;b&gt;Service&lt;/b&gt;");&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Now the server is ready for servicing clients, under the name "tcp://localhost:9999/Service". We can build a client to connect to it:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="font-size:x-small;"&gt;            IDictionary prop = new Hashtable();&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="font-size:x-small;"&gt;            prop["port"] = 9999;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="font-size:x-small;"&gt;            prop["secure"] = true;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="font-size:x-small;"&gt;            prop["tokenImpersonationLevel"] = TokenImpersonationLevel.Identification; // when "scure" is true, this is by default and also optional&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="font-size:x-small;"&gt;            IChannel tcp = new TcpClientChannel(prop, null);&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="font-size:x-small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="font-size:x-small;"&gt;            ChannelServices.RegisterChannel(tcp, true);&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="font-size:x-small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="font-size:x-small;"&gt;            IService svc = (IService) Activator.GetObject(typeof (IService), "tcp://localhost:9999/Service");&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="font-size:x-small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="font-size:x-small;"&gt;            IDictionary csp = ChannelServices.GetChannelSinkProperties(svc);&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="font-size:x-small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="font-size:x-small;"&gt;            svc.Repeat("From client", 5); // call with default login&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="font-size:x-small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="font-size:x-small;"&gt;            csp["username"] = "rrr";&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;// now use another user to call&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="font-size:x-small;"&gt;            csp["password"] = "rrr";&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="font-size:x-small;"&gt;            svc.Repeat("From client", 5);&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="font-size:x-small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="font-size:x-small;"&gt;            csp["username"] = "mmm";   // another&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="font-size:x-small;"&gt;            csp["password"] = "mmm";&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="font-size:x-small;"&gt;            svc.Repeat("From client", 5);&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;From the code you might have figured out that &lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;IService&lt;/span&gt;&lt;/span&gt; is a interface used by both server and client to decouple a concrete dependency to any implementation. It has only 1 method called Repeat.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;So how does server know who is calling for service? Even without impersonation, the server code can still retrieve the caller's identity by &lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;Thread.CurrentPrincipal.Identity.&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'times new roman';"&gt;But the &lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;WindowsIdentity.GetCurrent()&lt;/span&gt; will still return the current user the process is running on. MSDN made a mistake at this point.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1545943002454936764-1230391548826513401?l=java2cs2.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java2cs2.blogspot.com/feeds/1230391548826513401/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java2cs2.blogspot.com/2010/04/net-2-remoting-with-security-support.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1545943002454936764/posts/default/1230391548826513401'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1545943002454936764/posts/default/1230391548826513401'/><link rel='alternate' type='text/html' href='http://java2cs2.blogspot.com/2010/04/net-2-remoting-with-security-support.html' title='.Net 2 remoting with security support.'/><author><name>tcmaster</name><uri>http://www.blogger.com/profile/12229570806153597807</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1545943002454936764.post-972876274773467726</id><published>2010-03-22T03:51:00.000-07:00</published><updated>2010-03-22T03:59:18.421-07:00</updated><title type='text'>Which version of oracle client I'm running on?</title><content type='html'>Today I need to tell my DBA on which oracle client my software is running, on my PC. I knew by connecting into a server using sql*plus, the first several lines will give you information about which versions the client and server are. But this seems a little bit silly, you need to connect to a remote server to tell your local information. So I googled around and it turns out that the oracle tool TNSPING spools out it's version when it is started, even you don't provide anything as parameter.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;C:\&gt;tnsping&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;TNS Ping Utility for 32-bit Windows: Version 11.1.0.6.0 - Production on 22-MAR-2&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;010 11:56:24&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;Copyright (c) 1997, 2007, Oracle.  All rights reserved.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;TNS-03502: Insufficient arguments.  Usage:  tnsping xxxxx&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'times new roman';"&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;Why sql*plus, the most used tool don't provide this info? Afraid of confusing the users?&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1545943002454936764-972876274773467726?l=java2cs2.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java2cs2.blogspot.com/feeds/972876274773467726/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java2cs2.blogspot.com/2010/03/which-version-of-oracle-client-im.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1545943002454936764/posts/default/972876274773467726'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1545943002454936764/posts/default/972876274773467726'/><link rel='alternate' type='text/html' href='http://java2cs2.blogspot.com/2010/03/which-version-of-oracle-client-im.html' title='Which version of oracle client I&apos;m running on?'/><author><name>tcmaster</name><uri>http://www.blogger.com/profile/12229570806153597807</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1545943002454936764.post-4908654448572612292</id><published>2010-03-18T08:05:00.000-07:00</published><updated>2010-09-13T01:22:20.709-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Git'/><title type='text'>Setup a Git server on Windows machine, with MSysGit and CopSSH.</title><content type='html'>&lt;span class="Apple-style-span" style="font-family:'Helvetica Neue', Arial, Helvetica, sans-serif;"&gt;I switched to Git from SVN recently, not for fun or fashion but for performance. I was involved in a big project with thousands of files and dozens of sub-projects. The result was, each operation takes longer time than I could bear. I'm not a patient person, so I tried to find better solutions and there Git is :)&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family:'Helvetica Neue', Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family:'Helvetica Neue', Arial, Helvetica, sans-serif;"&gt;I work for a big company and therefore a centralized-repository working pattern is best suited to my team. I have to prepare a central server before we can really switch to Git. But it seems Git was born in Linux and is not so friendly to Windows, which is the mandatory platform I have to use. The gift-MSysGit ripped git-daemon, therefore the simplest, though not the best, option is gone. I googled around, with a &lt;a href="http://www.markembling.info/view/git-server-gitosis-and-cygwin-on-windows"&gt;cygwin solution&lt;/a&gt; and a &lt;a href="http://www.timdavis.com.au/git/setting-up-a-msysgit-server-with-copssh-on-windows/"&gt;MSysGit one&lt;/a&gt;. I have a small team, so I don't need Gitosis yet, and MSysGit impressed me a lot, so tried the 2nd way.&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family:'Helvetica Neue', Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family:'Helvetica Neue', Arial, Helvetica, sans-serif;"&gt;&lt;a href="http://www.timdavis.com.au/git/setting-up-a-msysgit-server-with-copssh-on-windows/"&gt;Tim Davis did a great job making the solution work&lt;/a&gt;, but the description  is somehow confusing to me, as I'm both new to Git and SSH. So I present my steps here, hope it helps people with just M$ Windows background.&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family:'Helvetica Neue', Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family:'Helvetica Neue', Arial, Helvetica, sans-serif;"&gt;You'll need 2 WinXP boxes (or virtual boxes) doing the setup, 1 as server and 1 as client. I used CopSSH 5.4p1 (file name Copssh_3.1.0_Installer.exe), and MSysGit  1.7.0.2 (file name Git-1.7.0.2-preview20100309.exe). Putty 0.60 is used to generate keys and test connections.&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family:'Helvetica Neue', Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family:'Helvetica Neue', Arial, Helvetica, sans-serif;"&gt;&lt;span class="Apple-style-span" style="color:#e69138;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-size:large;"&gt;On Server Box&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style=" color: rgb(230, 145, 56); font-family:'Helvetica Neue', Arial, Helvetica, sans-serif;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="color:black;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;div&gt;&lt;span class="Apple-style-span" style=" color: rgb(230, 145, 56); font-family:'Helvetica Neue', Arial, Helvetica, sans-serif;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="color:black;"&gt;1. install CopSSH&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family:'Helvetica Neue', Arial, Helvetica, sans-serif;"&gt;&lt;span class="Apple-style-span" style="color:#e69138;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="color:black;"&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;Be sure to install it to a folder without space in its name. I used C:\SSH. Then just press next until it finishes.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color:black;"&gt;&lt;b&gt;&lt;b&gt;&lt;/b&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color:black;"&gt;&lt;b&gt;&lt;b&gt;&lt;div style="display: inline !important; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;2. install MSysGit&lt;/div&gt;&lt;/b&gt;&lt;/b&gt;&lt;/span&gt; &lt;span class="Apple-style-span" style="color:black;"&gt;&lt;b&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color:black;"&gt;&lt;b&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span class="Apple-style-span" style="color:black;"&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;Be sure to install it to a folder without space in its name. I used C:\Git. The default values suits me well.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span class="Apple-style-span" style="color:black;"&gt;3. Config CopSSH&lt;/span&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span class="Apple-style-span" style="color:black;"&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;a. I would like to user a separate user for git access. So create a user from command line&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span class="Apple-style-span" style=" font-weight: normal;color:#e69138;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="color:black;"&gt;&lt;b&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="color:black;"&gt;&lt;b&gt;&lt;div style="display: inline !important; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;div style="display: inline !important;"&gt;&lt;span class="Apple-style-span" style="color:black;"&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;span class="Apple-style-span" style="font-family:'Courier New', Courier, monospace;"&gt;    net user git userspassword /add&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span class="Apple-style-span" style="color:black;"&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;span class="Apple-style-span" style="font-family:'Courier New', Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span class="Apple-style-span" style="color:black;"&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;b. Then, goto "Start | Programs | Copssh | 01. Activate a user" to activate the user.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_LaYimtxFULQ/S6IQuPvgynI/AAAAAAAAAAM/M2RbWPpoXgI/s1600-h/ssh_act_usr.GIF" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/_LaYimtxFULQ/S6IQuPvgynI/AAAAAAAAAAM/M2RbWPpoXgI/s320/ssh_act_usr.GIF" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span class="Apple-style-span" style="color:black;"&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color:black;"&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;Note, you should clear the 2nd checkbox, we'll generate keys later.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color:black;"&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color:black;"&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;c. goto C:\SSH\etc folder, open the sshd_config file using wordpad (or &lt;a href="http://www.flos-freeware.ch/notepad2.html"&gt;notepad2&lt;/a&gt;), don't use notepad, it's a UNIX format file. Remove the leading # character for item  "PasswordAuthentication" and change the "yes" to "no". Also you can review the rest of the config file and change if necessary. For me, most of the default settings works fine.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style=" font-weight: normal;color:#e69138;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="color:black;"&gt;&lt;b&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style=" font-weight: normal;color:#e69138;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="color:black;"&gt;&lt;b&gt;&lt;div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span class="Apple-style-span" style="color:black;"&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;d. Goto C:\SSH\home\git\.ssh folder, create a file named authorized_keys. Open this file using wordpad.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span class="Apple-style-span" style="color:black;"&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color:black;"&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;e. Install/extract Putty if you have not. Invoke PUTTYGEN.EXE to generate a pair of keys:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_LaYimtxFULQ/S6IruHLtnKI/AAAAAAAAAAc/8jtefLzLxCQ/s1600-h/puttygen.GIF" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/_LaYimtxFULQ/S6IruHLtnKI/AAAAAAAAAAc/8jtefLzLxCQ/s320/puttygen.GIF" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="color:black;"&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;I used a 4096 bit SSH2 key. Save the private key to a folder and remember it. We'll use it later. Copy the content in the text box labelled with "Public key for pasting...." to the wordpad window you opened at step d, and save it, close the wordpad.&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color:black;"&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color:black;"&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;f. (Re)Start SSH Server. You can either reboot your PC, or use below command line:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;span class="Apple-style-span" style="font-family:'Courier New', Courier, monospace;"&gt;   net stop opensshserver&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;span class="Apple-style-span" style="font-family:'Courier New', Courier, monospace;"&gt;   net start opensshserver&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color:black;"&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;g. Now it's ready to test SSH connection. Invoke Putty.EXE, put localhost as host name, if you changed port in step c, don't forget to change it here. Navigate to Connection/SSH/Auth node, press the "Browse" button to select the private file you generated and stored in step e, as shown below:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_LaYimtxFULQ/S6IuoSvWccI/AAAAAAAAAAk/OD2BvPx_STQ/s1600-h/puttygen.GIF" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/_LaYimtxFULQ/S6IuoSvWccI/AAAAAAAAAAk/OD2BvPx_STQ/s320/puttygen.GIF" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;You can save the settings to save you some typing next time. Google it if you don't know how. Now press "Open" button, you will see a warning window on first connection, press "Yes" to accept the key. Then a block terminal window pops up, with prompt "login as:", input "git" (without quote), and you should be prompted for a key-phrase if you set it when you saved the private key. &lt;i&gt;Note, this is not the password of the git user you created during step a!!!&lt;/i&gt;. And with some luck (which you don't need if you know what you are doing), you should see some window similar to this:&lt;/span&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_LaYimtxFULQ/S6Iwpwp8pnI/AAAAAAAAAAs/ZVaI-2j3FT4/s1600-h/puttygen.GIF" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/_LaYimtxFULQ/S6Iwpwp8pnI/AAAAAAAAAAs/ZVaI-2j3FT4/s320/puttygen.GIF" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;If you've made it, congratulations, the hardest part is behind you. If you don't see it, then please review carefully what you have missed.&lt;/span&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;h. invoke a command window if you have not (where have you executed those "net xxx" commands?), and type&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;span class="Apple-style-span" style="font-family:'Courier New', Courier, monospace;"&gt;  &lt;span class="Apple-style-span" style="font-size:small;"&gt;cd /d %USERPROFILE%&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;span class="Apple-style-span" style="font-family:'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size:small;"&gt;  echo export HOME=/c/SSH/home/git &amp;gt; .bashrc &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color:#e69138;"&gt;&lt;span class="Apple-style-span" style="color:black;"&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color:#e69138;"&gt;&lt;span class="Apple-style-span" style="color:black;"&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;i. goto C:\SSH\home\git folder, open the .bashrc file (yes, the same name as in the above line). Insert below line to the first line: (AGAIN, THIS IS A UNIX FILE!)  &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family:'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;span class="Apple-style-span" style="font-size:small;"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;span class="Apple-style-span" style="font-size:small;"&gt;export PATH=/cygdrive/c/Git/bin:/cygdrive/c/Git/libexec/git-core:$PATH&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style=" font-weight: normal;color:#e69138;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="color:black;"&gt;&lt;b&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: medium;"&gt;NOTE, above "export PATH=..." must be in the same line! &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="color:black;"&gt;&lt;b&gt;&lt;div style="display: inline !important;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="color:black;"&gt;&lt;b&gt;&lt;div style="display: inline !important;"&gt;&lt;div style="display: inline !important;"&gt;&lt;div style="display: inline !important;"&gt;4. setup a Git repository.&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;goto C:\SSH\home\git and make a folder named test.git. Right click the folder and select "Git Bash" from context menu. (What? You did not choose the explorer integration? Goto start menu, find Git|Git Bash, and use command line to goto this folder). Then input below lines:&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;span class="Apple-style-span" style="font-family:'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size:small;"&gt;  $ git init --bare&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;span class="Apple-style-span" style="font-family:'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size:small;"&gt;  Initialized empty Git repository in C:/SSH/home/git/test.git/&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color:#e69138;"&gt;&lt;span class="Apple-style-span" style="color:black;"&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;Now the server setup is DONE.  You might need a cup of coffee of a cake to ease your nerve.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color:#e69138;"&gt;&lt;span class="Apple-style-span" style="color:black;"&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color:#e69138;"&gt;&lt;span class="Apple-style-span" style="color:black;"&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;Special notes no 2003 server. It seems the sshd will experience error if the user account used to login is not a member of administrator (thanks for the comment from Raphael). So if you experience problem, try to add the user's account to administrator group and try again.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/b&gt;&lt;/span&gt;&lt;b&gt;&lt;b&gt;&lt;div&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family:'Helvetica Neue', Arial, Helvetica, sans-serif;"&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;b&gt;&lt;b&gt;&lt;div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span class="Apple-style-span" style="font-family:'Helvetica Neue', Arial, Helvetica, sans-serif;"&gt;&lt;span class="Apple-style-span" style="font-size:large;"&gt;On Client PC&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/b&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/b&gt;&lt;/b&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-family:'Helvetica Neue', Arial, Helvetica, sans-serif;"&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family:'Helvetica Neue', Arial, Helvetica, sans-serif;"&gt;&lt;div style="display: inline !important; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span class="Apple-style-span" style="color:black;"&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;1. Install MSysGit, as on server. You can choose any folder you like (better a folder without space in it's path).&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color:black;"&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color:black;"&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;2. Test connection, using Putty. Change the host name and port as in your environment. Don't forget the Connection | SSH | Auth node setting. Copy the private key file to client machine and point the file in this node. Then press "Open" button, you should find it similar to what you have experienced at step g above. But this time, after you logged in, you are actually logged in to another computer! After you logged in, type "git", and see if you have the familiar git help screen before you. If you see&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color:black;"&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color:black;"&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;     -bash: git: command not found&lt;br /&gt;then please check if you have step i done correctly.&lt;br /&gt;&lt;br /&gt;3. Opne a command window, type&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color:black;"&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="color:black;"&gt;&lt;b&gt;&lt;div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;span class="Apple-style-span" style="font-family:'Courier New', Courier, monospace;"&gt;  &lt;span class="Apple-style-span" style="font-size:small;"&gt;cd /d %USERPROFILE%&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;span class="Apple-style-span" style="font-family:'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size:small;"&gt;  md .ssh&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;span class="Apple-style-span" style="font-family:'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size:small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt; Then use windows explorer to open this folder. create a files (id_rsa.pub) if they don't exist.&lt;br /&gt;&lt;br /&gt;4. Fire up PuttyGen.EXE again, load the private key you used at step 2. Paste the content of the text box to file id_ras.pub, and use menu "Conversions | Export OpenSSH key" to save to the folder you created at step 3, in name "id_rsa". Now the folder %USERPROFILE"\.ssh should have at least 2 files: id_rsa and id_rsa.pub&lt;b&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-family:'Helvetica Neue', Arial, Helvetica, sans-serif;"&gt;&lt;div style="display: inline !important;"&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family:'Helvetica Neue', Arial, Helvetica, sans-serif;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family:'Helvetica Neue', Arial, Helvetica, sans-serif;"&gt;&lt;div style="display: inline !important; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;div style="display: inline !important;"&gt;&lt;span class="Apple-style-span" style="color:black;"&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;5. create a empty folder and invoke the Git Bash and navigate to that folder. Type&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color:black;"&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;b&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-family:'Helvetica Neue', Arial, Helvetica, sans-serif;"&gt;&lt;div style="display: inline !important;"&gt;&lt;span class="Apple-style-span" style="font-family:'Helvetica Neue', Arial, Helvetica, sans-serif;"&gt;&lt;div style="display: inline !important; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span class="Apple-style-span" style="color:black;"&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;b&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-family:'Helvetica Neue', Arial, Helvetica, sans-serif;"&gt;&lt;div style="display: inline !important;"&gt;&lt;span class="Apple-style-span" style="font-family:'Helvetica Neue', Arial, Helvetica, sans-serif;"&gt;&lt;div style="display: inline !important; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span class="Apple-style-span" style="color:black;"&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;b&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-family:'Helvetica Neue', Arial, Helvetica, sans-serif;"&gt;&lt;div style="display: inline !important;"&gt;&lt;span class="Apple-style-span" style="font-family:'Helvetica Neue', Arial, Helvetica, sans-serif;"&gt;&lt;div style="display: inline !important; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span class="Apple-style-span" style="color:black;"&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;b&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-family:'Helvetica Neue', Arial, Helvetica, sans-serif;"&gt;&lt;div style="display: inline !important;"&gt;&lt;span class="Apple-style-span" style="font-family:'Helvetica Neue', Arial, Helvetica, sans-serif;"&gt;&lt;div style="display: inline !important; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span class="Apple-style-span" style="color:black;"&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="color:black;"&gt;&lt;b&gt;&lt;div style="display: inline !important;"&gt;&lt;div style="display: inline !important; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;div style="display: inline !important;"&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;span class="Apple-style-span" style="font-family:'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size:small;"&gt;  ssh git@your.remote.host "echo something"&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;&lt;/span&gt;&lt;/b&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;&lt;/span&gt;&lt;/b&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;&lt;/span&gt;&lt;/b&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;&lt;/span&gt;&lt;/b&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;&lt;/span&gt;&lt;/b&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color:black;"&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color:black;"&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;input "yes" to accept the remote key. Then you should get an echo "something"&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_LaYimtxFULQ/S6I-yk7U2bI/AAAAAAAAAA0/h_NCc2opkHs/s1600-h/Snap1.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/_LaYimtxFULQ/S6I-yk7U2bI/AAAAAAAAAA0/h_NCc2opkHs/s320/Snap1.gif" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="color:black;"&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color:black;"&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;6. Now we are ready to clone the empty project we created at server&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color:black;"&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;b&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-family:'Helvetica Neue', Arial, Helvetica, sans-serif;"&gt;&lt;div style="display: inline !important;"&gt;&lt;span class="Apple-style-span" style="font-family:'Helvetica Neue', Arial, Helvetica, sans-serif;"&gt;&lt;div style="display: inline !important; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;div style="display: inline !important;"&gt;&lt;span class="Apple-style-span" style="color:black;"&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;span class="Apple-style-span" style="font-family:'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size:small;"&gt;  $ git clone ssh://git@tst/SSH/home/git/test.git&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;&lt;/span&gt;&lt;/b&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color:black;"&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt; &lt;span class="Apple-style-span" style="font-family:'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size:small;"&gt;  Initialized empty Git repository in D:/g/gt/test/.git/&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family:'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size:small;"&gt;  warning: You appear to have cloned an empty repository.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color:black;"&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color:black;"&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;Now you can make some change and push it back&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color:#000000;"&gt;&lt;span class="Apple-style-span" style="color:#E69138;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color:black;"&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;b&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-family:'Helvetica Neue', Arial, Helvetica, sans-serif;"&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family:'Helvetica Neue', Arial, Helvetica, sans-serif;"&gt;&lt;div style="display: inline !important; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span class="Apple-style-span" style="color:black;"&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span class="Apple-style-span" style="font-family:'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size:small;"&gt;  $cd test&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span class="Apple-style-span" style="font-family:'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size:small;"&gt;  $vim readme.txt&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span class="Apple-style-span" style="font-family:'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size:small;"&gt;  $git add readme.txt&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span class="Apple-style-span" style="font-family:'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size:small;"&gt;  $&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size:small;"&gt;git commit -a -m "first commit"&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-family:'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-family:'Helvetica Neue', Arial, Helvetica, sans-serif;"&gt;&lt;div style="display: inline !important;"&gt;&lt;span class="Apple-style-span" style="font-family:'Helvetica Neue', Arial, Helvetica, sans-serif;"&gt;&lt;div style="display: inline !important; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span class="Apple-style-span" style="color:black;"&gt;&lt;span class="Apple-style-span" style="font-family:'Helvetica Neue', Arial, Helvetica, sans-serif;"&gt;&lt;div style="display: inline !important;"&gt;&lt;span class="Apple-style-span" style="font-family:'Helvetica Neue', Arial, Helvetica, sans-serif;"&gt;&lt;div style="display: inline !important; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span class="Apple-style-span" style="color:black;"&gt;&lt;span class="Apple-style-span" style="color:#e69138;"&gt;&lt;span class="Apple-style-span" style="font-family:'Helvetica Neue', Arial, Helvetica, sans-serif;"&gt;&lt;div style="display: inline !important;"&gt;&lt;span class="Apple-style-span" style="font-family:'Helvetica Neue', Arial, Helvetica, sans-serif;"&gt;&lt;div style="display: inline !important; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span class="Apple-style-span" style="color:black;"&gt;&lt;span class="Apple-style-span" style="font-family:'Helvetica Neue', Arial, Helvetica, sans-serif;"&gt;&lt;div style="display: inline !important;"&gt;&lt;span class="Apple-style-span" style="font-family:'Helvetica Neue', Arial, Helvetica, sans-serif;"&gt;&lt;div style="display: inline !important; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span class="Apple-style-span" style="color:black;"&gt;&lt;div style="display: inline !important; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span class="Apple-style-span" style="font-family:'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size:small;"&gt;&lt;b&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-family:'Helvetica Neue', Arial, Helvetica, sans-serif;"&gt;&lt;div style="display: inline !important;"&gt;&lt;span class="Apple-style-span" style="font-family:'Helvetica Neue', Arial, Helvetica, sans-serif;"&gt;&lt;div style="display: inline !important; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span class="Apple-style-span" style="color:black;"&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;b&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-family:'Helvetica Neue', Arial, Helvetica, sans-serif;"&gt;&lt;div style="display: inline !important;"&gt;&lt;span class="Apple-style-span" style="font-family:'Helvetica Neue', Arial, Helvetica, sans-serif;"&gt;&lt;div style="display: inline !important; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span class="Apple-style-span" style="color:black;"&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;div style="display: inline !important;"&gt;&lt;span class="Apple-style-span" style="font-family:'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size:small;"&gt;  [master (root-commit) f216dfe] first commit&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;&lt;/span&gt;&lt;/b&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;&lt;/span&gt;&lt;/b&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family:'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-family:'Helvetica Neue', Arial, Helvetica, sans-serif;"&gt;&lt;div style="display: inline !important;"&gt;&lt;span class="Apple-style-span" style="font-family:'Helvetica Neue', Arial, Helvetica, sans-serif;"&gt;&lt;div style="display: inline !important; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span class="Apple-style-span" style="color:black;"&gt;&lt;span class="Apple-style-span" style="font-family:'Helvetica Neue', Arial, Helvetica, sans-serif;"&gt;&lt;div style="display: inline !important;"&gt;&lt;span class="Apple-style-span" style="font-family:'Helvetica Neue', Arial, Helvetica, sans-serif;"&gt;&lt;div style="display: inline !important; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span class="Apple-style-span" style="color:black;"&gt;&lt;span class="Apple-style-span" style="color:#e69138;"&gt;&lt;span class="Apple-style-span" style="font-family:'Helvetica Neue', Arial, Helvetica, sans-serif;"&gt;&lt;div style="display: inline !important;"&gt;&lt;span class="Apple-style-span" style="font-family:'Helvetica Neue', Arial, Helvetica, sans-serif;"&gt;&lt;div style="display: inline !important; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span class="Apple-style-span" style="color:black;"&gt;&lt;span class="Apple-style-span" style="font-family:'Helvetica Neue', Arial, Helvetica, sans-serif;"&gt;&lt;div style="display: inline !important;"&gt;&lt;span class="Apple-style-span" style="font-family:'Helvetica Neue', Arial, Helvetica, sans-serif;"&gt;&lt;div style="display: inline !important; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span class="Apple-style-span" style="color:black;"&gt;&lt;div style="display: inline !important; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span class="Apple-style-span" style="font-family:'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size:small;"&gt;&lt;b&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-family:'Helvetica Neue', Arial, Helvetica, sans-serif;"&gt;&lt;div style="display: inline !important;"&gt;&lt;span class="Apple-style-span" style="font-family:'Helvetica Neue', Arial, Helvetica, sans-serif;"&gt;&lt;div style="display: inline !important; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span class="Apple-style-span" style="color:black;"&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;b&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-family:'Helvetica Neue', Arial, Helvetica, sans-serif;"&gt;&lt;div style="display: inline !important;"&gt;&lt;span class="Apple-style-span" style="font-family:'Helvetica Neue', Arial, Helvetica, sans-serif;"&gt;&lt;div style="display: inline !important; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color:black;"&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;div style="display: inline !important;"&gt;&lt;span class="Apple-style-span" style="font-family:'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size:small;"&gt;   1 files changed, 1 insertions(+), 0 deletions(-)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;&lt;/span&gt;&lt;/b&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;&lt;/span&gt;&lt;/b&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family:'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-family:'Helvetica Neue', Arial, Helvetica, sans-serif;"&gt;&lt;div style="display: inline !important;"&gt;&lt;span class="Apple-style-span" style="font-family:'Helvetica Neue', Arial, Helvetica, sans-serif;"&gt;&lt;div style="display: inline !important; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;div style="display: inline !important;"&gt;&lt;div style="display: inline !important; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span class="Apple-style-span" style=" ;font-family:'Courier New', Courier, monospace;color:black;"&gt;&lt;span class="Apple-style-span" style="font-family:'Helvetica Neue', Arial, Helvetica, sans-serif;"&gt;&lt;div style="display: inline !important;"&gt;&lt;span class="Apple-style-span" style="font-family:'Helvetica Neue', Arial, Helvetica, sans-serif;"&gt;&lt;div style="display: inline !important; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span class="Apple-style-span" style="color:black;"&gt;&lt;span class="Apple-style-span" style="font-family:'Helvetica Neue', Arial, Helvetica, sans-serif;"&gt;&lt;div style="display: inline !important;"&gt;&lt;span class="Apple-style-span" style="font-family:'Helvetica Neue', Arial, Helvetica, sans-serif;"&gt;&lt;div style="display: inline !important; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span class="Apple-style-span" style="color:black;"&gt;&lt;span class="Apple-style-span" style="font-family:'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-family:'Helvetica Neue', Arial, Helvetica, sans-serif;"&gt;&lt;div style="display: inline !important;"&gt;&lt;span class="Apple-style-span" style="font-family:'Helvetica Neue', Arial, Helvetica, sans-serif;"&gt;&lt;div style="display: inline !important; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;div style="display: inline !important;"&gt;&lt;div style="display: inline !important; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span class="Apple-style-span" style=" ;font-family:'Courier New', Courier, monospace;color:black;"&gt;&lt;span class="Apple-style-span" style="font-family:'Helvetica Neue', Arial, Helvetica, sans-serif;"&gt;&lt;div style="display: inline !important;"&gt;&lt;span class="Apple-style-span" style="font-family:'Helvetica Neue', Arial, Helvetica, sans-serif;"&gt;&lt;div style="display: inline !important; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span class="Apple-style-span" style="color:black;"&gt;&lt;span class="Apple-style-span" style="font-family:'Helvetica Neue', Arial, Helvetica, sans-serif;"&gt;&lt;div style="display: inline !important;"&gt;&lt;span class="Apple-style-span" style="font-family:'Helvetica Neue', Arial, Helvetica, sans-serif;"&gt;&lt;div style="display: inline !important; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span class="Apple-style-span" style="color:black;"&gt;&lt;div style="display: inline !important; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span class="Apple-style-span" style="font-family:'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size:small;"&gt;&lt;b&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-family:'Helvetica Neue', Arial, Helvetica, sans-serif;"&gt;&lt;div style="display: inline !important;"&gt;&lt;span class="Apple-style-span" style="font-family:'Helvetica Neue', Arial, Helvetica, sans-serif;"&gt;&lt;div style="display: inline !important; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span class="Apple-style-span" style="color:black;"&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;b&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-family:'Helvetica Neue', Arial, Helvetica, sans-serif;"&gt;&lt;div style="display: inline !important;"&gt;&lt;span class="Apple-style-span" style="font-family:'Helvetica Neue', Arial, Helvetica, sans-serif;"&gt;&lt;div style="display: inline !important; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span class="Apple-style-span" style="color:black;"&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;span class="Apple-style-span" style="font-family:'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-family:'Helvetica Neue', Arial, Helvetica, sans-serif;"&gt;&lt;div style="display: inline !important;"&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family:'Helvetica Neue', Arial, Helvetica, sans-serif;"&gt;&lt;div style="display: inline !important; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;div style="display: inline !important;"&gt;&lt;div style="display: inline !important; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;div style="display: inline !important;"&gt;&lt;span class="Apple-style-span" style=" ;font-family:'Courier New', Courier, monospace;color:black;"&gt;&lt;span class="Apple-style-span" style="font-size:small;"&gt;  create mode 100644 readme.txt&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;&lt;/span&gt;&lt;/b&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;&lt;/span&gt;&lt;/b&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family:'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size:small;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family:'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="font-size:small;"&gt;&lt;div style="display: inline !important;"&gt;&lt;div style="display: inline !important; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;br /&gt;&lt;span class="Apple-style-span"&gt;&lt;div style="display: inline !important;"&gt;&lt;div style="display: inline !important; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span class="Apple-style-span"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span"&gt;&lt;div style="display: inline !important;"&gt;$ git push origin master&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color:black;"&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt; &lt;span class="Apple-style-span" style="font-family:'Courier New', Courier, monospace;"&gt;  Counting objects: 3, done.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family:'Courier New', Courier, monospace;"&gt;  Writing objects: 100% (3/3), 236 bytes, done.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family:'Courier New', Courier, monospace;"&gt;  Total 3 (delta 0), reused 0 (delta 0)&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family:'Courier New', Courier, monospace;"&gt;  To ssh://git@oti-tst/SSH/home/git/test.git&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family:'Courier New', Courier, monospace;"&gt;   * [new branch]      master -&amp;gt; master&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family:'Helvetica Neue', Arial, Helvetica, sans-serif;"&gt;&lt;div style="display: inline !important; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span class="Apple-style-span" style="color:black;"&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;span class="Apple-style-span" style="font-family:'Courier New', Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;&lt;/span&gt;&lt;/b&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color:black;"&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;Congratulations, you can clone and push back. It's not as hard as it sounds, after all :D&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family:'Helvetica Neue', Arial, Helvetica, sans-serif;"&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;b&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-family:'Helvetica Neue', Arial, Helvetica, sans-serif;"&gt;&lt;/span&gt;&lt;/b&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;Setting up multiple accounts&lt;span class="Apple-style-span" style="font-family:'Helvetica Neue', Arial, Helvetica, sans-serif;"&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;b&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-family:'Helvetica Neue', Arial, Helvetica, sans-serif;"&gt;&lt;div&gt;&lt;/div&gt;&lt;/span&gt;&lt;/b&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-weight: normal; "&gt;&lt;b&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-family:'Helvetica Neue', Arial, Helvetica, sans-serif;"&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family:'Helvetica Neue', Arial, Helvetica, sans-serif;"&gt;&lt;div style="display: inline !important; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; "&gt;&lt;span class="Apple-style-span" style="color:black;"&gt;&lt;span class="Apple-style-span" style="font-weight: normal; "&gt;I just realized that I forgot the part on how to make your repository accessible to multiple users. It's simple once you have gone through above steps: adding another user is just to generate another key-pair, and put the public-key into the authorized-key file. That's all. Then the new user can access your repository. (just follow the client setup, no other server settings needs to be changed).&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family:'Helvetica Neue', Arial, Helvetica, sans-serif;"&gt;&lt;div style="display: inline !important; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; "&gt;&lt;span class="Apple-style-span" style="color:black;"&gt;&lt;span class="Apple-style-span" style="font-weight: normal; "&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family:'Helvetica Neue', Arial, Helvetica, sans-serif;"&gt;&lt;div style="display: inline !important; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; "&gt;&lt;span class="Apple-style-span" style="color:black;"&gt;&lt;span class="Apple-style-span" style="font-weight: normal; "&gt;I know a better way is to use Gitosis, but I'm not able to run it without cygwin yet :(&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family:'Helvetica Neue', Arial, Helvetica, sans-serif;"&gt;&lt;div style="display: inline !important; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; "&gt;&lt;span class="Apple-style-span" style="color:black;"&gt;&lt;span class="Apple-style-span" style="font-weight: normal; "&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;&lt;/span&gt;&lt;/b&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1545943002454936764-4908654448572612292?l=java2cs2.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://java2cs2.blogspot.com/feeds/4908654448572612292/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://java2cs2.blogspot.com/2010/03/setup-git-server-on-windows-machine.html#comment-form' title='28 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1545943002454936764/posts/default/4908654448572612292'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1545943002454936764/posts/default/4908654448572612292'/><link rel='alternate' type='text/html' href='http://java2cs2.blogspot.com/2010/03/setup-git-server-on-windows-machine.html' title='Setup a Git server on Windows machine, with MSysGit and CopSSH.'/><author><name>tcmaster</name><uri>http://www.blogger.com/profile/12229570806153597807</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_LaYimtxFULQ/S6IQuPvgynI/AAAAAAAAAAM/M2RbWPpoXgI/s72-c/ssh_act_usr.GIF' height='72' width='72'/><thr:total>28</thr:total></entry></feed>
