<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Formatting code in blogs</title><link>http://blogs.msdn.com/jaybaz_ms/archive/2004/03/30/103505.aspx</link><description>In a comment , Steve asks how I format code in my blog. Here's the answer: Write the code in Visual Studio. Include correct references, 'using' directives, helper classes, fields, etc. Make sure the code builds. (I really should use NUnit to make sure</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>re: Formatting code in blogs</title><link>http://blogs.msdn.com/jaybaz_ms/archive/2004/03/30/103505.aspx#107241</link><pubDate>Sun, 04 Apr 2004 02:48:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:107241</guid><dc:creator>RB</dc:creator><description>I've written a HTML WYSIWYG editor and Word is it's second worst enemy (worst is Excel). The &amp;quot;HTML&amp;quot; generated by Word is unbelievably bad. Around 90% of the code is dedicated to trying to clean up Word HTML so that it can be displayed correctly in our (hopefully valid) XHTML websites. &lt;br&gt;&lt;br&gt;One day when you're in Word, save your document as HTML and veiw it in notepad. The amount of bad HTML in there will amaze you. &lt;br&gt;&lt;br&gt;So rather than stating that the RTF pasting is extra-broken, it would be more correct to say that the coders didn't have an extra two months to spend writing code to specifically clean up the crap from Word.&lt;br&gt; </description></item><item><title>re: Formatting code in blogs</title><link>http://blogs.msdn.com/jaybaz_ms/archive/2004/03/30/103505.aspx#111889</link><pubDate>Mon, 12 Apr 2004 22:31:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:111889</guid><dc:creator>Robert</dc:creator><description>What's wrong with simply putting your code inside PRE and/or CODE tags? Then you don't end up with all those bizarre MS Office xml tags that take up so much space.</description></item><item><title>re: Formatting code in blogs</title><link>http://blogs.msdn.com/jaybaz_ms/archive/2004/03/30/103505.aspx#112011</link><pubDate>Tue, 13 Apr 2004 04:07:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:112011</guid><dc:creator>jaybaz_MS</dc:creator><description>Robert: what smart tags are you talking about?  I don't think I've seen them.</description></item><item><title>re: Formatting code in blogs</title><link>http://blogs.msdn.com/jaybaz_ms/archive/2004/03/30/103505.aspx#112152</link><pubDate>Tue, 13 Apr 2004 10:57:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:112152</guid><dc:creator>Raphaël Balimann</dc:creator><description>You may want to read Phil Ringnaldas comments on clean code.&lt;br&gt;&lt;br&gt;&lt;a target="_new" href="http://philringnalda.com/blog/2004/04/html_is_code.php"&gt;http://philringnalda.com/blog/2004/04/html_is_code.php&lt;/a&gt;</description></item><item><title>re: Articles added.</title><link>http://blogs.msdn.com/jaybaz_ms/archive/2004/03/30/103505.aspx#117259</link><pubDate>Wed, 21 Apr 2004 06:16:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:117259</guid><dc:creator>JimGries's WebLog</dc:creator><description /></item><item><title>re: Formatting code in blogs</title><link>http://blogs.msdn.com/jaybaz_ms/archive/2004/03/30/103505.aspx#122603</link><pubDate>Thu, 29 Apr 2004 01:53:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:122603</guid><dc:creator>James</dc:creator><description>this page doesn't even validate...&lt;br&gt;&lt;br&gt;&lt;a target="_new" href="http://validator.w3.org/check?uri=http://blogs.msdn.com/jaybaz_ms/archive/2004/03/30/103505.aspx"&gt;http://validator.w3.org/check?uri=http://blogs.msdn.com/jaybaz_ms/archive/2004/03/30/103505.aspx&lt;/a&gt;&lt;br&gt;&lt;br&gt;so you're code isn't that clean!</description></item><item><title>re: Formatting code in blogs</title><link>http://blogs.msdn.com/jaybaz_ms/archive/2004/03/30/103505.aspx#123129</link><pubDate>Thu, 29 Apr 2004 17:45:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:123129</guid><dc:creator>jaybaz [MS]</dc:creator><description>James: Yeah, you're not the first person to tell me.  Word generates nasty looking HTML that looks great when rendered.  If you have any suggestions on how I can format my blog to look good *AND* have attractive HTML, let me know.</description></item><item><title>Visual Studio Add-In: CopySourceAsHtml</title><link>http://blogs.msdn.com/jaybaz_ms/archive/2004/03/30/103505.aspx#241993</link><pubDate>Thu, 14 Oct 2004 00:53:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:241993</guid><dc:creator>Needs Improvement</dc:creator><description>&amp;lt;p&amp;gt;&lt;br&gt;&amp;lt;a href=&amp;quot;http://blogs.msdn.com/brada/archive/2004/10/05/238427.aspx&amp;quot;&amp;gt;Brad Abrams&amp;lt;/a&amp;gt;, &lt;br&gt;&amp;lt;a href=&amp;quot;http://blogs.msdn.com/jaybaz_ms/archive/2004/03/30/103505.aspx&amp;quot;&amp;gt;Jay Bazuzi&amp;lt;/a&amp;gt;, &lt;br&gt;&amp;lt;a href=&amp;quot;http://weblogs.asp.net/rosherove/archive/2004/02/05/67957.aspx&amp;quot;&amp;gt;Roy Osherove&amp;lt;/a&amp;gt;, &lt;br&gt;and what seems like the majority of .NET bloggers use Word, Word macros, or Visual Studio macros that use Word &lt;br&gt;in some way to format their code.  A few use &lt;br&gt;&amp;lt;a href=&amp;quot;http://www.manoli.net/&amp;quot;&amp;gt;Jean-Claude Manoli&amp;lt;/a&amp;gt;'s &lt;br&gt;&amp;lt;a href=&amp;quot;http://www.manoli.net/csharpformat/&amp;quot;&amp;gt;CSharpFormat&amp;lt;/a&amp;gt;&lt;br&gt;tool.  Each solution has drawbacks (opening Word, opening another browser window, copying and pasting, extra steps, &lt;br&gt;terrible HTML, etc) and formatting code is still painful.  So...&lt;br&gt;&amp;lt;/p&amp;gt;&lt;br&gt;&amp;lt;p&amp;gt;&lt;br&gt;I've written a simple Visual Studio add-in that allows you to copy source as HTML suitable for pasting into blogs...&lt;br&gt;&amp;lt;/p&amp;gt;&lt;br&gt;</description></item><item><title>CopySourceAsHtml</title><link>http://blogs.msdn.com/jaybaz_ms/archive/2004/03/30/103505.aspx#244679</link><pubDate>Tue, 19 Oct 2004 21:52:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:244679</guid><dc:creator>Needs Improvement</dc:creator><description> Brad Abrams, Jay Bazuzi, Roy Osherove, and what seems like the majority of .NET bloggers use Word, Word macros, or Visual Studio macros that use Word in some way to format their code. A few use Jean-Claude Manoli's CSharpFormat...</description></item><item><title>CopySourceAsHtml</title><link>http://blogs.msdn.com/jaybaz_ms/archive/2004/03/30/103505.aspx#257254</link><pubDate>Mon, 15 Nov 2004 01:42:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:257254</guid><dc:creator>Bill Shen's Blog</dc:creator><description /></item><item><title>Spring : falling in love with programming all over again</title><link>http://blogs.msdn.com/jaybaz_ms/archive/2004/03/30/103505.aspx#269286</link><pubDate>Wed, 24 Nov 2004 19:09:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:269286</guid><dc:creator>maps and legends</dc:creator><description>Peter Gray left a comment that I can reduce the a part of the spring example even further, from this:public long getNewPrimaryKey(String sequenceName) { JdbcTemplate jdbcTemp = new JdbcTemplate(dataSource); long seqKey = jdbcTemp.queryForLong(&amp;quot;select &amp;quot;+sequenceName+&amp;quot;.nextval from dual&amp;quot;); return seqKey; } to this:public long getNewPrimaryKey(String sequenceName) { OracleSequenceMaxValueIncrementer osmvi = new OracleSequenceMaxValueIncrementer(dataSource,sequenceName); return osmvi.nextLongValue(); } And you swap the constructor for a call to the bean factory to get an instance of the bean if you have it configured in your spring.xml...</description></item><item><title>CopySourceAsHtml</title><link>http://blogs.msdn.com/jaybaz_ms/archive/2004/03/30/103505.aspx#333088</link><pubDate>Tue, 28 Dec 2004 06:25:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:333088</guid><dc:creator>Needs Improvement</dc:creator><description> Brad Abrams, Jay Bazuzi, Roy Osherove, and what seems like the majority of .NET bloggers use Word, Word macros, or Visual Studio macros that use Word in some way to format their code. A few use Jean-Claude Manoli's CSharpFormat...</description></item></channel></rss>