<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:blogChannel="http://backend.userland.com/blogChannelModule" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0">
  <id>http://www.tunatoksoz.com/</id>
  <title>Tuna Toksoz's weblog</title>
  <updated>2009-10-19T15:08:44+00:00</updated>
  <link href="http://www.tunatoksoz.com/" />
  
  <subtitle>Tuna Toksoz's weblog</subtitle>
  <author>
    <name>Tuna Toksoz</name>
  </author>
  <generator uri="http://dotnetblogengine.net/" version="1.0.0.0">BlogEngine.Net Syndication Generator</generator>
  <blogChannel:blogRoll>http://www.tunatoksoz.com/opml.axd</blogChannel:blogRoll>
  <blogChannel:blink>http://www.dotnetblogengine.net/syndication.axd</blogChannel:blink>
  <dc:creator>Tuna Toksoz</dc:creator>
  <dc:description>Tuna Toksoz's weblog</dc:description>
  <dc:language>en-US</dc:language>
  <dc:title>Tuna Toksoz's weblog</dc:title>
  <geo:lat>0.000000</geo:lat>
  <geo:long>0.000000</geo:long>
  <link rel="self" href="http://feeds.feedburner.com/tunatoksoz" type="application/atom+xml" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com" /><entry>
    <id>http://www.tunatoksoz.com/post/What-was-I-up-to-e28093-2-Months-of-no-blogging.aspx</id>
    <title>What was I up to? – 2 Months of no blogging?</title>
    <updated>2009-10-19T15:08:44+00:00</updated>
    <link rel="self" href="http://www.tunatoksoz.com/post.aspx?id=b5d22cbd-03cd-4d24-b78d-ec09ba65594a" />
    <link href="http://feedproxy.google.com/~r/tunatoksoz/~3/ymW1Z_i-0ww/What-was-I-up-to-e28093-2-Months-of-no-blogging.aspx" />
    <author>
      <name>admin</name>
    </author>
    
    <published>2009-10-19T15:08:44+00:00</published>
    <link rel="related" href="http://www.tunatoksoz.com/post/What-was-I-up-to-e28093-2-Months-of-no-blogging.aspx#comment" />
    <dc:publisher>admin</dc:publisher>
    <pingback:server>http://www.tunatoksoz.com/pingback.axd</pingback:server>
    <pingback:target>http://www.tunatoksoz.com/post.aspx?id=b5d22cbd-03cd-4d24-b78d-ec09ba65594a</pingback:target>
    <slash:comments>1</slash:comments>
    <trackback:ping>http://www.tunatoksoz.com/trackback.axd?id=b5d22cbd-03cd-4d24-b78d-ec09ba65594a</trackback:ping>
    <wfw:comment>http://www.tunatoksoz.com/post/What-was-I-up-to-e28093-2-Months-of-no-blogging.aspx#comment</wfw:comment>
    <wfw:commentRss>http://www.tunatoksoz.com/syndication.axd?post=b5d22cbd-03cd-4d24-b78d-ec09ba65594a</wfw:commentRss>
  <content type="html">&lt;p&gt;Long time no see… Things have been hectic in last 2 months. While I had a pretty good plan for the August and October, an unexpected internship opportunity in the US showed up. Thins like Visa interview and accommodation was almost a blocker, but I was able to dealt with them. I was lucky that I was qualified for an “Urgency Visa”. &lt;/p&gt;  &lt;p&gt;Anyway, in the month of September, I was an intern in a university, and worked on several scientific projects. The lab that I worked at was mainly working on autonomous systems, and path planning algorithms. There I had studied those algorithms a bit and also involved in software design for several projects.&lt;/p&gt;  &lt;p&gt;As soon as I went there, I found myself in an atmosphere of competition. The competition was about designing an algorithm so that the drone we own can go from one point to another without crashing any other drones or obstacles in the stage. The behavior of those drones was semi-stochastic and depending on that preknowledge given to us, we are asked to implement this algorithm. Even though we couldn’t make into competition, I can say that I learnt a lot. &lt;/p&gt;  &lt;p&gt;My first task was to implement this semi-stochastic behaviors of enemy drones. It was pretty fun, and it taught me how seemingly easy thing can contain a lot of challenges. While dealing with this stuff, i learnt some other stuff regarding to games, which i hope to blog about.&lt;/p&gt;  &lt;p&gt;Here is the work that I had after a short while&lt;/p&gt;  &lt;p&gt;&lt;a href="http://tunatoksoz.com/image.axd?picture=image_3.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://tunatoksoz.com/image.axd?picture=image_thumb_4.png" width="313" height="537" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;My other task was to implement a 2D visualizer for the drones. The data was coming from a system know as Vicon which is used to track objects. It could give the orientation data with up to 1 cm precision, which was pretty cool. This task took only a few days and it was easy.&lt;/p&gt;  &lt;p&gt;In the last few weeks, while dealing with other minor tasks, like programming the rover, or fixing bugs in our competition code, I started designing a 3D visualizer using XNA for the lab as a hobby project.&amp;#160; Below is a view from one of the cameras. There are several other cameras and also a dirty console implementation.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://tunatoksoz.com/image.axd?picture=image_4.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://tunatoksoz.com/image.axd?picture=image_thumb_5.png" width="554" height="382" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;The future of this project is more likely to be a simulator, with a physics engine.&lt;/p&gt;  &lt;p&gt;Nowadays, I am really busy with doing homeworks and getting ready for graduate school applications. They take a lot of time and a lot of money (standardized tests like TOEFL, GRE). I hope to blog about those too. &lt;/p&gt;  &lt;p&gt;I hope this feature will be my boost post, and i hope to continue blogging regularly. &lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/XvvCGHtvnGqLBGzXIJr5BySebY0/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/XvvCGHtvnGqLBGzXIJr5BySebY0/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/XvvCGHtvnGqLBGzXIJr5BySebY0/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/XvvCGHtvnGqLBGzXIJr5BySebY0/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/tunatoksoz/~4/ymW1Z_i-0ww" height="1" width="1"/&gt;</content><feedburner:origLink>http://www.tunatoksoz.com/post/What-was-I-up-to-e28093-2-Months-of-no-blogging.aspx</feedburner:origLink></entry>
  <entry>
    <id>http://www.tunatoksoz.com/post/My-Thoughts-on-ORM-comparisons.aspx</id>
    <title>My Thoughts on ORM comparisons</title>
    <updated>2009-08-21T16:26:51+00:00</updated>
    <link rel="self" href="http://www.tunatoksoz.com/post.aspx?id=fd424132-32ab-4f69-b2b4-ef7b1928ab27" />
    <link href="http://feedproxy.google.com/~r/tunatoksoz/~3/aqPa0dla0ek/My-Thoughts-on-ORM-comparisons.aspx" />
    <author>
      <name>admin</name>
    </author>
    
    <published>2009-08-21T16:26:51+00:00</published>
    <link rel="related" href="http://www.tunatoksoz.com/post/My-Thoughts-on-ORM-comparisons.aspx#comment" />
    <dc:publisher>admin</dc:publisher>
    <pingback:server>http://www.tunatoksoz.com/pingback.axd</pingback:server>
    <pingback:target>http://www.tunatoksoz.com/post.aspx?id=fd424132-32ab-4f69-b2b4-ef7b1928ab27</pingback:target>
    <slash:comments>8</slash:comments>
    <trackback:ping>http://www.tunatoksoz.com/trackback.axd?id=fd424132-32ab-4f69-b2b4-ef7b1928ab27</trackback:ping>
    <wfw:comment>http://www.tunatoksoz.com/post/My-Thoughts-on-ORM-comparisons.aspx#comment</wfw:comment>
    <wfw:commentRss>http://www.tunatoksoz.com/syndication.axd?post=fd424132-32ab-4f69-b2b4-ef7b1928ab27</wfw:commentRss>
  <content type="html">&lt;p&gt;&lt;strong&gt;I am a bit late to the party but there we go.&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Last several days, there have been a hot debate on the performance and capability of NH vs some other commercial/noncommercial ORMs. This issue has been discussed both in NHibernate Developer List and in &lt;a href="http://ayende.com"&gt;Ayende’s&lt;/a&gt; blog. I have recently noticed another benchmark between NH and EF, which I hope to address, too. &lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Fallacies of benchmark&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;What I have seen in those benchmarks is the wrong use of ORMs. This statement has two aspects: Wrong use of ORM and wrong use of NH itself.&lt;/p&gt;  &lt;p&gt;In ORM, you don’t use it to do bulk operations. And 0.001 second difference will not differ anything in your application. If it does, you don’t also use RDBMS, you use something else.&lt;/p&gt;  &lt;p&gt;There is no point on making a loop of thousands of iterations which saves an entity. &lt;a href="http://davybrion.com"&gt;Davy&lt;/a&gt; has well pointed out that this has a lot of implications in NHibernate, unlike some other ORMs. First of all, NHibernate first-level cache will be in action and it will fill the cache with each item saved. Secondly, as NH makes use of POCO it has no mechanism of things like INotifyPropertyChanged, it has to compare the old to the new value. As you may guess, the more entity you have, the longer it will take. No exception. If you want to leave first-level cache out of the game, you use &lt;a href="http://nhforge.org/blogs/nhibernate/archive/2008/10/30/bulk-data-operations-with-nhibernate-s-stateless-sessions.aspx"&gt;StatelessSession&lt;/a&gt; feature of NHibernate, no exception. Actually when you check &lt;a href="http://fabiomaulo.blogspot.com/2009/08/nhibernate-perfomance-cramer-vs-cramer.html"&gt;Fabio Maulo’s post&lt;/a&gt; you’ll see it can even become faster without Stateless Session.&lt;/p&gt;  &lt;p&gt;Another point I have noticed in both benchmarks is that they are/were not fair. If I compare it to EF, lets say, ctx.SaveChanges() will batch the chages and send the query to the database in one go. NH has this feature, as Ayende already pointed out, &lt;a href="http://ayende.com/Blog/2006/09/16/BatchingSupportInNHibernate.aspx"&gt;since 2006.&lt;/a&gt; However, NH by default doesn’t make use of it, and this is not a bug, it is a feature. You have to use setting to enable it. &lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Benchmark the community, too&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;NHibernate has a big community, and great minds as committers. It really does matter. Let me give you some statistics about NHibernate development and its community&lt;/p&gt;  &lt;p&gt;Here is the commit statistics.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://tunatoksoz.com/image.axd?picture=image_1.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://tunatoksoz.com/image.axd?picture=image_thumb_2.png" width="456" height="138" /&gt;&lt;/a&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;It is one of the most active projects in .net environment. The image above doesn’t include the contrib projects. A great kiss goes&amp;#160; to &lt;a href="http://fabiomaulo.blogspot.com/"&gt;Fabio Maulo&lt;/a&gt; for his massive efforts.&lt;/p&gt;  &lt;p&gt;Let’s look at discussion group, shall we?&lt;/p&gt;  &lt;p&gt;&lt;a href="http://tunatoksoz.com/image.axd?picture=image_2.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://tunatoksoz.com/image.axd?picture=image_thumb_3.png" width="459" height="108" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Do you know any other group with that activity? I don’t know.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;In addition, NHibernate gives you more than _ANY_ ORM can give. It gives you a lot of extensibility points which can be used in a lot of scenario. Validator, Search, Spatial, Shards to name a few.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;In conclusion&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;NHibernate is the obvious winner.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/gBBx-rtEKOXwEXXEjOOUN5aT9UA/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/gBBx-rtEKOXwEXXEjOOUN5aT9UA/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/gBBx-rtEKOXwEXXEjOOUN5aT9UA/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/gBBx-rtEKOXwEXXEjOOUN5aT9UA/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/tunatoksoz/~4/aqPa0dla0ek" height="1" width="1"/&gt;</content><feedburner:origLink>http://www.tunatoksoz.com/post/My-Thoughts-on-ORM-comparisons.aspx</feedburner:origLink></entry>
  <entry>
    <id>http://www.tunatoksoz.com/post/Even-Developers-Make-Art.aspx</id>
    <title>Even Developers Make Art</title>
    <updated>2009-08-12T08:10:00+00:00</updated>
    <link rel="self" href="http://www.tunatoksoz.com/post.aspx?id=884c1687-e1b4-480d-be03-8f7a2d4cdbe0" />
    <link href="http://feedproxy.google.com/~r/tunatoksoz/~3/TSNixcoARxU/Even-Developers-Make-Art.aspx" />
    <author>
      <name>Admin</name>
    </author>
    
    <published>2009-08-12T08:10:00+00:00</published>
    <link rel="related" href="http://www.tunatoksoz.com/post/Even-Developers-Make-Art.aspx#comment" />
    <dc:publisher>Admin</dc:publisher>
    <pingback:server>http://www.tunatoksoz.com/pingback.axd</pingback:server>
    <pingback:target>http://www.tunatoksoz.com/post.aspx?id=884c1687-e1b4-480d-be03-8f7a2d4cdbe0</pingback:target>
    <slash:comments>5</slash:comments>
    <trackback:ping>http://www.tunatoksoz.com/trackback.axd?id=884c1687-e1b4-480d-be03-8f7a2d4cdbe0</trackback:ping>
    <wfw:comment>http://www.tunatoksoz.com/post/Even-Developers-Make-Art.aspx#comment</wfw:comment>
    <wfw:commentRss>http://www.tunatoksoz.com/syndication.axd?post=884c1687-e1b4-480d-be03-8f7a2d4cdbe0</wfw:commentRss>
  <content type="html">&lt;p&gt;&lt;a href="http://tunatoksoz.com/image.axd?picture=WindowsLiveWriter\EvenDevelopersMakeArt\poster1ciktigh6.jpg"&gt;&lt;img style="display: inline; border: 0;" title="poster1ciktigh6" src="http://tunatoksoz.com/image.axd?picture=WindowsLiveWriter\EvenDevelopersMakeArt\poster1ciktigh6_thumb.jpg" border="0" alt="poster1ciktigh6" width="598" height="450" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Found this &lt;span style="text-decoration: line-through;"&gt;toda&lt;/span&gt;&lt;span style="text-decoration: line-through;"&gt;y&lt;/span&gt; last month. If you click on the picture, you&amp;rsquo;ll see that there are parts that are composed of other images.&lt;/p&gt;
