<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Tamir Khason - Just code &#187; Tips and Tricks</title>
	<atom:link href="http://khason.net/tag/tips-and-tricks/feed/" rel="self" type="application/rss+xml" />
	<link>http://khason.net</link>
	<description>Take care of the sense, and the sounds will take care of themselves.</description>
	<lastBuildDate>Sun, 08 Nov 2009 18:24:29 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Quick IT tip: How to build bootable USB stick</title>
		<link>http://khason.net/itpro/quick-it-tip-how-to-build-bootable-usb-stick/</link>
		<comments>http://khason.net/itpro/quick-it-tip-how-to-build-bootable-usb-stick/#comments</comments>
		<pubDate>Wed, 07 Oct 2009 11:55:12 +0000</pubDate>
		<dc:creator>Tamir</dc:creator>
				<category><![CDATA[ITPRO]]></category>
		<category><![CDATA[DEV]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Tips and Tricks]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[Windows 7]]></category>
		<category><![CDATA[Windows Embedded]]></category>
		<category><![CDATA[Work process]]></category>

		<guid isPermaLink="false">http://khason.net/itpro/quick-it-tip-how-to-build-bootable-usb-stick/</guid>
		<description><![CDATA[Because of my main job and lack of human resources there, I invest less and less in community. Thus I lost my MVP title. Sorry, guys. Also a ton of management tasks in big company prevents me from actual coding. However I am still able to find some time for doing “real” things such as [...]

<p/>]]></description>
			<content:encoded><![CDATA[<p>Because of my main job and <a href="/tag/better-place/" target="_blank">lack of human resources</a> there, I invest less and less in community. Thus I <a href="http://twitter.com/tamir/status/4638500894" target="_blank">lost my MVP title</a>. Sorry, guys. Also a ton of management tasks in big company prevents me from actual coding. However I am still able to find some time for doing “real” things such as <a href="http://connect.microsoft.com/windowsembedded" target="_blank">Windows Embedded Standard 2011</a> image building. Thus today I will explain how to build <a href="http://www.bootdisk.com/pendrive.htm" target="_blank">bootable flash USB disk</a> with a couple of simple commands and without <a href="http://www.askvg.com/a-bootable-usb-utility-to-create-bootable-usb-drive-to-install-windows-vista-server-2008-and-7/" target="_blank">using special utilities</a>. </p>
<p>&#160;<img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="World first USB drive by Trek Technology" border="0" alt="World first USB drive by Trek Technology" src="http://khason.net/images/2009/10/image.png" width="186" height="150" /> </p>
<p>Why to use bootable USB instead of regular <a href="http://en.wikipedia.org/wiki/Polycarbonate" target="_blank">CD or DVD ROM</a>? Well, it is more convenience, takes less storage, faster and fully recycle. So let’s start.</p>
<p>1. Insert USB flash drive <img src='http://khason.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />     <br />2. Run command prompt shell as Administrator (just in case the keyboard shortcut for “Run as Administrator” is Ctrl+Alt+Shift)     <br />3. Type “<strong>diskpart</strong>” to run Microsoft DiskPart utility. </p>
<blockquote><p>C:\Windows\system32&gt;diskpart </p>
<p>Microsoft DiskPart version 6.1.7600      <br />Copyright (C) 1999-2008 Microsoft Corporation.       <br />On computer: TAMIRK-DEV</p>
</blockquote>
<p>4. List your disks by typing in “<strong>list disk</strong>” or for those who like it shorter (like me) “<strong>list dis</strong>”</p>
<blockquote><p>DISKPART&gt; lis dis </p>
<p>&#160; Disk ###&#160; Status&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Size&#160;&#160;&#160;&#160; Free&#160;&#160;&#160;&#160; Dyn&#160; Gpt      <br />&#160; &#8212;&#8212;&#8211;&#160; &#8212;&#8212;&#8212;&#8212;-&#160; &#8212;&#8212;-&#160; &#8212;&#8212;-&#160; &#8212;&#160; &#8212;       <br />&#160; Disk 0&#160;&#160;&#160; Online&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 149 GB&#160; 1024 KB       <br />&#160; Disk 1&#160;&#160;&#160; Online&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 75 GB&#160;&#160;&#160;&#160; 2 GB       <br />&#160; Disk 2&#160;&#160;&#160; Online&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 3814 MB&#160;&#160;&#160;&#160;&#160; 0 B       <br />&#160; Disk 3&#160;&#160;&#160; No Media&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 0 B&#160;&#160;&#160;&#160;&#160; 0 B       <br />&#160; Disk 4&#160;&#160;&#160; No Media&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 0 B&#160;&#160;&#160;&#160;&#160; 0 B       <br />&#160; Disk 5&#160;&#160;&#160; Online&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 14 GB&#160;&#160;&#160;&#160;&#160; 0 B</p>
</blockquote>
<p>5. Identify your flash drive (in my case it is Disk 5)    <br />6. Select this drive to mark it for work by using “<strong>select disk</strong> 5” or “<strong>sel dis</strong> 5” command</p>
<blockquote><p>DISKPART&gt; sel dis 5</p>
<p>Disk 5 is now the selected disk.</p>
</blockquote>
<p>7. Clean it (this will delete everything on your disk drive, so be careful) by using “<strong>clean</strong>” or “<strong>cle</strong>” command.</p>
<blockquote><p>DISKPART&gt; cle</p>
<p>DiskPart succeeded in cleaning the disk.</p>
</blockquote>
<p>8. Create primary partition &#8211; “<strong>create partition primary</strong>” or “<strong>cre par pri</strong>”</p>
<blockquote><p>DISKPART&gt; cre par pri</p>
<p>DiskPart succeeded in creating the specified partition.</p>
</blockquote>
<p>9. Select new partition &#8211; “<strong>select partition 1</strong>” or “<strong>sel par 1</strong>”</p>
<blockquote><p>DISKPART&gt; sel par 1</p>
<p>Partition 1 is now the selected partition.</p>
</blockquote>
<p>10. Mark it as Active partition &#8211; “<strong>active</strong>” or “<strong>act</strong>”</p>
<blockquote><p>DISKPART&gt; act</p>
<p>DiskPart marked the current partition as active.</p>
</blockquote>
<p>11. Format &#8211; “<strong>format fs=ntfs quick</strong>” or “<strong>for fs=ntfs quick</strong>”</p>
<blockquote><p>DISKPART&gt; for fs=ntfs quick</p>
<p>&#160; 100 percent completed </p>
<p>DiskPart successfully formatted the volume.</p>
</blockquote>
<p>12. And finally my favorite command &#8211; “<strong>assign</strong>” or “<strong>ass</strong>” to mark it ready and create mount point</p>
<blockquote><p>DISKPART&gt; ass</p>
<p>DiskPart successfully assigned the drive letter or mount point.</p>
</blockquote>
<p>13. Exit &#8211; “exit” or “exi” to return to command shell</p>
<blockquote><p>DISKPART&gt; exi</p>
<p>Leaving DiskPart&#8230;</p>
</blockquote>
<p>Now your thumb drive is ready and bootable. So you can start copying files from ISO image into it.</p>
<p>Other option is to work with volumes rather than with disks. The all difference is in steps 4-6. Instead of “<strong>lis dis</strong>” use “<strong>lis vol</strong>” and instead of “<strong>sel dis</strong>” use “<strong>sel vol</strong>”. Maybe it is more convenience way of work because in this case you can identify partitions by labels and sizes rather than by sizes only.</p>
<blockquote><p>DISKPART&gt; lis vol </p>
<p>&#160; Volume ###&#160; Ltr&#160; Label&#160;&#160;&#160;&#160;&#160;&#160;&#160; Fs&#160;&#160;&#160;&#160; Type&#160;&#160;&#160;&#160;&#160;&#160;&#160; Size&#160;&#160;&#160;&#160; Status&#160;&#160;&#160;&#160; Info      <br />&#160; &#8212;&#8212;&#8212;-&#160; &#8212;&#160; &#8212;&#8212;&#8212;&#8211;&#160; &#8212;&#8211;&#160; &#8212;&#8212;&#8212;-&#160; &#8212;&#8212;-&#160; &#8212;&#8212;&#8212;&#160; &#8212;&#8212;&#8211;       <br />&#160; Volume 0&#160;&#160;&#160;&#160; E&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; DVD-ROM&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 0 B&#160; No Media       <br />&#160; Volume 1&#160;&#160;&#160;&#160; G&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; DVD-ROM&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 0 B&#160; No Media       <br />&#160; Volume 2&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; System Rese&#160; NTFS&#160;&#160; Partition&#160;&#160;&#160; 100 MB&#160; Healthy&#160;&#160;&#160; System       <br />&#160; Volume 3&#160;&#160;&#160;&#160; C&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; NTFS&#160;&#160; Partition&#160;&#160;&#160;&#160; 68 GB&#160; Healthy&#160;&#160;&#160; Boot       <br />&#160; Volume 4&#160;&#160;&#160;&#160; D&#160;&#160; DATA&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; NTFS&#160;&#160; Partition&#160;&#160;&#160;&#160; 80 GB&#160; Healthy       <br />&#160; Volume 5&#160;&#160;&#160;&#160; F&#160;&#160; READYBOOST&#160;&#160; FAT&#160;&#160;&#160; Removable&#160;&#160; 3812 MB&#160; Healthy       <br />&#160; Volume 6&#160;&#160;&#160;&#160; H&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Removable&#160;&#160;&#160;&#160;&#160;&#160; 0 B&#160; No Media       <br />&#160; Volume 7&#160;&#160;&#160;&#160; I&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Removable&#160;&#160;&#160;&#160;&#160;&#160; 0 B&#160; No Media       <br />&#160; Volume 8&#160;&#160;&#160;&#160; K&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; NTFS&#160;&#160; Removable&#160;&#160;&#160;&#160; 14 GB&#160; Healthy</p>
</blockquote>
<p>If you already copied your image into disk, you can mark MBR by using special utility called <a href="http://technet.microsoft.com/en-us/library/cc749177(WS.10).aspx" target="_blank">BootSect.exe</a> shipped with WAIK. In our case (with Windows 7 embedded), you’ll have to update master boot code to use BOOTMGR (Vista and up) rather than NTLDR (XP and down)</p>
<blockquote><p>BOOTSECT.EXE /NT60 K: /mbr</p>
</blockquote>
<p>We done, have a good day and be good people. Additional information regarding USB core guys from MS can be archived from <a href="http://blogs.msdn.com/usbcoreblog/" target="_blank">their brand new blog</a> (hope it will be up to date).</p>
<p>At the end, just you to know how are CDs make by Discovery Channel    </p>
<p><object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/O3FQzwNzUE4&amp;hl=en&amp;fs=1&amp;"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/O3FQzwNzUE4&amp;hl=en&amp;fs=1&amp;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object></p>


<p/>]]></content:encoded>
			<wfw:commentRss>http://khason.net/itpro/quick-it-tip-how-to-build-bootable-usb-stick/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Real singleton approach in WPF application</title>
		<link>http://khason.net/dev/read-singleton-approach-in-wpf-application/</link>
		<comments>http://khason.net/dev/read-singleton-approach-in-wpf-application/#comments</comments>
		<pubDate>Mon, 24 Aug 2009 20:19:35 +0000</pubDate>
		<dc:creator>Tamir</dc:creator>
				<category><![CDATA[DEV]]></category>
		<category><![CDATA[.NET 3.5]]></category>
		<category><![CDATA[CodeProject]]></category>
		<category><![CDATA[Performance]]></category>
		<category><![CDATA[source]]></category>
		<category><![CDATA[Tips and Tricks]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[WPF]]></category>

		<guid isPermaLink="false">http://khason.net/dev/read-singleton-approach-in-wpf-application/</guid>
		<description><![CDATA[One of the most common problems in WPF is memory/processor time consumption. Yes, WPF is rather greedy framework. It become even greedier when using unmanaged resources, such as memory files or interop images. To take care on it, you can implement singleton pattern for the application and share only one unmanaged instance among different application [...]


Related posts:<ol><li><a href='http://khason.net/dev/inotifypropertychanged-auto-wiring-or-how-to-get-rid-of-redundant-code/' rel='bookmark' title='Permanent Link: INotifyPropertyChanged auto wiring or how to get rid of redundant code'>INotifyPropertyChanged auto wiring or how to get rid of redundant code</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>One of the most common problems in WPF is memory/processor time consumption. Yes, WPF is rather greedy framework. It become even greedier when using unmanaged resources, such as memory files or interop images. To take care on it, you can implement singleton pattern for the application and share only one unmanaged instance among different application resources. So today we’ll try to create one large in-memory dynamic bitmap and share it between different instances of WPF controls. Let’s start</p>
<p><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="The Singleton" border="0" alt="The Singleton" src="http://khason.net/images/2009/08/image2.png" width="206" height="520" /> </p>
<p>First of all let’s create our single instance source. The pattern is straight forward. Create a class derived from INotifyPropertyChanged, create private constructor and static member returns the single instance of the class.</p>
<blockquote><p>public class MySingleton : INotifyPropertyChanged { </p>
<p>&#160;&#160; #region Properties     <br />&#160;&#160; public BitmapSource Source { get { return _source; } }      <br />&#160;&#160; public static MySingleton Instance {      <br />&#160;&#160;&#160;&#160;&#160; get {      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; if (_instance == default(MySingleton)) _instance = new MySingleton();      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; return _instance;      <br />&#160;&#160;&#160;&#160;&#160; }      <br />&#160;&#160; }      <br />&#160;&#160; #endregion </p>
<p>&#160;&#160; #region ctor     <br />&#160;&#160; private MySingleton() { _init(); }      <br />&#160;&#160; #endregion</p>
</blockquote>
<p>Now we need to create this single instance of this class inside our XAML program. To do this, we have great extension x:Static</p>
<blockquote><p>&lt;Window.DataContext&gt;     <br />&#160;&#160;&#160; &lt;x:StaticExtension Member=&quot;l:MySingleton.Instance&quot; /&gt;      <br />&lt;/Window.DataContext&gt;</p>
</blockquote>
<p>Now we need to find a way to do all dirty work inside MySingleton and keep classes using it as simple is possible. For this purpose we’ll register class handler to catch all GotFocus routed events, check the target of the event and rebind the only instance to new focused element. How to do this? Simple as 1-2-3</p>
<p>Create class handler</p>
<blockquote><p>EventManager.RegisterClassHandler(typeof(FrameworkElement), FrameworkElement.GotFocusEvent, (RoutedEventHandler)_onAnotherItemFocused);</p>
</blockquote>
<p>Check whether selected and focused item of the right type</p>
<blockquote><p>private void _onAnotherItemFocused(object sender, RoutedEventArgs e) {     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; DependencyPropertyDescriptor.FromProperty(ListBoxItem.IsSelectedProperty, typeof(ListBoxItem)).AddValueChanged(sender, (s, ex) =&gt; {}</p>
</blockquote>
<p>and reset binding </p>
<blockquote><p>var item = s as ListBoxItem;     <br />var img = item.Content as Image;      <br />if (_current != null &amp;&amp; _current.Target is Image &amp;&amp; _current.Target != img) {      <br />&#160;&#160; ((Image)_current.Target).ClearValue(Image.SourceProperty);      <br />}       <br />if (img != null) {      <br />&#160;&#160; _current = new WeakReference(img);      <br />&#160;&#160; img.SetBinding(Image.SourceProperty, _binding);      <br />}</p>
</blockquote>
<p>We almost done. a bit grease to make the source bitmap shiny </p>
<blockquote><p>var count = (uint)(_w * _h * 4);     <br />var section = CreateFileMapping(new IntPtr(-1), IntPtr.Zero, 0&#215;04, 0, count, null);      <br />_map = MapViewOfFile(section, 0xF001F, 0, 0, count);      <br />_source = Imaging.CreateBitmapSourceFromMemorySection(section, _w, _h, PixelFormats.Bgr32, (int)(_w * 4), 0) as InteropBitmap;      <br />_binding = new Binding {      <br />&#160;&#160; Mode = BindingMode.OneWay,      <br />&#160;&#160; Source = _source      <br />};      <br />CompositionTarget.Rendering += (s, e) =&gt; { _invalidate(); };</p>
</blockquote>
<blockquote><p>private void _invalidate() {     <br />&#160;&#160; var color = (uint)((uint)0xFF &lt;&lt; 24) | (uint)(_pixel &lt;&lt; 16) | (uint)(_pixel &lt;&lt; <img src='http://khason.net/wp-includes/images/smilies/icon_cool.gif' alt='8)' class='wp-smiley' /> | (uint)_pixel;      <br />&#160;&#160; _pixel++; </p>
<p>&#160;&#160; unsafe {     <br />&#160;&#160;&#160;&#160;&#160; uint* pBuffer = (uint*)_map;      <br />&#160;&#160;&#160;&#160;&#160; int _pxs = (_w * _h);      <br />&#160;&#160;&#160;&#160;&#160; for (var i = 0; i &lt; _pxs; i++) {      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; pBuffer[i] = color;      <br />&#160;&#160;&#160;&#160;&#160; }      <br />&#160;&#160; }      <br />&#160;&#160; _source.Invalidate();      <br />&#160;&#160; OnPropertyChanged(&quot;Source&quot;);      <br />}</p>
</blockquote>
<p>And we done. The usage of this approach is very simple – there is no usage at all. All happens automagically inside MySingleton class, all you need is to set static data context and add images</p>
<blockquote><p>&lt;StackPanel&gt;     <br />&#160;&#160;&#160; &lt;Button Click=&quot;_addAnother&quot;&gt;Add another&#8230;&lt;/Button&gt;      <br />&#160;&#160;&#160; &lt;ListBox Name=&quot;target&quot; /&gt;      <br />&lt;/StackPanel&gt;      <br />…      <br />private void _addAnother(object sender, RoutedEventArgs e) {      <br />&#160;&#160; var img = new Image { Width=200, Height=200, Margin=new Thickness(0,5,0,5) };      <br />&#160;&#160; target.Items.Add(img);      <br />&#160;&#160; this.Height += 200;      <br />}</p>
</blockquote>
<p>To summarize: in this article we learned how to use singletons as data sources for your XAML application, how to reuse it across WPF, how to connect to routed events externally and also how to handle dependency property changed from outside of the owner class. Have a nice day and be good people. </p>
<p><a href="http://khason.net/images/2009/08/ReuseSingleton.zip" target="_blank">Source code for this article (21k) &gt;&gt;</a></p>
<p>To make it works press number of times on “Add another…” button and then start selecting images used as listbox items. Pay attention to the working set of the application. Due to the fact that only one instance is in use it is not growing.</p>


<p>Related posts:<ol><li><a href='http://khason.net/dev/inotifypropertychanged-auto-wiring-or-how-to-get-rid-of-redundant-code/' rel='bookmark' title='Permanent Link: INotifyPropertyChanged auto wiring or how to get rid of redundant code'>INotifyPropertyChanged auto wiring or how to get rid of redundant code</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://khason.net/dev/read-singleton-approach-in-wpf-application/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>INotifyPropertyChanged auto wiring or how to get rid of redundant code</title>
		<link>http://khason.net/dev/inotifypropertychanged-auto-wiring-or-how-to-get-rid-of-redundant-code/</link>
		<comments>http://khason.net/dev/inotifypropertychanged-auto-wiring-or-how-to-get-rid-of-redundant-code/#comments</comments>
		<pubDate>Sun, 09 Aug 2009 19:43:41 +0000</pubDate>
		<dc:creator>Tamir</dc:creator>
				<category><![CDATA[DEV]]></category>
		<category><![CDATA[.NET 3.5]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[CodeProject]]></category>
		<category><![CDATA[source]]></category>
		<category><![CDATA[Tips and Tricks]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[Work process]]></category>
		<category><![CDATA[WPF]]></category>

		<guid isPermaLink="false">http://khason.net/dev/inotifypropertychanged-auto-wiring-or-how-to-get-rid-of-redundant-code/</guid>
		<description><![CDATA[For the last week most of WPF disciples are discussing how to get rid of hardcoded property name string inside INotifyPropertyChanged implementation and how to keep using automatic properties implementation but keep WPF binding working. The thread was started by Karl Shifflett, who proposed interesting method of using StackFrame for this task. During this thread [...]


Related posts:<ol><li><a href='http://khason.net/dev/read-singleton-approach-in-wpf-application/' rel='bookmark' title='Permanent Link: Real singleton approach in WPF application'>Real singleton approach in WPF application</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>For the last week most of <a title="RSS feed of all disciples" href="http://pipes.yahoo.com/pipes/pipe.run?_id=Jp_ob_fn3RGFP6DnBRNMsA&amp;_render=rss" rel="rss" target="_blank">WPF disciples</a> are discussing how to get rid of hardcoded property name string inside <a href="http://msdn.microsoft.com/en-us/library/system.componentmodel.inotifypropertychanged.aspx" target="_blank">INotifyPropertyChanged</a> implementation and how to keep using automatic properties implementation but keep WPF binding working. The thread was started by Karl Shifflett, <a href="http://karlshifflett.wordpress.com/2009/08/02/inotifypropertychanged-how-to-remove-the-property-name-string-code-smell/" target="_blank">who proposed interesting method</a> of using <a href="http://msdn.microsoft.com/en-us/library/system.diagnostics.stackframe.aspx" target="_blank">StackFrame</a> for this task. During this thread other methods were proposed including code snippets, R#, <a href="http://ayende.com/Blog/archive/2009/08/08/an-easier-way-to-manage-inotifypropertychanged.aspx" target="_blank">Observer Pattern</a>, <a href="http://www.codeproject.com/KB/WPF/CinchII.aspx#Better_INPC" target="_blank">Cinch framework</a>, <a href="http://mbrownchicago.spaces.live.com/blog/cns!2221DC39E0C749A4!1285.entry" target="_blank">Static Reflection</a>, <a href="http://danielvaughan.orpius.com/post/Property-Change-Notification-using-a-Weak-Referencing-Strategy.aspx" target="_blank">Weak References</a> and others. I also proposed the method we’re using for our classes and promised to blog about it. So the topic today is how to use <a href="http://www.postsharp.org" target="_blank">PostSharp</a> to wire automatic implementation of INotifyPropertyChanged interface based on automatic setters only.</p>
<p><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="My 5 ¢" border="0" alt="My 5 ¢" src="http://khason.net/images/2009/08/image1.png" width="483" height="337" /> </p>
<p>So, I want my code to looks like this:</p>
<blockquote><p>public class AutoWiredSource {      <br />&#160;&#160; public double MyProperty { get; set; }       <br />&#160;&#160; public double MyOtherProperty { get; set; }       <br />}</p>
</blockquote>
<p>while be fully noticeable about any change in any property and makes me able to bind to those properties.</p>
<blockquote><p>&lt;StackPanel DataContext=&quot;{Binding Source={StaticResource source}}&quot;&gt;      <br />&#160;&#160;&#160; &lt;Slider Value=&quot;{Binding Path=MyProperty}&quot; /&gt;       <br />&#160;&#160;&#160; &lt;Slider Value=&quot;{Binding Path=MyProperty}&quot; /&gt;       <br />&lt;/StackPanel&gt;</p>
</blockquote>
<p>How to achieve it? How to make compiler to replace my code with following?:</p>
<blockquote><p>private double _MyProperty;      <br />public double MyProperty {       <br />&#160;&#160; get { return _MyProperty; }       <br />&#160;&#160; set {       <br />&#160;&#160;&#160;&#160;&#160; if (value != _MyProperty) {       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; _MyProperty = value; OnPropertyChanged(&quot;MyProperty&quot;);       <br />&#160;&#160;&#160;&#160;&#160; }       <br />&#160;&#160; }       <br />}       <br />public event PropertyChangedEventHandler PropertyChanged;       <br />internal void OnPropertyChanged(string propertyName) {       <br />&#160;&#160; if (string.IsNullOrEmpty(propertyName)) throw new ArgumentNullException(&quot;propertyName&quot;); </p>
<p>&#160;&#160; var handler = PropertyChanged as PropertyChangedEventHandler;      <br />&#160;&#160; if (handler != null) handler(this, new PropertyChangedEventArgs(propertyName));       <br />}</p>
</blockquote>
<p>Simple: to use aspect oriented programming to inject set of instructions into pre-compiled source.</p>
<p>First of all we have to build some attribute will be used for marking classes requires change tracking. This attribute should be combined (compound) aspect to include all aspects used for change tracking. All we’re doing here is to get all set methods to add composition aspect to</p>
<blockquote><p>[Serializable, DebuggerNonUserCode, AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Class, AllowMultiple = false, Inherited = false),      <br />MulticastAttributeUsage(MulticastTargets.Class, AllowMultiple = false, Inheritance = MulticastInheritance.None, AllowExternalAssemblies = true)]       <br />public sealed class NotifyPropertyChangedAttribute : CompoundAspect {       <br />&#160;&#160; public int AspectPriority { get; set; } </p>
<p>&#160;&#160; public override void ProvideAspects(object element, LaosReflectionAspectCollection collection) {      <br />&#160;&#160;&#160;&#160;&#160; Type targetType = (Type)element;       <br />&#160;&#160;&#160;&#160;&#160; collection.AddAspect(targetType, new PropertyChangedAspect { AspectPriority = AspectPriority });       <br />&#160;&#160;&#160;&#160;&#160; foreach (var info in targetType.GetProperties(BindingFlags.Public | BindingFlags.Instance).Where(pi =&gt; pi.GetSetMethod() != null)) {       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; collection.AddAspect(info.GetSetMethod(), new NotifyPropertyChangedAspect(info.Name) { AspectPriority = AspectPriority });       <br />&#160;&#160;&#160;&#160;&#160; }       <br />&#160;&#160; }       <br />}</p>
</blockquote>
<p>Next aspect is change tracking composition aspect. Which is used for marking only</p>
<blockquote><p>[Serializable]      <br />internal sealed class PropertyChangedAspect : CompositionAspect {       <br />&#160;&#160; public override object CreateImplementationObject(InstanceBoundLaosEventArgs eventArgs) {       <br />&#160;&#160;&#160;&#160;&#160; return new PropertyChangedImpl(eventArgs.Instance);       <br />&#160;&#160; } </p>
<p>&#160;&#160; public override Type GetPublicInterface(Type containerType) {      <br />&#160;&#160;&#160;&#160;&#160; return typeof(INotifyPropertyChanged);       <br />&#160;&#160; } </p>
<p>&#160;&#160; public override CompositionAspectOptions GetOptions() {      <br />&#160;&#160;&#160;&#160;&#160; return CompositionAspectOptions.GenerateImplementationAccessor;       <br />&#160;&#160; }       <br />}</p>
</blockquote>
<p>And the next which is most interesting one, we will put onto method boundary for tracking. There are some highlights here. First we do not want to fire PropertyChanged event if the actual value did not changed, thus we’ll handle the method on it entry and on it exit for check.</p>
<blockquote><p>[Serializable]      <br />internal sealed class NotifyPropertyChangedAspect : OnMethodBoundaryAspect {       <br />&#160;&#160; private readonly string _propertyName; </p>
<p>&#160;&#160; public NotifyPropertyChangedAspect(string propertyName) {      <br />&#160;&#160;&#160;&#160;&#160; if (string.IsNullOrEmpty(propertyName)) throw new ArgumentNullException(&quot;propertyName&quot;);       <br />&#160;&#160;&#160;&#160;&#160; _propertyName = propertyName;       <br />&#160;&#160; } </p>
<p>&#160;&#160; public override void OnEntry(MethodExecutionEventArgs eventArgs) {      <br />&#160;&#160;&#160;&#160;&#160; var targetType = eventArgs.Instance.GetType();       <br />&#160;&#160;&#160;&#160;&#160; var setSetMethod = targetType.GetProperty(_propertyName);       <br />&#160;&#160;&#160;&#160;&#160; if (setSetMethod == null) throw new AccessViolationException();       <br />&#160;&#160;&#160;&#160;&#160; var oldValue = setSetMethod.GetValue(eventArgs.Instance,null);       <br />&#160;&#160;&#160;&#160;&#160; var newValue = eventArgs.GetReadOnlyArgumentArray()[0];       <br />&#160;&#160;&#160;&#160;&#160; if (oldValue == newValue) eventArgs.FlowBehavior = FlowBehavior.Return;       <br />&#160;&#160; } </p>
<p>&#160;&#160; public override void OnSuccess(MethodExecutionEventArgs eventArgs) {      <br />&#160;&#160;&#160;&#160;&#160; var instance = eventArgs.Instance as IComposed&lt;INotifyPropertyChanged&gt;;       <br />&#160;&#160;&#160;&#160;&#160; var imp = instance.GetImplementation(eventArgs.InstanceCredentials) as PropertyChangedImpl;       <br />&#160;&#160;&#160;&#160;&#160; imp.OnPropertyChanged(_propertyName);       <br />&#160;&#160; }       <br />}</p>
</blockquote>
<p>We almost done, all we have to do is to create class which implements INotifyPropertyChanged with internal method to useful call</p>
<blockquote><p>[Serializable]      <br />internal sealed class PropertyChangedImpl : INotifyPropertyChanged {       <br />&#160;&#160; private readonly object _instance; </p>
<p>&#160;&#160; public PropertyChangedImpl(object instance) {      <br />&#160;&#160;&#160;&#160;&#160; if (instance == null) throw new ArgumentNullException(&quot;instance&quot;);       <br />&#160;&#160;&#160;&#160;&#160; _instance = instance;       <br />&#160;&#160; } </p>
<p>&#160;&#160; public event PropertyChangedEventHandler PropertyChanged; </p>
<p>&#160;&#160; internal void OnPropertyChanged(string propertyName) {      <br />&#160;&#160;&#160;&#160;&#160; if (string.IsNullOrEmpty(propertyName)) throw new ArgumentNullException(&quot;propertyName&quot;); </p>
<p>&#160;&#160;&#160;&#160;&#160; var handler = PropertyChanged as PropertyChangedEventHandler;      <br />&#160;&#160;&#160;&#160;&#160; if (handler != null) handler(_instance, new PropertyChangedEventArgs(propertyName));       <br />&#160;&#160; }       <br />}</p>
</blockquote>
<p>We done. The last thing is to reference to PostSharp Laos and Public assemblies and mark compiler to use Postsharp targets (inside your project file (*.csproj)</p>
<blockquote><p>&lt;Import Project=&quot;$(MSBuildToolsPath)\Microsoft.CSharp.targets&quot; /&gt;      <br />&lt;PropertyGroup&gt;       <br />&#160; &lt;DontImportPostSharp&gt;True&lt;/DontImportPostSharp&gt;       <br />&lt;/PropertyGroup&gt;       <br />&lt;Import Project=&quot;PostSharp\PostSharp-1.5.targets&quot; /&gt;</p>
</blockquote>
<p>Now we done. We can use clear syntax like following to make all our properties has public setter to be traceable. The only disadvantage is that you’ll have to drag two Post Sharp files with your project. But after all it much more convenience than manual notify change tracking all over your project.</p>
<blockquote><p>[NotifyPropertyChanged]      <br />public class AutoWiredSource {       <br />&#160;&#160; public double MyProperty { get; set; }       <br />}</p>
</blockquote>
<p>Have a nice day and be good people. Also try to thing what other extremely useful things can be done with PostSharp (or any other aspect oriented engine)</p>
<p><a href="http://khason.net/images/2009/08/AutoPropertyChangedWiring.zip" rel="enclosure" target="_blank">Source code for this article (1,225 KB)&gt;&gt;</a></p>


<p>Related posts:<ol><li><a href='http://khason.net/dev/read-singleton-approach-in-wpf-application/' rel='bookmark' title='Permanent Link: Real singleton approach in WPF application'>Real singleton approach in WPF application</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://khason.net/dev/inotifypropertychanged-auto-wiring-or-how-to-get-rid-of-redundant-code/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Visual Studio debugger related attributes cheat sheet</title>
		<link>http://khason.net/dev/visual-studio-debugger-related-attributes-cheat-sheet/</link>
		<comments>http://khason.net/dev/visual-studio-debugger-related-attributes-cheat-sheet/#comments</comments>
		<pubDate>Tue, 07 Apr 2009 16:20:54 +0000</pubDate>
		<dc:creator>Tamir</dc:creator>
				<category><![CDATA[DEV]]></category>
		<category><![CDATA[CodeProject]]></category>
		<category><![CDATA[soft]]></category>
		<category><![CDATA[Tips and Tricks]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[Visual Studio]]></category>
		<category><![CDATA[VSTS]]></category>
		<category><![CDATA[Work process]]></category>

		<guid isPermaLink="false">http://khason.net/dev/visual-studio-debugger-related-attributes-cheat-sheet/</guid>
		<description><![CDATA[There are some debugger-oriented attributes in .Net, however 70% of developers not even know that they exist and 95% of them has no idea what they doing and how to use it. Today we’ll try to lid light on what those attributes doing and how to achieve the best of using it.
First of all let’s [...]


Related posts:<ol><li><a href='http://khason.net/dev/inotifypropertychanged-auto-wiring-or-how-to-get-rid-of-redundant-code/' rel='bookmark' title='Permanent Link: INotifyPropertyChanged auto wiring or how to get rid of redundant code'>INotifyPropertyChanged auto wiring or how to get rid of redundant code</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>There are some debugger-oriented attributes in .Net, however 70% of developers not even know that they exist and 95% of them has no idea what they doing and how to use it. Today we’ll try to lid light on what those attributes doing and how to achieve the best of using it.</p>
<p>First of all let’s define what we want to get from debugger in VS</p>
<table border="1" cellspacing="1" cellpadding="2" width="600">
<tbody>
<tr>
<td valign="top" width="116">Term</td>
<td valign="top" width="484">What it actually does</td>
</tr>
<tr>
<td valign="top" width="116">Step Into</td>
<td valign="top" width="484">Steps into immediate child (that is what F11 does for standard VS layout)         <br /><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://khason.net/images/2009/04/image1.png" width="240" height="17" /> </td>
</tr>
<tr>
<td valign="top" width="116">Step Over</td>
<td valign="top" width="484">Skips to any depth (that is what F10 does)         <br /><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://khason.net/images/2009/04/image2.png" width="238" height="19" /> </td>
</tr>
<tr>
<td valign="top" width="116">Step Deeper</td>
<td valign="top" width="484">Steps into bypassing code, using certain attribute</td>
</tr>
<tr>
<td valign="top" width="116">Run Through</td>
<td valign="top" width="484">Steps into, but only one level. All lower lavels will be Stepped Over</td>
</tr>
</tbody>
</table>
<p>Now, when we have our set of terms, we can learn what JMC means. It is not famous whisky brand or another car company. It Just My Code option, checked in or out in “Option” dialog inside Visual Studio</p>
<p><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://khason.net/images/2009/04/image3.png" width="749" height="437" /> </p>
<p> Next turn is for attributes, there are four (I know about) attributes, related to debugger and used by me for efficient programming: <a title="Read more in MSDN about this" href="http://msdn.microsoft.com/en-us/library/system.diagnostics.debuggerhiddenattribute.aspx" target="_blank">DebuggerHidden</a>, <a title="Read more in MSDN about this attribute" href="http://msdn.microsoft.com/en-us/library/system.diagnostics.debuggernonusercodeattribute.aspx" target="_blank">DebuggerNonUserCode</a>, <a title="Read more in MSDN about this attribute" href="http://msdn.microsoft.com/en-us/library/system.diagnostics.debuggerstepthroughattribute.aspx" target="_blank">DebuggerStepThrough</a> and <a title="Read more in MSDN about this attribute" href="http://msdn.microsoft.com/en-us/library/system.diagnostics.debuggerstepperboundaryattribute.aspx" target="_blank">DebuggerStepperBoundary</a>. We will use only three first. DebuggerStepperBoundary is the most secret attribute, which is related to debugging only in multithreaded environment. It used to avoid delusive effect, might appears when a context switch is made on a <a title="Read MSDN documentation about System.Threading.Thread class" href="http://msdn.microsoft.com/en-us/library/system.threading.thread.aspx" rel="tag" target="_blank">thread</a> within DebuggerNonUserCode applied. Other words, when you need to Step Through in Thread A and keep running at the same time in Thread B.</p>
<p>So let’s see the effects occurred when using those debugger attributes in case, you are trying to Step Into place, this attribute applied or set a Breakpoint there. When Just My Code (JMC) is checked all those attributes behaviors the same – they Step Deeper. However, when JMC is turned off (as in my picture) they begin to behavior differently.</p>
<table border="1" cellspacing="1" cellpadding="2" width="600">
<tbody>
<tr>
<td valign="top" width="200">Attribute</td>
<td valign="top" width="200">Step Into</td>
<td valign="top" width="200">Breakpoint</td>
</tr>
<tr>
<td valign="top" width="200">DebuggerHidden</td>
<td valign="top" width="200">Step Deeper</td>
<td valign="top" width="200">Step Deeper</td>
</tr>
<tr>
<td valign="top" width="200">DebuggerNonUserCode</td>
<td valign="top" width="200">Step Into</td>
<td valign="top" width="200">Step Into</td>
</tr>
<tr>
<td valign="top" width="200">DebuggerStepThrough</td>
<td valign="top" width="200">Step Deeper</td>
<td valign="top" width="200">Step Into</td>
</tr>
</tbody>
</table>
<p>As you can see, in this case </p>
<ul>
<li>DebuggerNonUserCode respects both for F11 (Step Into) and Breakpoints</li>
<li>DebuggerStepThrough respects only for Breakpoints</li>
<li>DebuggerHidden does not respects at all – just like when JMC is checked.</li>
</ul>
<p><strong>Bottom line</strong>: if you want people to manage whether to enter or not into your hidden methods – use DebuggerNonUserCode attribute. If you prefer them not to even know that those methods exists, use DebuggerHidden. If you want them to be able to put Breakpoints and stop on them, but keep running without explicit action – use&#160; DebuggerStepThrough</p>
<p>Have a nice day and be good people.&#160; Happy other developers friendly debugging.</p>
<p><em>Small bonus</em>: To visualize your struct, class, delegate, enum, field, property or even assembly for user debugger, you can use <a title="Read more on MSDN about this attribute" href="http://msdn.microsoft.com/en-us/library/system.diagnostics.debuggerdisplayattribute.aspx" target="_blank">DebuggerDisplay</a> attribute (you need to put executable code into {} for example (“Value = {X}:{Y}”)]</p>
<p><em>Thanks to <a title="Boris unleashed with huge passover gift" href="http://twitpic.com/2yivn" target="_blank">Boris</a> for deep investigation</em></p>


<p>Related posts:<ol><li><a href='http://khason.net/dev/inotifypropertychanged-auto-wiring-or-how-to-get-rid-of-redundant-code/' rel='bookmark' title='Permanent Link: INotifyPropertyChanged auto wiring or how to get rid of redundant code'>INotifyPropertyChanged auto wiring or how to get rid of redundant code</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://khason.net/dev/visual-studio-debugger-related-attributes-cheat-sheet/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>How to calculate CRC in C#?</title>
		<link>http://khason.net/dev/how-to-calculate-crc-in-c/</link>
		<comments>http://khason.net/dev/how-to-calculate-crc-in-c/#comments</comments>
		<pubDate>Mon, 06 Apr 2009 19:38:15 +0000</pubDate>
		<dc:creator>Tamir</dc:creator>
				<category><![CDATA[DEV]]></category>
		<category><![CDATA[.NET 3.5]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[CodeProject]]></category>
		<category><![CDATA[source]]></category>
		<category><![CDATA[Tips and Tricks]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[Work process]]></category>

		<guid isPermaLink="false">http://khason.net/dev/how-to-calculate-crc-in-c/</guid>
		<description><![CDATA[First of all, I want to beg your pardon about the frequency of posts last time. I’m completely understaffed and have a ton of things to do for my job. This why, today I’ll just write a quick post about checksum calculation in C#. It might be very useful for any of you, working with [...]


Related posts:<ol><li><a href='http://khason.net/dev/read-singleton-approach-in-wpf-application/' rel='bookmark' title='Permanent Link: Real singleton approach in WPF application'>Real singleton approach in WPF application</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>First of all, I want to beg your pardon about the frequency of posts last time. I’m completely understaffed and have a ton of things to do for my job. This why, today I’ll just write a quick post about checksum calculation in C#. It might be very useful for any of you, working with devices or external systems.</p>
<p><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="BIOS CRC Error for old thinkpad" src="http://khason.net/images/2009/04/image.png" border="0" alt="BIOS CRC Error for old thinkpad" width="636" height="53" /></p>
<p><a href="http://en.wikipedia.org/wiki/Cyclic_redundancy_check" target="_blank">CRC – Cyclic Redundancy Check</a> is an algorithm, which is widely used in different communication protocols, packing and packaging algorithms for assure robustness of data. The idea behind it is simple – calculate unique checksum (frame check sequence) for each data frame, based on it’s content and stick it at the end of each meaningful message. Once data received it’s possible to perform the same calculating and compare results – if results are similar, message is ok.</p>
<p>There are two kinds of CRC – 16 and 32 bit. There are also less used checksums for 8 and 64 bits. All this is about appending a string of zeros to the frame equal in number of frames and modulo two device by using generator polynomial containing one or more bits then checksum to be generated. This is very similar to performing a bit-wise XOR operation in the frame, while the reminder is actually our CRC.</p>
<p>In many industries first polynomial is in use to create CRC tables and then apply it for performance purposes. The default polynomial, defined by IEEE 802.3 which is 0xA001 for 16 bit and 0&#215;04C11DB7 for 32 bit. We’re in C#, thus we should use it inversed version which is 0&#215;8408 for 16 bit and 0xEDB88320 for 32 bit. Those polynomials we’re going to use also in our sample.</p>
<p>So let’s start. Because CRC is HashAlgorithm after all, we can derive our classes from System.Security.Cryptography.HashAlgorithm class.</p>
<blockquote><p>public class CRC16 : HashAlgorithm {<br />
public class CRC32 : HashAlgorithm {</p>
</blockquote>
<p>Then, upon first creation we’ll generate hashtables with CRC values to enhance future performance. It’s all about values table for bytes from 0 to 255 , so we should calculate it only once and then we can use it statically.</p>
<blockquote><p>[CLSCompliant(false)]<br />
public CRC16(ushort polynomial) {<br />
HashSizeValue = 16;<br />
_crc16Table = (ushort[])_crc16TablesCache[polynomial];<br />
if (_crc16Table == null) {<br />
_crc16Table = CRC16._buildCRC16Table(polynomial);<br />
_crc16TablesCache.Add(polynomial, _crc16Table);<br />
}<br />
Initialize();<br />
}</p>
<p>[CLSCompliant(false)]<br />
public CRC32(uint polynomial) {<br />
HashSizeValue = 32;<br />
_crc32Table = (uint[])_crc32TablesCache[polynomial];<br />
if (_crc32Table == null) {<br />
_crc32Table = CRC32._buildCRC32Table(polynomial);<br />
_crc32TablesCache.Add(polynomial, _crc32Table);<br />
}<br />
Initialize();<br />
}</p>
</blockquote>
<p>Then let’s calculate it</p>
<blockquote><p>private static ushort[] _buildCRC16Table(ushort polynomial) {<br />
// 256 values representing ASCII character codes.<br />
ushort[] table = new ushort[256];<br />
for (ushort i = 0; i &lt; table.Length; i++) {<br />
ushort value = 0;<br />
ushort temp = i;<br />
for (byte j = 0; j &lt; 8; j++) {<br />
if (((value ^ temp) &amp; 0&#215;0001) != 0) {<br />
value = (ushort)((value &gt;&gt; 1) ^ polynomial);<br />
} else {<br />
value &gt;&gt;= 1;<br />
}<br />
temp &gt;&gt;= 1;<br />
}<br />
table[i] = value;<br />
}<br />
return table;<br />
}</p>
<p>private static uint[] _buildCRC32Table(uint polynomial) {<br />
uint crc;<br />
uint[] table = new uint[256];</p>
<p>// 256 values representing ASCII character codes.<br />
for (int i = 0; i &lt; 256; i++) {<br />
crc = (uint)i;<br />
for (int j = 8; j &gt; 0; j&#8211;) {<br />
if ((crc &amp; 1) == 1)<br />
crc = (crc &gt;&gt; 1) ^ polynomial;<br />
else<br />
crc &gt;&gt;= 1;<br />
}<br />
table[i] = crc;<br />
}</p>
<p>return table;<br />
}</p>
</blockquote>
<p>The result will looks like this for 32 bits</p>
<blockquote>
<pre>        0x00, 0x31, 0x62, 0x53, 0xC4, 0xF5, 0xA6, 0x97,
        0xB9, 0x88, 0xDB, 0xEA, 0x7D, 0x4C, 0x1F, 0x2E,
        0x43, 0x72, 0x21, 0x10, 0x87, 0xB6, 0xE5, 0xD4,
        0xFA, 0xCB, 0x98, 0xA9, 0x3E, 0x0F, 0x5C, 0x6D,
        0x86, 0xB7, 0xE4, 0xD5, 0x42, 0x73, 0x20, 0x11,
        0x3F, 0x0E, 0x5D, 0x6C, 0xFB, 0xCA, 0x99, 0xA8,
        0xC5, 0xF4, 0xA7, 0x96, 0x01, 0x30, 0x63, 0x52,
        0x7C, 0x4D, 0x1E, 0x2F, 0xB8, 0x89, 0xDA, 0xEB,
        0x3D, 0x0C, 0x5F, 0x6E, 0xF9, 0xC8, 0x9B, 0xAA,
        0x84, 0xB5, 0xE6, 0xD7, 0x40, 0x71, 0x22, 0x13,
        0x7E, 0x4F, 0x1C, 0x2D, 0xBA, 0x8B, 0xD8, 0xE9,
        0xC7, 0xF6, 0xA5, 0x94, 0x03, 0x32, 0x61, 0x50,
        0xBB, 0x8A, 0xD9, 0xE8, 0x7F, 0x4E, 0x1D, 0x2C,
        0x02, 0x33, 0x60, 0x51, 0xC6, 0xF7, 0xA4, 0x95,
        0xF8, 0xC9, 0x9A, 0xAB, 0x3C, 0x0D, 0x5E, 0x6F,
        0x41, 0x70, 0x23, 0x12, 0x85, 0xB4, 0xE7, 0xD6,
        0x7A, 0x4B, 0x18, 0x29, 0xBE, 0x8F, 0xDC, 0xED,
        0xC3, 0xF2, 0xA1, 0x90, 0x07, 0x36, 0x65, 0x54,
        0x39, 0x08, 0x5B, 0x6A, 0xFD, 0xCC, 0x9F, 0xAE,
        0x80, 0xB1, 0xE2, 0xD3, 0x44, 0x75, 0x26, 0x17,
        0xFC, 0xCD, 0x9E, 0xAF, 0x38, 0x09, 0x5A, 0x6B,
        0x45, 0x74, 0x27, 0x16, 0x81, 0xB0, 0xE3, 0xD2,
        0xBF, 0x8E, 0xDD, 0xEC, 0x7B, 0x4A, 0x19, 0x28,
        0x06, 0x37, 0x64, 0x55, 0xC2, 0xF3, 0xA0, 0x91,
        0x47, 0x76, 0x25, 0x14, 0x83, 0xB2, 0xE1, 0xD0,
        0xFE, 0xCF, 0x9C, 0xAD, 0x3A, 0x0B, 0x58, 0x69,
        0x04, 0x35, 0x66, 0x57, 0xC0, 0xF1, 0xA2, 0x93,
        0xBD, 0x8C, 0xDF, 0xEE, 0x79, 0x48, 0x1B, 0x2A,
        0xC1, 0xF0, 0xA3, 0x92, 0x05, 0x34, 0x67, 0x56,
        0x78, 0x49, 0x1A, 0x2B, 0xBC, 0x8D, 0xDE, 0xEF,
        0x82, 0xB3, 0xE0, 0xD1, 0x46, 0x77, 0x24, 0x15,
        0x3B, 0x0A, 0x59, 0x68, 0xFF, 0xCE, 0x9D, 0xAC</pre>
</blockquote>
<p>Now, all we have to do is to upon request to lookup into this hash table for related value and XOR it</p>
<blockquote><p>protected override void HashCore(byte[] buffer, int offset, int count) {</p>
<p>for (int i = offset; i &lt; count; i++) {</p>
<p>ulong ptr = (_crc &amp; 0xFF) ^ buffer[i];</p>
<p>_crc &gt;&gt;= 8;</p>
<p>_crc ^= _crc32Table[ptr];</p>
<p>}</p>
<p>}</p>
<p>new public byte[] ComputeHash(Stream inputStream) {</p>
<p>byte[] buffer = new byte[4096];</p>
<p>int bytesRead;</p>
<p>while ((bytesRead = inputStream.Read(buffer, 0, 4096)) &gt; 0) {</p>
<p>HashCore(buffer, 0, bytesRead);</p>
<p>}</p>
<p>return HashFinal();</p>
<p>}</p>
<p>protected override byte[] HashFinal() {</p>
<p>byte[] finalHash = new byte[4];</p>
<p>ulong finalCRC = _crc ^ _allOnes;</p>
<p>finalHash[0] = (byte)((finalCRC &gt;&gt; 0) &amp; 0xFF);</p>
<p>finalHash[1] = (byte)((finalCRC &gt;&gt; <img src='http://khason.net/wp-includes/images/smilies/icon_cool.gif' alt='8)' class='wp-smiley' /> &amp; 0xFF);</p>
<p>finalHash[2] = (byte)((finalCRC &gt;&gt; 16) &amp; 0xFF);</p>
<p>finalHash[3] = (byte)((finalCRC &gt;&gt; 24) &amp; 0xFF);</p>
<p>return finalHash;</p>
<p>}</p>
</blockquote>
<p>We done. Have a good time and be good people. Also, I want to thank Boris for helping me with this article. He promised to write here some day…</p>
<p><a href="http://khason.net/images/2009/04/crc-source.zip" target="_blank">Source code for this article</a></p>


<p>Related posts:<ol><li><a href='http://khason.net/dev/read-singleton-approach-in-wpf-application/' rel='bookmark' title='Permanent Link: Real singleton approach in WPF application'>Real singleton approach in WPF application</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://khason.net/dev/how-to-calculate-crc-in-c/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
<enclosure url="http://khason.net/images/2009/04/crc-source.zip" length="" type="" />
		</item>
		<item>
		<title>Quick how to: Reduce number of colors programmatically</title>
		<link>http://khason.net/dev/quick-how-to-reduce-number-of-colors-programmatically/</link>
		<comments>http://khason.net/dev/quick-how-to-reduce-number-of-colors-programmatically/#comments</comments>
		<pubDate>Mon, 09 Feb 2009 18:46:50 +0000</pubDate>
		<dc:creator>Tamir</dc:creator>
				<category><![CDATA[DEV]]></category>
		<category><![CDATA[.NET 3.5]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[CodeProject]]></category>
		<category><![CDATA[DirectX]]></category>
		<category><![CDATA[Interop]]></category>
		<category><![CDATA[Performance]]></category>
		<category><![CDATA[Tips and Tricks]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[Work process]]></category>
		<category><![CDATA[WPF]]></category>
		<category><![CDATA[WPF crossbow]]></category>

		<guid isPermaLink="false">http://khason.net/dev/quick-how-to-reduce-number-of-colors-programmatically/</guid>
		<description><![CDATA[My colleague just asked me about how to reduce a number of colors in image programmatically. This is very simple task and contains of 43   steps:

First of all, you have to read a source image
using (var img = Image.FromFile(name)) {
var bmpEncoder = ImageCodecInfo.GetImageDecoders().FirstOrDefault(e =&#62; e.FormatID == ImageFormat.Bmp.Guid);
Then create your own encoder with certain [...]


Related posts:<ol><li><a href='http://khason.net/dev/read-singleton-approach-in-wpf-application/' rel='bookmark' title='Permanent Link: Real singleton approach in WPF application'>Real singleton approach in WPF application</a></li>
<li><a href='http://khason.net/dev/inotifypropertychanged-auto-wiring-or-how-to-get-rid-of-redundant-code/' rel='bookmark' title='Permanent Link: INotifyPropertyChanged auto wiring or how to get rid of redundant code'>INotifyPropertyChanged auto wiring or how to get rid of redundant code</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>My colleague just asked me about how to reduce a number of colors in image programmatically. This is very simple task and contains of 43 <img src='http://khason.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  steps:</p>
<p><img style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" title="Simple color matrix" src="http://khason.net/images/2009/02/image2.png" border="0" alt="Simple color matrix" width="383" height="366" /></p>
<p>First of all, you have to read a source image</p>
<blockquote><p>using (var img = Image.FromFile(name)) {<br />
var bmpEncoder = ImageCodecInfo.GetImageDecoders().FirstOrDefault(e =&gt; e.FormatID == ImageFormat.Bmp.Guid);</p></blockquote>
<p>Then create your own encoder with certain color depth (32 bits in this case)</p>
<blockquote><p>var myEncoder = System.Drawing.Imaging.Encoder.ColorDepth;<br />
var myEncoderParameter = new EncoderParameter(myEncoder, 32L);<br />
var myEncoderParameters = new EncoderParameters(1) { Param = new EncoderParameter[] { myEncoderParameter } };</p></blockquote>
<p>Then save it</p>
<blockquote><p>img.Save(name.Replace(&#8220;.png&#8221;, &#8220;.bmp&#8221;), bmpEncoder, myEncoderParameters);</p></blockquote>
<p>It it enough? Not really, because if you’re going to loose colors (by reducing color depth), it makes sense to avoid letting default WIX decoder to do this, thus you have to find nearest base colors manually. How to do this? By using simple math</p>
<blockquote><p>Color GetNearestBaseColor(Color exactColor) {<br />
Color nearestColor = Colors.Black;<br />
int cnt = baseColors.Count;<br />
for (int i = 0; i &lt; cnt; i++) {<br />
int rRed = baseColors[i].R &#8211; exactColor.R;<br />
int rGreen = baseColors[i].G &#8211; exactColor.G;<br />
int rBlue = baseColors[i].B &#8211; exactColor.B;</p>
<p>int rDistance =<br />
(rRed * rRed) +<br />
(rGreen * rGreen) +<br />
(rBlue * rBlue);<br />
if (rDistance == 0.0) {<br />
return baseColors[i];<br />
} else if (rDistance &lt; maxDistance) {<br />
maxDistance = rDistance;<br />
nearestColor = baseColors[i];<br />
}<br />
}<br />
return nearestColor;<br />
}</p></blockquote>
<p>Now, you can either change colors on base image directly</p>
<blockquote><p>unsafe {<br />
uint* pBuffer = (uint*)hMap;<br />
for (int iy = 0; iy &lt; (int)ColorMapSource.PixelHeight; ++iy)<br />
{<br />
for (int ix = 0; ix &lt; nWidth; ++ix)<br />
{<br />
Color nc = GetNearestBaseColor(pBuffer[0].FromOle());</p>
<p>pBuffer[0] &amp;= (uint)((uint)nc.A &lt;&lt; 24) | //A<br />
(uint)(nc.R &lt;&lt; 16 ) | //R<br />
(uint)(nc.G &lt;&lt; 8 ) | //G<br />
(uint)(nc.B ); //B<br />
++pBuffer;<br />
}<br />
pBuffer += nOffset;<br />
}<br />
}</p></blockquote>
<p>Or, if you’re in WPF and .NET 3.5 <a title="HLSL (Pixel shader) effects tutorial" href="http://khason.net/blog/hlsl-pixel-shader-effects-tutorial/" target="_blank">create simple pixel shader effect</a> to do it for you in hardware. Now, my colleague can do it himself in about 5 minutes <img src='http://khason.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  . Have a nice day and be good people.</p>


<p>Related posts:<ol><li><a href='http://khason.net/dev/read-singleton-approach-in-wpf-application/' rel='bookmark' title='Permanent Link: Real singleton approach in WPF application'>Real singleton approach in WPF application</a></li>
<li><a href='http://khason.net/dev/inotifypropertychanged-auto-wiring-or-how-to-get-rid-of-redundant-code/' rel='bookmark' title='Permanent Link: INotifyPropertyChanged auto wiring or how to get rid of redundant code'>INotifyPropertyChanged auto wiring or how to get rid of redundant code</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://khason.net/dev/quick-how-to-reduce-number-of-colors-programmatically/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Math world, simple mental calculations or what&#8217;s going on with education?</title>
		<link>http://khason.net/blog/math-world-simple-mental-calculations-or-whats-going-on-with-education/</link>
		<comments>http://khason.net/blog/math-world-simple-mental-calculations-or-whats-going-on-with-education/#comments</comments>
		<pubDate>Sun, 08 Feb 2009 13:07:55 +0000</pubDate>
		<dc:creator>Tamir</dc:creator>
				<category><![CDATA[BLOG]]></category>
		<category><![CDATA[blogging general]]></category>
		<category><![CDATA[fun]]></category>
		<category><![CDATA[help]]></category>
		<category><![CDATA[jobs]]></category>
		<category><![CDATA[Math]]></category>
		<category><![CDATA[quiz]]></category>
		<category><![CDATA[thoughts]]></category>
		<category><![CDATA[Tips and Tricks]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://khason.net/blog/math-world-simple-mental-calculations-or-whats-going-on-with-education/</guid>
		<description><![CDATA[Today, I want to write blog post which is absolutely not related to programming. It related to math and education in general those days. During work interviews, I see a lot of people, who was absolutely unable to calculate mentally. They just can’t understand, that it’s possible to do without calculators. When my kids (2nd, [...]


Related posts:<ol><li><a href='http://khason.net/blog/how-to-pass-technical-interview-in-better-place/' rel='bookmark' title='Permanent Link: How to pass technical interview in Better Place'>How to pass technical interview in Better Place</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Today, I want to write blog post which is absolutely not related to programming. It related to math and education in general those days. During <a href="http://khason.net/tech/brilliant-yet-simple-technical-questions-can-be-used-for-work-interview/" target="_blank">work interviews</a>, I see a lot of people, who was absolutely unable to calculate mentally. They just can’t understand, that it’s possible to do without calculators. When my kids (2nd, 6th and 7th grade) were small I taught them to play with numbers, and until 4th grade (bigger kids) they were able do it. but then school teachers “killed” this ability. Why people should use calculator for simple math operations, if he can do it mentally? Shame you, the modern educational system. Let’s go back and try to understand how people were able to live without devil devices, such as calculators…</p>
<p>Following the paint of <a href="http://en.wikipedia.org/wiki/Nikolai_Bogdanov-Belsky" target="_blank">Nikolai Bogdanov-Belsky</a> “Counting in their heads”. This painting is dated 1895.</p>
<p><img title="Богданов Бельский - Устный счёт" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="570" alt="Богданов Бельский - Устный счёт" src="http://khason.net/images/2009/02/image1.png" width="714" border="0" /> </p>
<p>As you can see at the painting, peasant kids trying to solve following exercise mentally:</p>
<blockquote><p>(10<sup>2</sup> + 11<sup>2</sup> + 12<sup>2</sup> + 13<sup>2</sup> + 14<sup>2</sup>) / 365</p>
</blockquote>
<p>This is not very simple exercise, especially when should be solved without your favorite calculator. However, when I was 4th grade I learned to square two-digit numbers mentally (my, and I think, yours too): <strong>First, find the nearest multiple of ten, by raising or lowering your number, then add and remove the rest to each of numbers and add the square of oddment</strong>. For example</p>
<blockquote><p>45 * 45 = (45+5) * (45-5) + (5 * 5) = 50 * 40 + 25 = (5 * 4) * 100 + 25 = 20 * 100 + 25 = 2000 + 25 = 2025      <br />14 * 14 = (14+4) * (14-4) + (4 * 4) = 18 * 10 + 16 = 180 + 16 = 196</p>
</blockquote>
<p>So, now it can be solved easily:</p>
<blockquote><p>10<sup>2</sup> = 100       <br />11<sup>2</sup>= (11+1) * (11-1) + 1 = 12 * 10 + 1 = 121      <br />12<sup>2</sup>= (12+2) * (12-2) + 4 = 14 * 10 + 4 = 144      <br />13<sup>2</sup>= (13+3) * (13-3) + 9 = 16 * 10 + 9 = 169      <br />14<sup>2</sup>= (14+4) * (14-4) + 16 = 18 * 10 + 16 = 196</p>
</blockquote>
<p>And so on… but wait, 100+121+144 already equals 365, which is our denominator. Next sequence will bring us 169+196, which is also 365. So the answer to this black board brain teaser is 2.</p>
<p>However, it can be rather complicated to calculate 86<sup>2</sup> for instance:</p>
<blockquote><p>86<sup>2</sup> = (86 + 4) * (86 – 4) + (4 * 4) = 90 * 82 + 16…</p>
</blockquote>
<p>Let’s try another way – <strong>multiple the difference between the number and 25 by 100, then add the square of the difference or excess of the number and 50</strong>. For example</p>
<blockquote><p>86<sup>2</sup> = (86 – 25) * 100 + (86 – 50)<sup>2</sup> = 61 * 100 +&#160; 36<sup>2</sup> = 6100 + (36 – 25) * 100 + (50 &#8211; 36)<sup>2</sup> = 6100 + 1100 + 14<sup>2</sup> = 7200 + 196 = 7396</p>
</blockquote>
<p>Isn’t it really simple and fun to calculate squares of numbers?</p>
<p><em>Bonus</em>: how to calculate multiple of two digit numbers with the sum of its unity digits equals to 10? </p>
<ol>
<li>Multiply first digit of the first number by 10</li>
<li>Add 1 to first digit of second number and multiply the result by 10</li>
<li>Multiply results of step 1 and step 2</li>
<li>Deduct second number and the result of step 1</li>
<li>Multiply second digit of the first number by the result of step 4</li>
<li>Add results of steps 3 and 5</li>
</ol>
<p>Looks complicated? Let’s make it easier. Assuming that first number is X = 10x + z and second number is Y = 10y + (10 – z), the formula for quick multiplication calculation is: <strong>100 * x * (y + 1) + z * (Y – 10 * x)</strong>. For example:</p>
<blockquote><p>96 * 84 = 100 * 9 * (8+1) + 6 * (84-10 * 9) = 100 * 9 * 9 + 6 * (84 – 90) = 8100 – 6 * 6 = 8100 – 36 = 8064     <br />37 * 93 = 100 * 3 * (9+1) + 7 * (93 – 10 * 3) = 3000 + 7 * 63 = 3000 + (100 * 6 * 1 + 3 * (7 – 60)) = 3000 + 600 – 3 * 53 = 3600 – 159 = 3441</p>
</blockquote>
<p>Have a nice day and be good people. Also, throw out all hardware calculators and uninstall all software <img src='http://khason.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>


<p>Related posts:<ol><li><a href='http://khason.net/blog/how-to-pass-technical-interview-in-better-place/' rel='bookmark' title='Permanent Link: How to pass technical interview in Better Place'>How to pass technical interview in Better Place</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://khason.net/blog/math-world-simple-mental-calculations-or-whats-going-on-with-education/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Bootstrapper for .NET framework version detector</title>
		<link>http://khason.net/tech/bootstrapper-for-net-framework-version-detector/</link>
		<comments>http://khason.net/tech/bootstrapper-for-net-framework-version-detector/#comments</comments>
		<pubDate>Wed, 04 Feb 2009 17:22:26 +0000</pubDate>
		<dc:creator>Tamir</dc:creator>
				<category><![CDATA[TECH]]></category>
		<category><![CDATA[.NET 3.5]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[DEV]]></category>
		<category><![CDATA[download]]></category>
		<category><![CDATA[Interop]]></category>
		<category><![CDATA[My tools]]></category>
		<category><![CDATA[promo]]></category>
		<category><![CDATA[soft]]></category>
		<category><![CDATA[Tips and Tricks]]></category>
		<category><![CDATA[Vista]]></category>
		<category><![CDATA[VSTS]]></category>
		<category><![CDATA[Work process]]></category>
		<category><![CDATA[WPF]]></category>
		<category><![CDATA[XNA]]></category>

		<guid isPermaLink="false">http://khason.net/tech/bootstrapper-for-net-framework-version-detector/</guid>
		<description><![CDATA[You wrote your .NET program, that can be used as stand alone portable application (such as it should be for Smart Client Apps), however you have to be sure, that necessary prerequisites (such as .NET framework) are installed on client’s machine. What to do? How to detect .NET framework version installed on target machine before [...]


Related posts:<ol><li><a href='http://khason.net/tech/some-new-in-mix-downloads/' rel='bookmark' title='Permanent Link: Some new in-mix downloads'>Some new in-mix downloads</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>You wrote your .NET program, that can be used as stand alone portable application (such as it should be for Smart Client Apps), however you have to be sure, that necessary prerequisites (such as .NET framework) are installed on client’s machine. What to do? How to detect .NET framework version installed on target machine before running .NET application. The answer is – to use unmanaged C++ bootstrapper, that invoke your application if correct version of framework is installed.</p>
<p><a title=".NET Framework Detector" href="http://khason.net/images/2009/02/whoooot.exe" target="_blank" rel="enclosure"><img title=".NET framework vrsion detector" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="212" alt=".NET framework vrsion detector" src="http://khason.net/images/2009/02/image.png" width="310" border="0" /></a> </p>
<p>Until now there are 15 possible .NET frameworks can be installed on client’s machine. Here the table of possible and official supported versions, <a href="http://support.microsoft.com/kb/318785" target="_blank">as appears in Q318785</a></p>
<table cellspacing="0" cellpadding="2" width="400" border="1">
<tbody>
<tr>
<td valign="top" width="200">.NET version</td>
<td valign="top" width="200">Actual version</td>
</tr>
<tr>
<td valign="top" width="200">3.5 SP1</td>
<td valign="top" width="200">3.5.30729.1</td>
</tr>
<tr>
<td valign="top" width="200">3.5</td>
<td valign="top" width="200">3.5.21022.8</td>
</tr>
<tr>
<td valign="top" width="200">3.0 SP2</td>
<td valign="top" width="200">3.0.4506.2152</td>
</tr>
<tr>
<td valign="top" width="200">3.0 SP1</td>
<td valign="top" width="200">3.0.4506.648</td>
</tr>
<tr>
<td valign="top" width="200">3.0</td>
<td valign="top" width="200">3.0.4506.30</td>
</tr>
<tr>
<td valign="top" width="200">2.0 SP2</td>
<td valign="top" width="200">2.0.50727.3053</td>
</tr>
<tr>
<td valign="top" width="200">2.0 SP1</td>
<td valign="top" width="200">2.0.50727.1433</td>
</tr>
<tr>
<td valign="top" width="200">2.0</td>
<td valign="top" width="200">2.0.50727.42</td>
</tr>
<tr>
<td valign="top" width="200">1.1 SP1</td>
<td valign="top" width="200">1.1.4322.2032</td>
</tr>
<tr>
<td valign="top" width="200">1.1 SP1 (in 32 bit version of Windows 2003)</td>
<td valign="top" width="200">1.1.4322.2300</td>
</tr>
<tr>
<td valign="top" width="200">1.1</td>
<td valign="top" width="200">1.1.4322.573</td>
</tr>
<tr>
<td valign="top" width="200">1.0 SP3</td>
<td valign="top" width="200">1.0.3705.6018</td>
</tr>
<tr>
<td valign="top" width="200">1.0 SP2</td>
<td valign="top" width="200">1.0.3705.288</td>
</tr>
<tr>
<td valign="top" width="200">1.0 SP1</td>
<td valign="top" width="200">1.0.3705.209</td>
</tr>
<tr>
<td valign="top" width="200">1.0</td>
<td valign="top" width="200">1.0.3705.0</td>
</tr>
</tbody>
</table>
<p>All of those versions are detectible by queering specific registry keys. However, in some cases, you need to load mscoree.dll and call “GETCOREVERSION” API to determine whether specific version of .NET is installed. You can read more about it <a href="http://msdn2.microsoft.com/library/ydh6b3yb.aspx" target="_blank">in MSDN</a>.</p>
<p>So it’s really simple to write small C++ application (or PowerShell applet), that queries registry and invoke your managed application. How to do this? You can either read about it in outstanding blog of <a href="http://blogs.msdn.com/astebner/archive/2009/01/31/9387659.aspx" target="_blank">Aaron Stebner</a>, who is Project Manager in XNA platform deployment team or <a href="http://khason.net/blog/action-required-smart-client-development-present-and-future/" target="_blank">attend my session next week</a> to learn do it yourself. We’ll speak about nifty ways to do it also. </p>
<p>Anyway, by now, you can use small stand alone program, I wrote a while ago, that will tell you all versions of .NET frameworks installed in target machine without any prerequisites. It can be run even from shared network location <img src='http://khason.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><a href="http://khason.net/images/2009/02/whoooot.exe" target="_blank"><strong>Download whoooot.exe (13K) &gt;&gt;</strong></a></p>
<p>See you next week. </p>
<p>PS: Do not forget to <a href="http://www.codeplex.com/SnippetEditor/" target="_blank">download and install the new version</a> of <a href="http://khason.net/blog/visual-studio-snippet-designer/" target="_blank">Visual Studio Snippet Designer</a>, which is extremely useful tool by MVP <a href="http://msmvps.com/blogs/bill/" target="_blank">Bill McCarthy</a>, you’ll need it later next week…</p>
<p>Have a nice day and be good people.</p>


<p>Related posts:<ol><li><a href='http://khason.net/tech/some-new-in-mix-downloads/' rel='bookmark' title='Permanent Link: Some new in-mix downloads'>Some new in-mix downloads</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://khason.net/tech/bootstrapper-for-net-framework-version-detector/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Line-Of-Business vs. Beautifulness or two dogmas comparison as exemplified by two Twitter applications</title>
		<link>http://khason.net/blog/line-of-business-vs-beautifulness-or-two-dogmas-comparison-as-exemplified-by-two-twitter-applications/</link>
		<comments>http://khason.net/blog/line-of-business-vs-beautifulness-or-two-dogmas-comparison-as-exemplified-by-two-twitter-applications/#comments</comments>
		<pubDate>Fri, 30 Jan 2009 08:03:48 +0000</pubDate>
		<dc:creator>Tamir</dc:creator>
				<category><![CDATA[BLOG]]></category>
		<category><![CDATA[Accessibility]]></category>
		<category><![CDATA[blogging general]]></category>
		<category><![CDATA[blogging tools]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Performance]]></category>
		<category><![CDATA[soft]]></category>
		<category><![CDATA[thoughts]]></category>
		<category><![CDATA[Tips and Tricks]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[Windows Gadgets]]></category>
		<category><![CDATA[WPF]]></category>

		<guid isPermaLink="false">http://khason.net/blog/line-of-business-vs-beautifulness-or-two-dogmas-comparison-as-exemplified-by-two-twitter-applications/</guid>
		<description><![CDATA[Today I want to speak about two dogmas: design and functional driven programming. As the example of those two approaches, I want to introduce two Twitter clients: *Chirp by thirteen23 and TwitterFox by Naan Studio
 
As you can see, *Chirp is state of art application with outstanding user interface, and well-defined usability studies. While TwitterFox [...]


Related posts:<ol><li><a href='http://khason.net/blog/book-review-c-2008-and-2005-threaded-programming/' rel='bookmark' title='Permanent Link: Book review: C# 2008 and 2005 Threaded Programming'>Book review: C# 2008 and 2005 Threaded Programming</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Today I want to speak about two dogmas: design and functional driven programming. As the example of those two approaches, I want to introduce two Twitter clients: <a href="http://www.thirteen23.com/experiences/desktop/chirp/" target="_blank">*Chirp by thirteen23</a> and <a href="http://twitterfox.net/" target="_blank">TwitterFox by Naan Studio</a></p>
<p><img title="Chirp and TwitterFox comparision" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="651" alt="Chirp and TwitterFox comparision" src="http://khason.net/images/2009/01/image26.png" width="664" border="0" /> </p>
<p>As you can see, *Chirp is state of art application with outstanding user interface, and well-defined usability studies. While TwitterFox is wacky grey boring kind-of-grid only. However, you cannot judge app by only how it looks like. Let’s try to understand first what’s for you need twitter client?</p>
<h3>Defining application goals by user story</h3>
<p><a href="https://twitter.com/tamir" target="_blank">I’m using twitter</a> as quick and handy business tool to write my thought, feelings and everyday events. It is not my main (not even secondary) task during the day, so I want to be able to open, write and forget. Thus, I need an application, that can be invoked by one click and dismissed after writing. Also, I do not want background application to gasp valuable space in my screen, when not in use. Thus it should be background process with reduced workset and one textarea, to be focused when the main window become active. Also the application should hide itself when unfocus, yet be able to notify me about events without disturbing. </p>
<p>Let’s see how it done in *Chirp:</p>
<ul>
<li>140MB workset</li>
<li>No ability to hide</li>
<li>Bouncing thingy at left upper corner to disturb you – it designed as you main desktop beautifier.</li>
<li>No ability to know that new twittes arrived without showing main window</li>
<li>Twit process required to click additional button (named “Update” for some reason)</li>
<li>If you not finished typing, you can either dismiss all text of post it.</li>
<li>Strange 140 characters countdown on background absolutely esthetical, yet very disturbing.</li>
<li>You cannot type more, then 140 characters – this restricted by textbox. If pasted bigger text all additional characters truncated.</li>
<li>You need mouse to operate an application</li>
</ul>
<p>Now TwitterFox:</p>
<ul>
<li>10MB workset</li>
<li>You can hide it by hitting escape or clicking X button</li>
<li>Small and portable without disturbing elements – it not designed as your main everyday app.</li>
<li>New twits counter over small icon in browser tray, all other notifications can be disabled</li>
<li>Once focused text are become active, expanded automatically and ready to write</li>
<li>If you’re hiding it without clearing area, all un write text remains – you can clear it by one click</li>
<li>Small 140 characters countdown which is visible only when typing</li>
<li>You can type more, then 140 characters – counter becomes red, and you cannot post, however you’re able to fix, by dismissing unnecessary spaces or characters.</li>
<li>Can be operated by only keyboard.</li>
</ul>
<p><strong>Bottom line</strong>: *Chirp designed to show how good it looks, while TwitterFox to twit only. Thus for my specific user story TwitterFox won!</p>
<h3>Defining functional specifications</h3>
<p>Next task defined for Twitter is read other twits. I used to read all my following and followers when I have free minute. Sometimes I retwit things, rather often reply followers and read replies and rarely send direct messages. </p>
<p>*Chirp provides twit area without scrollbar, yet not restricted to number of twits. Other words, you can scroll with mouse wheel only or by holding somewhere inside and dragging unlimited up and down. When the mouse is over specific twit, it fades and show three buttons: reply, direct and retwit. Also each twit contains the name of the client was used (just like in regular web interface). When clicking user avatar it brings to special internal screen with last twit of the user, information and statistics about him, three functional buttons: UnFollow, Fave and Block and huge button Get User’s Tweets. When clicking the line displays the time of the twit it puts twit url into clipboard.</p>
<p>Also *Chirp contains five main functional buttons: Faves, Home, Direct, Update and Refresh. When Home tab unfocused (for example you’re on other screen), it also displays a number of new twits. </p>
<p>Error screen of *Chirp is really odd. It contains everything you not really need to know and beautiful whales moving on screen.</p>
<p><img title="WTF?" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="458" alt="WTF?" src="http://khason.net/images/2009/01/image27.png" width="305" border="0" /> </p>
<p>TwitterFox is much simpler. It contains two buttons on mouse/keyboard over – reply and fave. When clicking on user’s avatar it opens it’s page in Twitter with all necessary information. Main TwitterFox window contains three buttons: Recent, Replies, Messages.</p>
<p>No doubt, that *Chirp provides much richer functional spec, but wait, am I really need all this? I told earlier, that I used to read twits and replies, while *Chirp has no such view at all. You can easy copy twit url into clipboard, but what for? Also, you can read&#160; bio and statistics of people you following whenever you want without opening browser window. But how often you’re doing that?</p>
<p>TwitterFox concentrated on functionality – twit, read, reply, read replies (and direct messages) – base tasks , Twitter designed for. It also marks replies with contrast color in public timeline, while *Chirp has inline reply functionality with threaded discussions support (which is very odd for Twitter)</p>
<p><strong>Bottom line</strong>: *Chirp is enriched with not useful features, while TwitterFox contains only things, you’re use. Thus for my specific functional requirements TwitterFox won again!</p>
<h3>Developers vs. Designers final round</h3>
<p>So, we already understand, that *Chirp is an application, designed to show how skilled <a href="http://www.thirteen23.com/" target="_blank">thirteen23</a> designers are. And it achieved this goal. The application is state-of-art, looks and designed very well with taking into account even small details, however it huge, unusable for everyday twittering and extremely slow. This is a general example about Designers’ doctrine.</p>
<p>TwitterFox is very ugly, but concentrated on functionality, tiny and reactive. It includes only features are necessary for twittering and has no other goals. So, this is a general example about Developers’ doctrine.</p>
<p>Is it possible to messmate those doctrines? Probably it is. And it is really simple. Each one of actors should do his own work. Designers should design and Developers – develop. I spoke about it a lot during my lectures, I’ll speak about it also at <a href="http://khason.net/blog/action-required-smart-client-development-present-and-future/" target="_blank">11th February in user group meeting</a>. By now, when you know how I see Twitter, <a href="https://twitter.com/tamir" target="_blank">you can start following me</a>. Also, I’m interesting to hear your ideas about Designer-Developer intercommunication. It is not just about Microsoft way <img src='http://khason.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><img title="Designer and Developer - Microsoft way" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="207" alt="Designer and Developer - Microsoft way" src="http://khason.net/images/2009/01/image28.png" width="419" border="0" /> </p>
<p>Have a nice day and be good people.</p>


<p>Related posts:<ol><li><a href='http://khason.net/blog/book-review-c-2008-and-2005-threaded-programming/' rel='bookmark' title='Permanent Link: Book review: C# 2008 and 2005 Threaded Programming'>Book review: C# 2008 and 2005 Threaded Programming</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://khason.net/blog/line-of-business-vs-beautifulness-or-two-dogmas-comparison-as-exemplified-by-two-twitter-applications/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Making TFS better or what is TITS?</title>
		<link>http://khason.net/tech/making-tfs-better-or-what-is-tits/</link>
		<comments>http://khason.net/tech/making-tfs-better-or-what-is-tits/#comments</comments>
		<pubDate>Tue, 27 Jan 2009 17:42:07 +0000</pubDate>
		<dc:creator>Tamir</dc:creator>
				<category><![CDATA[TECH]]></category>
		<category><![CDATA[.NET 3.5]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[DEV]]></category>
		<category><![CDATA[My tools]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[soft]]></category>
		<category><![CDATA[source]]></category>
		<category><![CDATA[Tips and Tricks]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[Visual Studio]]></category>
		<category><![CDATA[VSTS]]></category>

		<guid isPermaLink="false">http://khason.net/tech/making-tfs-better-or-what-is-tits/</guid>
		<description><![CDATA[Those days me and my team work very hard toward new version of “The System”. This includes massive refactoring of all solutions, hard work with TFS (which not restricted to only adding files, but also deleting, moving, etc. other words, all stuff, which TFS is not really love). Because of this, we need a bunch [...]


Related posts:<ol><li><a href='http://khason.net/itpro/tfs-licensing-model-demystification-or-what-should-i-buy-for-my-company-in-order-not-to-step-on-the-licensing-mine/' rel='bookmark' title='Permanent Link: TFS licensing model demystification or what should I buy for my company in order not to step on the licensing mine?'>TFS licensing model demystification or what should I buy for my company in order not to step on the licensing mine?</a></li>
<li><a href='http://khason.net/tech/zone-of-pain-vs-zone-of-uselessness-or-code-analysis-with-ndepend/' rel='bookmark' title='Permanent Link: &ldquo;Zone of Pain vs. Zone of Uselessness&rdquo; or code analysis with NDepend'>&ldquo;Zone of Pain vs. Zone of Uselessness&rdquo; or code analysis with NDepend</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Those days me and my team work very hard toward new version of “The System”. This includes massive refactoring of all solutions, hard work with TFS (which not restricted to only adding files, but also deleting, moving, etc. other words, all stuff, which TFS is not really love). Because of this, we need a bunch of handy tools to make our dreams come true and to decrease unnecessary number of clicks inside Team System Explorer and Visual Studio. You do not really think, that we have no tools to make our everyday job easier. We have. However, we never package and release it. Let me introduce “<strong>TITS” – T</strong>ools, <strong>I</strong>nvaluable for <strong>T</strong>eam <strong>S</strong>ystem. This suite I’m planning to release as another open source project within couple of months.</p>
<p><img title="TITS - Tools, Invaluable for Team System" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="498" alt="TITS - Tools, Invaluable for Team System" src="http://khason.net/images/2009/01/image19.png" width="632" border="0" /> </p>
<p>What “TITS” includes? First of all &#8211; </p>
<h3>“QOF” – Quick Open File</h3>
<p><img title="QOF - Quick Open File" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="550" alt="QOF - Quick Open File" src="http://khason.net/images/2009/01/image20.png" width="562" border="0" /> </p>
<p>This tools is absolutely invaluable if you have big solutions. While all it knows to do is to search. But, wait, what’s wrong with build-in search of Visual Studio? First of all, it does not search Solution items and files, are in solution directory, but not in project. Also it cannot fix your typos and errors. Also it does not know to move you quickly to found solution item in Solution Explorer or in Source Editor.</p>
<p>Basic set of QOF features:</p>
<ul>
<li>No mouse &#8211; open any file</li>
<li>No mouse – locate any file in solution explorer</li>
<li>Highlighting found items</li>
<li>Multiple files open</li>
<li>Filter by source files only, resources, owner or any other kind of filters</li>
<li>Search inside TFS, including history, changesets, shelves (either private and public)</li>
<li>…and much much more</li>
</ul>
<p>Next tool is:</p>
<h3>“WIBREW” – Who Is Breaking What</h3>
<p><img title="WIBREW - Who is breaking what" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="181" alt="WIBREW - Who is breaking what" src="http://khason.net/images/2009/01/image21.png" width="372" border="0" /> </p>
<p>Absolutely invaluable tool to know who actually breaking what file inside TFS. For example, I do not want to lock files, while I still want to know who holds what file. TFS provides such feature out-of-the-box, however from command prompt only. You can add it even as macro. Like this:</p>
<p><img title="WIBREW for poor people" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="451" alt="WIBREW for poor people" src="http://khason.net/images/2009/01/image22.png" width="464" border="0" /> </p>
<p>However it not user friendly and impossible for use, ‘cos it looks as following:</p>
<p><img title="WIBREW for poor people in action" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="308" alt="WIBREW for poor people in action" src="http://khason.net/images/2009/01/image23.png" width="387" border="0" /> </p>
<p>You do not know what actually developer doing, where and why. With “WIBREW”, you can know:</p>
<ul>
<li>When developer started to break files</li>
<li>What exactly he’s doing</li>
<li>Is the breaking file locked or now</li>
<li>Where the developer breaks it (workspace and computer name of the user)</li>
<li>…and much much more</li>
</ul>
<p>Another tool is:</p>
<h3>“WITCH” – What I have To Check-in</h3>
<p>If you ever worked with Team Force, you know what this tool is doing. It shows you a preview of all <strong>changed</strong> files, you’ll check-in. For some reason, TFS has no such feature. Let’s imagine, that your work method is to check out everything, change something and check-in only changed files. Until here TFS does everything, however if you want to preview changeset (for example in order to compare with “WIBREW” output), you can not. Here “WITCH” comes to help. </p>
<blockquote><p><em>[Here should be a screenshot of “WITCH”, but it looks exactly the same as “WIBREW” with shameless blurring]</em></p>
</blockquote>
<p>Another invaluable tool is:</p>
<h3>“VOCUS” – VOid CUstom Settings for check in</h3>
<p>This tool is absolutely UI-less. It allows developers to work with their own custom settings in Visual Studio, while for check-in and check-out it format all documents, according predefined custom settings (for example indentation). How many times, you tried to merge files, when all the difference is indentation it tab size? Well, this tool solves this problem.</p>
<p><img title="VOCUS – VOid CUstom Settings for check in" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="329" alt="VOCUS – VOid CUstom Settings for check in" src="http://khason.net/images/2009/01/image24.png" width="633" border="0" /> </p>
<p>It stores custom settings for each user (BTW, it also makes able for each developer to restore his settings fluently in any computer) and reformat documents on check-in action toward corporate settings, when on check-out toward custom developer’s setting.</p>
<h3>“SHMOC” – SHow MOre Code</h3>
<p>This is not actually tool, works with TFS. It rather works with your Visual Studio Development Environment. It’s UI-less as well and makes able to hide and restore all docking windows in VS. It makes you able to write in “Dark Room” mode (which is full screen, distraction free environment) and return to Visual Studio within one button press. It can also change VS color scheme, if required.</p>
<p><img title="“SHMOC” – SHow MOre Code" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="309" alt="“SHMOC” – SHow MOre Code" src="http://khason.net/images/2009/01/image25.png" width="639" border="0" /> </p>
<p>There are some other tools should be inside this suite, however, I still have no names for them <img src='http://khason.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Also, if you have something interesting, and you want to contribute it to this suite, you’re highly welcome.</p>
<p><em>PS</em>: This blog is about code, but this post is 6th in row without even one line of code, so I have to fix it as soon as possible. Thus, I’ll example how WIBREW works under the hood. Other words, small example of how to work with TFS API from Visual Studio plugin.</p>
<p>First of all, as in any VS plugin, you need to acquire DTE2 application object:</p>
<blockquote><p>_applicationObject = (DTE2)application;     <br />_addInInstance = (AddIn)addInInst;</p>
</blockquote>
<p>When you have it, you need to detect what TFS server you’re working with and what are user credentials for this session. The common problem of WIBREW for poor men, was how to work with this tool over VPN (when your connected session is only inside VS). So each time, you tried to run it, you had to enter your domain credentials – very inconvenience way of work. </p>
<p>In order to prevent it, let’s ask your environment about Team Foundation information:</p>
<blockquote><p>private TeamFoundationServerExt _tfsExt;     <br />…      <br />_tfsExt = (TeamFoundationServerExt)_applicationObject.GetObject(&quot;Microsoft.VisualStudio.TeamFoundation.TeamFoundationServerExt&quot;);</p>
</blockquote>
<p>Also, you can be notified when your work project context was changed. To do this, just subscribe to ProjectContextChanged event and handle it inside:</p>
<blockquote><p>_tfsExt.ProjectContextChanged += OnProjectContextChanged;     <br />…      <br />public void OnProjectContextChanged(object sender, EventArgs e) {      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; if (!string.IsNullOrEmpty(_tfsExt.ActiveProjectContext.ProjectName)) {</p>
</blockquote>
<p>Now when we know, that we have out active project context, all we have to do is to ask about changes</p>
<blockquote><p>private VersionControlExt _vcExt;     <br />…      <br />_vcExt = (VersionControlExt)_applicationObject.GetObject(&quot;Microsoft.VisualStudio.TeamFoundation.VersionControl.VersionControlExt&quot;);</p>
</blockquote>
<p>Inside VersionControlExt object you have following self-descriptive properties and methods: FindChangeSet, History, PendingChanges, SolutionWorkspace etc. however it works only with TFS solution explorer. To handle pending changes for the project without tickling TFS, we can use it internal methods. All the difference is with references. To work with Visual Studio TFS explorer methods, you should reference:   <br />Microsoft.VisualStudio.TeamFoundation.dll, Microsoft.VisualStudio.TeamFoundation.Client.dll and Microsoft.VisualStudio.TeamFoundation.VersionControl.dll, while working with TFS API directly, use Microsoft.TeamFoundation.dll, Microsoft.TeamFoundation.Client.dll and Microsoft.TeamFoundation.VersionControl.dll from [PROGRAM FILES]\Microsoft Visual Studio 9.0\Common7\IDE\PrivateAssemblies\. Just like this:</p>
<blockquote><pre>VersionControlServer _vcs…_vcs = (VersionControlServer)_server.GetService(typeof(VersionControlServer));…var _sets = _vcs.QueryPendingSets( new[] { new ItemSpec(serverPath, RecursionType.Full) }, null, null);…foreach (PendingSet set in sets) {…
//Get everything you need here</pre>
</blockquote>
<p>We done. It’s very easy to work with Team System from inside Visual Studio. Also it’s very easy to build useful tools, not built by Microsoft for some reason <img src='http://khason.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Have a nice day, be good people and wait for me to beatify sources before releasing as another <a title="Open Source licenses comparison table" href="http://khason.net/blog/open-source-licenses-comparison-table/" target="_blank" rel="dofollow">Open Source</a> application. </p>


<p>Related posts:<ol><li><a href='http://khason.net/itpro/tfs-licensing-model-demystification-or-what-should-i-buy-for-my-company-in-order-not-to-step-on-the-licensing-mine/' rel='bookmark' title='Permanent Link: TFS licensing model demystification or what should I buy for my company in order not to step on the licensing mine?'>TFS licensing model demystification or what should I buy for my company in order not to step on the licensing mine?</a></li>
<li><a href='http://khason.net/tech/zone-of-pain-vs-zone-of-uselessness-or-code-analysis-with-ndepend/' rel='bookmark' title='Permanent Link: &ldquo;Zone of Pain vs. Zone of Uselessness&rdquo; or code analysis with NDepend'>&ldquo;Zone of Pain vs. Zone of Uselessness&rdquo; or code analysis with NDepend</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://khason.net/tech/making-tfs-better-or-what-is-tits/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
	</channel>
</rss>
