<?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>CyberShadow’s blog &#187; Random</title>
	<atom:link href="http://blog.thecybershadow.net/category/random/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.thecybershadow.net</link>
	<description>Code and miscellanea</description>
	<lastBuildDate>Wed, 05 Oct 2011 15:01:59 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Fixing DirectMusic on some 64-bit Windows versions</title>
		<link>http://blog.thecybershadow.net/2011/07/14/fixing-directmusic-on-some-64-bit-windows-versions/</link>
		<comments>http://blog.thecybershadow.net/2011/07/14/fixing-directmusic-on-some-64-bit-windows-versions/#comments</comments>
		<pubDate>Thu, 14 Jul 2011 04:41:42 +0000</pubDate>
		<dc:creator>CyberShadow</dc:creator>
				<category><![CDATA[Random]]></category>
		<category><![CDATA[DirectX]]></category>

		<guid isPermaLink="false">http://blog.thecybershadow.net/?p=344</guid>
		<description><![CDATA[If you&#8217;re getting error messages such as &#8220;No sound device detected. Sounds might not play.&#8221; or &#8220;Failed to create Direct Music Performance.&#8221; when running Game Maker games, the following may help you. Here&#8217;s what I did to fix them on my system: Download the DirectX redistributable Unpack it Unpack dxnt.cab In dmusic.inf, search and replace [...]]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re getting error messages such as &#8220;No sound device detected. Sounds might not play.&#8221; or &#8220;Failed to create Direct Music Performance.&#8221; when running Game Maker games, the following may help you. Here&#8217;s what I did to fix them on my system:</p>
<ol>
<li>Download the <a href="http://www.microsoft.com/download/en/details.aspx?id=9033">DirectX redistributable</a>
<li>Unpack it
<li>Unpack <tt>dxnt.cab</tt>
<li>In <tt>dmusic.inf</tt>, search and replace &#8220;<tt>HKCR,</tt>&#8221; with &#8220;<tt>HKCR,Wow6432Node\</tt>&#8221;
<li>Install the edited <tt>dmusic.inf</tt> (from the right-click menu)
<li>Copy missing DLLs (<tt>dm*.dll</tt>) to <tt>%WINDIR%/SysWOW64</tt>.
</ol>
<p>That&#8217;s it! The same method could work for other DirectX components as well.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.thecybershadow.net/2011/07/14/fixing-directmusic-on-some-64-bit-windows-versions/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Color grep for Windows</title>
		<link>http://blog.thecybershadow.net/2010/09/12/color-grep-for-windows/</link>
		<comments>http://blog.thecybershadow.net/2010/09/12/color-grep-for-windows/#comments</comments>
		<pubDate>Sun, 12 Sep 2010 02:49:40 +0000</pubDate>
		<dc:creator>CyberShadow</dc:creator>
				<category><![CDATA[Random]]></category>
		<category><![CDATA[ack]]></category>
		<category><![CDATA[grep]]></category>
		<category><![CDATA[tools]]></category>

		<guid isPermaLink="false">http://blog.thecybershadow.net/?p=265</guid>
		<description><![CDATA[Looking for color grep for Windows? I was. I didn&#8217;t find exactly what I was looking for; instead, I found something better. ack is a tool like grep, designed for programmers with large trees of heterogeneous source code. ack doesn&#8217;t enable or output colors on Windows by default. To get it all working, do the [...]]]></description>
			<content:encoded><![CDATA[<p>Looking for color grep for Windows? I was. I didn&#8217;t find exactly what I was looking for; instead, I found something better.</p>
<blockquote><p><a href="http://betterthangrep.com/">ack</a> is a tool like grep, designed for programmers with large trees of heterogeneous source code.</p></blockquote>
<p><span id="more-265"></span><a href="http://blog.thecybershadow.net/wp-content/uploads/2010/09/result.png"><img src="http://blog.thecybershadow.net/wp-content/uploads/2010/09/result_s.png" alt="ack + FAR screenshot" title="ack + FAR screenshot" width="518" height="391" class="aligncenter size-full wp-image-268" /></a><br />
<strong>ack</strong> doesn&#8217;t enable or output colors on Windows by default. To get it all working, do the following:</p>
<ol>
<li>If you don&#8217;t have it yet, <a href="http://www.activestate.com/activeperl/downloads">get ActivePerl</a>.</li>
<li>Download the <a href="http://betterthangrep.com/ack-standalone">standalone version</a> of ack; save it with a <tt>.pl</tt> extension</li>
<li>Create a batch file somewhere under <tt>%PATH%</tt> named <tt><strong>ack.bat</strong></tt> which invokes perl with ack:
<pre class="brush: batch; light: true; title: ; notranslate">@C:\Perl\bin\perl.exe C:\Tools\ack-standalone.pl %*</pre>
<p>You should now be able to type <tt><b>ack</b> <i>arguments</i></tt> from anywhere, however this won&#8217;t get colors working right away. To do that:</li>
<li>Install the <a href="http://www.bribes.org/perl/wANSIConsole.html">Win32::Console::ANSI module</a> using <abbr title="Perl Package Manager">PPM</abbr> (you&#8217;ll need to add the repository).</li>
<li>In <tt>ack-standalone.pl</tt>, add this line after the other two <tt>use</tt> lines:
<pre class="brush: perl; light: true; title: ; notranslate">use Win32::Console::ANSI;</pre>
</li>
<li>Create a file named <tt>.ackrc</tt> in your user profile folder (usually C:\Documents and Settings\<i>Username</i>), with the contents:
<pre class="brush: plain; light: true; title: ; notranslate">--color
--color-match
bold red</pre>
<p>&#8220;<tt>bold red</tt>&#8221; (which actually means bright red) is my own preference; I think it&#8217;s nicer than the default &#8220;black on_yellow&#8221;, and the default color for grep (on *nix) as well.</li>
</ol>
<p>That&#8217;s it!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.thecybershadow.net/2010/09/12/color-grep-for-windows/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Why is the amount of text I can type in my combo box limited by its width?</title>
		<link>http://blog.thecybershadow.net/2010/05/26/why-is-the-amount-of-text-i-can-type-in-my-combo-box-limited-by-its-width/</link>
		<comments>http://blog.thecybershadow.net/2010/05/26/why-is-the-amount-of-text-i-can-type-in-my-combo-box-limited-by-its-width/#comments</comments>
		<pubDate>Wed, 26 May 2010 01:46:43 +0000</pubDate>
		<dc:creator>CyberShadow</dc:creator>
				<category><![CDATA[Random]]></category>
		<category><![CDATA[C++]]></category>
		<category><![CDATA[WinAPI]]></category>

		<guid isPermaLink="false">http://blog.thecybershadow.net/?p=222</guid>
		<description><![CDATA[Once in a while you&#8217;ll stumble upon a combo box which doesn&#8217;t allow you to type past the right edge of the control. When normally typing more text would just scroll the contents, you&#8217;ll just get back an annoying beep. The amount of text you can enter is actually bound by the on-screen width of [...]]]></description>
			<content:encoded><![CDATA[<p>Once in a while you&#8217;ll stumble upon a combo box which doesn&#8217;t allow you to type past the right edge of the control. When normally typing more text would just scroll the contents, you&#8217;ll just get back an annoying beep. The amount of text you can enter is actually bound by the on-screen width of the text &#8211; thus, you may be able to enter 125 &#8220;i&#8221; characters, but only 25 &#8220;W&#8221; characters.</p>
<p>The cause of the problem is that the combo box was not created with the <a href="http://msdn.microsoft.com/en-us/library/7h63bxbe(VS.80).aspx">CBS_AUTOHSCROLL</a> style:</p>
<blockquote><dl>
<dt>CBS_AUTOHSCROLL</dt>
<dd>Automatically scrolls the text in the edit control to the right when the user types a character at the end of the line. If this style is not set, only text that fits within the rectangular boundary is allowed.</dd>
</dl>
</blockquote>
<p>Visual Studio&#8217;s resource editor has a different name and description for this property:</p>
<blockquote><dl>
<dt>Auto</dt>
<dd>Automatically scrolls text to the left when the user types a character at the end of the line.</dd>
</dl>
</blockquote>
]]></content:encoded>
			<wfw:commentRss>http://blog.thecybershadow.net/2010/05/26/why-is-the-amount-of-text-i-can-type-in-my-combo-box-limited-by-its-width/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress &#8220;Pixel&#8221; theme &#8211; fixed background mod</title>
		<link>http://blog.thecybershadow.net/2010/04/23/wordpress-pixel-theme-fixed-background-mod/</link>
		<comments>http://blog.thecybershadow.net/2010/04/23/wordpress-pixel-theme-fixed-background-mod/#comments</comments>
		<pubDate>Fri, 23 Apr 2010 01:35:58 +0000</pubDate>
		<dc:creator>CyberShadow</dc:creator>
				<category><![CDATA[Random]]></category>
		<category><![CDATA[Website]]></category>
		<category><![CDATA[web design]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://blog.thecybershadow.net/?p=179</guid>
		<description><![CDATA[I love fixed backgrounds. So, I made a version of Sam&#8216;s Pixel theme with a fixed background (which you can see on the blog already). It even supports IE6 (well, almost) &#8211; thanks, ie7-js! Note: I re-exported the background from the original PSD as a PNG, since it&#8217;s too beautiful to be degraded by JPEG [...]]]></description>
			<content:encoded><![CDATA[<p>I love fixed backgrounds. So, I made a version of <a href="http://samk.ca/">Sam</a>&#8216;s <a href="http://samk.ca/freebies/pixel/">Pixel</a> theme with a fixed background (which you can see on the blog already). It even supports IE6 (well, almost) &#8211; thanks, <a href="http://code.google.com/p/ie7-js/">ie7-js</a>!</p>
<p>Note: I re-exported the background from the <a href="http://samk.ca/mememe/bg_pixel_by_samk.ca.zip">original PSD</a> as a PNG, since it&#8217;s too beautiful to be degraded by JPEG compression artifacts. The PNG is about <span title="Thanks, Deadcode!">350kb in size</span> &#8211; so, if that bothers you, convert it to JPEG and edit style.css accordingly.</p>
<p><a href='http://blog.thecybershadow.net/wp-content/uploads/2010/04/pixel-fixed.zip'>Download</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.thecybershadow.net/2010/04/23/wordpress-pixel-theme-fixed-background-mod/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Ctrl+Tab and Ctrl+Shift+Tab in Eclipse</title>
		<link>http://blog.thecybershadow.net/2010/04/19/ctrltab-and-ctrlshifttab-in-eclipse/</link>
		<comments>http://blog.thecybershadow.net/2010/04/19/ctrltab-and-ctrlshifttab-in-eclipse/#comments</comments>
		<pubDate>Mon, 19 Apr 2010 20:59:57 +0000</pubDate>
		<dc:creator>CyberShadow</dc:creator>
				<category><![CDATA[Random]]></category>
		<category><![CDATA[AutoHotKey]]></category>
		<category><![CDATA[Eclipse]]></category>

		<guid isPermaLink="false">http://blog.thecybershadow.net/?p=150</guid>
		<description><![CDATA[The Eclipse IDE doesn&#8217;t use the overwhelmingly common Ctrl+Tab and Ctrl+Shift+Tab shortcuts to switch editor tabs. Not only that, it doesn&#8217;t even allow you to bind these keys to the classic Ctrl+Tab behavior (switch to the tab left/right of the current one). However, Ctrl+PageUp/Down seem to be hard-coded to switching tabs the good-old way, so [...]]]></description>
			<content:encoded><![CDATA[<p>The <a href="http://www.eclipse.org/">Eclipse</a> IDE doesn&#8217;t use the overwhelmingly common Ctrl+Tab and Ctrl+Shift+Tab shortcuts to switch editor tabs. Not only that, it doesn&#8217;t even allow you to bind these keys to the classic Ctrl+Tab behavior (switch to the tab left/right of the current one). However, Ctrl+PageUp/Down seem to be hard-coded to switching tabs the good-old way, so it&#8217;s just a matter of remapping Ctrl+(Shift+)Tab to those keys.</p>
<p>Here&#8217;s my <a href="http://www.autohotkey.com/">AutoHotKey</a> solution:</p>
<pre class="brush: plain; title: ; notranslate">#IfWinActive ahk_class SWT_Window0
^Tab::Send ^{PgDn}
#IfWinActive ahk_class SWT_Window0
^+Tab::Send ^{PgUp}</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.thecybershadow.net/2010/04/19/ctrltab-and-ctrlshifttab-in-eclipse/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PuTTY Knife for KiTTY</title>
		<link>http://blog.thecybershadow.net/2010/01/07/putty-knife-for-kitty/</link>
		<comments>http://blog.thecybershadow.net/2010/01/07/putty-knife-for-kitty/#comments</comments>
		<pubDate>Wed, 06 Jan 2010 23:01:44 +0000</pubDate>
		<dc:creator>CyberShadow</dc:creator>
				<category><![CDATA[Random]]></category>
		<category><![CDATA[PuTTY]]></category>
		<category><![CDATA[tools]]></category>

		<guid isPermaLink="false">http://blog.thecybershadow.net/?p=76</guid>
		<description><![CDATA[PuTTY Knife is a small program that, when launched, creates a context menu that contains all of your PuTTY sessions. KiTTY is a PuTTY fork with a bunch of new features. Since KiTTY stores its sessions in another registry key, PuTTY Knife doesn&#8217;t &#8220;see&#8221; them. Here is a patched version that reads the KiTTY registry [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.salug.org/~reg/puttyknife.html">PuTTY Knife</a> is a small program that, when launched, creates a context menu that contains all of your PuTTY sessions. <a href="http://kitty.9bis.com/">KiTTY</a> is a PuTTY fork with a bunch of new features. Since KiTTY stores its sessions in another registry key, PuTTY Knife doesn&#8217;t &#8220;see&#8221; them.<span id="more-76"></span></p>
<p>Here is a patched version that reads the KiTTY registry key instead of the standard PuTTY one:<br />
<a href="http://dump.thecybershadow.net/a45e14b026d9a013e37c3cb5bd9a49d3/KiTTYKnife.exe">Download</a></p>
<p><strong>Edit</strong>: I completely missed out on <a href="http://www.9bis.net/kitty/?page=The%20session%20launcher&amp;zone=en">the session launcher</a> feature in KiTTY, which supports KiTTY&#8217;s session folder structure.</p>
<p><strong>Edit 2</strong>: I got so used to launching PuTTY Knife from a shortcut, that I could never get used to reaching for KiTTY&#8217;s session launcher in the system tray. Instead, I wrote a tiny program which pops up KiTTY&#8217;s system tray menu. Here it is:</p>
<pre class="brush: cpp; title: ; notranslate">
#include &lt;windows.h&gt;
void main()
{
	HWND h = FindWindow(&quot;KiTTYLauncher&quot;, &quot;KiTTYLauncher&quot;);
	if (h == 0)
		MessageBeep(MB_ICONERROR);
	else
		SendMessage(h, 0x402, 9901, WM_LBUTTONUP);
	ExitProcess(0);
}
</pre>
<p>Download: <a href="http://dump.thecybershadow.net/dc00036328cc560d5aa329b877cb9b98/KiTTYLauncher.exe">KiTTYLauncher.exe</a> (just 1 KB!)</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.thecybershadow.net/2010/01/07/putty-knife-for-kitty/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