&lt;p&gt;I prepared a folder with full of small pictures, and a preprocessor scanned all files in that folder, took their R G and B averages and saved it to a database.&lt;/p&gt;
&lt;p&gt;I then divided the big picture into small chunks (the small, the better, but also requires more photos in order not to have repetitions). I took R G B averages of each part and computed the distance from each of the items stored in DB(for efficient access, they are fetched to memory). The distance formula is simply the Pythagoras theorem.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://tunatoksoz.com/image.axd?picture=clip_image002%5B6%5D.gif"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px" title="clip_image002[6]" src="http://tunatoksoz.com/image.axd?picture=clip_image002%5B6%5D_thumb.gif" border="0" alt="clip_image002[6]" width="367" height="26" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The closer it is, the better it fits to the place. However, there is one problem. Neighbor parts tend to have a correlation (they share similar colors), and if we use the same picture for neighboring cells, it doesn&amp;rsquo;t look good(above probably left from an early version). What I did was to take closest 10 and select randomly.&lt;/p&gt;
&lt;p&gt;The rest is a bit of Image processing(not processing but replacing, lets say)&lt;/p&gt;
&lt;p&gt;I had fun doing it :) Art is everywhere even if I don&amp;rsquo;t think I like it :)&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/kyjNluabJNc9gtT8AZRcFGpR1Ow/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/kyjNluabJNc9gtT8AZRcFGpR1Ow/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/kyjNluabJNc9gtT8AZRcFGpR1Ow/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/kyjNluabJNc9gtT8AZRcFGpR1Ow/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/tunatoksoz/~4/TSNixcoARxU" height="1" width="1"/&gt;</content><feedburner:origLink>http://www.tunatoksoz.com/post/Even-Developers-Make-Art.aspx</feedburner:origLink></entry>
  <entry>
    <id>http://www.tunatoksoz.com/post/YAGNI-in-Real-Life.aspx</id>
    <title>YAGNI in Real Life</title>
    <updated>2009-08-06T19:58:00+00:00</updated>
    <link rel="self" href="http://www.tunatoksoz.com/post.aspx?id=a11bfc84-5845-4393-9182-66c48e924ab7" />
    <link href="http://feedproxy.google.com/~r/tunatoksoz/~3/PQZ-5FkFg70/YAGNI-in-Real-Life.aspx" />
    <author>
      <name>Admin</name>
    </author>
    
    <published>2009-08-06T19:58:00+00:00</published>
    <link rel="related" href="http://www.tunatoksoz.com/post/YAGNI-in-Real-Life.aspx#comment" />
    <dc:publisher>Admin</dc:publisher>
    <pingback:server>http://www.tunatoksoz.com/pingback.axd</pingback:server>
    <pingback:target>http://www.tunatoksoz.com/post.aspx?id=a11bfc84-5845-4393-9182-66c48e924ab7</pingback:target>
    <slash:comments>5</slash:comments>
    <trackback:ping>http://www.tunatoksoz.com/trackback.axd?id=a11bfc84-5845-4393-9182-66c48e924ab7</trackback:ping>
    <wfw:comment>http://www.tunatoksoz.com/post/YAGNI-in-Real-Life.aspx#comment</wfw:comment>
    <wfw:commentRss>http://www.tunatoksoz.com/syndication.axd?post=a11bfc84-5845-4393-9182-66c48e924ab7</wfw:commentRss>
  <content type="html">&lt;p&gt;One of my friends wanted to have a cheap SVN hosting (actually wanted to install svn to his hosting, but this part is irrelevant to what I am going to say). I offered him some alternatives including &lt;a href="http://www.assembla.com"&gt;Assembla&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Then the topic came to OpenSource SVN hosting, and he believed SourceForge is superior to Google Code. While I can understand his claims, I have objections to it. As I am contributing to various opensource projects, and being an active user of opensource, I have a bunch of projects in my &amp;ldquo;OpenSourceProjects&amp;rdquo; folder. Most of them use SVN, rarely CVS. Most SVN projects was hosted under either Google Code or Sourceforge, some Codeplex.&lt;/p&gt;
