<?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>Capi's Corner &#187; bug</title>
	<atom:link href="http://www.dont-panic.cc/capi/tag/bug/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.dont-panic.cc/capi</link>
	<description>Development, Network, Security, Ideas &#038; Opinions</description>
	<lastBuildDate>Sat, 10 Dec 2011 19:31:21 +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>Missing dictionaries on OpenOffice.org 3</title>
		<link>http://www.dont-panic.cc/capi/2008/10/24/missing-dictionaries-on-openofficeorg-3/</link>
		<comments>http://www.dont-panic.cc/capi/2008/10/24/missing-dictionaries-on-openofficeorg-3/#comments</comments>
		<pubDate>Fri, 24 Oct 2008 13:41:15 +0000</pubDate>
		<dc:creator>Martin Carpella</dc:creator>
				<category><![CDATA[computer]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[bug]]></category>
		<category><![CDATA[openoffice]]></category>
		<category><![CDATA[troubleshooting]]></category>
		<category><![CDATA[workaround]]></category>

		<guid isPermaLink="false">http://www.dont-panic.cc/capi/?p=165</guid>
		<description><![CDATA[I just upgraded to OpenOffice.org 3 and I really like it. But there was a small, but very anoying problem: OO.org seemed to be unable to find any dictionaries. I found out rather quicky, that starting with OO.org 3 dictionaries are only available as extensions. Well, basically this is no problem, but the English (at [...]]]></description>
			<content:encoded><![CDATA[<p>I just upgraded to <a href="http://www.openoffice.org/">OpenOffice.org 3</a> and I really like it. But there was a small, but very anoying problem: OO.org seemed to be unable to find any dictionaries. I found out rather quicky, that starting with OO.org 3 dictionaries are only available as extensions. Well, basically this is no problem, but the English (at least the US and GB variante) are supposed to be bundled with the installer and are not available as seperate extension.</p>
<p>It seems there is a little bug with the installation on Vista under certain circumstances which causes the extensions not being registered properly with OO.org.</p>
<p>To solve the problem, follow the same following steps:</p>
<ul>
<li>Locate your OO.org &#8220;install&#8221; directory of your installation, usually it is C:\Program Files\OpenOffice.org 3\share\extensions\install&#8221; [<strong>Updated 2008-12-21</strong> to include "extensions", thanks to the anonymous commenter!]</li>
<li>Manuylla install the appropriate dictionary extension (&#8220;dict-en.oxt&#8221;, &#8220;dict-de.oxt&#8221;, &#8220;dict-fr.oxt&#8221;, &#8220;dict-it.oxt&#8221;) by either launching the oxt directly or by chosing Tools -&gt; Extension Manager.</li>
</ul>
<p>For me this worked after restarting OO.org totally (i.e. closing down all Writer, Calc, &#8230;).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dont-panic.cc/capi/2008/10/24/missing-dictionaries-on-openofficeorg-3/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>.NET strings are not always immutable!</title>
		<link>http://www.dont-panic.cc/capi/2007/10/03/net-strings-are-not-always-immutable/</link>
		<comments>http://www.dont-panic.cc/capi/2007/10/03/net-strings-are-not-always-immutable/#comments</comments>
		<pubDate>Wed, 03 Oct 2007 14:17:45 +0000</pubDate>
		<dc:creator>Martin Carpella</dc:creator>
				<category><![CDATA[computer]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[.net]]></category>
		<category><![CDATA[bug]]></category>
		<category><![CDATA[c#]]></category>

		<guid isPermaLink="false">http://www.dont-panic.cc/capi/2007/10/03/net-strings-are-not-always-immutable/</guid>
		<description><![CDATA[Strings are immutable. If you want to modify a sequence of characters, use StringBuilder. At least, that&#8217;s whats officially said. But in the framework there is at least one method that does modify a string: TextRenderer.MeasureText() with ModifyString and EndEllipses will modify your string to match the ellipsed text if ellipsing happens. You can look [...]]]></description>
			<content:encoded><![CDATA[<p><code>Strings</code> are immutable. If you want to modify a sequence of characters, use <code>StringBuilder</code>. At least, that&#8217;s whats officially said. But in the framework there is at least one method that does modify a string:</p>
<p><code>TextRenderer.MeasureText()</code> with <code>ModifyString</code> and <code>EndEllipses</code>  will modify your string  to match the ellipsed text if ellipsing happens. You can look at this <a href="http://www.codeproject.com/useritems/NewPathCompactPath.asp" aiotitle="VB# example on codeproject using TextRenderer.MeasureText() for trimming text">VB# example on codeproject using <code>TextRenderer.MeasureText()</code> for trimming text</a> on how it is used.</p>
<p>The string seems to be modified directly in native code by <code>DrawTextEx</code> from <code>user32.dll</code>. Additionally to the scary fact that strings are not immutable, the length of the string is not updated, regardless if the resulting string is shorter!</p>
<p>For instance if you have a string &#8220;<code>aaaaaaa</code>&#8221; which will be truncated to &#8220;<code>aa...</code>&#8220;, the <code>Length</code> property will still return 7 for the shortened string.  The debugger shows that the string will in fact be &#8220;aa&#8230;\0a&#8221; after the operation. So maybe it might be right that the string is still 7 characters long but most outputting functionality like <code>Console.Out.WriteLine()</code> gets confused sometimes and stops any further output to the debugger or console under certain conditions.</p>
<p>A very quick investigation of the System.Drawing assembly using Lutz Roeder&#8217;s fabulous <a href="http://www.aisto.com/roeder/dotnet">.NET Reflector</a> showed that at least there should be no memory corruption in case &#8220;<code>WW</code>&#8221; would get ellipsed to &#8220;<code>W...</code>&#8220;, as <code>DrawTextEx</code> takes the length of the buffer and should result only in &#8220;<code>W.</code>&#8220;.</p>
<p>Summing up, I find the <em>corruption</em> of an immutable string <em>by an official Microsoft API</em> very troubling.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dont-panic.cc/capi/2007/10/03/net-strings-are-not-always-immutable/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ubuntu 7.04 cryptsetup problem</title>
		<link>http://www.dont-panic.cc/capi/2007/06/26/ubuntu-704-cryptsetup-problem/</link>
		<comments>http://www.dont-panic.cc/capi/2007/06/26/ubuntu-704-cryptsetup-problem/#comments</comments>
		<pubDate>Tue, 26 Jun 2007 19:57:09 +0000</pubDate>
		<dc:creator>Martin Carpella</dc:creator>
				<category><![CDATA[sysadmin]]></category>
		<category><![CDATA[bug]]></category>
		<category><![CDATA[cryptsetup]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.dont-panic.cc/capi/2007/06/26/ubuntu-704-cryptsetup-problem/</guid>
		<description><![CDATA[I am using cryptsetup LUKS for storing encrypted office data on my USB memory stick (just in case I lose it). I recently installed Ubuntu 7.04 on one of my machines and wanted to open the encrypted partition using cryptsetup luksOpen, which failed with a rather strange Unable to make device node for &#8216;temporary-cryptsetup-32733&#8242; While [...]]]></description>
			<content:encoded><![CDATA[<p>I am using <a href="http://luks.endorphin.org/dm-crypt">cryptsetup LUKS</a> for storing encrypted office data on my USB memory stick (just in case I lose it). I recently installed <a href="http://www.ubuntu.com/">Ubuntu</a> 7.04 on one of my machines and wanted to open the encrypted partition using cryptsetup luksOpen, which failed with a rather strange</p>
<blockquote style="text-align: left"><p>Unable to make device node for &#8216;temporary-cryptsetup-32733&#8242;</p></blockquote>
<p>While searching around the net I found a lot of people asking the same question but hardly any answer, until I finally read <a href="http://ubuntuforums.org/showthread.php?t=420182">this article</a><br />
on the Ubuntu forum.</p>
<p>The solution to the whole problem is rather simple:</p>
<blockquote align="left"><p>sudo mkdir /dev/.static/dev/mapper</p></blockquote>
<p>With a little bit more verbose error message of cryptsetup I <em>might</em> have figured this out myself&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dont-panic.cc/capi/2007/06/26/ubuntu-704-cryptsetup-problem/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A Small &#8220;Patch&#8221; for Scuttle</title>
		<link>http://www.dont-panic.cc/capi/2006/11/10/a-small-patch-for-scuttle/</link>
		<comments>http://www.dont-panic.cc/capi/2006/11/10/a-small-patch-for-scuttle/#comments</comments>
		<pubDate>Thu, 09 Nov 2006 23:43:23 +0000</pubDate>
		<dc:creator>Martin Carpella</dc:creator>
				<category><![CDATA[internet]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[bug]]></category>
		<category><![CDATA[patch]]></category>
		<category><![CDATA[scuttle]]></category>

		<guid isPermaLink="false">http://www.dont-panic.cc/capi/archives/48</guid>
		<description><![CDATA[Yesterday I realized, that our internal office installation of Scuttle (SF project page) suffered a minor bug: it kept on sorting all bookmarks by date, but in ascending order, i.e. the oldest bookmark was displayed first. After doing some research, I quickly found out that this seems to be a &#8220;bug&#8221; (well the devs say [...]]]></description>
			<content:encoded><![CDATA[<p>Yesterday I realized, that our internal office installation of <a href="http://www.scuttle.org">Scuttle</a> (<a href="http://sourceforge.net/projects/scuttle">SF project page</a>) suffered a minor bug: it kept on sorting all bookmarks by date, but in ascending order, i.e. the oldest bookmark was displayed first.</p>
<p>After doing some research, I quickly found out that this seems to be a &#8220;<a href="http://bugs.mysql.com/bug.php?id=815">bug</a>&#8221; (well the devs say it isn&#8217;t but one can argue&#8230;) of MySQL, caused by an optimization of a <code>SELECT DISTINCT</code> queries.</p>
<p><strike>So I patched </strike><code><strike>services/bookmarkservice.php</strike></code><strike> and removed the </strike><code><strike>DISTINCT</strike></code><strike> keyword in the SQL-query of </strike><code><strike>getBookmarks()</strike></code><strike> (line 249, version 0.7.2).</strike></p>
<p><strike>Up to now, I did not experience any duplicate lines caused by this. I think, I&#8217;m going to report this minor issue upstream.</strike></p>
<p><strong>Update:</strong> hmm, ups, when searching, you will most certainly get duplicate results&#8230; I&#8217;ll check in the evening.</p>
<p><strong>Update 2:</strong> Ok, so I wrote a litte more extensive patch, by wrapping the original <code>SELECT DISTINCT</code> statement as a subselect and ordering the result as such. This now really works. <strike>The patch for 0.7.2  can be downloaded <a href="http://www.dont-panic.cc/capi/files/bookmarkservice.php.patch" title="scuttle 0.7.2 Patch">here</a>. You have to apply it to <code>services/bookmarkservice.php</code>.</strike></p>
<p><strong>Update 3:</strong> Ok, I somehow managed to delete the patch file. I am sorry. I will look if I can find it in any of the old backups, but I am not too convinced about this.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dont-panic.cc/capi/2006/11/10/a-small-patch-for-scuttle/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

