<?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>Olaf's Thoughts About Development &#187; compression</title>
	<atom:link href="http://www.monien.net/blog/index.php/tag/compression/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.monien.net/blog</link>
	<description>Delphi Programming, .NET Philosophy, Web development and more ...</description>
	<lastBuildDate>Wed, 21 Jul 2010 10:55:31 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>IntraWeb compression</title>
		<link>http://www.monien.net/blog/index.php/2008/04/intraweb-compression/</link>
		<comments>http://www.monien.net/blog/index.php/2008/04/intraweb-compression/#comments</comments>
		<pubDate>Tue, 29 Apr 2008 15:22:43 +0000</pubDate>
		<dc:creator>Olaf Monien</dc:creator>
				<category><![CDATA[Delphi]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[IntraWeb]]></category>
		<category><![CDATA[compression]]></category>
		<category><![CDATA[ServerController]]></category>
		<category><![CDATA[Standalone]]></category>

		<guid isPermaLink="false">http://www.monien.net/blog/index.php/2008/04/intraweb-compression/</guid>
		<description><![CDATA[Using IntraWeb&#8217;s integrated compression option you can easily speed up the transfer of your applications forms. Interestingly many IntraWeb users don&#8217;t know that there is a Compression option in the ServerController: just set ServerController.Compression.Enabled = true and IntraWeb will compress all pages sent to the web browser. If the Web browser doesn&#8217;t support compression, then [...]]]></description>
			<content:encoded><![CDATA[<p>Using IntraWeb&#8217;s integrated compression option you can easily speed up the transfer of your applications forms.<span id="more-27"></span></p>
<p>Interestingly many IntraWeb users don&#8217;t know that there is a Compression option in the ServerController:</p>
<p>just set <span style="font-style: italic;">ServerController.Compression.Enabled</span> <span style="font-style: italic;">= true </span>and IntraWeb will compress all pages sent to the web browser. If the Web browser doesn&#8217;t support compression, then IntraWeb will of course detect that and send uncompressed.</p>
<p>The only requirement is to put a zlib.dll into the application&#8217;s directory. A working version can be downloaded <a href="http://downloads.atozed.com/intraweb/zlib.zip" target="_Blank">here</a>. No changes/settings on the client side are necessary.</p>
<p>There is one trade-off though which you should keep in mind: compression takes CPU cycles. Thats no problem for the client, but if your server machine is already close to its limit, then compression might not be a so good idea ..</p>
]]></content:encoded>
			<wfw:commentRss>http://www.monien.net/blog/index.php/2008/04/intraweb-compression/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Highlander: .NET Reference Analyzer Demo</title>
		<link>http://www.monien.net/blog/index.php/2007/08/highlander-net-reference-analyzer-demo/</link>
		<comments>http://www.monien.net/blog/index.php/2007/08/highlander-net-reference-analyzer-demo/#comments</comments>
		<pubDate>Thu, 23 Aug 2007 22:00:00 +0000</pubDate>
		<dc:creator></dc:creator>
				<category><![CDATA[Miscellaneous]]></category>
		<category><![CDATA[.net]]></category>
		<category><![CDATA[compression]]></category>
		<category><![CDATA[Delphi]]></category>

		<guid isPermaLink="false">http://www.monien.net/blog/index.php/2007/08/highlander-net-reference-analyzer-demo/</guid>
		<description><![CDATA[Many people are still wondering why to use .NET at all, because they can do all their business fine with Delphi for Win32. This article demos a Reference Analyzer, written in Highlander and meant to be a real world tool. The purpose is to list all .NET assemblies, that an other assembly (dll or executable) [...]]]></description>
			<content:encoded><![CDATA[<p>Many people are still wondering why to use .NET at all, because they can do all their business fine with Delphi for Win32. This article demos a Reference Analyzer, written in Highlander and meant to be a real world tool. The purpose is to list all .NET assemblies, that an other assembly (dll or executable) depends on.<span id="more-162"></span>
<p>The ReferenceAnalyzer uses .NET Reflection to load and analyze any .NET assembly. It will show a detailed list of assemblies being referenced. Of course you cannot write this in Win 32, because this a .NET analyzing tool, so this an end in itself &#8211; somehow.</p>
<p><img src="images/ReferenceAnalyzer.png" border="0"></p>
<p><img src="images/zip.gif" border="0"> <a href="files/ReferenceAnalyzer.zip">ReferenceAnalyzer.zip</a> </p>
<p><img src="images/zip.gif" border="0"> <a href="files/ReferenceAnalyzerSource.zip">ReferenceAnalyzerSource.zip</a></p>
<p> However, the demo shows how mighty and easy to use .NET reflection is. In Delphi Win32 we have RTTI, which certainly allows some fancy things, but Reflection is way more powerful and directly built into the .NET system classes.</p>
<p>It all starts with this:</p>
<pre>LAssembly := Assembly.ReflectionOnlyLoadFrom(LAssemblyFileName);</pre>
<p>ReflectionOnlyLoadFrom() is a static (class) Method of the Assembly class. This tries to load the given file as assembly. Its a new method of .NET2.0 and does not call any initialization code of the assembly being loaded &#8211; which may cause unwanted side effects. </p>
<p>After that we obtain a list of all referenced assemblies of that one we have just loaded:</p>
<pre>&nbsp; //Get all referenced assemblies&nbsp; for LAssemblyName in LAssembly.GetReferencedAssemblies do&nbsp; begin    //Load each assembly&nbsp;&nbsp;&nbsp; LReferencedAssembly := Assembly.ReflectionOnlyLoad(LAssemblyName.FullName);</pre>
<p>Now we do that recursivly and we are done. Thats the whole idea.</p>
<h3>Now where is the .NET 2.0 beef?<br /></h3>
<p>The above has shown some stuff which in theory could have been done with Delphi 2006.NET already. There we did not have the ReflectionOnlyLoad methods (as D2006 was .NET 1.1), but we might have done this somehow &#8230;</p>
<p>The demo also utilizes <span style="font-weight: bold;">Generics</span>. Look at this class definition:</p>
<pre>TAssemblyDetail = record    Name:string;    FullPath:string;    FullInfo:string;    Exists:boolean;    //used as predicate in List.Exists    function Match(AAssemblyDetail:TAssemblyDetail):boolean;end;</pre>
<p>We are using that to store assembly details, and we want to keep a list of that. (I could have used a &#8220;full class&#8221; as well, but I was lazy and wanted to avoid the &#8220;create&#8221; calls.) Without generics, you would have to cast the items of a TList back and forth to TAssemblyDetail &#8211; you all know that.</p>
<p>In Highlander I can go the .NET 2.0 way:</p>
<p>FAssemblies : List&lt;TAssemblyDetail&gt;;</p>
<p>This makes FAssemblies a strongly typed list of TAssemblyDetail. Now look at a sample how to use that:</p>
<pre>procedure TForm1.UpdateListView;var&nbsp; LAssemblyDetail: TAssemblyDetail;&nbsp; LNode: TTreeNode;begin&nbsp; TreeView1.Items.Clear;&nbsp; <span style="font-weight: bold;">for LAssemblyDetail in FAssemblies do begin</span>&nbsp;&nbsp;&nbsp; LNode := TreeView1.Items.Add(nil, <span style="font-weight: bold;">LAssemblyDetail.FullInfo</span>);&nbsp;&nbsp;&nbsp; LNode.Data := <span style="font-weight: bold;">LAssemblyDetail</span>;&nbsp;&nbsp;&nbsp; if <span style="font-weight: bold;">LAssemblyDetail.Exists</span> then&nbsp; begin&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; LNode.ImageIndex := 0;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; LNode.Text := LNode.Text + ', ' + <span style="font-weight: bold;">LAssemblyDetail.FullPath</span>;&nbsp;&nbsp;&nbsp; end&nbsp;&nbsp;&nbsp; else&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; LNode.ImageIndex := 1;&nbsp; end;end;</pre>
<p>No TAssemblyDetail(FAssemblies.items[i]) cast anymore, just clean code&#8230;</p>
<h3>Using .NET libraries<br /></h3>
<p>If you think &#8220;well generics are nice, but I can live without them&#8221;, then ok, that may be true. If language feature do not convince you, then you might have a look at Google how many libraries there are available for .NET. You can use all of them with Highlander &#8211; and you can still happily mix .NET stuff with all your existing code and &#8220;skills&#8221;. There is no need to start from the scratch, if you don&#8217;t want to.</p>
<p>As a very simple example, ReferenceAnalyzer utilizes a .NET ZIP library, which is based on the already built in System.IO.Compression namespace. Just reference the library you need, and start using it:</p>
<pre>procedure TForm1.CompressAssemblies;var&nbsp; LZipFileName:string;&nbsp; LZipFile: ZipFile;&nbsp; LAssembly: TAssemblyDetail;begin&nbsp; LZipFileName := EditAssemblyName.Text;&nbsp; LZipFileName := ChangeFileExt(LZipFileName,'.zip');&nbsp; if FileExists(LZipFileName) then&nbsp;&nbsp;&nbsp; DeleteFile(LZipFileName);&nbsp; <span style="font-weight: bold;">LZipFile := ZipFile.Create(LZipFileName);</span>&nbsp; ProgressBar1.Position := 0;&nbsp; ProgressBar1.Max := FAssemblies.Count + 1;&nbsp; for LAssembly in FAssemblies do begin&nbsp;&nbsp;&nbsp; <span style="font-weight: bold;">LZipFile.AddFile(LAssembly.FullPath);</span>&nbsp;&nbsp;&nbsp; ProgressBar1.StepBy(1);&nbsp; end;&nbsp; //Save is last progress step&nbsp; <span style="font-weight: bold;">LZipFile.Save;</span>&nbsp; ProgressBar1.Position := ProgressBar1.Max;end;</pre>
<p>Coming up next, I&#8217;ll show how to do WPF stuff with&nbsp; Highlander. </p>
<p></p></p>
]]></content:encoded>
			<wfw:commentRss>http://www.monien.net/blog/index.php/2007/08/highlander-net-reference-analyzer-demo/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Knoppicillin saved my a**</title>
		<link>http://www.monien.net/blog/index.php/2007/08/knoppicillin-saved-my-a/</link>
		<comments>http://www.monien.net/blog/index.php/2007/08/knoppicillin-saved-my-a/#comments</comments>
		<pubDate>Sat, 18 Aug 2007 22:00:00 +0000</pubDate>
		<dc:creator></dc:creator>
				<category><![CDATA[Miscellaneous]]></category>
		<category><![CDATA[.net]]></category>
		<category><![CDATA[compression]]></category>

		<guid isPermaLink="false">http://www.monien.net/blog/index.php/2007/08/knoppicillin-saved-my-a/</guid>
		<description><![CDATA[Using &#8220;Knoppicillin&#8221; a variant of Knoppix, which is a Linux distribution, which runs off CD/DVD, I was able to recover my Windows XP from a boot failure within minutes. Yesterday I changed my laptop&#8217;s partitions using Acronis&#8217; DiskDirector. I realized, that I still had a recovery partition on it, which is more or less useless [...]]]></description>
			<content:encoded><![CDATA[<p>Using  &#8220;Knoppicillin&#8221; a variant of Knoppix, which is a Linux distribution, which runs off CD/DVD, I was able to recover my Windows XP from a boot failure within minutes.<span id="more-161"></span>
<p>Yesterday I changed my laptop&#8217;s partitions using Acronis&#8217; <a href="http://www.acronis.com/homecomputing/products/diskdirector/" target="_Blank">DiskDirector</a>. I realized, that I still had a recovery partition on it, which is more or less useless for me, i.e. 8GB wasted. This recovery partition is pre-installed by Sony and basically replaces the Windows XP installation DVD, so that Sony can save a dollar or two <img src='http://www.monien.net/blog/wp-includes/images/smilies/icon_neutral.gif' alt=':-|' class='wp-smiley' />  I have my own recovery images (frequently updated using TrueImage), so I really don&#8217;t need that pre-installed recovery partition.</p>
<p>DiskDirector easily lets you remove, resize and move partitions on your hard drives. I&#8217;ve used it a couple of times before, so I was sure it&#8217;ll be an easy job again.</p>
<p>Murphy hit though: &#8220;Windows can not boot due to a partition configuartion error.&#8221; (or similar) on boot, after DiskDirector finished. Great!</p>
<p>F8 still worked, but same error message even for console mode. Too bad! Well, what could be the reason? Certainly not a random HD crash or something, F8 wouldn&#8217;t work in that case most likely. What if DiskDirector &#8220;forgot&#8221; to update boot.ini, where Windows marks its startup partition? I removed the first partition of my drive, so for sure boot.ini needs updated.</p>
<p>But how to check boot.ini, if F8 won&#8217;t even let you boot into console mode? Boot from an external device &#8211; right! I remembered I had a copy of c&#8217;t magazine (Germany&#8217;s major PC magazine), which came with a CD, that had a bootable Knoppix V5.2 on it. (Actually it is Knoppicillin, which is based on Knoppix and adds some &#8220;non-free&#8221; stuff like virus scanners etc). </p>
<p><span style="font-style: italic;">Note: There are other boot-from-somedevice solutions, which may be great as well. I&#8217;m describing Knoppix, because I get frequent updates through my c&#8217;t magazine subscription, and do not need to download it &#8211; in the case I need it &#8230;</span></p>
<p>Booted it up, a GUI Desktop showed up. I found MidnightCommander installed, so no VI nightmares <img src='http://www.monien.net/blog/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' />  Under /media I found a few entries, and a &#8220;mount /media/sda1&#8243; gave me access to my C: drive. I changed boot.ini from</p>
<p><span style="font-family: Courier New;">multi(0)disk(0)rdisk(0)partition(2) to multi(0)disk(0)rdisk(0)partition(1)</span></p>
<p>and crossed fingers for a reboot. And hurray, Window&#8217;s boot showed up <img src='http://www.monien.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Shame on Acronis to forget about boot.ini <img src='http://www.monien.net/blog/wp-includes/images/smilies/icon_sad.gif' alt=':-(' class='wp-smiley' /> <br /><font size="-1">( I used 9.1, and 10.0 is current. Hopefully they fixed that bug already)</font></p>
<p>Kudos to the Knopper team!</p>
</p>
<p><a href="http://www.knopper.net/knoppix/index-en.html" target="_Blank">Knoppix</a> is a German Linux distribution, which runs completely from CD or DVD and provides a really rich selection of hardware dirvers and additional software. The CD edition can hold up to 2GB of software &#8211; they are using &#8220;on-the-fly&#8221; compression to achieve that.</p>
<p>The important thing (for me) is, that it has read/write drivers for NTFS and MidnightCommander (a Linux &#8220;Norton Commander&#8221; clone) pre-installed.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.monien.net/blog/index.php/2007/08/knoppicillin-saved-my-a/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