&lt;p&gt;To begin with, having used&amp;rsquo;em all, I have pretty much experience with both, at least as a user.&lt;/p&gt;
&lt;p&gt;One argument that my friend used that SF has many features. Looking at google code interface, I have to admit that this is true. However, those blown features are not at my center of interest. When I develop the project, I want speed. SF doesn&amp;rsquo;t give me that much smooth experience, I remember having to update a project 5+ times just to download, and less frequently trying to commit 2+ times. Google, on the other hand, didn&amp;rsquo;t cause any problem regarding to its SVN usage.&lt;/p&gt;
&lt;p&gt;Another problem that we faced recently is that the download counts of NHibernate.Linq project was shown as 0 a week after we released it. I am pretty sure (:) ) that it had thousands of downloads since then, but it is not seen on SF.&lt;/p&gt;
&lt;p&gt;To sum up what I have said, I prefer quality of service over the features provided most of the time. Having features that I perhaps will never ever use is &amp;ldquo;relevant&amp;rdquo; to this story, it is YAGNI.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/wxhcHdKwejMPKgf-kO7E8UKOytM/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/wxhcHdKwejMPKgf-kO7E8UKOytM/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/wxhcHdKwejMPKgf-kO7E8UKOytM/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/wxhcHdKwejMPKgf-kO7E8UKOytM/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/tunatoksoz/~4/PQZ-5FkFg70" height="1" width="1"/&gt;</content><feedburner:origLink>http://www.tunatoksoz.com/post/YAGNI-in-Real-Life.aspx</feedburner:origLink></entry>
  <entry>
    <id>http://www.tunatoksoz.com/post/DELL-increases-the-Fan-speed-to-hide-problems-Yet-Another-Dell-Fail!.aspx</id>
    <title>DELL increases the Fan speed to hide problems - Yet Another Dell Fail?!</title>
    <updated>2009-08-06T15:59:00+00:00</updated>
    <link rel="self" href="http://www.tunatoksoz.com/post.aspx?id=c6e46d09-29f6-4c3f-ba23-456d8cd830d6" />
    <link href="http://feedproxy.google.com/~r/tunatoksoz/~3/bNkqVsjoVI8/DELL-increases-the-Fan-speed-to-hide-problems-Yet-Another-Dell-Fail!.aspx" />
    <author>
      <name>Admin</name>
    </author>
    
    <published>2009-08-06T15:59:00+00:00</published>
    <link rel="related" href="http://www.tunatoksoz.com/post/DELL-increases-the-Fan-speed-to-hide-problems-Yet-Another-Dell-Fail!.aspx#comment" />
    <dc:publisher>Admin</dc:publisher>
    <pingback:server>http://www.tunatoksoz.com/pingback.axd</pingback:server>
    <pingback:target>http://www.tunatoksoz.com/post.aspx?id=c6e46d09-29f6-4c3f-ba23-456d8cd830d6</pingback:target>
    <slash:comments>4</slash:comments>
    <trackback:ping>http://www.tunatoksoz.com/trackback.axd?id=c6e46d09-29f6-4c3f-ba23-456d8cd830d6</trackback:ping>
    <wfw:comment>http://www.tunatoksoz.com/post/DELL-increases-the-Fan-speed-to-hide-problems-Yet-Another-Dell-Fail!.aspx#comment</wfw:comment>
    <wfw:commentRss>http://www.tunatoksoz.com/syndication.axd?post=c6e46d09-29f6-4c3f-ba23-456d8cd830d6</wfw:commentRss>
  <content type="html">&lt;p&gt;I got my laptop repaired, thankfully, with the help of the Customer Care (Thank you Mustafa!)&lt;/p&gt;
