<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Stream of Consciousness</title>
	<atom:link href="http://cassioam.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://cassioam.wordpress.com</link>
	<description></description>
	<lastBuildDate>Wed, 28 Mar 2007 12:16:20 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='cassioam.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Stream of Consciousness</title>
		<link>http://cassioam.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://cassioam.wordpress.com/osd.xml" title="Stream of Consciousness" />
	<atom:link rel='hub' href='http://cassioam.wordpress.com/?pushpress=hub'/>
		<item>
		<title>AJAX AutoSuggest Textbox</title>
		<link>http://cassioam.wordpress.com/2007/03/28/ajax-autosuggest-textbox/</link>
		<comments>http://cassioam.wordpress.com/2007/03/28/ajax-autosuggest-textbox/#comments</comments>
		<pubDate>Wed, 28 Mar 2007 12:16:19 +0000</pubDate>
		<dc:creator>Cassio Mosqueira</dc:creator>
		
		<guid isPermaLink="false">http://cassioam.wordpress.com/2007/03/28/ajax-autosuggest-textbox/</guid>
		<description><![CDATA[I wrote an article on CodeProject describing this nice webcontrol I&#8217;ve done using the Anthem library. I find this webcontrol very useful in many situations. Here is the link to the article with the source code and some samples: http://www.codeproject.com/Ajax/AJAXAutoSuggest.asp<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=cassioam.wordpress.com&amp;blog=418049&amp;post=40&amp;subd=cassioam&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I wrote an article on <a href="http://www.codeproject.com/">CodeProject</a> describing this nice webcontrol I&#8217;ve done using the Anthem library. I find this webcontrol very useful in many situations.</p>
<p><a href="http://cassioam.files.wordpress.com/2007/03/windowslivewriterajaxautosuggesttextbox-8254example3.jpg"><img style="border-right:0;border-top:0;border-left:0;border-bottom:0;" height="337" src="http://cassioam.files.wordpress.com/2007/03/windowslivewriterajaxautosuggesttextbox-8254example-thumb1.jpg?w=472&#038;h=337" width="472" border="0"></a> </p>
<p>Here is the link to the article with the source code and some samples: <a href="http://www.codeproject.com/Ajax/AJAXAutoSuggest.asp">http://www.codeproject.com/Ajax/AJAXAutoSuggest.asp</a></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/cassioam.wordpress.com/40/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/cassioam.wordpress.com/40/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/cassioam.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/cassioam.wordpress.com/40/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/cassioam.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/cassioam.wordpress.com/40/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/cassioam.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/cassioam.wordpress.com/40/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/cassioam.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/cassioam.wordpress.com/40/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/cassioam.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/cassioam.wordpress.com/40/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/cassioam.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/cassioam.wordpress.com/40/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/cassioam.wordpress.com/40/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/cassioam.wordpress.com/40/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=cassioam.wordpress.com&amp;blog=418049&amp;post=40&amp;subd=cassioam&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://cassioam.wordpress.com/2007/03/28/ajax-autosuggest-textbox/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/71b11b1e2411ebf6c01a21c74bbf6693?s=96&#38;d=identicon" medium="image">
			<media:title type="html">cassioam</media:title>
		</media:content>

		<media:content url="http://cassioam.files.wordpress.com/2007/03/windowslivewriterajaxautosuggesttextbox-8254example-thumb1.jpg" medium="image" />
	</item>
		<item>
		<title>Change ListBox background color</title>
		<link>http://cassioam.wordpress.com/2007/01/04/change-listbox-background-color/</link>
		<comments>http://cassioam.wordpress.com/2007/01/04/change-listbox-background-color/#comments</comments>
		<pubDate>Thu, 04 Jan 2007 18:28:48 +0000</pubDate>
		<dc:creator>Cassio Mosqueira</dc:creator>
		
		<guid isPermaLink="false">http://cassioam.wordpress.com/2007/01/04/change-listbox-background-color/</guid>
		<description><![CDATA[The screenshot below is from&#160;an interesting&#160;software I&#160;wrote for my college final project. It is an assembly and microinstruction emulator that gives you the chance to debug and monitor all the registers, controllers, buses and&#160;memory&#160;values. I&#8217;ll try to talk more about that project in&#160;future posts. On the form we have a RichTextBox on the left, where [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=cassioam.wordpress.com&amp;blog=418049&amp;post=37&amp;subd=cassioam&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<div>
<p>The screenshot below is from&nbsp;an interesting&nbsp;software I&nbsp;wrote for my college final project. It is an assembly and microinstruction emulator that gives you the chance to debug and monitor all the registers, controllers, buses and&nbsp;memory&nbsp;values. I&#8217;ll try to talk more about that project in&nbsp;future posts.</p>
<p>On the form we have a RichTextBox on the left, where we can write macroinstructions (i.e., assembly) and on the top left we have a ListBox that contains the default microinstruction program.&nbsp; So as we debug the instructions&nbsp;we have to keep track of which command line is being executed, both on the macro and micro-program.</p>
<p>To give it a Visual Studio feeling I decided to highlight the current command line.</p>
<p><a href="http://cassioam.files.wordpress.com/2007/01/windowslivewriterchangelistboxbackgroundcolor-d0e6imagem401.jpg"><img style="border-width:0;" height="400" src="http://cassioam.files.wordpress.com/2007/01/windowslivewriterchangelistboxbackgroundcolor-d0e6imagem-thumb361.jpg?w=497&#038;h=400" width="497" border="0"></a> </p>
<p>The RichTextBox already has a built-in SelectionBackColor property, so the only thing I had to do was to select the current command and set the property to yellow.</p>
<p>On&nbsp;the other hand, the ListBox&nbsp;doesn&#8217;t have&nbsp;any built-in property like that. But I found a pretty easy way to do it.</p>
<p>The ListBox control exposes&nbsp;a DrawItem event that we can use to override the default&nbsp;drawing for each item.<br />First we need to set the DrawMode property of the ListBox to DrawMode.OwnerDrawFixed. This can be done on the form&#8217;s&nbsp;constructor, right&nbsp;after the InitializeComponent method is called.<br />Then, on the DrawItem event handler we&nbsp;need to write the following code to draw the ListBox item.&nbsp;&nbsp;</p>
<div style="background-color:#ffffff;">
<pre><span style="color:#0000ff;">private</span> <span style="color:#0000ff;">void</span> lbMIC_DrawItem(<span style="color:#0000ff;">object</span> sender, DrawItemEventArgs e)
{
    <span style="color:#008000;">// if we call the DrawBackground method, </span>
    <span style="color:#008000;">// it will use the default gray color to paint the background</span>
    <span style="color:#008000;">//e.DrawBackground();</span>

    Brush backGroundBrush;

    <span style="color:#008000;">// Determines if the current item is the selected one</span>
    <span style="color:#0000ff;">if</span> ((e.State &amp; DrawItemState.Selected) &gt; 0)
    {
        <span style="color:#008000;">//It is the selected one, so we use yellow</span>
        backGroundBrush = Brushes.Yellow;
    }
    <span style="color:#0000ff;">else</span>
    {
        <span style="color:#008000;">//It isn't the selected one,
        //so we use the default white color</span>
        backGroundBrush = Brushes.White;
    }

    <span style="color:#008000;">// Draw the background as a rectangle using
    //the color defined above</span>
    e.Graphics.FillRectangle(backGroundBrush, e.Bounds);

    <span style="color:#008000;">// Draw the text of the item</span>
    <span style="color:#008000;">// Here you can also change the text fore color</span>
    <span style="color:#0000ff;">if</span> (e.Index &gt; -1)
        e.Graphics.DrawString(lbMIC.Items[e.Index].ToString(),
        	e.Font, Brushes.Black, e.Bounds);
}</pre>
</div>
<p>&nbsp;</p>
<p>With this in mind, we could easily create an inherited ListBox control with a built-in SelectedItemBackColor property.</p>
<p>Hope&nbsp;it helps. </p>
<p>Cassio</p>
</div>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/cassioam.wordpress.com/37/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/cassioam.wordpress.com/37/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/cassioam.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/cassioam.wordpress.com/37/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/cassioam.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/cassioam.wordpress.com/37/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/cassioam.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/cassioam.wordpress.com/37/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/cassioam.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/cassioam.wordpress.com/37/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/cassioam.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/cassioam.wordpress.com/37/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/cassioam.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/cassioam.wordpress.com/37/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/cassioam.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/cassioam.wordpress.com/37/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=cassioam.wordpress.com&amp;blog=418049&amp;post=37&amp;subd=cassioam&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://cassioam.wordpress.com/2007/01/04/change-listbox-background-color/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/71b11b1e2411ebf6c01a21c74bbf6693?s=96&#38;d=identicon" medium="image">
			<media:title type="html">cassioam</media:title>
		</media:content>

		<media:content url="http://cassioam.files.wordpress.com/2007/01/windowslivewriterchangelistboxbackgroundcolor-d0e6imagem-thumb361.jpg" medium="image" />
	</item>
		<item>
		<title>Select Multiple Objects in SQL Manager Studio</title>
		<link>http://cassioam.wordpress.com/2006/11/05/select-multiple-objects-in-sql-manager-studio/</link>
		<comments>http://cassioam.wordpress.com/2006/11/05/select-multiple-objects-in-sql-manager-studio/#comments</comments>
		<pubDate>Sun, 05 Nov 2006 16:16:22 +0000</pubDate>
		<dc:creator>Cassio Mosqueira</dc:creator>
				<category><![CDATA[MS SQL Server/ T-SQL]]></category>

		<guid isPermaLink="false">http://cassioam.wordpress.com/2006/11/05/select-multiple-objects-in-sql-manager-studio/</guid>
		<description><![CDATA[This is a little tip for developers who are using SQL Server 2005 and, like me, are missing some of the functionality Enterprise Manager used to offer. It&#8217;s often&#160;necessary to select multiple objects (tables or stored procedures) to script or drop them. But in the Object Explorer in SQL Management Studio you can only select [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=cassioam.wordpress.com&amp;blog=418049&amp;post=13&amp;subd=cassioam&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This is a little tip for developers who are using SQL Server 2005 and, like me, are missing some of the functionality Enterprise Manager used to offer. </p>
<p>It&#8217;s often&nbsp;necessary to select multiple objects (tables or stored procedures) to script or drop them. But in the Object Explorer in SQL Management Studio you can only select one item at a time. That&#8217;s a pain when you need to publish your new stored procedures on the production database at the end of the day.</p>
<p>After a couple of&nbsp;days I realised that you can use the summary page to multiselect objects. Just&nbsp;use the&nbsp;F7 key to open it and now you can script or delete multiple objects. You can even filter the objects you want to see on the page by using the filter option on the top of the page. That&#8217;s very helpful when your database has more than one thousand stored procedures.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/cassioam.wordpress.com/13/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/cassioam.wordpress.com/13/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/cassioam.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/cassioam.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/cassioam.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/cassioam.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/cassioam.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/cassioam.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/cassioam.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/cassioam.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/cassioam.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/cassioam.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/cassioam.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/cassioam.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/cassioam.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/cassioam.wordpress.com/13/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=cassioam.wordpress.com&amp;blog=418049&amp;post=13&amp;subd=cassioam&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://cassioam.wordpress.com/2006/11/05/select-multiple-objects-in-sql-manager-studio/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/71b11b1e2411ebf6c01a21c74bbf6693?s=96&#38;d=identicon" medium="image">
			<media:title type="html">cassioam</media:title>
		</media:content>
	</item>
		<item>
		<title>T-SQL Proper Case Function</title>
		<link>http://cassioam.wordpress.com/2006/10/07/t-sql-proper-case-function/</link>
		<comments>http://cassioam.wordpress.com/2006/10/07/t-sql-proper-case-function/#comments</comments>
		<pubDate>Sat, 07 Oct 2006 05:18:20 +0000</pubDate>
		<dc:creator>Cassio Mosqueira</dc:creator>
				<category><![CDATA[MS SQL Server/ T-SQL]]></category>

		<guid isPermaLink="false">http://cassioam.wordpress.com/2006/10/07/t-sql-proper-case-function/</guid>
		<description><![CDATA[Today one of our clients asked us to&#160;fix the letter&#160;casing in a particular field of the&#160;products table. We had just imported their products table from their old system into ours and the products descriptions&#160;were all messed up. Since&#160;there is no&#160;buit-in function to do that, I had to do it my own. I&#8217;m posting it here [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=cassioam.wordpress.com&amp;blog=418049&amp;post=12&amp;subd=cassioam&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Today one of our clients asked us to&nbsp;fix the letter&nbsp;casing in a particular field of the&nbsp;products table. We had just imported their products table from their old system into ours and the products descriptions&nbsp;were all messed up.</p>
<p>Since&nbsp;there is no&nbsp;buit-in function to do that, I had to do it my own. <br />I&#8217;m posting it here in case someone find it useful.&nbsp;</p>
<div style="background-color:#ffffff;">
<pre><span style="color:#0000ff;">CREATE</span> <span style="color:#0000ff;">FUNCTION</span> [dbo].[ProperCase]
(
    @str <span style="color:#0000ff;">VARCHAR</span>(500)
)
<span style="color:#0000ff;">RETURNS</span> <span style="color:#0000ff;">VARCHAR</span>(500)
<span style="color:#0000ff;">AS</span>
<span style="color:#0000ff;">BEGIN</span>
    <span style="color:#0000ff;">IF</span> @str <span style="color:#0000ff;">IS</span> <span style="color:#0000ff;">NULL</span>
        <span style="color:#0000ff;">RETURN</span> <span style="color:#0000ff;">NULL</span>  

    <span style="color:#0000ff;">DECLARE</span> @counter <span style="color:#0000ff;">INT</span>
    <span style="color:#0000ff;">DECLARE</span> @ret <span style="color:#0000ff;">VARCHAR</span>(255)
    <span style="color:#0000ff;">DECLARE</span> @goUp <span style="color:#0000ff;">BIT</span>
    <span style="color:#0000ff;">DECLARE</span> @currentChar <span style="color:#0000ff;">CHAR</span> 

    <span style="color:#0000ff;">SET</span> @counter = 1
    <span style="color:#0000ff;">SET</span> @ret = <span style="color:#990000;">''</span>
    <span style="color:#0000ff;">SET</span> @goUp = 1 

    <span style="color:#0000ff;">WHILE</span> @counter &lt;= LEN(@str)
    <span style="color:#0000ff;">BEGIN</span>
        <span style="color:#0000ff;">SET</span> @currentChar = <span style="color:#0000ff;">SUBSTRING</span>(@str, @counter, 1)
        <span style="color:#0000ff;">IF</span> @currentChar <span style="color:#0000ff;">IN</span> (<span style="color:#990000;">' '</span>, <span style="color:#990000;">'-'</span>)
            <span style="color:#0000ff;">SET</span> @goUp  = 1
        <span style="color:#0000ff;">ELSE</span>
        <span style="color:#0000ff;">BEGIN</span>
            <span style="color:#0000ff;">IF</span> @goUp  = 1
                <span style="color:#0000ff;">SET</span> @currentChar = <span style="color:#0000ff;">UPPER</span>(@currentChar)
            <span style="color:#0000ff;">ELSE</span>
                <span style="color:#0000ff;">SET</span> @currentChar = <span style="color:#0000ff;">LOWER</span>(@currentChar)  

            <span style="color:#0000ff;">SET</span> @goUp  = 0
        <span style="color:#0000ff;">END</span> 

        <span style="color:#0000ff;">SET</span> @ret = @ret + @currentChar
        <span style="color:#0000ff;">SET</span> @counter = @counter + 1
    <span style="color:#0000ff;">END</span>
    <span style="color:#0000ff;">RETURN</span> @ret
<span style="color:#0000ff;">END</span> </pre>
</div>
<p></p>
<p>After creating the user-defined function in the database, you can use the following line to test it: </p>
<div style="background-color:#ffffff;">
<pre><span style="color:#0000ff;">SELECT</span> dbo.ProperCase(<span style="color:#990000;">'GOLD 802.11B WIRELESS CARD'</span>)</pre>
</div>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/cassioam.wordpress.com/12/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/cassioam.wordpress.com/12/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/cassioam.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/cassioam.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/cassioam.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/cassioam.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/cassioam.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/cassioam.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/cassioam.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/cassioam.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/cassioam.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/cassioam.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/cassioam.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/cassioam.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/cassioam.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/cassioam.wordpress.com/12/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=cassioam.wordpress.com&amp;blog=418049&amp;post=12&amp;subd=cassioam&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://cassioam.wordpress.com/2006/10/07/t-sql-proper-case-function/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/71b11b1e2411ebf6c01a21c74bbf6693?s=96&#38;d=identicon" medium="image">
			<media:title type="html">cassioam</media:title>
		</media:content>
	</item>
		<item>
		<title>Source Code Formatting</title>
		<link>http://cassioam.wordpress.com/2006/09/16/source-code-formatting/</link>
		<comments>http://cassioam.wordpress.com/2006/09/16/source-code-formatting/#comments</comments>
		<pubDate>Sat, 16 Sep 2006 07:09:23 +0000</pubDate>
		<dc:creator>Cassio Mosqueira</dc:creator>
				<category><![CDATA[c#]]></category>
		<category><![CDATA[Life Hacks]]></category>

		<guid isPermaLink="false">http://cassioam.wordpress.com/2006/09/16/source-code-formatting/</guid>
		<description><![CDATA[When I decided to set up this blog, the first thing I thought was: &#8220;how am I going to format my c# code blocks on the web?&#8221;. After some googling, I found this really nice site that, apparently, did just what I needed. It formats c#, vb, html and even t-sql. The only drawback for me is [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=cassioam.wordpress.com&amp;blog=418049&amp;post=11&amp;subd=cassioam&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><font face="Courier New">When I decided to set up this blog, the first thing I thought was: &#8220;how am I going to format my c# code blocks on the web?&#8221;. After some googling, I found <a target="_blank" href="http://www.manoli.net/csharpformat/">this</a> really nice site that, apparently, did just what I needed. It formats c#, vb, html and even t-sql. The only drawback for me is that it uses CSS classes. WordPress and other free blogs do not support that.</font></p>
<p><font face="Courier New">Thankfully, the author had posted the source code, so I tweaked it a little bit and created a simple windows app to format the code without CSS classes.</font></p>
<p><font face="Courier New">Here&#8217;s a screenshot:</font></p>
<p><a href="http://cassioam.files.wordpress.com/2006/09/WindowsLiveWriter/SourceCodeFormatting_3181/scformatter%5B28%5D.jpg"><img border="0" width="487" src="http://cassioam.files.wordpress.com/2006/09/WindowsLiveWriter/SourceCodeFormatting_3181/scformatter_thumb%5B18%5D.jpg?w=487&#038;h=420" height="420" /></a></p>
<p>And here&#8217;s a proof it works:</p>
<div style="background-color:white;border-width:1px;">
<pre><span style="font-size:11px;color:#0000ff;">using</span> System;
<span style="color:#0000ff;">using</span> System.Collections.Generic;
<span style="color:#0000ff;">using</span> System.Text;
<span style="color:#0000ff;">using</span> System.Web.UI;
<span style="color:#0000ff;">using</span> System.Web.UI.WebControls;           

<span style="color:#0000ff;">namespace</span> Common
{
    <span style="color:#008000;">/// &lt;summary&gt;</span>
    <span style="color:#008000;">/// Comments here</span>
    <span style="color:#008000;">/// &lt;/summary&gt;</span>
    [Serializable]
    <span style="color:#0000ff;">public</span> <span style="color:#0000ff;">class</span> FieldManager
    {
        <span style="color:#0000ff;">private</span> Dictionary&lt;<span style="color:#0000ff;">string</span>, Field&gt; _controlList;
        <span style="color:#0000ff;">public</span> FieldManager()
        {
            _controlList = <span style="color:#0000ff;">new</span> Dictionary&lt;<span style="color:#0000ff;">string</span>, Field&gt;();
        }
    }
}</pre>
</div>
<p>If you like it, get the source files <a href="http://www.esnips.com/doc/04908b6f-b074-49cc-aef5-d603f7b7754b/Source-code-formatter.zip">here</a>.</p>
<p>Hope this helps,</p>
<p>Cassio</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/cassioam.wordpress.com/11/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/cassioam.wordpress.com/11/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/cassioam.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/cassioam.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/cassioam.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/cassioam.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/cassioam.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/cassioam.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/cassioam.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/cassioam.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/cassioam.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/cassioam.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/cassioam.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/cassioam.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/cassioam.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/cassioam.wordpress.com/11/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=cassioam.wordpress.com&amp;blog=418049&amp;post=11&amp;subd=cassioam&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://cassioam.wordpress.com/2006/09/16/source-code-formatting/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/71b11b1e2411ebf6c01a21c74bbf6693?s=96&#38;d=identicon" medium="image">
			<media:title type="html">cassioam</media:title>
		</media:content>

		<media:content url="http://cassioam.files.wordpress.com/2006/09/WindowsLiveWriter/SourceCodeFormatting_3181/scformatter_thumb%5B18%5D.jpg" medium="image" />
	</item>
	</channel>
</rss>
