<?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; development</title>
	<atom:link href="http://www.dont-panic.cc/capi/category/computer/development/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>The power of git aliases</title>
		<link>http://www.dont-panic.cc/capi/2010/12/09/the-power-of-git-aliases/</link>
		<comments>http://www.dont-panic.cc/capi/2010/12/09/the-power-of-git-aliases/#comments</comments>
		<pubDate>Thu, 09 Dec 2010 21:56:59 +0000</pubDate>
		<dc:creator>Martin Carpella</dc:creator>
				<category><![CDATA[computer]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[productivity]]></category>
		<category><![CDATA[tricks]]></category>

		<guid isPermaLink="false">http://www.dont-panic.cc/capi/?p=278</guid>
		<description><![CDATA[Based on a recent question on stackoverflow I found the power of git aliases and want so share one I invented for answering the question and after that I found very useful in everyday git use: git config --global alias.add-commit '!git add -A &#38;&#38; git commit' After this, you can simply check in all new, [...]]]></description>
			<content:encoded><![CDATA[<p>Based on a <a href="http://stackoverflow.com/questions/4298960/git-add-a-git-commit-in-one-command/">recent question</a> on <a href="http://stackoverflow.com/">stackoverflow</a> I found the power of <a href="http://git-scm.com/">git</a> <a href="https://git.wiki.kernel.org/index.php/Aliases">aliases</a> and want so share one I invented for <a href="http://stackoverflow.com/questions/4298960/git-add-a-git-commit-in-one-command/4299159#4299159">answering</a> the question and after that I found very useful in everyday git use:</p>
<blockquote><p><code>git config --global alias.add-commit '!git add -A &amp;&amp; git commit'</code></p></blockquote>
<p>After this, you can simply check in all new, modified, and deleted files with a simple</p>
<blockquote><p><code>git add-commit -m 'My commit message'</code></p></blockquote>
<p>I have aliased this command also to <code> git ac</code> in order to save further on typing. I never thought that this combination could be that useful, but actually I think it really is. Thanks to the questioner for bringing the idea up.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dont-panic.cc/capi/2010/12/09/the-power-of-git-aliases/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How to force Git to consider a file as binary</title>
		<link>http://www.dont-panic.cc/capi/2009/02/16/how-to-force-git-to-consider-a-file-as-binary/</link>
		<comments>http://www.dont-panic.cc/capi/2009/02/16/how-to-force-git-to-consider-a-file-as-binary/#comments</comments>
		<pubDate>Mon, 16 Feb 2009 21:58:27 +0000</pubDate>
		<dc:creator>Martin Carpella</dc:creator>
				<category><![CDATA[computer]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[eps]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[troubleshooting]]></category>

		<guid isPermaLink="false">http://www.dont-panic.cc/capi/?p=212</guid>
		<description><![CDATA[If you are using Git on Windows and follow my advise on how to get past the problem with the &#8220;suspicious patch lines&#8221;, you might run into problems if you are using Encapsulated PostScript (.eps) files in your repository. PostScript files are almost plain-text files, and if you set core.autocrlf and core.safecrlf, they might cause [...]]]></description>
			<content:encoded><![CDATA[<p>If you are using <a href="http://git-scm.com/">Git</a> on Windows and follow my advise on how to get past <a href="http://www.dont-panic.cc/capi/2007/07/13/git-on-windows-you-have-some-suspicious-patch-lines/">the problem with the &#8220;suspicious patch lines&#8221;</a>, you might run into problems if you are using <a href="http://en.wikipedia.org/wiki/Encapsulated_PostScript">Encapsulated PostScript</a> (.eps) files in your repository.</p>
<p>PostScript files are almost plain-text files, and if you set core.autocrlf and core.safecrlf, they might cause problems with the EPS binary encoded parts, as they might be detected as text-files and therefore remove any CRLF and replace it with single LF, which can mess up the whole image.</p>
<p>To force Git to consider a file binary which it would consider as text-file otherwise, the easiest way is to add a .gitattributes file to the directory containing the file or to any parent directory. In my case, I normally add a .gitattributes file in the root of the repository, containing</p>
<blockquote><p>*.eps -crlf<br />
*.jpg -crlf<br />
*.png -crlf</p></blockquote>
<p>In the file you set attributes to a path (or a pattern), or unset them (with the minus sign).  The crlf attribute is the attribute which tells if a file is affected by the core.autocrlf options. If you unset it, Git won&#8217;t mess with the line endings in the file.</p>
<p>More details can be found on the <a href="http://www.kernel.org/pub/software/scm/git/docs/gitattributes.html">gitattributes man page</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dont-panic.cc/capi/2009/02/16/how-to-force-git-to-consider-a-file-as-binary/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>My initial git settings for any repository</title>
		<link>http://www.dont-panic.cc/capi/2008/12/28/my-initial-git-settings-for-any-repository/</link>
		<comments>http://www.dont-panic.cc/capi/2008/12/28/my-initial-git-settings-for-any-repository/#comments</comments>
		<pubDate>Sun, 28 Dec 2008 09:00:54 +0000</pubDate>
		<dc:creator>Martin Carpella</dc:creator>
				<category><![CDATA[computer]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[git]]></category>

		<guid isPermaLink="false">http://www.dont-panic.cc/capi/?p=177</guid>
		<description><![CDATA[This is my cheat sheet for the settings I use for my git-repositories (list to be edited continuously): Global settings: git config &#8211;global user.name Martin Carpella git config &#8211;global user.email xxx@yyy.invalid git config &#8211;global color.ui auto Per-repository settings: git config core.autocrlf true git config core.safecrlf true Per-repository .gitignore for Visual Studio/C# projects: bin obj *.user [...]]]></description>
			<content:encoded><![CDATA[<p>This is my cheat sheet for the settings I use for my git-repositories (list to be edited continuously):</p>
<p>Global settings:</p>
<blockquote><p>git config &#8211;global user.name Martin Carpella<br />
git config &#8211;global user.email xxx@yyy.invalid<br />
git config &#8211;global color.ui auto</p></blockquote>
<p>Per-repository settings:</p>
<blockquote><p>git config core.autocrlf true<br />
git config core.safecrlf true</p></blockquote>
<p>Per-repository .gitignore for Visual Studio/C# projects:</p>
<blockquote><p>bin<br />
obj<br />
*.user<br />
*.suo<br />
Thumbs.db</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.dont-panic.cc/capi/2008/12/28/my-initial-git-settings-for-any-repository/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>git-svn fails with fatal error: unable to remap</title>
		<link>http://www.dont-panic.cc/capi/2007/10/29/git-svn-fails-with-fatal-error-unable-to-remap/</link>
		<comments>http://www.dont-panic.cc/capi/2007/10/29/git-svn-fails-with-fatal-error-unable-to-remap/#comments</comments>
		<pubDate>Mon, 29 Oct 2007 12:41:04 +0000</pubDate>
		<dc:creator>Martin Carpella</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[cygwin]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[subversion]]></category>
		<category><![CDATA[troubleshooting]]></category>

		<guid isPermaLink="false">http://www.dont-panic.cc/capi/2007/10/29/git-svn-fails-with-fatal-error-unable-to-remap/</guid>
		<description><![CDATA[Git&#8216;s nice Subversion (SVN) integration is one of the reasons I switched to using it within our company for my own revision control besides our official repository. Unfortunately, upgrading cygwin broke my system once again: $ git svn dcommit 6 [main] perl 4760 C:\cygwin\bin\perl.exe: *** fatal error - unable to remap C:\cygwin\lib\perl5\site_perl\5.8\cygwin\auto\SVN\_Core\_ Core.dll to same [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://git.or.cz/">Git</a>&#8216;s nice <a href="http://subversion.tigris.org/">Subversion</a> (SVN) integration is one of the reasons I switched to using it within our company for my own revision control besides our official repository. Unfortunately, upgrading <a href="http://www.cygwin.com/">cygwin</a> broke my system once again:</p>
<blockquote style="text-align: left;"><p><code>$ git svn dcommit</code><br />
<code>6 [main] perl 4760 C:\cygwin\bin\perl.exe: *** fatal error - unable to remap C:\cygwin\lib\perl5\site_perl\5.8\cygwin\auto\SVN\_Core\_ Core.dll to same address as parent(0x260000) != 0x990000 84 [main] perl 3224 fork: child 4760 - died waiting for dll loading, errno 11 panic: MUTEX_LOCK (45) [util.c:2331] at /usr/bin/git-svn line 787. panic: MUTEX_LOCK (45) [op.c:352].</code></p></blockquote>
<p>The reason behind this behavior is a huge difference in the way processes and threads and libraries are created/handled on Windows and Linux. <code>git-svn</code> relies on perl within cygwin and several perl libraries that use the same base-address for libraries internally. Of course, no two libraries can be loaded to the same base-address at the same time.</p>
<p>Long explanation, short way to fix the problem:</p>
<ol>
<li>Quit all cygwin processes</li>
<li>Start <em>ash</em> (&lt;cygroot&gt;\bin\ash.exe) (&lt;edit&gt;Use &#8220;Run as Administrator&#8230;&#8221;&lt;/edit&gt;)</li>
<li>Execute <em>/usr/bin/rebaseall</em></li>
</ol>
<p>Voilla, that&#8217;s all. git-svn should work again.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dont-panic.cc/capi/2007/10/29/git-svn-fails-with-fatal-error-unable-to-remap/feed/</wfw:commentRss>
		<slash:comments>11</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>Content-aware image resizing</title>
		<link>http://www.dont-panic.cc/capi/2007/10/03/content-aware-image-resizing/</link>
		<comments>http://www.dont-panic.cc/capi/2007/10/03/content-aware-image-resizing/#comments</comments>
		<pubDate>Wed, 03 Oct 2007 10:56:51 +0000</pubDate>
		<dc:creator>Martin Carpella</dc:creator>
				<category><![CDATA[computer]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[algorithm]]></category>
		<category><![CDATA[graphics]]></category>
		<category><![CDATA[image-processing]]></category>
		<category><![CDATA[science]]></category>
		<category><![CDATA[video]]></category>

		<guid isPermaLink="false">http://www.dont-panic.cc/capi/2007/10/03/content-aware-image-resizing/</guid>
		<description><![CDATA[Krispin made me aware of a very cool new technique for resizing images: content-aware image resizing. Based on an energy-function path of an image are removed when shrinking or are duplicated and interpolated when growing the image in a non-uniform way. This technique can also be used to remove objects from a given image. There [...]]]></description>
			<content:encoded><![CDATA[<p>Krispin made me aware of a very cool new technique for resizing images: content-aware image resizing. Based on an energy-function path of an image are removed when shrinking or are duplicated and interpolated when growing the image in a non-uniform way.</p>
<p>This technique can also be used to  remove objects from a given image. There is a nice demo video available on YouTube (it&#8217;s the same as in <a href="http://jfoscoding.blogspot.com/2007/08/image-resizing-re-imagined.html">jfo&#8217;s coding</a> blog, where Krispin originally found the information):</p>
<p>[youtube vIFCV2spKtg]</p>
<p>(via <a href="http://jfoscoding.blogspot.com/2007/08/image-resizing-re-imagined.html">jfo&#8217;s coding</a> and <a href="http://science.slashdot.org/science/07/08/25/1835256.shtml">slashdot</a>)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dont-panic.cc/capi/2007/10/03/content-aware-image-resizing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>git-svn on Windows (cygwin)</title>
		<link>http://www.dont-panic.cc/capi/2007/07/23/git-svn-on-windows-cygwin/</link>
		<comments>http://www.dont-panic.cc/capi/2007/07/23/git-svn-on-windows-cygwin/#comments</comments>
		<pubDate>Mon, 23 Jul 2007 17:34:25 +0000</pubDate>
		<dc:creator>Martin Carpella</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[subversion]]></category>
		<category><![CDATA[troubleshooting]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://www.dont-panic.cc/capi/2007/07/23/git-svn-on-windows-cygwin/</guid>
		<description><![CDATA[Update 2008-10-10: Often perl will not work due to memory-remapping problems. A solution can be found in my article about the issue. What I really love about Git is the fact that it nicely integrates with existing Subversion repositories. At our company, we are using Subversion as our SCM, but I personally like Git more [...]]]></description>
			<content:encoded><![CDATA[<div style="border-style: dashed; border-width: 1px; margin-top: 14px;padding: 4px; background: #f0f0f0;"><strong>Update 2008-10-10:</strong> Often perl will not work due to memory-remapping problems. A solution can be found in <a href="http://www.dont-panic.cc/capi/2007/10/29/git-svn-fails-with-fatal-error-unable-to-remap/">my article about the issue</a>.</div>
<p>What I really love about <a href="http://git.or.cz/">Git</a> is the fact that it nicely integrates with existing <a href="http://subversion.tigris.org/">Subversion</a> repositories. At our company, we are using Subversion as our <a href="http://en.wikipedia.org/wiki/Revision_control">SCM</a>, but I personally like Git more and I want to use it as a side tool for more flexible branching, merging, and for checking in versions I wouldn&#8217;t check in the shared repository.</p>
<p>Git is supplied with <a href="http://www.kernel.org/pub/software/scm/git/docs/git-svn.html">git-svn</a>, which can import an existing SVN repository and also commit back to it. Under cygwin, you need to perform two additional steps for getting git-svn to work, otherwise it is likely to fail with &#8220;failed to include Error.pm&#8221;.</p>
<ul>
<li>subversion-perl (install via <a href="http://www.cygwin.com/">cygwin</a>&#8216;s <a href="http://www.cygwin.com/setup.exe">setup.exe</a>)</li>
<li>Error.pm</li>
</ul>
<p>You need to <a href="http://search.cpan.org/src/UARUN/Error-0.15/Error.pm">download Error.pm from CPAN</a>. You have to save it to &lt;cygwin-dir&gt;\lib\perl5\Error.pm</p>
<p>Voila! git-svn should work now.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dont-panic.cc/capi/2007/07/23/git-svn-on-windows-cygwin/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Waiting for WLAN and UMTS for OpenMoko</title>
		<link>http://www.dont-panic.cc/capi/2007/07/18/waiting-for-wlan-and-umts-for-openmoko/</link>
		<comments>http://www.dont-panic.cc/capi/2007/07/18/waiting-for-wlan-and-umts-for-openmoko/#comments</comments>
		<pubDate>Wed, 18 Jul 2007 17:00:37 +0000</pubDate>
		<dc:creator>Martin Carpella</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[hardware]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[mobile]]></category>
		<category><![CDATA[openmoko]]></category>

		<guid isPermaLink="false">http://www.dont-panic.cc/capi/2007/07/18/waiting-for-wlan-and-umts-for-openmoko/</guid>
		<description><![CDATA[I am currently thinking a lot about the OpenMoko project. Unfortunately OpenMoko at the moment provides hardware which is limited to GPRS, Bluetooth, and/or USB 1.0 for connectivity. In autumn there should be the next generation which should include a WLAN (and maybe even UMTS?) support. It will be called Neo 1973 &#8211; GTA02. Together [...]]]></description>
			<content:encoded><![CDATA[<p>I am currently thinking a lot about the <a href="http://www.openmoko.org/">OpenMoko</a> project. Unfortunately OpenMoko at the moment provides hardware which is limited to <a href="http://en.wikipedia.org/wiki/GPRS">GPRS</a>, <a href="http://en.wikipedia.org/wiki/Bluetooth">Bluetooth</a>, and/or <a href="http://en.wikipedia.org/wiki/USB">USB</a> 1.0 for connectivity. In autumn there <a href="http://lists.openmoko.org/pipermail/announce/2007-June/000013.html">should be</a> the next generation which should include a WLAN (and maybe even UMTS?) support. It will be called Neo 1973 &#8211; GTA02.</p>
<p>Together with Austrian-based one &#8220;H.U.I. Starter&#8221; rate (250MB @ UMTS, reduction to 56kBit/s above, 10€/month) this would be a nice package. However, if I could have UMTS, well, that would be better. Personally, WLAN is even more important for me, I could use it in the office or in my home, where I have WLAN access available and fall back to GPRS while being &#8220;on the road&#8221;.</p>
<p>For me this means: standby for autumn, because I can&#8217;t afford to invest US-$300 now and another US-$450 in a couple of month. Still, I am really, really interested in OpenMoko (and normally I wouldn&#8217;t invest that amount of money into a hobby of mine). Which means, I am standing by and waiting for news from the OpenMoko community&#8230;</p>
<p>In the meantime, if you understand German, you could listen to this very interesting <a href="http://chaosradio.ccc.de/cre042.html">Chaosradio Express Podcast</a>.</p>
<p>On YouTube there are some very interesting <a href="http://youtube.com/results?search_query=neo1973&amp;search=">videos about the Neo 1973</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dont-panic.cc/capi/2007/07/18/waiting-for-wlan-and-umts-for-openmoko/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Git on Windows: &#8220;You have some suspicious patch lines&#8221;</title>
		<link>http://www.dont-panic.cc/capi/2007/07/13/git-on-windows-you-have-some-suspicious-patch-lines/</link>
		<comments>http://www.dont-panic.cc/capi/2007/07/13/git-on-windows-you-have-some-suspicious-patch-lines/#comments</comments>
		<pubDate>Fri, 13 Jul 2007 15:11:22 +0000</pubDate>
		<dc:creator>Martin Carpella</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[troubleshooting]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://www.dont-panic.cc/capi/2007/07/13/git-on-windows-you-have-some-suspicious-patch-lines/</guid>
		<description><![CDATA[Update 2008-04-24: as commenter Jakub Narebski correctly points out, it should be better to use core.autocrlf and crlf attribute for resolving this issue, but I have had no chance to test this up to now. The solution below is still valid, but more of the sort of an ugly hack. Update 2008-06-11: I have stopped [...]]]></description>
			<content:encoded><![CDATA[<div style="border-style: dashed; border-width: 1px; margin-top: 14px;padding: 4px; background: #f0f0f0;"><strong>Update 2008-04-24:</strong> as commenter Jakub Narebski correctly points out,  it should be better to use <em>core.autocrlf</em> and crlf attribute for resolving this issue, but I have had no chance to test this up to now. The solution below is still valid, but more of the sort of an ugly hack.</div>
<div style="border-style: dashed; border-width: 1px; margin-top: 14px;padding: 4px; background: #f0f0f0;"><strong>Update 2008-06-11:</strong> I have stopped using this solution and only use &#8220;git-config core.autocrlf true&#8221; and &#8220;git-config core.safecrlf true&#8221; any more. It works reliably and is exactly what I need and not such an ugly hack.</div>
<div style="border-style: dashed; border-width: 1px; margin-top: 14px;padding: 4px; background: #f0f0f0;"><strong>Update 2008-06-22:</strong> Well, of course you can still get &#8220;You have some suspicious patch lines&#8221; if you follow the core.autocrlf approach&#8230; but this time it really means you have trailing whitespace, not just line-breaks. If you really don&#8217;t care about trailing white-space at all, my initial solution is still valid, as it simply disables this check.</div>
<p>If you are using <a href="http://git.or.cz/">Git</a> under Windows using <a href="http://www.cygwin.com/">cygwin</a>, and you got through the <a href="http://www.dont-panic.cc/capi/2007/07/06/git-and-windows-vista/">initial problems</a>, you will soon realize that Git likes to fail with &#8220;You have some suspicious patch lines&#8221; when committing.</p>
<p>The cause for this problem is the carriage-return/line-feed problem of Git under Windows/cygwin: The patches contain a trailing line-feed if you edited them with a Windows editor and not strictly inside cygwin.  This will trigger the pre-commit hook to fail on patches where the last line of a file has been changed.</p>
<p>To solve the problem, you need to edit <code>.git/hooks/pre-commit</code> and comment out the following lines:</p>
<blockquote><p><code>if (/\s$/) {<br />
bad_line("trailing whitespace", $_);<br />
}</code></p></blockquote>
<p>Now committing should work.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dont-panic.cc/capi/2007/07/13/git-on-windows-you-have-some-suspicious-patch-lines/feed/</wfw:commentRss>
		<slash:comments>34</slash:comments>
		</item>
		<item>
		<title>DWR with &#8220;Reverse AJAX&#8221;</title>
		<link>http://www.dont-panic.cc/capi/2007/04/24/dwr-with-reverse-ajax/</link>
		<comments>http://www.dont-panic.cc/capi/2007/04/24/dwr-with-reverse-ajax/#comments</comments>
		<pubDate>Tue, 24 Apr 2007 21:36:31 +0000</pubDate>
		<dc:creator>Martin Carpella</dc:creator>
				<category><![CDATA[development]]></category>

		<guid isPermaLink="false">http://www.dont-panic.cc/capi/2007/04/24/dwr-with-reverse-ajax/</guid>
		<description><![CDATA[In a previous article I already mentioned Direct Web Remoting (DWR), the best AJAX-library I encountered up to now. I just had the time to re-discover it, as I sought something to get back to my Java skills. This library really keeps one promise: it really starts making fun to develop web-applications with AJAX. A [...]]]></description>
			<content:encoded><![CDATA[<p>In <a href="http://www.dont-panic.cc/capi/2006/05/03/dwr-easy-ajax-for-java/">a previous article</a> I already mentioned <a href="http://www.directwebremoting.org">Direct Web Remoting</a> (DWR), the best <a href="http://en.wikipedia.org/wiki/AJAX">AJAX</a>-library I encountered up to now. I just had the time to re-discover it, as I sought something to get back to my Java skills. This library really keeps one promise: it really starts making fun to develop web-applications with AJAX. A short summary: DWR provides a very easy means for calling server-side methods which are hosted in a Java Servlet Container like <a href="http://tomcat.apache.org/">Tomcat</a> or <a href="http://jetty.mortbay.org/">Jetty</a>. It masks the communication effort by providing client-side abstraction to the method calls of exported Java methods, so remote calls look local to the developer.</p>
<p>The new version 2.0 (release-candidate) introduces a new concept, which they call &#8220;<a href="http://getahead.org/dwr/reverse-ajax">reverse AJAX</a>&#8220;. Reverse AJAX allows the server to asynchronously send data to its clients. It works by either polling, persistent connection or additional information on your next AJAX call. It means, that the server at any time can push data to the client, without the client&#8217;s request. In &#8220;persistent connection&#8221; this works almost &#8220;real-time&#8221;, while polling takes at least a poll-interval to notice the new information and additionally increases load on the server.</p>
<p>This feature allows highly interactive applications where new information can be published right away, in best case without noticeable delay. Developing a simple chat-application becomes the matter of just a few lines of server-side code.</p>
<p>For an example of what you can easily do now, look at this example (fake) <a href="http://upl.codeq.info/ajaxkurs/stocks.html">stock ticker</a>, which updates the data on the client without the client being required to poll for changes. Also note the simple, yet cool, inclusion of <a href="http://script.aculo.us/">script.aculo.us</a> effects during the update. (Hint: you need to move the mouse over the table for the application to start.)</p>
<p>The downside is, the feature is still in an early stage of development, it still has some problems. On my <a href="http://www.gentoo.org">Gentoo</a> Linux box, I can reproducibly increase my CPU load to 100% by duplicating a tab with an open persistent connection in <a href="http://www.opera.com">Opera</a>. In <a href="http://www.mozilla.com/firefox/">Firefox</a>, duplicating the tab leads to normal AJAX calls to no longer function with about 50% chance. If Firefox enters this mode, it will queue up <code>XMLHttpRequest</code> causing a &#8220;normal&#8221; call to be queued behind the persistent call which will be kept open for around 60 seconds if no data is pushed from the server or even longer, if there is data. This of course makes it almost unusable at the moment, unless you can be sure, users won&#8217;t hit your site twice within the same session and/or are not using tab-duplication.</p>
<p>I&#8217;m really looking forward to this feature becoming stable, this is so cool and you can do so much awesome stuff with it. Thanks to all developers for their great work!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dont-panic.cc/capi/2007/04/24/dwr-with-reverse-ajax/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