&lt;p&gt;It seems like my laptop suffered from the same problem &lt;a href="http://en.community.dell.com/forums/p/19247093/19406051.aspx"&gt;many others faced&lt;/a&gt;. &lt;a href="http://www.tunatoksoz.com/post/DELL-Fail-e28093-Once-more.aspx"&gt;I had my warranty information disappearing from time to time&lt;/a&gt;. Because of this reason, I had chance (?) to make phone calls to the USA DELL, and learnt at that time that the issue occurred due to non-updated BIOS. I thought it was something different but now I see that that new BIOS version just &lt;strong&gt;increases the fan speed&lt;/strong&gt; in order to &lt;strong&gt;postpone the problem&lt;/strong&gt;, perhaps till the warranty expires. I am not an expert on Ethics but I believe that this issue is non ethical as they try to hide the real problem instead of fixing it. Another drawback of increased fan is the increased power consumption and therefore less battery life.&lt;/p&gt;
&lt;p&gt;As a result of many many complaints, &lt;a href="http://en.community.dell.com/blogs/direct2dell/archive/2008/08/18/nvidia-gpu-update-dell-to-offer-warranty-enhancement-to-all-affected-customers-worldwide.aspx?PageIndex=2"&gt;DELL decides to add 1 year extension to limited warranty.&lt;/a&gt; Mine still shows 2010 but I hope i&amp;rsquo;ll figure it out.&lt;/p&gt;
&lt;p&gt;Dell lost my respect, even if this is NVIDIA&amp;rsquo;s fault, Dell&amp;rsquo;s attitude toward customers is not acceptable.&lt;/p&gt;
&lt;p&gt;I hope that I won&amp;rsquo;t have to buy DELL in some near future.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/zCz-EoiQkAOM7TnBTDjEWuq7Wm0/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/zCz-EoiQkAOM7TnBTDjEWuq7Wm0/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/zCz-EoiQkAOM7TnBTDjEWuq7Wm0/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/zCz-EoiQkAOM7TnBTDjEWuq7Wm0/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/tunatoksoz/~4/bNkqVsjoVI8" height="1" width="1"/&gt;</content><feedburner:origLink>http://www.tunatoksoz.com/post/DELL-increases-the-Fan-speed-to-hide-problems-Yet-Another-Dell-Fail!.aspx</feedburner:origLink></entry>
  <entry>
    <id>http://www.tunatoksoz.com/post/Making-Transient-as-Default-Lifestyle-in-Castle-Windsor.aspx</id>
    <title>Making Transient as Default Lifestyle in Castle Windsor</title>
    <updated>2009-08-06T10:29:00+00:00</updated>
    <link rel="self" href="http://www.tunatoksoz.com/post.aspx?id=493ba43c-3860-425e-b486-feddee4afa5e" />
    <link href="http://feedproxy.google.com/~r/tunatoksoz/~3/HZgzaBZTEa0/Making-Transient-as-Default-Lifestyle-in-Castle-Windsor.aspx" />
    <author>
      <name>Admin</name>
    </author>
    
    <published>2009-08-06T10:29:00+00:00</published>
    <link rel="related" href="http://www.tunatoksoz.com/post/Making-Transient-as-Default-Lifestyle-in-Castle-Windsor.aspx#comment" />
    <dc:publisher>Admin</dc:publisher>
    <pingback:server>http://www.tunatoksoz.com/pingback.axd</pingback:server>
    <pingback:target>http://www.tunatoksoz.com/post.aspx?id=493ba43c-3860-425e-b486-feddee4afa5e</pingback:target>
    <slash:comments>5</slash:comments>
    <trackback:ping>http://www.tunatoksoz.com/trackback.axd?id=493ba43c-3860-425e-b486-feddee4afa5e</trackback:ping>
    <wfw:comment>http://www.tunatoksoz.com/post/Making-Transient-as-Default-Lifestyle-in-Castle-Windsor.aspx#comment</wfw:comment>
    <wfw:commentRss>http://www.tunatoksoz.com/syndication.axd?post=493ba43c-3860-425e-b486-feddee4afa5e</wfw:commentRss>
  <content type="html">&lt;p&gt;This is actually an answer to fellow blogger &lt;a href="http://devlicio.us/blogs/casey"&gt;Jak Charlton&lt;/a&gt;, but I see a benefit in sharing it.&lt;/p&gt;  &lt;p&gt;Casey pointed out that the default lifestyle should be transient. Even though I understand his reasonings, I am used to this way. &lt;/p&gt;  &lt;p&gt;There is a solution for those who wants Transient as the default.&lt;/p&gt;  &lt;p&gt;You know what? Yes, the events ! Here is how.&lt;/p&gt;  &lt;pre class="brush: csharp;"&gt;container.Kernel.ComponentModelCreated += new ComponentModelDelegate(Kernel_ComponentModelCreated);


