<?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>GammaTwo</title>
	<atom:link href="http://www.gammatwo.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.gammatwo.com</link>
	<description>Born to be coder</description>
	<lastBuildDate>Tue, 12 Jul 2011 09:25:23 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>DHL Fail</title>
		<link>http://www.gammatwo.com/2011/07/12/dhl-fail/</link>
		<comments>http://www.gammatwo.com/2011/07/12/dhl-fail/#comments</comments>
		<pubDate>Tue, 12 Jul 2011 09:19:39 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Other]]></category>
		<category><![CDATA[Fail]]></category>

		<guid isPermaLink="false">http://www.gammatwo.com/?p=412</guid>
		<description><![CDATA[Nice Tracking&#8230;]]></description>
			<content:encoded><![CDATA[<!-- AdSense Now! V1.64 -->
<!-- Post[count: 3] -->
<div class="adsense adsense-leadin" style="text-align:center;margin: 12px;"><script type="text/javascript"><!--
google_ad_client = "pub-8666602824020947";
/* 468x60, gammatwo */
google_ad_slot = "0584674544";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></div><p>Nice Tracking&#8230;</p>
<p><a href="http://www.gammatwo.com/wp-content/uploads/2011/07/dhl_fail2.png"><img src="http://www.gammatwo.com/wp-content/uploads/2011/07/dhl_fail2.png" alt="" title="dhl_fail" width="625" height="588" class="aligncenter size-full wp-image-420" /></a></p>
<p><a class="a2a_button_digg" href="http://www.addtoany.com/add_to/digg?linkurl=http%3A%2F%2Fwww.gammatwo.com%2F2011%2F07%2F12%2Fdhl-fail%2F&amp;linkname=DHL%20Fail" title="Digg" rel="nofollow" target="_blank"><img src="http://www.gammatwo.com/wp-content/plugins/add-to-any/icons/digg.png" width="16" height="16" alt="Digg"/></a><a class="a2a_button_twitter" href="http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fwww.gammatwo.com%2F2011%2F07%2F12%2Fdhl-fail%2F&amp;linkname=DHL%20Fail" title="Twitter" rel="nofollow" target="_blank"><img src="http://www.gammatwo.com/wp-content/plugins/add-to-any/icons/twitter.png" width="16" height="16" alt="Twitter"/></a><a class="a2a_button_technorati_favorites" href="http://www.addtoany.com/add_to/technorati_favorites?linkurl=http%3A%2F%2Fwww.gammatwo.com%2F2011%2F07%2F12%2Fdhl-fail%2F&amp;linkname=DHL%20Fail" title="Technorati Favorites" rel="nofollow" target="_blank"><img src="http://www.gammatwo.com/wp-content/plugins/add-to-any/icons/technorati.png" width="16" height="16" alt="Technorati Favorites"/></a><a class="a2a_button_delicious" href="http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fwww.gammatwo.com%2F2011%2F07%2F12%2Fdhl-fail%2F&amp;linkname=DHL%20Fail" title="Delicious" rel="nofollow" target="_blank"><img src="http://www.gammatwo.com/wp-content/plugins/add-to-any/icons/delicious.png" width="16" height="16" alt="Delicious"/></a><a class="a2a_button_google_bookmarks" href="http://www.addtoany.com/add_to/google_bookmarks?linkurl=http%3A%2F%2Fwww.gammatwo.com%2F2011%2F07%2F12%2Fdhl-fail%2F&amp;linkname=DHL%20Fail" title="Google Bookmarks" rel="nofollow" target="_blank"><img src="http://www.gammatwo.com/wp-content/plugins/add-to-any/icons/google.png" width="16" height="16" alt="Google Bookmarks"/></a><a class="a2a_button_dzone" href="http://www.addtoany.com/add_to/dzone?linkurl=http%3A%2F%2Fwww.gammatwo.com%2F2011%2F07%2F12%2Fdhl-fail%2F&amp;linkname=DHL%20Fail" title="DZone" rel="nofollow" target="_blank"><img src="http://www.gammatwo.com/wp-content/plugins/add-to-any/icons/dzone.png" width="16" height="16" alt="DZone"/></a><a class="a2a_button_yahoo_bookmarks" href="http://www.addtoany.com/add_to/yahoo_bookmarks?linkurl=http%3A%2F%2Fwww.gammatwo.com%2F2011%2F07%2F12%2Fdhl-fail%2F&amp;linkname=DHL%20Fail" title="Yahoo Bookmarks" rel="nofollow" target="_blank"><img src="http://www.gammatwo.com/wp-content/plugins/add-to-any/icons/yahoo.png" width="16" height="16" alt="Yahoo Bookmarks"/></a><a class="a2a_button_facebook" href="http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Fwww.gammatwo.com%2F2011%2F07%2F12%2Fdhl-fail%2F&amp;linkname=DHL%20Fail" title="Facebook" rel="nofollow" target="_blank"><img src="http://www.gammatwo.com/wp-content/plugins/add-to-any/icons/facebook.png" width="16" height="16" alt="Facebook"/></a><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.gammatwo.com%2F2011%2F07%2F12%2Fdhl-fail%2F&amp;title=DHL%20Fail" id="wpa2a_2">Share/Save</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.gammatwo.com/2011/07/12/dhl-fail/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SourceGrid with Columns Drag and Swap &#8211; a grid all C# for .NET 2.0</title>
		<link>http://www.gammatwo.com/2011/02/01/sourcegrid-with-columns-drag-and-swap/</link>
		<comments>http://www.gammatwo.com/2011/02/01/sourcegrid-with-columns-drag-and-swap/#comments</comments>
		<pubDate>Tue, 01 Feb 2011 01:41:49 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[.NET 2.0]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[DataGrid]]></category>
		<category><![CDATA[Library]]></category>

		<guid isPermaLink="false">http://www.gammatwo.com/?p=397</guid>
		<description><![CDATA[Last night I discovery SourceGrid is not stopped on .NET 1.1, Davide Icardi version, but it&#8217;s maintained by dariusdamalakas (I don&#8217;t know if he&#8217;s the same guy, I think no), however is a great grid, but there was something missing really important for my project, lucky for me it&#8217;s quite simple to do, I need [...]]]></description>
			<content:encoded><![CDATA[<p>Last night I discovery SourceGrid is not stopped on .NET 1.1, Davide Icardi version, but it&#8217;s maintained by dariusdamalakas (I don&#8217;t know if he&#8217;s the same guy, I think no), however is a great grid, but there was something missing really important for my project, lucky for me it&#8217;s quite simple to do, I need a columns drag and reorder or drag and swap reordering functionality.</p>
<p>First attempt [at the end failed] was to build a Controller for dragging headers, and it was working, but I cannot find a nice way to call column Swap and redraw header under mouse without changing more code that I was think it was a good code.<br />
If I write too much code to do simple task, there&#8217;s a voice in me that tell me I&#8217;m wrong on what I&#8217;ve done.</p>
<p>So, trashed all tests, I prefer to keep original code &#8220;as is&#8221; and inherit original object:</p>
<p>* override OnMouseDown and save dragged column header<br />
* override OnMouseMove to set destination column header by moving pointer<br />
* override OnMouseUp to set final destination column header<br />
* override OnPaint to redraw destination column header by moving pointer with a nice veil of transparent white</p>
<p> here a snapshot of result:</p>
<p><a href="http://www.gammatwo.com/wp-content/uploads/2011/02/sourcegrid_dragnswap.png"><img src="http://www.gammatwo.com/wp-content/uploads/2011/02/sourcegrid_dragnswap-300x190.png" alt="" title="sourcegrid_dragnswap" width="300" height="190" class="aligncenter size-medium wp-image-398" /></a></p>
<p>and here is the code:</p>
<pre class="brush:csharp">
using System;
using System.Drawing;

namespace SourceGrid_ColumnDragNSwap
{
    public class SourceGrid_ColumnDragNSwap:SourceGrid.DataGrid
    {
        int draggingColumn = -1;
        int targetColumn = -1;
        protected override void OnMouseDown(System.Windows.Forms.MouseEventArgs e)
        {
            base.OnMouseDown(e);

            draggingColumn = -1;
            if (e.Button == System.Windows.Forms.MouseButtons.Left)
                if (this.MouseCellPosition.Row == 0) // header
                    draggingColumn = this.MouseCellPosition.Column;
        }

        protected override void OnMouseMove(System.Windows.Forms.MouseEventArgs e)
        {
            base.OnMouseMove(e);
            if (draggingColumn != -1)
            {
                int newTargetColumn = this.PositionAtPoint(e.Location).Column;
                if (targetColumn != newTargetColumn)
                {
                    targetColumn = newTargetColumn;
                    // Invalidate to redraw all header cells
                    if (targetColumn != -1) this.InvalidateRange(new SourceGrid.Range(0, 0, 0, this.Columns.Count - 1));
                }
            }
        }

        protected override void OnMouseUp(System.Windows.Forms.MouseEventArgs e)
        {
            base.OnMouseUp(e);

            if (draggingColumn != -1)
            {
                targetColumn = this.PositionAtPoint(e.Location).Column;
                if (targetColumn != -1)
                {
                    //Swap Columns
                    if (targetColumn != draggingColumn) this.Columns.Swap(targetColumn, draggingColumn);
                    targetColumn = -1;
                }
                draggingColumn = -1;
            }
        }

        private Brush whiteVeilBrush = new SolidBrush(Color.FromArgb(150, Color.White));
        private Rectangle cellVeilRectangle = new Rectangle();
        protected override void OnPaint(System.Windows.Forms.PaintEventArgs e)
        {
            base.OnPaint(e);
            //Paint over target header cell a white veil
            if (draggingColumn != -1 &#038;&#038; targetColumn != -1 &#038;&#038; draggingColumn != targetColumn)
            {
                Rectangle currentCellRectangle = this.PositionToRectangle(new SourceGrid.Position(0, targetColumn));
                cellVeilRectangle.X = currentCellRectangle.X;
                cellVeilRectangle.Y = currentCellRectangle.Y;
                cellVeilRectangle.Width = currentCellRectangle.Width - 2;
                cellVeilRectangle.Height = currentCellRectangle.Height - 1;
                e.Graphics.FillRectangle(whiteVeilBrush, cellVeilRectangle);
            }
        }
    }
}
</pre>
<p>My source with test project is <a href='http://www.gammatwo.com/wp-content/uploads/2011/02/SourceGrid_ColumnDragNSwap.zip'>here</a></p>
<p>This work is based on <strong>SourceGrid</strong>:<br />
Last source on <a href="https://bitbucket.org/dariusdamalakas/sourcegrid">https://bitbucket.org/dariusdamalakas/sourcegrid</a><br />
Main site is <a href="http://sourcegrid.codeplex.com/">http://sourcegrid.codeplex.com/</a> </p>
<p>A great thing about SourceGrid, that&#8217;s all C# managed code, I want to try to see what happens on Mono&#8230;</p>
<p><a class="a2a_button_digg" href="http://www.addtoany.com/add_to/digg?linkurl=http%3A%2F%2Fwww.gammatwo.com%2F2011%2F02%2F01%2Fsourcegrid-with-columns-drag-and-swap%2F&amp;linkname=SourceGrid%20with%20Columns%20Drag%20and%20Swap%20%26%238211%3B%20a%20grid%20all%20C%23%20for%20.NET%202.0" title="Digg" rel="nofollow" target="_blank"><img src="http://www.gammatwo.com/wp-content/plugins/add-to-any/icons/digg.png" width="16" height="16" alt="Digg"/></a><a class="a2a_button_twitter" href="http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fwww.gammatwo.com%2F2011%2F02%2F01%2Fsourcegrid-with-columns-drag-and-swap%2F&amp;linkname=SourceGrid%20with%20Columns%20Drag%20and%20Swap%20%26%238211%3B%20a%20grid%20all%20C%23%20for%20.NET%202.0" title="Twitter" rel="nofollow" target="_blank"><img src="http://www.gammatwo.com/wp-content/plugins/add-to-any/icons/twitter.png" width="16" height="16" alt="Twitter"/></a><a class="a2a_button_technorati_favorites" href="http://www.addtoany.com/add_to/technorati_favorites?linkurl=http%3A%2F%2Fwww.gammatwo.com%2F2011%2F02%2F01%2Fsourcegrid-with-columns-drag-and-swap%2F&amp;linkname=SourceGrid%20with%20Columns%20Drag%20and%20Swap%20%26%238211%3B%20a%20grid%20all%20C%23%20for%20.NET%202.0" title="Technorati Favorites" rel="nofollow" target="_blank"><img src="http://www.gammatwo.com/wp-content/plugins/add-to-any/icons/technorati.png" width="16" height="16" alt="Technorati Favorites"/></a><a class="a2a_button_delicious" href="http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fwww.gammatwo.com%2F2011%2F02%2F01%2Fsourcegrid-with-columns-drag-and-swap%2F&amp;linkname=SourceGrid%20with%20Columns%20Drag%20and%20Swap%20%26%238211%3B%20a%20grid%20all%20C%23%20for%20.NET%202.0" title="Delicious" rel="nofollow" target="_blank"><img src="http://www.gammatwo.com/wp-content/plugins/add-to-any/icons/delicious.png" width="16" height="16" alt="Delicious"/></a><a class="a2a_button_google_bookmarks" href="http://www.addtoany.com/add_to/google_bookmarks?linkurl=http%3A%2F%2Fwww.gammatwo.com%2F2011%2F02%2F01%2Fsourcegrid-with-columns-drag-and-swap%2F&amp;linkname=SourceGrid%20with%20Columns%20Drag%20and%20Swap%20%26%238211%3B%20a%20grid%20all%20C%23%20for%20.NET%202.0" title="Google Bookmarks" rel="nofollow" target="_blank"><img src="http://www.gammatwo.com/wp-content/plugins/add-to-any/icons/google.png" width="16" height="16" alt="Google Bookmarks"/></a><a class="a2a_button_dzone" href="http://www.addtoany.com/add_to/dzone?linkurl=http%3A%2F%2Fwww.gammatwo.com%2F2011%2F02%2F01%2Fsourcegrid-with-columns-drag-and-swap%2F&amp;linkname=SourceGrid%20with%20Columns%20Drag%20and%20Swap%20%26%238211%3B%20a%20grid%20all%20C%23%20for%20.NET%202.0" title="DZone" rel="nofollow" target="_blank"><img src="http://www.gammatwo.com/wp-content/plugins/add-to-any/icons/dzone.png" width="16" height="16" alt="DZone"/></a><a class="a2a_button_yahoo_bookmarks" href="http://www.addtoany.com/add_to/yahoo_bookmarks?linkurl=http%3A%2F%2Fwww.gammatwo.com%2F2011%2F02%2F01%2Fsourcegrid-with-columns-drag-and-swap%2F&amp;linkname=SourceGrid%20with%20Columns%20Drag%20and%20Swap%20%26%238211%3B%20a%20grid%20all%20C%23%20for%20.NET%202.0" title="Yahoo Bookmarks" rel="nofollow" target="_blank"><img src="http://www.gammatwo.com/wp-content/plugins/add-to-any/icons/yahoo.png" width="16" height="16" alt="Yahoo Bookmarks"/></a><a class="a2a_button_facebook" href="http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Fwww.gammatwo.com%2F2011%2F02%2F01%2Fsourcegrid-with-columns-drag-and-swap%2F&amp;linkname=SourceGrid%20with%20Columns%20Drag%20and%20Swap%20%26%238211%3B%20a%20grid%20all%20C%23%20for%20.NET%202.0" title="Facebook" rel="nofollow" target="_blank"><img src="http://www.gammatwo.com/wp-content/plugins/add-to-any/icons/facebook.png" width="16" height="16" alt="Facebook"/></a><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.gammatwo.com%2F2011%2F02%2F01%2Fsourcegrid-with-columns-drag-and-swap%2F&amp;title=SourceGrid%20with%20Columns%20Drag%20and%20Swap%20%26%238211%3B%20a%20grid%20all%20C%23%20for%20.NET%202.0" id="wpa2a_4">Share/Save</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.gammatwo.com/2011/02/01/sourcegrid-with-columns-drag-and-swap/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Share HP Deskjet 1280 from Windows XP to Windows 7</title>
		<link>http://www.gammatwo.com/2011/01/27/share-hp-deskjet-1280-from-windows-xp-to-windows-7/</link>
		<comments>http://www.gammatwo.com/2011/01/27/share-hp-deskjet-1280-from-windows-xp-to-windows-7/#comments</comments>
		<pubDate>Thu, 27 Jan 2011 00:29:35 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Windows]]></category>
		<category><![CDATA[Printer]]></category>

		<guid isPermaLink="false">http://www.gammatwo.com/?p=385</guid>
		<description><![CDATA[Consider this scenario: * HP Deskjet 1280 on USB on a Windows XP machine * Windows 7 machine * We want to share HP Deskjet 1280 and use from Windows 7 machine the thing seems very simple, but at the end seem really impossible, and finally a compromise that works so, let go by step, [...]]]></description>
			<content:encoded><![CDATA[<p>Consider this scenario:</p>
<p>* HP Deskjet 1280 on USB on a Windows XP machine<br />
* Windows 7 machine<br />
* We want to share HP Deskjet 1280 and use from Windows 7 machine</p>
<p>the thing seems very simple, but at the end seem really impossible, and finally a compromise that works</p>
<p>so, let go by step, I want to tell you all story:</p>
<p><strong>First &#8220;What The Hell&#8221; Path and Fail</strong><br />
* activate printer share in Windows XP<br />
* browse network from Windows 7<br />
* find our shared printer<br />
* double click to install<br />
* Windows 7 says it has no driver<br />
* uhm<br />
* Yeah, it&#8217;s simple, let&#8217;s click Windows Update to check new driver availability &#8230; hours of waiting<br />
* No driver again<br />
* uhm<br />
* Well, let&#8217;s go to HP web site, navigate to HP support web site and download manually drivers for HP Deskjet 1280<br />
* web site says that the driver is included in Windows 7, no manual download available<br />
* and now? </p>
<p><strong>Second &#8220;What The Hell&#8221; Path and Fail</strong><br />
* Create a fake printer in Windows XP for a ipotetic HP LaserJet 4 (Windows 7 has drivers for this)<br />
* Share calling it &#8220;HPFake&#8221;<br />
* From Windows 7 install &#8220;HPFake&#8221; share on Windows XP<br />
* On Windows XP rename printer shares, &#8220;HPReal&#8221; to &#8220;HPFake&#8221; and &#8220;HPFake&#8221; to &#8220;HPReal&#8221;<br />
* You are mine Winzoz!<br />
* Go to Windows 7 and test printer<br />
* But, what? Windows 7 switch automagically share to &#8220;HPReal&#8221;<br />
* Damn! No way.. I need a new idea&#8230; and to buy a new printer?&#8230; uhmm</p>
<p><strong>Third &#8220;What The Hell&#8221; Path and Final Solution</strong><br />
* A thing you have to know is that HP DeskJet 1280 has a compatible driver&#8230; and the driver is&#8230; HP DeskJet 1220C<br />
* And Windows 7 has this driver<br />
* So in Windows XP add another printer temporally on LPT1 with HP DeskJet 1220C driver<br />
* Modify port on printer and choose USB port used by original installed printer, in order to share USB port with two printers<br />
* Activate sharing<br />
* Go to Windows 7 and install printer<br />
* Do a test print, OK<br />
* &#8230; Microsoft + HP = &#8230;</p>
<p>See you on next post</p>
<p><a class="a2a_button_digg" href="http://www.addtoany.com/add_to/digg?linkurl=http%3A%2F%2Fwww.gammatwo.com%2F2011%2F01%2F27%2Fshare-hp-deskjet-1280-from-windows-xp-to-windows-7%2F&amp;linkname=Share%20HP%20Deskjet%201280%20from%20Windows%20XP%20to%20Windows%207" title="Digg" rel="nofollow" target="_blank"><img src="http://www.gammatwo.com/wp-content/plugins/add-to-any/icons/digg.png" width="16" height="16" alt="Digg"/></a><a class="a2a_button_twitter" href="http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fwww.gammatwo.com%2F2011%2F01%2F27%2Fshare-hp-deskjet-1280-from-windows-xp-to-windows-7%2F&amp;linkname=Share%20HP%20Deskjet%201280%20from%20Windows%20XP%20to%20Windows%207" title="Twitter" rel="nofollow" target="_blank"><img src="http://www.gammatwo.com/wp-content/plugins/add-to-any/icons/twitter.png" width="16" height="16" alt="Twitter"/></a><a class="a2a_button_technorati_favorites" href="http://www.addtoany.com/add_to/technorati_favorites?linkurl=http%3A%2F%2Fwww.gammatwo.com%2F2011%2F01%2F27%2Fshare-hp-deskjet-1280-from-windows-xp-to-windows-7%2F&amp;linkname=Share%20HP%20Deskjet%201280%20from%20Windows%20XP%20to%20Windows%207" title="Technorati Favorites" rel="nofollow" target="_blank"><img src="http://www.gammatwo.com/wp-content/plugins/add-to-any/icons/technorati.png" width="16" height="16" alt="Technorati Favorites"/></a><a class="a2a_button_delicious" href="http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fwww.gammatwo.com%2F2011%2F01%2F27%2Fshare-hp-deskjet-1280-from-windows-xp-to-windows-7%2F&amp;linkname=Share%20HP%20Deskjet%201280%20from%20Windows%20XP%20to%20Windows%207" title="Delicious" rel="nofollow" target="_blank"><img src="http://www.gammatwo.com/wp-content/plugins/add-to-any/icons/delicious.png" width="16" height="16" alt="Delicious"/></a><a class="a2a_button_google_bookmarks" href="http://www.addtoany.com/add_to/google_bookmarks?linkurl=http%3A%2F%2Fwww.gammatwo.com%2F2011%2F01%2F27%2Fshare-hp-deskjet-1280-from-windows-xp-to-windows-7%2F&amp;linkname=Share%20HP%20Deskjet%201280%20from%20Windows%20XP%20to%20Windows%207" title="Google Bookmarks" rel="nofollow" target="_blank"><img src="http://www.gammatwo.com/wp-content/plugins/add-to-any/icons/google.png" width="16" height="16" alt="Google Bookmarks"/></a><a class="a2a_button_dzone" href="http://www.addtoany.com/add_to/dzone?linkurl=http%3A%2F%2Fwww.gammatwo.com%2F2011%2F01%2F27%2Fshare-hp-deskjet-1280-from-windows-xp-to-windows-7%2F&amp;linkname=Share%20HP%20Deskjet%201280%20from%20Windows%20XP%20to%20Windows%207" title="DZone" rel="nofollow" target="_blank"><img src="http://www.gammatwo.com/wp-content/plugins/add-to-any/icons/dzone.png" width="16" height="16" alt="DZone"/></a><a class="a2a_button_yahoo_bookmarks" href="http://www.addtoany.com/add_to/yahoo_bookmarks?linkurl=http%3A%2F%2Fwww.gammatwo.com%2F2011%2F01%2F27%2Fshare-hp-deskjet-1280-from-windows-xp-to-windows-7%2F&amp;linkname=Share%20HP%20Deskjet%201280%20from%20Windows%20XP%20to%20Windows%207" title="Yahoo Bookmarks" rel="nofollow" target="_blank"><img src="http://www.gammatwo.com/wp-content/plugins/add-to-any/icons/yahoo.png" width="16" height="16" alt="Yahoo Bookmarks"/></a><a class="a2a_button_facebook" href="http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Fwww.gammatwo.com%2F2011%2F01%2F27%2Fshare-hp-deskjet-1280-from-windows-xp-to-windows-7%2F&amp;linkname=Share%20HP%20Deskjet%201280%20from%20Windows%20XP%20to%20Windows%207" title="Facebook" rel="nofollow" target="_blank"><img src="http://www.gammatwo.com/wp-content/plugins/add-to-any/icons/facebook.png" width="16" height="16" alt="Facebook"/></a><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.gammatwo.com%2F2011%2F01%2F27%2Fshare-hp-deskjet-1280-from-windows-xp-to-windows-7%2F&amp;title=Share%20HP%20Deskjet%201280%20from%20Windows%20XP%20to%20Windows%207" id="wpa2a_6">Share/Save</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.gammatwo.com/2011/01/27/share-hp-deskjet-1280-from-windows-xp-to-windows-7/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>NullFileNET &#8211; NullFile in .NET way or zeroing disk for Windows in VirtualBox</title>
		<link>http://www.gammatwo.com/2011/01/16/nullfilenet-nullfile-in-net-way-or-zeroing-disk/</link>
		<comments>http://www.gammatwo.com/2011/01/16/nullfilenet-nullfile-in-net-way-or-zeroing-disk/#comments</comments>
		<pubDate>Sun, 16 Jan 2011 01:19:35 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[.NET 2.0]]></category>
		<category><![CDATA[Virtual Machines]]></category>
		<category><![CDATA[NullFile]]></category>
		<category><![CDATA[VirtualBox]]></category>

		<guid isPermaLink="false">http://www.gammatwo.com/?p=358</guid>
		<description><![CDATA[Updated version 0.2 Exception catched on file object disposing. &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212; I have some VMs with VirtualBox, I use to run nullfile-1.02.exe by Matthias Jordan in order to clear unused sectors with a VBoxManage compact. It&#8217;s a good tool, but I want to know more infos, first of all, when app thinks to finish to wipe? [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Updated version 0.2</strong><br />
Exception catched on file object disposing.<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p>I have some VMs with VirtualBox, I use to run <a href="http://www.feyrer.de/g4u/nullfile-1.02.exe">nullfile-1.02.exe </a> by Matthias Jordan in order to clear unused sectors with a VBoxManage compact.</p>
<p>It&#8217;s a good tool, but I want to know more infos, first of all, when app thinks to finish to wipe?<br />
I remember to see nullfile sources in pascal, great language, I want to thanks Matthias Jordan because he shares it.</p>
<p>I need a faster application to do this work&#8230;<br />
&#8230; Think .NET &#8230;<br />
So I decide to write a very similar command line app, with some new statistical features:</p>
<p><a href="http://www.gammatwo.com/wp-content/uploads/2011/01/nullfilenet_running.png"><img class="aligncenter size-medium wp-image-359" title="nullfilenet_running" src="http://www.gammatwo.com/wp-content/uploads/2011/01/nullfilenet_running-300x218.png" alt="" width="300" height="218" /></a></p>
<p>Download NullFileNET <a href="http://www.gammatwo.com/wp-content/uploads/2011/01/NullFileNET_exe_source.zip">source and binary (.exe)</a><strong></strong>, and here only <a href="http://www.gammatwo.com/wp-content/uploads/2011/01/NullFileNET_exe.zip">binary (.exe)</a>.</p>
<p>I can resume code lines that do the work in:</p>
<pre class="brush:csharp">string filename = "appleapplebananacoffee";
byte[] bArray = new byte[1024];
FileStream zeroingFile = File.Create(filename, 1024, FileOptions.DeleteOnClose);
while (true)
   zeroingFile.Write(bArray, 0, 1024);</pre>
<p>Have a good 2011!!!</p>
<p><del datetime="2011-01-20T14:44:05+00:00">P.S.: There is a thing I&#8217;ve not understand, when process finish, it seems to throw an ex on a lower level than main call, but I think it&#8217;s because of low disk space; when I have another slice of time I&#8217;ll try to solve this.</del></p>
<p><a class="a2a_button_digg" href="http://www.addtoany.com/add_to/digg?linkurl=http%3A%2F%2Fwww.gammatwo.com%2F2011%2F01%2F16%2Fnullfilenet-nullfile-in-net-way-or-zeroing-disk%2F&amp;linkname=NullFileNET%20%26%238211%3B%20NullFile%20in%20.NET%20way%20or%20zeroing%20disk%20for%20Windows%20in%20VirtualBox" title="Digg" rel="nofollow" target="_blank"><img src="http://www.gammatwo.com/wp-content/plugins/add-to-any/icons/digg.png" width="16" height="16" alt="Digg"/></a><a class="a2a_button_twitter" href="http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fwww.gammatwo.com%2F2011%2F01%2F16%2Fnullfilenet-nullfile-in-net-way-or-zeroing-disk%2F&amp;linkname=NullFileNET%20%26%238211%3B%20NullFile%20in%20.NET%20way%20or%20zeroing%20disk%20for%20Windows%20in%20VirtualBox" title="Twitter" rel="nofollow" target="_blank"><img src="http://www.gammatwo.com/wp-content/plugins/add-to-any/icons/twitter.png" width="16" height="16" alt="Twitter"/></a><a class="a2a_button_technorati_favorites" href="http://www.addtoany.com/add_to/technorati_favorites?linkurl=http%3A%2F%2Fwww.gammatwo.com%2F2011%2F01%2F16%2Fnullfilenet-nullfile-in-net-way-or-zeroing-disk%2F&amp;linkname=NullFileNET%20%26%238211%3B%20NullFile%20in%20.NET%20way%20or%20zeroing%20disk%20for%20Windows%20in%20VirtualBox" title="Technorati Favorites" rel="nofollow" target="_blank"><img src="http://www.gammatwo.com/wp-content/plugins/add-to-any/icons/technorati.png" width="16" height="16" alt="Technorati Favorites"/></a><a class="a2a_button_delicious" href="http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fwww.gammatwo.com%2F2011%2F01%2F16%2Fnullfilenet-nullfile-in-net-way-or-zeroing-disk%2F&amp;linkname=NullFileNET%20%26%238211%3B%20NullFile%20in%20.NET%20way%20or%20zeroing%20disk%20for%20Windows%20in%20VirtualBox" title="Delicious" rel="nofollow" target="_blank"><img src="http://www.gammatwo.com/wp-content/plugins/add-to-any/icons/delicious.png" width="16" height="16" alt="Delicious"/></a><a class="a2a_button_google_bookmarks" href="http://www.addtoany.com/add_to/google_bookmarks?linkurl=http%3A%2F%2Fwww.gammatwo.com%2F2011%2F01%2F16%2Fnullfilenet-nullfile-in-net-way-or-zeroing-disk%2F&amp;linkname=NullFileNET%20%26%238211%3B%20NullFile%20in%20.NET%20way%20or%20zeroing%20disk%20for%20Windows%20in%20VirtualBox" title="Google Bookmarks" rel="nofollow" target="_blank"><img src="http://www.gammatwo.com/wp-content/plugins/add-to-any/icons/google.png" width="16" height="16" alt="Google Bookmarks"/></a><a class="a2a_button_dzone" href="http://www.addtoany.com/add_to/dzone?linkurl=http%3A%2F%2Fwww.gammatwo.com%2F2011%2F01%2F16%2Fnullfilenet-nullfile-in-net-way-or-zeroing-disk%2F&amp;linkname=NullFileNET%20%26%238211%3B%20NullFile%20in%20.NET%20way%20or%20zeroing%20disk%20for%20Windows%20in%20VirtualBox" title="DZone" rel="nofollow" target="_blank"><img src="http://www.gammatwo.com/wp-content/plugins/add-to-any/icons/dzone.png" width="16" height="16" alt="DZone"/></a><a class="a2a_button_yahoo_bookmarks" href="http://www.addtoany.com/add_to/yahoo_bookmarks?linkurl=http%3A%2F%2Fwww.gammatwo.com%2F2011%2F01%2F16%2Fnullfilenet-nullfile-in-net-way-or-zeroing-disk%2F&amp;linkname=NullFileNET%20%26%238211%3B%20NullFile%20in%20.NET%20way%20or%20zeroing%20disk%20for%20Windows%20in%20VirtualBox" title="Yahoo Bookmarks" rel="nofollow" target="_blank"><img src="http://www.gammatwo.com/wp-content/plugins/add-to-any/icons/yahoo.png" width="16" height="16" alt="Yahoo Bookmarks"/></a><a class="a2a_button_facebook" href="http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Fwww.gammatwo.com%2F2011%2F01%2F16%2Fnullfilenet-nullfile-in-net-way-or-zeroing-disk%2F&amp;linkname=NullFileNET%20%26%238211%3B%20NullFile%20in%20.NET%20way%20or%20zeroing%20disk%20for%20Windows%20in%20VirtualBox" title="Facebook" rel="nofollow" target="_blank"><img src="http://www.gammatwo.com/wp-content/plugins/add-to-any/icons/facebook.png" width="16" height="16" alt="Facebook"/></a><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.gammatwo.com%2F2011%2F01%2F16%2Fnullfilenet-nullfile-in-net-way-or-zeroing-disk%2F&amp;title=NullFileNET%20%26%238211%3B%20NullFile%20in%20.NET%20way%20or%20zeroing%20disk%20for%20Windows%20in%20VirtualBox" id="wpa2a_8">Share/Save</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.gammatwo.com/2011/01/16/nullfilenet-nullfile-in-net-way-or-zeroing-disk/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Ubuntu 10.10 – Kernel panic – not syncing: VFS: Unable to mount root fs on unkown block</title>
		<link>http://www.gammatwo.com/2011/01/15/ubuntu-10-10-kernel-panic-not-syncing-vfs-unable-to-mount-root-fs-on-unkown-block/</link>
		<comments>http://www.gammatwo.com/2011/01/15/ubuntu-10-10-kernel-panic-not-syncing-vfs-unable-to-mount-root-fs-on-unkown-block/#comments</comments>
		<pubDate>Sat, 15 Jan 2011 12:31:23 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.gammatwo.com/?p=349</guid>
		<description><![CDATA[Booting Ubuntu 10.10 from my laptop Dell XPS I run into a kernel panic: Kernel panic - not syncing: VFS: Unable to mount root fs on unkown block Pid 1 com: swapper not tainted 2.6.35-24 generic (or something similar, I&#8217;ve wrote down by hand) &#8230;Mind panic&#8230; I lost 2 hours, and then find a really [...]]]></description>
			<content:encoded><![CDATA[<p>Booting Ubuntu 10.10 from my laptop Dell XPS I run into a kernel panic:</p>
<p><code>Kernel panic - not syncing: VFS: Unable to mount root fs on unkown block<br />
Pid 1 com: swapper not tainted 2.6.35-24 generic<br />
</code>(or something similar, I&#8217;ve wrote down by hand)</p>
<p>&#8230;Mind panic&#8230;</p>
<p>I lost 2 hours, and then find a really simple solution:</p>
<p>* Boot with older kernel (I&#8217;ve also 2.6.35-22)<br />
* Reintall <strong>linux-image-2.6.35-24-generic </strong>(Linux kernel image for version 2.6.35 on x86/x86_64) from Synaptic<br />
* I&#8217;ve done also a <strong>sudo update-grub</strong> to update grub menu</p>
<p>sudo reboot!</p>
<p>Good Luck</p>
<p><a class="a2a_button_digg" href="http://www.addtoany.com/add_to/digg?linkurl=http%3A%2F%2Fwww.gammatwo.com%2F2011%2F01%2F15%2Fubuntu-10-10-kernel-panic-not-syncing-vfs-unable-to-mount-root-fs-on-unkown-block%2F&amp;linkname=Ubuntu%2010.10%20%E2%80%93%20Kernel%20panic%20%E2%80%93%20not%20syncing%3A%20VFS%3A%20Unable%20to%20mount%20root%20fs%20on%20unkown%20block" title="Digg" rel="nofollow" target="_blank"><img src="http://www.gammatwo.com/wp-content/plugins/add-to-any/icons/digg.png" width="16" height="16" alt="Digg"/></a><a class="a2a_button_twitter" href="http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fwww.gammatwo.com%2F2011%2F01%2F15%2Fubuntu-10-10-kernel-panic-not-syncing-vfs-unable-to-mount-root-fs-on-unkown-block%2F&amp;linkname=Ubuntu%2010.10%20%E2%80%93%20Kernel%20panic%20%E2%80%93%20not%20syncing%3A%20VFS%3A%20Unable%20to%20mount%20root%20fs%20on%20unkown%20block" title="Twitter" rel="nofollow" target="_blank"><img src="http://www.gammatwo.com/wp-content/plugins/add-to-any/icons/twitter.png" width="16" height="16" alt="Twitter"/></a><a class="a2a_button_technorati_favorites" href="http://www.addtoany.com/add_to/technorati_favorites?linkurl=http%3A%2F%2Fwww.gammatwo.com%2F2011%2F01%2F15%2Fubuntu-10-10-kernel-panic-not-syncing-vfs-unable-to-mount-root-fs-on-unkown-block%2F&amp;linkname=Ubuntu%2010.10%20%E2%80%93%20Kernel%20panic%20%E2%80%93%20not%20syncing%3A%20VFS%3A%20Unable%20to%20mount%20root%20fs%20on%20unkown%20block" title="Technorati Favorites" rel="nofollow" target="_blank"><img src="http://www.gammatwo.com/wp-content/plugins/add-to-any/icons/technorati.png" width="16" height="16" alt="Technorati Favorites"/></a><a class="a2a_button_delicious" href="http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fwww.gammatwo.com%2F2011%2F01%2F15%2Fubuntu-10-10-kernel-panic-not-syncing-vfs-unable-to-mount-root-fs-on-unkown-block%2F&amp;linkname=Ubuntu%2010.10%20%E2%80%93%20Kernel%20panic%20%E2%80%93%20not%20syncing%3A%20VFS%3A%20Unable%20to%20mount%20root%20fs%20on%20unkown%20block" title="Delicious" rel="nofollow" target="_blank"><img src="http://www.gammatwo.com/wp-content/plugins/add-to-any/icons/delicious.png" width="16" height="16" alt="Delicious"/></a><a class="a2a_button_google_bookmarks" href="http://www.addtoany.com/add_to/google_bookmarks?linkurl=http%3A%2F%2Fwww.gammatwo.com%2F2011%2F01%2F15%2Fubuntu-10-10-kernel-panic-not-syncing-vfs-unable-to-mount-root-fs-on-unkown-block%2F&amp;linkname=Ubuntu%2010.10%20%E2%80%93%20Kernel%20panic%20%E2%80%93%20not%20syncing%3A%20VFS%3A%20Unable%20to%20mount%20root%20fs%20on%20unkown%20block" title="Google Bookmarks" rel="nofollow" target="_blank"><img src="http://www.gammatwo.com/wp-content/plugins/add-to-any/icons/google.png" width="16" height="16" alt="Google Bookmarks"/></a><a class="a2a_button_dzone" href="http://www.addtoany.com/add_to/dzone?linkurl=http%3A%2F%2Fwww.gammatwo.com%2F2011%2F01%2F15%2Fubuntu-10-10-kernel-panic-not-syncing-vfs-unable-to-mount-root-fs-on-unkown-block%2F&amp;linkname=Ubuntu%2010.10%20%E2%80%93%20Kernel%20panic%20%E2%80%93%20not%20syncing%3A%20VFS%3A%20Unable%20to%20mount%20root%20fs%20on%20unkown%20block" title="DZone" rel="nofollow" target="_blank"><img src="http://www.gammatwo.com/wp-content/plugins/add-to-any/icons/dzone.png" width="16" height="16" alt="DZone"/></a><a class="a2a_button_yahoo_bookmarks" href="http://www.addtoany.com/add_to/yahoo_bookmarks?linkurl=http%3A%2F%2Fwww.gammatwo.com%2F2011%2F01%2F15%2Fubuntu-10-10-kernel-panic-not-syncing-vfs-unable-to-mount-root-fs-on-unkown-block%2F&amp;linkname=Ubuntu%2010.10%20%E2%80%93%20Kernel%20panic%20%E2%80%93%20not%20syncing%3A%20VFS%3A%20Unable%20to%20mount%20root%20fs%20on%20unkown%20block" title="Yahoo Bookmarks" rel="nofollow" target="_blank"><img src="http://www.gammatwo.com/wp-content/plugins/add-to-any/icons/yahoo.png" width="16" height="16" alt="Yahoo Bookmarks"/></a><a class="a2a_button_facebook" href="http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Fwww.gammatwo.com%2F2011%2F01%2F15%2Fubuntu-10-10-kernel-panic-not-syncing-vfs-unable-to-mount-root-fs-on-unkown-block%2F&amp;linkname=Ubuntu%2010.10%20%E2%80%93%20Kernel%20panic%20%E2%80%93%20not%20syncing%3A%20VFS%3A%20Unable%20to%20mount%20root%20fs%20on%20unkown%20block" title="Facebook" rel="nofollow" target="_blank"><img src="http://www.gammatwo.com/wp-content/plugins/add-to-any/icons/facebook.png" width="16" height="16" alt="Facebook"/></a><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.gammatwo.com%2F2011%2F01%2F15%2Fubuntu-10-10-kernel-panic-not-syncing-vfs-unable-to-mount-root-fs-on-unkown-block%2F&amp;title=Ubuntu%2010.10%20%E2%80%93%20Kernel%20panic%20%E2%80%93%20not%20syncing%3A%20VFS%3A%20Unable%20to%20mount%20root%20fs%20on%20unkown%20block" id="wpa2a_10">Share/Save</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.gammatwo.com/2011/01/15/ubuntu-10-10-kernel-panic-not-syncing-vfs-unable-to-mount-root-fs-on-unkown-block/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Save Skype Chat History</title>
		<link>http://www.gammatwo.com/2010/12/18/save-skype-chat-history/</link>
		<comments>http://www.gammatwo.com/2010/12/18/save-skype-chat-history/#comments</comments>
		<pubDate>Sat, 18 Dec 2010 15:56:35 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[.NET 2.0]]></category>
		<category><![CDATA[Backup]]></category>
		<category><![CDATA[Skype]]></category>

		<guid isPermaLink="false">http://www.gammatwo.com/?p=336</guid>
		<description><![CDATA[I was searching for something to save my chat history of Skype, I found this link talking about COM object exposed by Skype application; mixing this with some poor information on Skype developer website and my .NET knowledge, I&#8217;ve done a simple command line app that save on text files my chat history. You can [...]]]></description>
			<content:encoded><![CDATA[<p>I was searching for something to save my chat history of Skype, I found this <a href="http://itarato.blogspot.com/2009/01/save-skype-chat-history.html" target="_blank">link</a> talking about COM object exposed by Skype application; mixing this with some poor information on Skype developer website and my .NET knowledge, I&#8217;ve done a simple command line app that save on text files my chat history.</p>
<p>You can download from this <a href="http://www.gammatwo.com/wp-content/uploads/2010/12/SkypeChatToTxt.zip">link</a> both source and app, and customize as you want.</p>
<p><a href="http://www.gammatwo.com/wp-content/uploads/2010/12/SkypeChatToTxt.png"><img class="aligncenter size-medium wp-image-338" title="SkypeChatToTxt" src="http://www.gammatwo.com/wp-content/uploads/2010/12/SkypeChatToTxt-300x173.png" alt="" width="300" height="173" /></a></p>
<p>All code is in a file called program.cs, I provide also Visual Studio 2005 project and solution file.</p>
<p>Here is the code:</p>
<pre class="brush:csharp">static void Main(string[] args)
{

  Console.WriteLine();
  Console.WriteLine("SkypeChatToTxt");
  Console.WriteLine();

  string basePath = "";
  basePath = System.Reflection.Assembly.GetExecutingAssembly().GetModules()[0].FullyQualifiedName;
  basePath = System.IO.Path.GetDirectoryName(basePath);
  basePath += "\\skype chat";
  int iCounter = 0;
  while (System.IO.Directory.Exists(basePath + " " + iCounter.ToString()))
  {
    iCounter++;
  }
  basePath += " " + iCounter.ToString();
  System.IO.Directory.CreateDirectory(basePath);

  Console.WriteLine("BasePath = " + basePath);
  Console.WriteLine();
  SKYPE4COMLib.Skype oSkype = new SKYPE4COMLib.Skype();
  if (!oSkype.Client.IsRunning) oSkype.Client.Start(true, true);

  string owner = oSkype.CurrentUser.FullName + " (" + oSkype.CurrentUser.Handle + ")";

  foreach (SKYPE4COMLib.Chat oChat in oSkype.Chats)
  {
    try
    {

      string name = oChat.Name;
      string description = oChat.Description;
      SortedList&lt;string, string&gt; members = new SortedList&lt;string, string&gt;();
      foreach (SKYPE4COMLib.User oUser in oChat.Members)
      {
        members.Add(oUser.FullName + " (" + oUser.Handle + ")", null);
      }

      string filename = "\\chat";
      foreach (string m in members.Keys)
      {
        filename += " " + m;
      }
      filename = filename.Replace(owner, "").Replace("  ", " ");
      if (filename.Length &gt; 100) filename = filename.Substring(0, 100);
      filename = filename.Trim() + ".txt";

      Console.WriteLine();
      Console.WriteLine("Chat File = " + filename);
      Console.WriteLine("With " + oChat.Messages.Count.ToString() + " Message(s)");

      filename = basePath + filename;

      int iMessageCount = oChat.Messages.Count;
      iCounter = 0;
      StringBuilder messages = new StringBuilder(21000);
      foreach (SKYPE4COMLib.ChatMessage oMessage in oChat.Messages)
      {
        iCounter++;
        messages.Append(oMessage.Timestamp + "\t" + oMessage.FromDisplayName + "\t" + oMessage.Body + "\r\n");
        if (iCounter % 25 == 0) Console.Write(".");
        if (messages.Length &gt; 20000)
        {
          System.IO.File.AppendAllText(filename, messages.ToString());
          messages = new StringBuilder(21000);
          GC.Collect();
        }
        if (iMessageCount - iCounter &gt; 1000)
        if ((iMessageCount - iCounter) % 1000 == 0)
        {
          Console.WriteLine("");
          Console.Write((iMessageCount - iCounter).ToString() + " ");
        }
      }
      System.IO.File.AppendAllText(filename, messages.ToString());
      Console.WriteLine(" OK");
    }
    catch (Exception ex)
    {
      Console.WriteLine();
      Console.WriteLine("Error " + ex.Message);
      Console.WriteLine();
    }
  }

  Console.WriteLine("");
  Console.WriteLine("Done");
}</pre>
<p>Enjoy it!</p>
<p><a class="a2a_button_digg" href="http://www.addtoany.com/add_to/digg?linkurl=http%3A%2F%2Fwww.gammatwo.com%2F2010%2F12%2F18%2Fsave-skype-chat-history%2F&amp;linkname=Save%20Skype%20Chat%20History" title="Digg" rel="nofollow" target="_blank"><img src="http://www.gammatwo.com/wp-content/plugins/add-to-any/icons/digg.png" width="16" height="16" alt="Digg"/></a><a class="a2a_button_twitter" href="http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fwww.gammatwo.com%2F2010%2F12%2F18%2Fsave-skype-chat-history%2F&amp;linkname=Save%20Skype%20Chat%20History" title="Twitter" rel="nofollow" target="_blank"><img src="http://www.gammatwo.com/wp-content/plugins/add-to-any/icons/twitter.png" width="16" height="16" alt="Twitter"/></a><a class="a2a_button_technorati_favorites" href="http://www.addtoany.com/add_to/technorati_favorites?linkurl=http%3A%2F%2Fwww.gammatwo.com%2F2010%2F12%2F18%2Fsave-skype-chat-history%2F&amp;linkname=Save%20Skype%20Chat%20History" title="Technorati Favorites" rel="nofollow" target="_blank"><img src="http://www.gammatwo.com/wp-content/plugins/add-to-any/icons/technorati.png" width="16" height="16" alt="Technorati Favorites"/></a><a class="a2a_button_delicious" href="http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fwww.gammatwo.com%2F2010%2F12%2F18%2Fsave-skype-chat-history%2F&amp;linkname=Save%20Skype%20Chat%20History" title="Delicious" rel="nofollow" target="_blank"><img src="http://www.gammatwo.com/wp-content/plugins/add-to-any/icons/delicious.png" width="16" height="16" alt="Delicious"/></a><a class="a2a_button_google_bookmarks" href="http://www.addtoany.com/add_to/google_bookmarks?linkurl=http%3A%2F%2Fwww.gammatwo.com%2F2010%2F12%2F18%2Fsave-skype-chat-history%2F&amp;linkname=Save%20Skype%20Chat%20History" title="Google Bookmarks" rel="nofollow" target="_blank"><img src="http://www.gammatwo.com/wp-content/plugins/add-to-any/icons/google.png" width="16" height="16" alt="Google Bookmarks"/></a><a class="a2a_button_dzone" href="http://www.addtoany.com/add_to/dzone?linkurl=http%3A%2F%2Fwww.gammatwo.com%2F2010%2F12%2F18%2Fsave-skype-chat-history%2F&amp;linkname=Save%20Skype%20Chat%20History" title="DZone" rel="nofollow" target="_blank"><img src="http://www.gammatwo.com/wp-content/plugins/add-to-any/icons/dzone.png" width="16" height="16" alt="DZone"/></a><a class="a2a_button_yahoo_bookmarks" href="http://www.addtoany.com/add_to/yahoo_bookmarks?linkurl=http%3A%2F%2Fwww.gammatwo.com%2F2010%2F12%2F18%2Fsave-skype-chat-history%2F&amp;linkname=Save%20Skype%20Chat%20History" title="Yahoo Bookmarks" rel="nofollow" target="_blank"><img src="http://www.gammatwo.com/wp-content/plugins/add-to-any/icons/yahoo.png" width="16" height="16" alt="Yahoo Bookmarks"/></a><a class="a2a_button_facebook" href="http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Fwww.gammatwo.com%2F2010%2F12%2F18%2Fsave-skype-chat-history%2F&amp;linkname=Save%20Skype%20Chat%20History" title="Facebook" rel="nofollow" target="_blank"><img src="http://www.gammatwo.com/wp-content/plugins/add-to-any/icons/facebook.png" width="16" height="16" alt="Facebook"/></a><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.gammatwo.com%2F2010%2F12%2F18%2Fsave-skype-chat-history%2F&amp;title=Save%20Skype%20Chat%20History" id="wpa2a_12">Share/Save</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.gammatwo.com/2010/12/18/save-skype-chat-history/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Install eGalax TouchScreen on Ubuntu 9.10</title>
		<link>http://www.gammatwo.com/2010/05/12/install-egalax-touchscreen-on-ubuntu-9-10/</link>
		<comments>http://www.gammatwo.com/2010/05/12/install-egalax-touchscreen-on-ubuntu-9-10/#comments</comments>
		<pubDate>Wed, 12 May 2010 08:01:22 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[TouchScreen]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.gammatwo.com/?p=321</guid>
		<description><![CDATA[Download latest drivers for Ubuntu 9.10 from: http://home.eeti.com.tw/web20/eGalaxTouchDriver/linuxDriver.htm 32Bit 2010/01/20 Kernel 2.4.x 3.00.3719 Kernel 2.6.x 3.00.3719 [download this one] At this time filename is eGalaxTouch-3.00.3719-32b-k26.tar.gz, untar on Desktop or wherever you want. Two files are needed: eGalaxTouch.tar.gz setup.sh WARNING! setup.sh writes on /etc/X11/xorg.conf and probably you don&#8217;t have in Ubuntu 9.10, xorg configuration is now [...]]]></description>
			<content:encoded><![CDATA[<p>Download latest drivers for Ubuntu 9.10 from:</p>
<p><a title="http://home.eeti.com.tw/web20/eGalaxTouchDriver/linuxDriver.htm" href="http://home.eeti.com.tw/web20/eGalaxTouchDriver/linuxDriver.htm">http://home.eeti.com.tw/web20/eGalaxTouchDriver/linuxDriver.htm</a></p>
<blockquote><p>32Bit  	2010/01/20<br />
Kernel 2.4.x 	3.00.3719<br />
Kernel 2.6.x 	3.00.3719 [download this one]</p></blockquote>
<p>At this time filename is <strong>eGalaxTouch-3.00.3719-32b-k26.tar.gz</strong>, untar on Desktop or wherever you want.</p>
<p>Two files are needed:</p>
<ul>
<li> eGalaxTouch.tar.gz</li>
<li> setup.sh</li>
</ul>
<p>WARNING! setup.sh writes on  /etc/X11/xorg.conf and probably you don&#8217;t have in Ubuntu 9.10, xorg configuration is now done with another XML configuration file, but xorg.conf is supported if present.</p>
<p>so let&#8217;s create xorg.conf before exec setup.sh:</p>
<blockquote><p>sudo gedit  /etc/X11/xorg.conf</p></blockquote>
<p><strong>fill with a space</strong> and save.</p>
<p>Now you can launch setup.sh, and all should go fine:</p>
<blockquote><p>sudo sh setup.sh</p></blockquote>
<p>Bye</p>
<p><a class="a2a_button_digg" href="http://www.addtoany.com/add_to/digg?linkurl=http%3A%2F%2Fwww.gammatwo.com%2F2010%2F05%2F12%2Finstall-egalax-touchscreen-on-ubuntu-9-10%2F&amp;linkname=Install%20eGalax%20TouchScreen%20on%20Ubuntu%209.10" title="Digg" rel="nofollow" target="_blank"><img src="http://www.gammatwo.com/wp-content/plugins/add-to-any/icons/digg.png" width="16" height="16" alt="Digg"/></a><a class="a2a_button_twitter" href="http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fwww.gammatwo.com%2F2010%2F05%2F12%2Finstall-egalax-touchscreen-on-ubuntu-9-10%2F&amp;linkname=Install%20eGalax%20TouchScreen%20on%20Ubuntu%209.10" title="Twitter" rel="nofollow" target="_blank"><img src="http://www.gammatwo.com/wp-content/plugins/add-to-any/icons/twitter.png" width="16" height="16" alt="Twitter"/></a><a class="a2a_button_technorati_favorites" href="http://www.addtoany.com/add_to/technorati_favorites?linkurl=http%3A%2F%2Fwww.gammatwo.com%2F2010%2F05%2F12%2Finstall-egalax-touchscreen-on-ubuntu-9-10%2F&amp;linkname=Install%20eGalax%20TouchScreen%20on%20Ubuntu%209.10" title="Technorati Favorites" rel="nofollow" target="_blank"><img src="http://www.gammatwo.com/wp-content/plugins/add-to-any/icons/technorati.png" width="16" height="16" alt="Technorati Favorites"/></a><a class="a2a_button_delicious" href="http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fwww.gammatwo.com%2F2010%2F05%2F12%2Finstall-egalax-touchscreen-on-ubuntu-9-10%2F&amp;linkname=Install%20eGalax%20TouchScreen%20on%20Ubuntu%209.10" title="Delicious" rel="nofollow" target="_blank"><img src="http://www.gammatwo.com/wp-content/plugins/add-to-any/icons/delicious.png" width="16" height="16" alt="Delicious"/></a><a class="a2a_button_google_bookmarks" href="http://www.addtoany.com/add_to/google_bookmarks?linkurl=http%3A%2F%2Fwww.gammatwo.com%2F2010%2F05%2F12%2Finstall-egalax-touchscreen-on-ubuntu-9-10%2F&amp;linkname=Install%20eGalax%20TouchScreen%20on%20Ubuntu%209.10" title="Google Bookmarks" rel="nofollow" target="_blank"><img src="http://www.gammatwo.com/wp-content/plugins/add-to-any/icons/google.png" width="16" height="16" alt="Google Bookmarks"/></a><a class="a2a_button_dzone" href="http://www.addtoany.com/add_to/dzone?linkurl=http%3A%2F%2Fwww.gammatwo.com%2F2010%2F05%2F12%2Finstall-egalax-touchscreen-on-ubuntu-9-10%2F&amp;linkname=Install%20eGalax%20TouchScreen%20on%20Ubuntu%209.10" title="DZone" rel="nofollow" target="_blank"><img src="http://www.gammatwo.com/wp-content/plugins/add-to-any/icons/dzone.png" width="16" height="16" alt="DZone"/></a><a class="a2a_button_yahoo_bookmarks" href="http://www.addtoany.com/add_to/yahoo_bookmarks?linkurl=http%3A%2F%2Fwww.gammatwo.com%2F2010%2F05%2F12%2Finstall-egalax-touchscreen-on-ubuntu-9-10%2F&amp;linkname=Install%20eGalax%20TouchScreen%20on%20Ubuntu%209.10" title="Yahoo Bookmarks" rel="nofollow" target="_blank"><img src="http://www.gammatwo.com/wp-content/plugins/add-to-any/icons/yahoo.png" width="16" height="16" alt="Yahoo Bookmarks"/></a><a class="a2a_button_facebook" href="http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Fwww.gammatwo.com%2F2010%2F05%2F12%2Finstall-egalax-touchscreen-on-ubuntu-9-10%2F&amp;linkname=Install%20eGalax%20TouchScreen%20on%20Ubuntu%209.10" title="Facebook" rel="nofollow" target="_blank"><img src="http://www.gammatwo.com/wp-content/plugins/add-to-any/icons/facebook.png" width="16" height="16" alt="Facebook"/></a><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.gammatwo.com%2F2010%2F05%2F12%2Finstall-egalax-touchscreen-on-ubuntu-9-10%2F&amp;title=Install%20eGalax%20TouchScreen%20on%20Ubuntu%209.10" id="wpa2a_14">Share/Save</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.gammatwo.com/2010/05/12/install-egalax-touchscreen-on-ubuntu-9-10/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Light Ubuntu: Install Basic Gnome Desktop On Ubuntu Server</title>
		<link>http://www.gammatwo.com/2010/04/22/light-ubuntu-install-basic-gnome-desktop-on-ubuntu-server/</link>
		<comments>http://www.gammatwo.com/2010/04/22/light-ubuntu-install-basic-gnome-desktop-on-ubuntu-server/#comments</comments>
		<pubDate>Wed, 21 Apr 2010 22:45:47 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.gammatwo.com/?p=294</guid>
		<description><![CDATA[I&#8217;m working on an embedded hardware for a Mono touch screen application ported from a .NET 2.o existing application and I want to use Ubuntu, but I have an embedded system with a small solid state disk of 2 GB. No way to install Ubuntu Desktop, it takes about 3.5 GB, so I choose Ubuntu [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m working on an embedded hardware for a Mono touch screen application ported from a .NET 2.o existing application and I want to use Ubuntu, but I have an embedded system with a small solid state disk of 2 GB.</p>
<p>No way to install Ubuntu Desktop, it takes about 3.5 GB, so I choose Ubuntu Server and in some way selecting packages to fit in 2GB.</p>
<p>So this is what I have done:</p>
<h4>1 Install Ubuntu Server with minimal packages</h4>
<p>&#8230; nothing to say, this is very simple.</p>
<h4>2 Install Gnome Desktop (only Gnome, without OpenOffice, Firefox, Evolution e Co)</h4>
<p>Login with your username and password, update packages with:</p>
<pre>sudo apt-get update</pre>
<p>Install Gnome-only with:</p>
<pre>sudo apt-get install --no-install-recommends ubuntu-desktop</pre>
<p>If you install standard ubuntu-desktop package (ommitting &#8211;no-install-recommends), it contains as recommended packages a very large number of application, sometimes usefull, sometimes not, and last one is my case, I want only gnome.</p>
<p>Once it&#8217;s done, reboot and login in Gnome GUI:</p>
<pre>sudo reboot
</pre>
<p>Now 1.3 GB are used:</p>
<p><a href="http://www.gammatwo.com/wp-content/uploads/2010/04/space_available.png"><img class="aligncenter size-medium wp-image-304" title="space_available" src="http://www.gammatwo.com/wp-content/uploads/2010/04/space_available-300x226.png" alt="" width="300" height="226" /></a></p>
<h4>3 Upgrade and Clean Up</h4>
<p>Usually I prefer to interact with a graphical interface, to do this click on System menù, Administration, Update Manager.</p>
<p><a href="http://www.gammatwo.com/wp-content/uploads/2010/04/upgrade_pk.png"><img class="aligncenter size-medium wp-image-305" title="upgrade_pk" src="http://www.gammatwo.com/wp-content/uploads/2010/04/upgrade_pk-300x233.png" alt="" width="300" height="233" /></a></p>
<p>Otherwise to update packages list, type on terminal:</p>
<pre>sudo apt-get update</pre>
<p>After this upgrade old packages:</p>
<pre>sudo apt-get upgrade</pre>
<p>and finally clean orphans:</p>
<pre>sudo apt-get autoremove</pre>
<p>At the end here disk space status:</p>
<p><a href="http://www.gammatwo.com/wp-content/uploads/2010/04/space_available_2.png"><img src="http://www.gammatwo.com/wp-content/uploads/2010/04/space_available_2-300x233.png" alt="" title="space_available_2" width="300" height="233" class="aligncenter size-medium wp-image-315" /></a></p>
<p>This is a simple result with simple steps, but I have to working on to remove other things and gain free space to install Mono, but it&#8217;s another quest!</p>
<p>Bye</p>
<p><a class="a2a_button_digg" href="http://www.addtoany.com/add_to/digg?linkurl=http%3A%2F%2Fwww.gammatwo.com%2F2010%2F04%2F22%2Flight-ubuntu-install-basic-gnome-desktop-on-ubuntu-server%2F&amp;linkname=Light%20Ubuntu%3A%20Install%20Basic%20Gnome%20Desktop%20On%20Ubuntu%20Server" title="Digg" rel="nofollow" target="_blank"><img src="http://www.gammatwo.com/wp-content/plugins/add-to-any/icons/digg.png" width="16" height="16" alt="Digg"/></a><a class="a2a_button_twitter" href="http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fwww.gammatwo.com%2F2010%2F04%2F22%2Flight-ubuntu-install-basic-gnome-desktop-on-ubuntu-server%2F&amp;linkname=Light%20Ubuntu%3A%20Install%20Basic%20Gnome%20Desktop%20On%20Ubuntu%20Server" title="Twitter" rel="nofollow" target="_blank"><img src="http://www.gammatwo.com/wp-content/plugins/add-to-any/icons/twitter.png" width="16" height="16" alt="Twitter"/></a><a class="a2a_button_technorati_favorites" href="http://www.addtoany.com/add_to/technorati_favorites?linkurl=http%3A%2F%2Fwww.gammatwo.com%2F2010%2F04%2F22%2Flight-ubuntu-install-basic-gnome-desktop-on-ubuntu-server%2F&amp;linkname=Light%20Ubuntu%3A%20Install%20Basic%20Gnome%20Desktop%20On%20Ubuntu%20Server" title="Technorati Favorites" rel="nofollow" target="_blank"><img src="http://www.gammatwo.com/wp-content/plugins/add-to-any/icons/technorati.png" width="16" height="16" alt="Technorati Favorites"/></a><a class="a2a_button_delicious" href="http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fwww.gammatwo.com%2F2010%2F04%2F22%2Flight-ubuntu-install-basic-gnome-desktop-on-ubuntu-server%2F&amp;linkname=Light%20Ubuntu%3A%20Install%20Basic%20Gnome%20Desktop%20On%20Ubuntu%20Server" title="Delicious" rel="nofollow" target="_blank"><img src="http://www.gammatwo.com/wp-content/plugins/add-to-any/icons/delicious.png" width="16" height="16" alt="Delicious"/></a><a class="a2a_button_google_bookmarks" href="http://www.addtoany.com/add_to/google_bookmarks?linkurl=http%3A%2F%2Fwww.gammatwo.com%2F2010%2F04%2F22%2Flight-ubuntu-install-basic-gnome-desktop-on-ubuntu-server%2F&amp;linkname=Light%20Ubuntu%3A%20Install%20Basic%20Gnome%20Desktop%20On%20Ubuntu%20Server" title="Google Bookmarks" rel="nofollow" target="_blank"><img src="http://www.gammatwo.com/wp-content/plugins/add-to-any/icons/google.png" width="16" height="16" alt="Google Bookmarks"/></a><a class="a2a_button_dzone" href="http://www.addtoany.com/add_to/dzone?linkurl=http%3A%2F%2Fwww.gammatwo.com%2F2010%2F04%2F22%2Flight-ubuntu-install-basic-gnome-desktop-on-ubuntu-server%2F&amp;linkname=Light%20Ubuntu%3A%20Install%20Basic%20Gnome%20Desktop%20On%20Ubuntu%20Server" title="DZone" rel="nofollow" target="_blank"><img src="http://www.gammatwo.com/wp-content/plugins/add-to-any/icons/dzone.png" width="16" height="16" alt="DZone"/></a><a class="a2a_button_yahoo_bookmarks" href="http://www.addtoany.com/add_to/yahoo_bookmarks?linkurl=http%3A%2F%2Fwww.gammatwo.com%2F2010%2F04%2F22%2Flight-ubuntu-install-basic-gnome-desktop-on-ubuntu-server%2F&amp;linkname=Light%20Ubuntu%3A%20Install%20Basic%20Gnome%20Desktop%20On%20Ubuntu%20Server" title="Yahoo Bookmarks" rel="nofollow" target="_blank"><img src="http://www.gammatwo.com/wp-content/plugins/add-to-any/icons/yahoo.png" width="16" height="16" alt="Yahoo Bookmarks"/></a><a class="a2a_button_facebook" href="http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Fwww.gammatwo.com%2F2010%2F04%2F22%2Flight-ubuntu-install-basic-gnome-desktop-on-ubuntu-server%2F&amp;linkname=Light%20Ubuntu%3A%20Install%20Basic%20Gnome%20Desktop%20On%20Ubuntu%20Server" title="Facebook" rel="nofollow" target="_blank"><img src="http://www.gammatwo.com/wp-content/plugins/add-to-any/icons/facebook.png" width="16" height="16" alt="Facebook"/></a><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.gammatwo.com%2F2010%2F04%2F22%2Flight-ubuntu-install-basic-gnome-desktop-on-ubuntu-server%2F&amp;title=Light%20Ubuntu%3A%20Install%20Basic%20Gnome%20Desktop%20On%20Ubuntu%20Server" id="wpa2a_16">Share/Save</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.gammatwo.com/2010/04/22/light-ubuntu-install-basic-gnome-desktop-on-ubuntu-server/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Reset Ubuntu Gnome Video Settings</title>
		<link>http://www.gammatwo.com/2010/04/13/reset-ubuntu-gnome-video-settings/</link>
		<comments>http://www.gammatwo.com/2010/04/13/reset-ubuntu-gnome-video-settings/#comments</comments>
		<pubDate>Tue, 13 Apr 2010 12:46:41 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.gammatwo.com/?p=290</guid>
		<description><![CDATA[I was playing with my VirtualBox Ubuntu and 3D Acceleration, and I lost gnome video settings, Ubuntu now starts with console, damn! The simplest thing to do is: * login as root (or administrator) * sudo mv /etc/X11/xorg.conf /etc/X11/xorg.old * sudo gdm (Gnome starts) * reboot Bye]]></description>
			<content:encoded><![CDATA[<p>I was playing with my VirtualBox Ubuntu and 3D Acceleration, and I lost gnome video settings, Ubuntu now starts with console, damn!<br />
The simplest thing to do is:</p>
<blockquote><p>* login as root (or administrator)<br />
* sudo mv /etc/X11/xorg.conf /etc/X11/xorg.old<br />
* sudo gdm (Gnome starts)<br />
* reboot</p></blockquote>
<p>Bye</p>
<p><a class="a2a_button_digg" href="http://www.addtoany.com/add_to/digg?linkurl=http%3A%2F%2Fwww.gammatwo.com%2F2010%2F04%2F13%2Freset-ubuntu-gnome-video-settings%2F&amp;linkname=Reset%20Ubuntu%20Gnome%20Video%20Settings" title="Digg" rel="nofollow" target="_blank"><img src="http://www.gammatwo.com/wp-content/plugins/add-to-any/icons/digg.png" width="16" height="16" alt="Digg"/></a><a class="a2a_button_twitter" href="http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fwww.gammatwo.com%2F2010%2F04%2F13%2Freset-ubuntu-gnome-video-settings%2F&amp;linkname=Reset%20Ubuntu%20Gnome%20Video%20Settings" title="Twitter" rel="nofollow" target="_blank"><img src="http://www.gammatwo.com/wp-content/plugins/add-to-any/icons/twitter.png" width="16" height="16" alt="Twitter"/></a><a class="a2a_button_technorati_favorites" href="http://www.addtoany.com/add_to/technorati_favorites?linkurl=http%3A%2F%2Fwww.gammatwo.com%2F2010%2F04%2F13%2Freset-ubuntu-gnome-video-settings%2F&amp;linkname=Reset%20Ubuntu%20Gnome%20Video%20Settings" title="Technorati Favorites" rel="nofollow" target="_blank"><img src="http://www.gammatwo.com/wp-content/plugins/add-to-any/icons/technorati.png" width="16" height="16" alt="Technorati Favorites"/></a><a class="a2a_button_delicious" href="http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fwww.gammatwo.com%2F2010%2F04%2F13%2Freset-ubuntu-gnome-video-settings%2F&amp;linkname=Reset%20Ubuntu%20Gnome%20Video%20Settings" title="Delicious" rel="nofollow" target="_blank"><img src="http://www.gammatwo.com/wp-content/plugins/add-to-any/icons/delicious.png" width="16" height="16" alt="Delicious"/></a><a class="a2a_button_google_bookmarks" href="http://www.addtoany.com/add_to/google_bookmarks?linkurl=http%3A%2F%2Fwww.gammatwo.com%2F2010%2F04%2F13%2Freset-ubuntu-gnome-video-settings%2F&amp;linkname=Reset%20Ubuntu%20Gnome%20Video%20Settings" title="Google Bookmarks" rel="nofollow" target="_blank"><img src="http://www.gammatwo.com/wp-content/plugins/add-to-any/icons/google.png" width="16" height="16" alt="Google Bookmarks"/></a><a class="a2a_button_dzone" href="http://www.addtoany.com/add_to/dzone?linkurl=http%3A%2F%2Fwww.gammatwo.com%2F2010%2F04%2F13%2Freset-ubuntu-gnome-video-settings%2F&amp;linkname=Reset%20Ubuntu%20Gnome%20Video%20Settings" title="DZone" rel="nofollow" target="_blank"><img src="http://www.gammatwo.com/wp-content/plugins/add-to-any/icons/dzone.png" width="16" height="16" alt="DZone"/></a><a class="a2a_button_yahoo_bookmarks" href="http://www.addtoany.com/add_to/yahoo_bookmarks?linkurl=http%3A%2F%2Fwww.gammatwo.com%2F2010%2F04%2F13%2Freset-ubuntu-gnome-video-settings%2F&amp;linkname=Reset%20Ubuntu%20Gnome%20Video%20Settings" title="Yahoo Bookmarks" rel="nofollow" target="_blank"><img src="http://www.gammatwo.com/wp-content/plugins/add-to-any/icons/yahoo.png" width="16" height="16" alt="Yahoo Bookmarks"/></a><a class="a2a_button_facebook" href="http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Fwww.gammatwo.com%2F2010%2F04%2F13%2Freset-ubuntu-gnome-video-settings%2F&amp;linkname=Reset%20Ubuntu%20Gnome%20Video%20Settings" title="Facebook" rel="nofollow" target="_blank"><img src="http://www.gammatwo.com/wp-content/plugins/add-to-any/icons/facebook.png" width="16" height="16" alt="Facebook"/></a><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.gammatwo.com%2F2010%2F04%2F13%2Freset-ubuntu-gnome-video-settings%2F&amp;title=Reset%20Ubuntu%20Gnome%20Video%20Settings" id="wpa2a_18">Share/Save</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.gammatwo.com/2010/04/13/reset-ubuntu-gnome-video-settings/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HowTo RAW Printing C# .NET 2.0 To Network Printer</title>
		<link>http://www.gammatwo.com/2009/11/24/raw-printing-net-2-to-generic-printserver/</link>
		<comments>http://www.gammatwo.com/2009/11/24/raw-printing-net-2-to-generic-printserver/#comments</comments>
		<pubDate>Mon, 23 Nov 2009 23:38:01 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[.NET 2.0]]></category>
		<category><![CDATA[.NET]]></category>

		<guid isPermaLink="false">http://www.gammatwo.com/?p=285</guid>
		<description><![CDATA[Sometimes I need to print labels on label printers, .NET 2.0 has a hole in this theme; no way, I have tryed many methods, the only one works well in every configuration is this; only thing that disappont me is you have to use directly Win32 API di do it. Here the code: public void [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes I need to print labels on label printers, .NET 2.0 has a hole in this theme; no way, I have tryed many methods, the only one works well in every configuration is this; only thing that disappont me is you have to use directly Win32 API di do it.</p>
<p>Here the code:</p>
<pre class="brush:csharp">public void PrintString(string toSend, string printerPath)
{
IntPtr myPtrPort;
Int32 iByteWritten = 0;

myPtrPort = CreateFile(printerPath, GENERIC_WRITE, FILE_SHARE_WRITE, IntPtr.Zero, OPEN_EXISTING, 0, IntPtr.Zero);

if (myPtrPort.ToInt32() &lt;= 0)
throw new Exception("Error " + GetLastError().ToString());

if (!WriteFile(myPtrPort, System.Text.ASCIIEncoding.ASCII.GetBytes(toSend),
System.Text.ASCIIEncoding.ASCII.GetByteCount(toSend), ref iByteWritten, IntPtr.Zero))
throw new Exception("Error " + GetLastError().ToString());

if (!FlushFileBuffers(myPtrPort))
throw new Exception("Error " + GetLastError().ToString());

if (!CloseHandle(myPtrPort))
throw new Exception("Error " + GetLastError().ToString());
}

const Int32 FILE_SHARE_READ = 0x00000001;
const Int32 FILE_SHARE_WRITE = 0x00000002;
const Int32 FILE_SHARE_DELETE = 0x00000004;
const Int32 OPEN_EXISTING = 3;

const uint GENERIC_READ = (0x80000000);
const Int32 GENERIC_WRITE = (0x40000000);

const Int32 FILE_FLAG_NO_BUFFERING = 0x20000000;
const Int32 FILE_READ_ATTRIBUTES = (0x0080);
const Int32 FILE_WRITE_ATTRIBUTES = 0x0100;
const Int32 ERROR_INSUFFICIENT_BUFFER = 122;

[DllImport("kernel32.dll", SetLastError = true)]
static extern IntPtr CreateFile(
string lpFileName,
Int32 dwDesiredAccess,
Int32 dwShareMode,
IntPtr lpSecurityAttributes,
Int32 dwCreationDisposition,
Int32 dwFlagsAndAttributes,
IntPtr hTemplateFile);

[DllImport("kernel32.dll", SetLastError = true)]
static extern bool CloseHandle(IntPtr hObject);

[DllImport("kernel32.dll")]
static extern bool ReadFile(IntPtr hFile, byte[] lpBuffer,
Int32 nNumberOfBytesToRead, ref Int32 lpNumberOfBytesRead, IntPtr lpOverlapped);

[DllImport("kernel32.dll")]
static extern bool WriteFile(IntPtr hFile, byte[] lpBuffer,
Int32 nNumberOfBytesToWrite, ref Int32 lpNumberOfBytesWritten, IntPtr lpOverlapped);

[DllImport("kernel32.dll")]
static extern bool FlushFileBuffers(IntPtr hFile);

[DllImport("kernel32.dll", SetLastError = true)]
static extern int GetLastError();</pre>
<p>.</p>
<p><a class="a2a_button_digg" href="http://www.addtoany.com/add_to/digg?linkurl=http%3A%2F%2Fwww.gammatwo.com%2F2009%2F11%2F24%2Fraw-printing-net-2-to-generic-printserver%2F&amp;linkname=HowTo%20RAW%20Printing%20C%23%20.NET%202.0%20To%20Network%20Printer" title="Digg" rel="nofollow" target="_blank"><img src="http://www.gammatwo.com/wp-content/plugins/add-to-any/icons/digg.png" width="16" height="16" alt="Digg"/></a><a class="a2a_button_twitter" href="http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fwww.gammatwo.com%2F2009%2F11%2F24%2Fraw-printing-net-2-to-generic-printserver%2F&amp;linkname=HowTo%20RAW%20Printing%20C%23%20.NET%202.0%20To%20Network%20Printer" title="Twitter" rel="nofollow" target="_blank"><img src="http://www.gammatwo.com/wp-content/plugins/add-to-any/icons/twitter.png" width="16" height="16" alt="Twitter"/></a><a class="a2a_button_technorati_favorites" href="http://www.addtoany.com/add_to/technorati_favorites?linkurl=http%3A%2F%2Fwww.gammatwo.com%2F2009%2F11%2F24%2Fraw-printing-net-2-to-generic-printserver%2F&amp;linkname=HowTo%20RAW%20Printing%20C%23%20.NET%202.0%20To%20Network%20Printer" title="Technorati Favorites" rel="nofollow" target="_blank"><img src="http://www.gammatwo.com/wp-content/plugins/add-to-any/icons/technorati.png" width="16" height="16" alt="Technorati Favorites"/></a><a class="a2a_button_delicious" href="http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fwww.gammatwo.com%2F2009%2F11%2F24%2Fraw-printing-net-2-to-generic-printserver%2F&amp;linkname=HowTo%20RAW%20Printing%20C%23%20.NET%202.0%20To%20Network%20Printer" title="Delicious" rel="nofollow" target="_blank"><img src="http://www.gammatwo.com/wp-content/plugins/add-to-any/icons/delicious.png" width="16" height="16" alt="Delicious"/></a><a class="a2a_button_google_bookmarks" href="http://www.addtoany.com/add_to/google_bookmarks?linkurl=http%3A%2F%2Fwww.gammatwo.com%2F2009%2F11%2F24%2Fraw-printing-net-2-to-generic-printserver%2F&amp;linkname=HowTo%20RAW%20Printing%20C%23%20.NET%202.0%20To%20Network%20Printer" title="Google Bookmarks" rel="nofollow" target="_blank"><img src="http://www.gammatwo.com/wp-content/plugins/add-to-any/icons/google.png" width="16" height="16" alt="Google Bookmarks"/></a><a class="a2a_button_dzone" href="http://www.addtoany.com/add_to/dzone?linkurl=http%3A%2F%2Fwww.gammatwo.com%2F2009%2F11%2F24%2Fraw-printing-net-2-to-generic-printserver%2F&amp;linkname=HowTo%20RAW%20Printing%20C%23%20.NET%202.0%20To%20Network%20Printer" title="DZone" rel="nofollow" target="_blank"><img src="http://www.gammatwo.com/wp-content/plugins/add-to-any/icons/dzone.png" width="16" height="16" alt="DZone"/></a><a class="a2a_button_yahoo_bookmarks" href="http://www.addtoany.com/add_to/yahoo_bookmarks?linkurl=http%3A%2F%2Fwww.gammatwo.com%2F2009%2F11%2F24%2Fraw-printing-net-2-to-generic-printserver%2F&amp;linkname=HowTo%20RAW%20Printing%20C%23%20.NET%202.0%20To%20Network%20Printer" title="Yahoo Bookmarks" rel="nofollow" target="_blank"><img src="http://www.gammatwo.com/wp-content/plugins/add-to-any/icons/yahoo.png" width="16" height="16" alt="Yahoo Bookmarks"/></a><a class="a2a_button_facebook" href="http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Fwww.gammatwo.com%2F2009%2F11%2F24%2Fraw-printing-net-2-to-generic-printserver%2F&amp;linkname=HowTo%20RAW%20Printing%20C%23%20.NET%202.0%20To%20Network%20Printer" title="Facebook" rel="nofollow" target="_blank"><img src="http://www.gammatwo.com/wp-content/plugins/add-to-any/icons/facebook.png" width="16" height="16" alt="Facebook"/></a><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.gammatwo.com%2F2009%2F11%2F24%2Fraw-printing-net-2-to-generic-printserver%2F&amp;title=HowTo%20RAW%20Printing%20C%23%20.NET%202.0%20To%20Network%20Printer" id="wpa2a_20">Share/Save</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.gammatwo.com/2009/11/24/raw-printing-net-2-to-generic-printserver/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

