<?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>vandango &#187; Code Snippet</title>
	<atom:link href="http://www.vandango.org/archives/tag/code-snippet/feed" rel="self" type="application/rss+xml" />
	<link>http://www.vandango.org</link>
	<description>driving on code serpentines</description>
	<lastBuildDate>Tue, 17 Aug 2010 20:59:52 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>AODL &#8211; The .NET Interface for ODF files</title>
		<link>http://www.vandango.org/archives/aodl-the-net-interface-for-odf-files</link>
		<comments>http://www.vandango.org/archives/aodl-the-net-interface-for-odf-files#comments</comments>
		<pubDate>Tue, 22 Apr 2008 10:16:00 +0000</pubDate>
		<dc:creator>vandango</dc:creator>
				<category><![CDATA[Technik]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[AODL]]></category>
		<category><![CDATA[Code Snippet]]></category>
		<category><![CDATA[Coding]]></category>
		<category><![CDATA[English]]></category>
		<category><![CDATA[Projekte]]></category>

		<guid isPermaLink="false">http://www.vandango.org//?p=13</guid>
		<description><![CDATA[In my spare free time im working on a simple movie database to have a sortable collection list of my movies. Hitherto i&#8217;ve do that with the Spreadsheet of OpenOffice.After some time of development i&#8217;ve finished a first betaversion of my tool and starts to work on a importer.The best way to import ODF files [...]]]></description>
			<content:encoded><![CDATA[<p>In my spare free time im working on a simple movie database to have a sortable collection list of my movies. Hitherto i&#8217;ve do that with the Spreadsheet of OpenOffice.<br />After some time of development i&#8217;ve finished a first betaversion of my tool and starts to work on a importer.<br />The best way to import ODF files is to extract the content files fromt the zip-encoded files and read the xml. This steps were already done by the OpenOffice team and somebody has implement this steps in a .NET interface library. I&#8217;ve found this project (<a href="http://wiki.services.openoffice.org/wiki/AODL" target="_blank">AODL</a>, <a href="http://sourceforge.net/projects/aodl" target="_blank">Sourceforge</a>) and starts to working with it. Bug it has a bad bug.<br />I have a big table with many cells in many rows, but some of this cell &#8211; also severals side by side &#8211; are empty. And OpenOffice creates on this empty cells a XML attribute called &#8220;table:number-columns-repeated&#8221; which descripes how many copies of this cells came after this one.<br />The AODL assembly do&#8217;snt has this attribute calculation implemented so that if&#8217;ve sit down and do that. So, here&#8217;s the bugfix and the assembly.</p>
<p>Link: <a href="http://static.toenda.com/patches/AODL_vandango_bugfix_1.2.0.2.zip">Download</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.vandango.org/archives/aodl-the-net-interface-for-odf-files/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Code Snippet &#8211; C#: Prüfen ob ein String eine gültige Zahl ist / ein gültiger Alpha-numerischer String</title>
		<link>http://www.vandango.org/archives/code-snippet-c-pr-fen-ob-ein-string-eine-g-ltige-zahl-ist-ein-g-ltiger-alpha-numerischer-string</link>
		<comments>http://www.vandango.org/archives/code-snippet-c-pr-fen-ob-ein-string-eine-g-ltige-zahl-ist-ein-g-ltiger-alpha-numerischer-string#comments</comments>
		<pubDate>Fri, 08 Jun 2007 08:52:00 +0000</pubDate>
		<dc:creator>vandango</dc:creator>
				<category><![CDATA[Technik]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[Code Snippet]]></category>
		<category><![CDATA[Coding]]></category>
		<category><![CDATA[Mono]]></category>

		<guid isPermaLink="false">http://www.vandango.org//?p=48</guid>
		<description><![CDATA[public bool IsAlphaNumericString(string strAlphanum) { &#160;&#160;&#160; System.Text.RegularExpressions.Regex pattern = new System.Text.RegularExpressions.Regex(@&#8221;^[A-Za-z0-9]+$&#8221;); &#160;&#160;&#160; return pattern.IsMatch(strAlphanum.Trim()); } public bool IsNumeric(string strAlphanum) { &#160;&#160;&#160; System.Text.RegularExpressions.Regex pattern = new System.Text.RegularExpressions.Regex(@&#8221;^[0-9]+$&#8221;); &#160;&#160;&#160; return pattern.IsMatch(strAlphanum.Trim()); }]]></description>
			<content:encoded><![CDATA[<p>public bool IsAlphaNumericString(string strAlphanum) {<br />
&nbsp;&nbsp;&nbsp; System.Text.RegularExpressions.Regex pattern = new System.Text.RegularExpressions.Regex(@&#8221;^[A-Za-z0-9]+$&#8221;);<br />
&nbsp;&nbsp;&nbsp; return pattern.IsMatch(strAlphanum.Trim());<br />
}</p>
<p>public bool IsNumeric(string strAlphanum) {<br />
&nbsp;&nbsp;&nbsp; System.Text.RegularExpressions.Regex pattern = new System.Text.RegularExpressions.Regex(@&#8221;^[0-9]+$&#8221;);<br />
&nbsp;&nbsp;&nbsp; return pattern.IsMatch(strAlphanum.Trim());<br />
}<strong class="text_huge"></strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.vandango.org/archives/code-snippet-c-pr-fen-ob-ein-string-eine-g-ltige-zahl-ist-ein-g-ltiger-alpha-numerischer-string/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>LIMIT x,y in T-SQL?</title>
		<link>http://www.vandango.org/archives/limit-xy-in-t-sql</link>
		<comments>http://www.vandango.org/archives/limit-xy-in-t-sql#comments</comments>
		<pubDate>Tue, 21 Nov 2006 23:02:00 +0000</pubDate>
		<dc:creator>vandango</dc:creator>
				<category><![CDATA[Technik]]></category>
		<category><![CDATA[Code Snippet]]></category>
		<category><![CDATA[Projekte]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[T-SQL]]></category>

		<guid isPermaLink="false">http://www.vandango.org//?p=76</guid>
		<description><![CDATA[Wer kennt nicht das Problem, Daten Seitenweise aus der Datenbank zu laden. MySQL kann das auch sehr sch&#246;n mit einem beherzten LIMIT x,y, aber wenn man nun an einem Microsoft SQL Server sitzt und nur T-SQL hat? Dagegen hilft nur der folgender Code Schnitzel: SELECT * FROM &#160;&#160;&#160;&#160;SELECT TOP x * FROM ( &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;SELECT TOP [...]]]></description>
			<content:encoded><![CDATA[<p>Wer kennt nicht das Problem, Daten Seitenweise aus der Datenbank zu laden. MySQL kann das auch sehr sch&#246;n mit einem beherzten LIMIT x,y, aber wenn man nun an einem Microsoft SQL Server sitzt und nur T-SQL hat?<br />
Dagegen hilft nur der folgender Code Schnitzel:</p>
<pre>
SELECT * FROM
&nbsp;&nbsp;&nbsp;&nbsp;SELECT TOP x * FROM (
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SELECT TOP y fields
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;FROM table
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;WHERE conditions
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ORDER BY table.field  ASC) as foo
&nbsp;&nbsp;&nbsp;&nbsp;ORDER by field DESC) as bar
ORDER by field ASC
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.vandango.org/archives/limit-xy-in-t-sql/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Code Snippet &#8211; C#: Generate square thumbnails</title>
		<link>http://www.vandango.org/archives/code-snippet-c-generate-square-thumbnails</link>
		<comments>http://www.vandango.org/archives/code-snippet-c-generate-square-thumbnails#comments</comments>
		<pubDate>Mon, 09 Oct 2006 11:53:00 +0000</pubDate>
		<dc:creator>vandango</dc:creator>
				<category><![CDATA[Technik]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[Code Snippet]]></category>
		<category><![CDATA[Coding]]></category>
		<category><![CDATA[English]]></category>
		<category><![CDATA[Mono]]></category>

		<guid isPermaLink="false">http://www.vandango.org//?p=87</guid>
		<description><![CDATA[To generate a square thumbnail in c#, use this code: public Bitmap Generate75x75Pixel(Bitmap image) { &#160;&#160;&#160;&#160;if(image == null) &#160;&#160;&#160;&#160;throw new ArgumentNullException("image"); &#160;&#160;&#160;&#160;Bitmap bmp = null; &#160;&#160;&#160;&#160;Bitmap crapped = null; &#160;&#160;&#160;&#160;int x = 0, y = 0; &#160;&#160;&#160;&#160;double prop = 0; &#160;&#160;&#160;&#160;if(image.Width > 75) { &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;// compute proportation &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;prop = (double)image.Width / (double)image.Height; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;if(image.Width > image.Height) [...]]]></description>
			<content:encoded><![CDATA[<p>To generate a square thumbnail in c#, use this code:</p>
<pre>
public Bitmap Generate75x75Pixel(Bitmap image) {
&nbsp;&nbsp;&nbsp;&nbsp;if(image == null)
&nbsp;&nbsp;&nbsp;&nbsp;throw new ArgumentNullException("image");
&nbsp;&nbsp;&nbsp;&nbsp;Bitmap bmp = null;
&nbsp;&nbsp;&nbsp;&nbsp;Bitmap crapped = null;
&nbsp;&nbsp;&nbsp;&nbsp;int x = 0, y = 0;
&nbsp;&nbsp;&nbsp;&nbsp;double prop = 0;
&nbsp;&nbsp;&nbsp;&nbsp;if(image.Width > 75) {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// compute proportation
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;prop = (double)image.Width / (double)image.Height;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if(image.Width > image.Height) {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;x = (int)Math.Round(75 * prop, 0);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;y = 75;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;x = 75;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;y = (int)Math.Round(75 / prop, 0);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;bmp = new Bitmap((Image)image, new Size(x, y));
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;crapped = new Bitmap(75, 75);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Graphics g = Graphics.FromImage(crapped);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;g.DrawImage(bmp,
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;new Rectangle(0, 0, 75, 75),
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;new Rectangle(0, 0, 75, 75),
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;GraphicsUnit.Pixel
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;bmp = crapped;
&nbsp;&nbsp;&nbsp;&nbsp;}
&nbsp;&nbsp;&nbsp;&nbsp;else {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;crapped = image;
&nbsp;&nbsp;&nbsp;&nbsp;}
&nbsp;&nbsp;&nbsp;&nbsp;return bmp;
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.vandango.org/archives/code-snippet-c-generate-square-thumbnails/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