void Kernel_ComponentModelCreated(Castle.Core.ComponentModel model)
{
	if (model.LifestyleType == LifestyleType.Undefined)
		model.LifestyleType = LifestyleType.Transient;
}&lt;/pre&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/dRw5IPTZD2T3yZd1GewDwOFD36Y/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/dRw5IPTZD2T3yZd1GewDwOFD36Y/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/dRw5IPTZD2T3yZd1GewDwOFD36Y/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/dRw5IPTZD2T3yZd1GewDwOFD36Y/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/tunatoksoz/~4/HZgzaBZTEa0" height="1" width="1"/&gt;</content><feedburner:origLink>http://www.tunatoksoz.com/post/Making-Transient-as-Default-Lifestyle-in-Castle-Windsor.aspx</feedburner:origLink></entry>
  <entry>
    <id>http://www.tunatoksoz.com/post/NHibernate-Linq-Released.aspx</id>
    <title>NHibernate Linq Released</title>
    <updated>2009-07-26T20:26:17+00:00</updated>
    <link rel="self" href="http://www.tunatoksoz.com/post.aspx?id=ae3acbcb-416c-4c10-bbb1-53cbc1aab9ff" />
    <link href="http://feedproxy.google.com/~r/tunatoksoz/~3/Lwqqe0YL8Po/NHibernate-Linq-Released.aspx" />
    <author>
      <name>admin</name>
    </author>
    
    <published>2009-07-26T20:26:17+00:00</published>
    <link rel="related" href="http://www.tunatoksoz.com/post/NHibernate-Linq-Released.aspx#comment" />
    <dc:publisher>admin</dc:publisher>
    <pingback:server>http://www.tunatoksoz.com/pingback.axd</pingback:server>
    <pingback:target>http://www.tunatoksoz.com/post.aspx?id=ae3acbcb-416c-4c10-bbb1-53cbc1aab9ff</pingback:target>
    <slash:comments>5</slash:comments>
    <trackback:ping>http://www.tunatoksoz.com/trackback.axd?id=ae3acbcb-416c-4c10-bbb1-53cbc1aab9ff</trackback:ping>
    <wfw:comment>http://www.tunatoksoz.com/post/NHibernate-Linq-Released.aspx#comment</wfw:comment>
    <wfw:commentRss>http://www.tunatoksoz.com/syndication.axd?post=ae3acbcb-416c-4c10-bbb1-53cbc1aab9ff</wfw:commentRss>
  <content type="html">&lt;p&gt;Just as a reminder, even though you might have seen it before on twitter or &lt;a href="http://www.nhforge.org"&gt;nhforge&lt;/a&gt; or &lt;a href="http://nhforge.org"&gt;Ayende’s blog&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;As of today, we released the first version of NHibernate.Linq. It is currently based on criteria api, and can handle many situations that Criteria API can handle. &lt;/p&gt;  &lt;p&gt;Oh one more thing, NHibernate.Linq was the first project that I contribute as a committer (it was in Rhino Tools), it is a strange feeling to see its release.&lt;/p&gt;  &lt;p&gt;I would like to thank &lt;a href="http://ayende.com/blog"&gt;Oren Eini(Ayende),&lt;/a&gt; &lt;a href="http://chadly.net"&gt;Chad Lee&lt;/a&gt; and &lt;a href="http://www.primedigit.com/"&gt;Will Shaver&lt;/a&gt; for making this project come true.&lt;/p&gt;  &lt;p&gt;You can read the official announcement &lt;a href="http://nhforge.org/blogs/nhibernate/archive/2009/07/26/nhibernate-linq-1-0-ga-released.aspx"&gt;here on NHForge&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/H28QLH3aufdC6FSeealEiI71IgQ/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/H28QLH3aufdC6FSeealEiI71IgQ/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/H28QLH3aufdC6FSeealEiI71IgQ/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/H28QLH3aufdC6FSeealEiI71IgQ/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/tunatoksoz/~4/Lwqqe0YL8Po" height="1" width="1"/&gt;</content><feedburner:origLink>http://www.tunatoksoz.com/post/NHibernate-Linq-Released.aspx</feedburner:origLink></entry>
  <entry>
    <id>http://www.tunatoksoz.com/post/Implementing-EnrichWith(of-StructureMap)-with-Castle.aspx</id>
    <title>Implementing EnrichWith(of StructureMap) with Castle</title>
    <updated>2009-07-14T13:30:00+00:00</updated>
    <link rel="self" href="http://www.tunatoksoz.com/post.aspx?id=fe6b6031-8183-4713-b11b-7252d3ae1d2a" />
    <link href="http://feedproxy.google.com/~r/tunatoksoz/~3/n4EcfUVsn-A/Implementing-EnrichWith(of-StructureMap)-with-Castle.aspx" />
    <author>
      <name>Admin</name>
    </author>
    
    <published>2009-07-14T13:30:00+00:00</published>
    <link rel="related" href="http://www.tunatoksoz.com/post/Implementing-EnrichWith(of-StructureMap)-with-Castle.aspx#comment" />
    <dc:publisher>Admin</dc:publisher>
    <pingback:server>http://www.tunatoksoz.com/pingback.axd</pingback:server>
    <pingback:target>http://www.tunatoksoz.com/post.aspx?id=fe6b6031-8183-4713-b11b-7252d3ae1d2a</pingback:target>
    <slash:comments>4</slash:comments>
    <trackback:ping>http://www.tunatoksoz.com/trackback.axd?id=fe6b6031-8183-4713-b11b-7252d3ae1d2a</trackback:ping>
    <wfw:comment>http://www.tunatoksoz.com/post/Implementing-EnrichWith(of-StructureMap)-with-Castle.aspx#comment</wfw:comment>
    <wfw:commentRss>http://www.tunatoksoz.com/syndication.axd?post=fe6b6031-8183-4713-b11b-7252d3ae1d2a</wfw:commentRss>
  <content type="html">&lt;p&gt;&lt;strong&gt;UPDATE: This facility made its way into Castle Microkernel, with name OnCreateFacility. I also made it possible to specify more than one actions. &lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;In one of &lt;a href="http://www.lostechies.com/blogs/joshuaflanagan/archive/2009/07/12/how-we-handle-application-configuration.aspx"&gt;Joshua Flanagan's recent post&lt;/a&gt; he mentioned about how they handle application configuration and I have to say that I liked their way. I also liked how SM can post-modify an object created, and looked for a way to do it in Castle. As many other stuff, I was able to achieve the same effect with a custom Facility.&lt;/p&gt;
&lt;p&gt;If I go further in the details, I had to catch ComponentCreated event of Kernel.&lt;/p&gt;
&lt;pre class="brush: csharp; auto-links: true; collapse: false; first-line: 1; gutter: true; html-script: false; light: false; ruler: false; smart-tabs: true; tab-size: 4; toolbar: true;"&gt;public class EnrichWithFacility:AbstractFacility
{
	public const string ExtendWithPropertyKey = "extendwith";
	protected override void Init()
	{
		Kernel.ComponentCreated += Kernel_ComponentCreated;
	}
	void Kernel_ComponentCreated(ComponentModel model, object instance)
	{
		if(model.ExtendedProperties.Contains(ExtendWithPropertyKey))
		{
			var action = model.ExtendedProperties[ExtendWithPropertyKey] as ExtendComponentDelegate;
			action(this.Kernel, instance);
		}
	}
}&lt;/pre&gt;
&lt;p&gt;Whenever a component is created, I will catch it and ask if there is any EnrichWith registered for the ComponentModel, and if there is any, invoke the action.&lt;/p&gt;
&lt;p&gt;I also added a fluent registration extensions (Castle style!) in order to make it easy to register enrichments.&lt;/p&gt;
&lt;pre class="brush: csharp; auto-links: true; collapse: false; first-line: 1; gutter: true; html-script: false; light: false; ruler: false; smart-tabs: true; tab-size: 4; toolbar: true;"&gt;container.Register(Component.For&amp;lt;IService&amp;gt;().ImplementedBy&amp;lt;MyService&amp;gt;()
			 .EnrichWith((kernel, instance) =&amp;gt; ((IService) instance).I++));&lt;/pre&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The code for &lt;a href="http://code.google.com/p/blogsharp/source/browse/trunk/BlogSharp.CastleExtensions/Facilities/EnrichFacility/EnrichWithFacility.cs?spec=svn112&amp;amp;r=108"&gt;the facility&lt;/a&gt;, &lt;a href="http://code.google.com/p/blogsharp/source/browse/trunk/BlogSharp.CastleExtensions/Facilities/EnrichFacility/FluentRegistration.cs?spec=svn112&amp;amp;r=108"&gt;fluent registration interface&lt;/a&gt;,and &lt;a href="http://code.google.com/p/blogsharp/source/browse/trunk/BlogSharp.CastleExtensions.Tests/Facilities/EnrichWithFacilityTests.cs?spec=svn112&amp;amp;r=108"&gt;the tests&lt;/a&gt; can be found on our never-ending blog engine, BlogSharp codebase.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/DfWNSqEzG_8Dwp0JYlrypAcd7dA/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/DfWNSqEzG_8Dwp0JYlrypAcd7dA/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/DfWNSqEzG_8Dwp0JYlrypAcd7dA/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/DfWNSqEzG_8Dwp0JYlrypAcd7dA/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/tunatoksoz/~4/n4EcfUVsn-A" height="1" width="1"/&gt;</content><feedburner:origLink>http://www.tunatoksoz.com/post/Implementing-EnrichWith(of-StructureMap)-with-Castle.aspx</feedburner:origLink></entry>
  <entry>
    <id>http://www.tunatoksoz.com/post/Long-Live-Nikola-Tesla!.aspx</id>
    <title>Long Live, Nikola Tesla!</title>
    <updated>2009-07-10T10:58:00+00:00</updated>
    <link rel="self" href="http://www.tunatoksoz.com/post.aspx?id=de19006b-c11f-497c-95d9-7347c4659c12" />
    <link href="http://feedproxy.google.com/~r/tunatoksoz/~3/ndlWEKQdmbk/Long-Live-Nikola-Tesla!.aspx" />
    <author>
      <name>Admin</name>
    </author>
    
    <published>2009-07-10T10:58:00+00:00</published>
    <link rel="related" href="http://www.tunatoksoz.com/post/Long-Live-Nikola-Tesla!.aspx#comment" />
    <dc:publisher>Admin</dc:publisher>
    <pingback:server>http://www.tunatoksoz.com/pingback.axd</pingback:server>
    <pingback:target>http://www.tunatoksoz.com/post.aspx?id=de19006b-c11f-497c-95d9-7347c4659c12</pingback:target>
    <slash:comments>1</slash:comments>
    <trackback:ping>http://www.tunatoksoz.com/trackback.axd?id=de19006b-c11f-497c-95d9-7347c4659c12</trackback:ping>
    <wfw:comment>http://www.tunatoksoz.com/post/Long-Live-Nikola-Tesla!.aspx#comment</wfw:comment>
    <wfw:commentRss>http://www.tunatoksoz.com/syndication.axd?post=de19006b-c11f-497c-95d9-7347c4659c12</wfw:commentRss>
  <content type="html">&lt;p&gt;This is the 153th birthday of &lt;a href="http://www.amazon.com/Man-Who-Invented-Twentieth-Century/dp/0747262659/" target="_blank"&gt;The Man Who Invented 20th Century (and also 21st century).&lt;/a&gt; There are a lot to say on his works and life, and how Edison prevented his work, etc, but i am not going to go over and detail them.&lt;/p&gt;
&lt;p&gt;Tesla was a great man, and a researcher mostly known for his interest in Magnetism and Electricity. He is also the real inventor of Radio. He&amp;rsquo;s the inventor of Alternative Current, which we use today. He designed the future in his mind. Rumor is that he worked on transferring energy in the air and actually designed them. Research is still going on this topic, roughly 100 years after his works.&lt;/p&gt;
&lt;p&gt;I found a great video on his life and works, recommend you to watch.&lt;/p&gt;
&lt;p align="center"&gt;&lt;embed style="width: 400px; height: 326px;" type="application/x-shockwave-flash" src="http://video.google.com/googleplayer.swf?docid=2188562935002257117&amp;amp;hl=tr&amp;amp;fs=true" allowfullscreen="true" allowscriptaccess="always"/&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Tesla doesn&amp;rsquo;t have the fame he deserve today, but for me, he is the hero of today&amp;rsquo;s technology, not Edison!&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/U6coECR6jzWws7FF2jtFr3okU_w/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/U6coECR6jzWws7FF2jtFr3okU_w/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/U6coECR6jzWws7FF2jtFr3okU_w/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/U6coECR6jzWws7FF2jtFr3okU_w/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/tunatoksoz/~4/ndlWEKQdmbk" height="1" width="1"/&gt;</content><feedburner:origLink>http://www.tunatoksoz.com/post/Long-Live-Nikola-Tesla!.aspx</feedburner:origLink></entry>
  <entry>
    <id>http://www.tunatoksoz.com/post/Querying-on-Child-Count-With-NHibernate.aspx</id>
    <title>Querying on Child Count With NHibernate</title>
    <updated>2009-07-09T23:23:00+00:00</updated>
    <link rel="self" href="http://www.tunatoksoz.com/post.aspx?id=27448e5d-7f64-4fa5-9da1-ccdb6219b3e1" />
    <link href="http://feedproxy.google.com/~r/tunatoksoz/~3/Kih7SFKl5aw/Querying-on-Child-Count-With-NHibernate.aspx" />
    <author>
      <name>Admin</name>
    </author>
    
    <published>2009-07-09T23:23:00+00:00</published>
    <link rel="related" href="http://www.tunatoksoz.com/post/Querying-on-Child-Count-With-NHibernate.aspx#comment" />
    <dc:publisher>Admin</dc:publisher>
    <pingback:server>http://www.tunatoksoz.com/pingback.axd</pingback:server>
    <pingback:target>http://www.tunatoksoz.com/post.aspx?id=27448e5d-7f64-4fa5-9da1-ccdb6219b3e1</pingback:target>
    <slash:comments>0</slash:comments>
    <trackback:ping>http://www.tunatoksoz.com/trackback.axd?id=27448e5d-7f64-4fa5-9da1-ccdb6219b3e1</trackback:ping>
    <wfw:comment>http://www.tunatoksoz.com/post/Querying-on-Child-Count-With-NHibernate.aspx#comment</wfw:comment>
    <wfw:commentRss>http://www.tunatoksoz.com/syndication.axd?post=27448e5d-7f64-4fa5-9da1-ccdb6219b3e1</wfw:commentRss>
  <content type="html">&lt;p&gt;This is a recent question raised in &lt;a href="groups.google.com/group/nhusers" target="_blank"&gt;NHibernate Users Group&lt;/a&gt;. The user wanted to realize the following query with Criteria api.&lt;/p&gt;
&lt;pre class="code"&gt;&lt;span style="color: blue"&gt;var &lt;/span&gt;result = db.Person.Where(x =&amp;gt; x.Pets.Count &amp;gt; 0 &amp;amp;&amp;amp; x.Alive)&lt;br /&gt;                      .OrderBy(x =&amp;gt; x.Name);&lt;/pre&gt;
&lt;p&gt;&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;This is not a simple query, but it has a solution&lt;/p&gt;
&lt;pre class="brush: csharp; auto-links: true; collapse: false; first-line: 1; gutter: true; highlight: [1,2]; html-script: false; light: false; ruler: false; smart-tabs: true; tab-size: 4; toolbar: true;"&gt;DetachedCriteria crit = DetachedCriteria.For(typeof (Person), "p2")
    .CreateCriteria("p2.Pets","Pets")
    .Add(Restrictions.EqProperty("p.Id", "p2.Id"))
    .SetProjection(Projections.Count("Pets.Id"));

ICriteria c = s.CreateCriteria(typeof (Person), "p")
    .Add(Restrictions.Gt(Projections.SubQuery(crit), 0))
    .Add(Restrictions.Eq("p.Alive",true))
    .AddOrder(Order.Asc("p.Name"));&lt;/pre&gt;
&lt;p&gt;What we had to do is to create a DetachedCriteria and on that execute CreateCriteria so that we can do querying on our collection.&lt;/p&gt;
&lt;p&gt;The other way is simpler, but requires you to use HQL (below query is provided by &lt;a href="http://fabiomaulo.blogspot.com/" target="_blank"&gt;Fabio Maulo&lt;/a&gt;)&lt;/p&gt;
&lt;pre class="brush: csharp; auto-links: true; collapse: false; first-line: 1; gutter: true; html-script: false; light: false; ruler: false; smart-tabs: true; tab-size: 4; toolbar: true;"&gt;session.CreateQuery("from Person p where  size(p.Pets) &amp;gt; 0 and p.Visible = true order by p.Name")&lt;/pre&gt;
&lt;p&gt;or&lt;/p&gt;
&lt;pre class="brush: csharp; auto-links: true; collapse: false; first-line: 1; gutter: true; html-script: false; light: false; ruler: false; smart-tabs: true; tab-size: 4; toolbar: true;"&gt;session.CreateQuery("from Person p where  p.Pets.size &amp;gt; 0 and p.Visible = true order by p.Name")&lt;/pre&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I hope this helps.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/K6R6WgqulFIbp0WtwMirdMeiDCM/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/K6R6WgqulFIbp0WtwMirdMeiDCM/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/K6R6WgqulFIbp0WtwMirdMeiDCM/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/K6R6WgqulFIbp0WtwMirdMeiDCM/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/tunatoksoz/~4/Kih7SFKl5aw" height="1" width="1"/&gt;</content><feedburner:origLink>http://www.tunatoksoz.com/post/Querying-on-Child-Count-With-NHibernate.aspx</feedburner:origLink></entry>
</feed>
