<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="wordpress/2.3.1" -->
<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/"
	>

<channel>
	<title>SquidPower.com Master Site Feed</title>
	<link>http://squidpower.com</link>
	<description>Shows all posts, comments, and pages from all blogs on this WPMU powered site</description>
	<pubDate>Wed, 13 Jan 2010 17:09:50 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.3.1</generator>
	<language>en</language>
	<item>
		<title>Solution to Error Running mxmlc.exe with Windows 64bit JVM</title>
		<link>http://sray.squidpower.com/2010/01/13/solution-to-error-running-mxmlcexe-with-windows-64bit-jvm/</link>
		<comments>http://sray.squidpower.com/2010/01/13/solution-to-error-running-mxmlcexe-with-windows-64bit-jvm/#comments</comments>
		<pubDate>Wed, 13 Jan 2010 17:09:50 +0000</pubDate>
		<dc:creator>Steve Gudmundson</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://sray.squidpower.com/2010/01/13/solution-to-error-running-mxmlcexe-with-windows-64bit-jvm/</guid>
		<description><![CDATA[When attempting to run mxmlc.exe from the Flex 3 SDK:
Error loading: C:\Program Files\Java\jdk1.6.0_17\jre\bin\server\jvm.dll
To solve this error I created a new batch file in the FLEX3_HOME/bin directory and named it mxmlc64bit.bat with the following one line:
 &#8221;%JAVA_HOME%\bin\java.exe&#8221; -Xmx384m -Dsun.io.useCanonCaches=false -jar &#8220;%~dp0\..\lib\mxmlc.jar&#8221; +flexlib=&#8221;%~dp0\..\frameworks&#8221; %*
 This bascially executes java to load the mxmlc.jar directly similar to what the linux script does [...]]]></description>
			<content:encoded><![CDATA[<p>When attempting to run mxmlc.exe from the Flex 3 SDK:</p>
<blockquote><p>Error loading: C:\Program Files\Java\jdk1.6.0_17\jre\bin\server\jvm.dll</p></blockquote>
<p>To solve this error I created a new batch file in the FLEX3_HOME/bin directory and named it mxmlc64bit.bat with the following one line:</p>
<blockquote><p> &#8221;%JAVA_HOME%\bin\java.exe&#8221; -Xmx384m -Dsun.io.useCanonCaches=false -jar &#8220;%~dp0\..\lib\mxmlc.jar&#8221; +flexlib=&#8221;%~dp0\..\frameworks&#8221; %*</p></blockquote>
<p> This bascially executes java to load the mxmlc.jar directly similar to what the linux script does and I assume it is also what mxmlc.exe does.</p>
<p> Hope this helps. <img src='http://squidpower.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> Check out my google ads. <img src='http://squidpower.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /></p>
]]></content:encoded>
			<wfw:commentRss></wfw:commentRss>
		</item>
	<item>
		<title>Windows 7 shows Live Messenger twice in the Taskbar</title>
		<link>http://radfordbw.squidpower.com/2010/01/11/windows-7-shows-live-messenger-twice-in-the-taskbar/</link>
		<comments>http://radfordbw.squidpower.com/2010/01/11/windows-7-shows-live-messenger-twice-in-the-taskbar/#comments</comments>
		<pubDate>Mon, 11 Jan 2010 15:53:06 +0000</pubDate>
		<dc:creator>Brian Radford</dc:creator>
		
		<category><![CDATA[Operating System]]></category>

		<category><![CDATA[Windows 7]]></category>

		<guid isPermaLink="false">http://radfordbw.squidpower.com/2010/01/11/windows-7-shows-live-messenger-twice-in-the-taskbar/</guid>
		<description><![CDATA[Windows Live Messengers shows up as two separate items in the Windows 7 taskbar.  In order to fix this, if it annoys you like it does me, follow the steps below:

Open the Start Menu
Look for Windows Live Messenger 
Do not left click, instead Right Click on the icon 
Select Properties
Look for Compatibility Tab
There is [...]]]></description>
			<content:encoded><![CDATA[<p>Windows Live Messengers shows up as two separate items in the Windows 7 taskbar.  In order to fix this, if it annoys you like it does me, follow the steps below:</p>
<ol>
<li>Open the Start Menu</li>
<li>Look for Windows Live Messenger </li>
<li>Do not left click, instead Right Click on the icon </li>
<li>Select Properties</li>
<li>Look for Compatibility Tab</li>
<li>There is a drop down list of operating systems you can choose to which the application was compatible (or in the mode you wish it to run)</li>
<li>Select either Windows XP SP3 or Vista </li>
<li>Click Apply</li>
<li>Click OK</li>
<li>Restart the application (in this case Microsoft Live Messenger)</li>
<li>Should only show one now.</li>
</ol>
<p>That is it.  I can&#8217;t explain why this is yet, but at least you can free up some of your taskbar again. <img src='http://squidpower.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p>
]]></content:encoded>
			<wfw:commentRss></wfw:commentRss>
		</item>
	<item>
		<title>Convert Xen OSS (Hypervisor) to XenServer</title>
		<link>http://radfordbw.squidpower.com/2009/10/16/convert-xen-oss-hypervisor-to-xenserver/</link>
		<comments>http://radfordbw.squidpower.com/2009/10/16/convert-xen-oss-hypervisor-to-xenserver/#comments</comments>
		<pubDate>Fri, 16 Oct 2009 22:32:17 +0000</pubDate>
		<dc:creator>Brian Radford</dc:creator>
		
		<category><![CDATA[Virtualization]]></category>

		<guid isPermaLink="false">http://radfordbw.squidpower.com/2009/10/16/convert-xen-oss-hypervisor-to-xenserver/</guid>
		<description><![CDATA[To import a linux guest from the Xen Opensource (hypervisor) to XenServer 
1.  Create a new VM in XenServer, and make sure the virtual disk is at least the size of the disk you will import.
2.  Get UUID from virtual disk images
xe vdi-list params=all
3.  Import the raw disk image file into the [...]]]></description>
			<content:encoded><![CDATA[<p>To import a linux guest from the Xen Opensource (hypervisor) to XenServer </p>
<p>1.  Create a new VM in XenServer, and make sure the virtual disk is at least the size of the disk you will import.</p>
<p>2.  Get UUID from virtual disk images<br />
<code>xe vdi-list params=all</code></p>
<p>3.  Import the raw disk image file into the virtual disk image<br />
<code>xe vdi-import filename="raw_image.img" uuid="UUID"</code></p>
<p>4.  Boot the VM.  <em>Note:  You may need boot the VM off a valid bootable ISO image first so that the drive&#8217;s location path is set.</em></p>
<p><strong>To convert from a VMware guest to XenServer</strong><br />
To import a VMware linux guest first convert the vmdk to img and use the &#8220;Other install media&#8221; Template in XenServer.</p>
<p><code>qemu-img convert -f vmdk vmdk_image.vmdk -O raw raw_image.img</code></p>
]]></content:encoded>
			<wfw:commentRss></wfw:commentRss>
		</item>
	<item>
		<title>Ensure Saving Changes to Data before Closing Browser</title>
		<link>http://radfordbw.squidpower.com/2009/08/03/ensure-saving-changes-to-data-before-closing-browser/</link>
		<comments>http://radfordbw.squidpower.com/2009/08/03/ensure-saving-changes-to-data-before-closing-browser/#comments</comments>
		<pubDate>Mon, 03 Aug 2009 15:20:34 +0000</pubDate>
		<dc:creator>Brian Radford</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://radfordbw.squidpower.com/2009/08/03/ensure-saving-changes-to-data-before-closing-browser/</guid>
		<description><![CDATA[In the past as we have moved more applications to the browser, there are some users who still struggle with the change from a desktop application to the browser.   One main change is that the browser applications don&#8217;t always prompt for saving data as the user closes the browser or navigates away from [...]]]></description>
			<content:encoded><![CDATA[<p>In the past as we have moved more applications to the browser, there are some users who still struggle with the change from a desktop application to the browser.   One main change is that the browser applications don&#8217;t always prompt for saving data as the user closes the browser or navigates away from the page.  Changes are made, and the changes are lost as they navigate away from the page without saving.  How do you ensure that changes to the data are saved before the user navigates away or closes the browser?</p>
<p>The javascript <strong>window.onbeforeunload</strong> event can help with this.</p>
<p><code>window.onbeforeunload = <em>some_function</em></code></p>
<p>Your code can be as simple as the above, but I would recommend a few additions, e.g. checking to see if the user has made any changes before you throw up a confirmation prompt.  It is always annoying to make no changes, but still be prompted to save before navigating away.  In order to track if changes have been made, here is a simple javascript tracking example.  Of course, your pages may be much more complicated, but this will illustrate one approach.</p>
<p><code><br />
  var values = new Array('', '', '', '', '', '');<br />
  var needToConfirm = true;</p>
<p>  window.onbeforeunload = confirmExit;<br />
  function confirmExit()<br />
  {<br />
    if (needToConfirm)<br />
    {<br />
      // check to see if any changes to the data entry fields have been made<br />
      for (var i = 0; i &lt; values.length; i++)<br />
      {<br />
        var elem = document.getElementById(ids[i]);<br />
        if (elem)<br />
          if ((elem.type == 'checkbox' || elem.type == 'radio')<br />
                  &amp;&amp; values[i] != elem.checked)<br />
            return "You have attempted to leave this page.  If you have made any changes to the fields without clicking the Save button, your changes will be lost.  Are you sure you want to exit this page?";<br />
          else if (!(elem.type == 'checkbox' || elem.type == 'radio') &amp;&amp;<br />
                  elem.value != values[i])<br />
            return "You have attempted to leave this page.  If you have made any changes to the fields without clicking the Save button, your changes will be lost.  Are you sure you want to exit this page?";<br />
      }</p>
<p>      // no changes - return nothing<br />
    }<br />
  }<br />
</code></p>
<p>Enjoy this bit of code, but be careful not to over use it.  It can be annoying. <img src='http://squidpower.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p>
]]></content:encoded>
			<wfw:commentRss></wfw:commentRss>
		</item>
	<item>
		<title>Hauppauge HD PVR Streaming to Flash Player</title>
		<link>http://sray.squidpower.com/2009/04/08/hauppauge-hd-pvr-streaming-to-flash-player-on-windows/</link>
		<comments>http://sray.squidpower.com/2009/04/08/hauppauge-hd-pvr-streaming-to-flash-player-on-windows/#comments</comments>
		<pubDate>Wed, 08 Apr 2009 15:23:36 +0000</pubDate>
		<dc:creator>Steve Gudmundson</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://sray.squidpower.com/2009/04/08/hauppauge-hd-pvr-streaming-to-flash-player-on-windows/</guid>
		<description><![CDATA[This blog shows how to stream directly from the Hauppauage HD PVR H.264 Encoder to a Flash Player Client with no need to reencode the audio or video.  To accomplish this I have used a series of Windows DirectShow Filters to receive the stream from the HD PVR, send the stream out to the network [...]]]></description>
			<content:encoded><![CDATA[<p>This blog shows how to stream directly from the Hauppauage HD PVR H.264 Encoder to a Flash Player Client with no need to reencode the audio or video.  To accomplish this I have used a series of Windows DirectShow Filters to receive the stream from the HD PVR, send the stream out to the network using RTP/AVP.  And then Wowza Media Server does the rest to restream it to flash player.</p>
<p>What you will need:</p>
<p>- Hauppauge HD PVR<br />
- Elecard NWRenderer DirectShow Filter (Elecard Codec .NET SDK G4 or Streaming Plug-in)<br />
- Windows Graph Edit (Windows Driver Devlopment Kit)<br />
- Wowza Media Server</p>
<p>First, install the Hauppauage HD PVR and drivers and get a good video signal coming in to it.   Next, get a copy of the Windows Driver Development Kit and you only need to install the AV Stream Tools in order to get the graphedt.exe and related libraries.  ( &#8220;C:\WINDDK\3790.1830\tools\avstream\x86\graphedt.exe&#8221; )  Most of the instructions will be building a DirectShow Filter Graph using this tool.</p>
<p>Using Windows Graph Edit you can create a filter graph to expose the raw data from the HD PVR.  The raw data is an MPEG Transport Stream containing H.264 video and AAC audio.  In Graph Edit you need to add and connect in sequence the Hauppauge HD PVR Crossbar, Hauppauge HD PVR Capture Device, and Hauppauge PVR Encoder filters.  These are found under Graph &gt; Insert Filters &gt; WDM Streaming Crossbar Devices,  WDM Streaming Capture Devices, and WDM Streaming Encoder Devices respectivally.  Connect the crossbar device to the capture device and connect the capture device to the encoder.  You can right click on each of these to modify properties.  Especially usefully is the encoder properties page to set the H.264 and AAC settings.</p>
<p>You now have direct access to the MPEG Transport Stream (containing H.264 audio and AAC video).  You could use a Dump Filter to dump this directly to a file if you wanted to.  What we want to do is feed this into the Elecard NWRenderer and stream it out to the network.  You will need to install either the Elecard Codec .NET SDK G4 or the Elecard Streaming Pack.  Once you have installed these they should show up under Graph &gt; Insert Filters &gt; DirectShow Filters.  If for some reason you do not see these Elecard filters, you may need to register them in windows.  The filters are *.ax files in the install folder of the Elecard software.  ( &#8220;C:\Program Files\Elecard\Elecard Codec SDK G4\Bin&#8221; or &#8220;C:\Program Files\Common Files\Elecard&#8221; )  Pass each of the *.ax filenames as a parameter to regsvr32.exe.</p>
<p>Insert the Elecard NWRenderer filter.  Connect the output of the Hauppauge Encoder to the Input of the Elecard NWRenderer.  Click Play to run the filter graph.  Right click to view the properties of the NWRenderer.  Under Information Click the Save SDP message.  Save this file out.  You can open this file in VLC Media Player to test that it is really being sent out over the network.  We are finished using the Graph Edit program.  Leave the graph playing and streaming on the network.</p>
<p>Install Wowza Media Server with an MPEG-TS add-on license.  Make sure you request an MPEG-TS add-on license.  Without the MPEG-TS add-on this does not work in Wowza Media Server.  Copy the rtplive folder from &#8220;%WMSCONFIG_HOME%\examples\NativeRTPVideoStreaming\conf&#8221; to &#8220;%WMSCONFIG_HOME%\conf&#8221;.  Create an empty folder named  rtplive in &#8220;%WMSCONFIG_HOME%\applications&#8221;.  Copy the .sdp into &#8220;%WMSCONFIG_HOME%\content&#8221;. Start the Wowza service.</p>
<p>Now you can run &#8220;%WMSCONFIG_HOME%\examples\NativeRTPVideoStreaming\client\nativertp.html&#8221;.  Put the filename of the .sdp file as the stream name. You are now watching the video and audio being encoded from the HD PVR.  Wowza simply converts the container from mpeg transport stream to the flash compatible mp4 box.</p>
<p>More to come including screen shots &#8230;</p>
]]></content:encoded>
			<wfw:commentRss></wfw:commentRss>
		</item>
	<item>
		<title>Working udev rules for multiple pvrusb2 and hvr-1950 devices</title>
		<link>http://sray.squidpower.com/2009/03/03/working-udev-rules-for-multiple-pvrusb2-and-hvr-1950-devices/</link>
		<comments>http://sray.squidpower.com/2009/03/03/working-udev-rules-for-multiple-pvrusb2-and-hvr-1950-devices/#comments</comments>
		<pubDate>Tue, 03 Mar 2009 23:01:30 +0000</pubDate>
		<dc:creator>Steve Gudmundson</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://sray.squidpower.com/2009/03/03/working-udev-rules-for-multiple-pvrusb2-and-hvr-1950-devices/</guid>
		<description><![CDATA[I have 6 WinTV HVR-1950 Model Category 751xx usb devices attached to one MythBuntu box recording 6 composite audio/video feeds from 6 security cameras.
Whenever the machine reboots the usb devices are assigned their device filename in non-repeatable and not well defined order so that each time /dev/video0 will probably be a different device.
So I knew [...]]]></description>
			<content:encoded><![CDATA[<p>I have 6 WinTV HVR-1950 Model Category 751xx usb devices attached to one MythBuntu box recording 6 composite audio/video feeds from 6 security cameras.</p>
<p>Whenever the machine reboots the usb devices are assigned their device filename in non-repeatable and not well defined order so that each time /dev/video0 will probably be a different device.</p>
<p>So I knew that udev rules should solve the problem.  At present, there are no attributes defined for these devices that can be used in a udev rules, but the driver does create a lot of useful information in files under /sys/class/pvrusb2/.</p>
<p>I first tried using the rules and script found on this page: http://www.isely.net/pvrusb2/utils.html</p>
<p>But they did not work.  After several hours of troubleshooting and with some help, I finally found out the reason why: the /sys/class/pvrusb2/ folder and files are not yet available at the time that the udev rule is executing the program script.</p>
<p>To solve this problem, I&#8217;ve rewritten the script so that it will wait up to 15 seconds until these sys files are available, and then using the information, properly link each /dev/videoX device to a /dev/video_sn-XXXXXXX using the serial number of that device.</p>
<p>Then in MythTV I am able to use the /dev/video_sn-XXXXXXX filename which will be the exact same physical device every time.</p>
<p>I tried using the WAIT_FOR_SYSFS and WAIT_FOR keys in the rules file, but it also did not work for me.</p>
<p>If you find this information useful you might also find a useful ad on my site and click to read more about it.  <img src='http://squidpower.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>Here are the files that work for me:</p>
<p>/etc/udev/rules.d/99-hvr1950.rules<br />
<b><br />
<code><br />
KERNEL=="video[0-9]*", PROGRAM="/usr/bin/udev-hvr-1950.sh %m", SYMLINK+="video_%c", OWNER="mythtv", GROUP="mythtv"<br />
</code><br />
</b></p>
<p>/usr/bin/udev-hvr-1950.sh<br />
<b><br />
<code><br />
#!/bin/bash</code></p>
<p># author: Steve Gudmundson</p>
<p>pvrusb2=/sys/class/pvrusb2<br />
search=$pvrusb2/sn-*<br />
timeout=15</p>
<p># find the serial number for this device #<br />
count_seconds=0<br />
minor_num=-1<br />
until [ $count_seconds -gt $timeout ]<br />
do<br />
sleep 1<br />
count_seconds=`expr $count_seconds + 1`<br />
for file in $search<br />
do<br />
minor_num=`cat $file/v4l_minor_number`<br />
if [ $minor_num -eq $1 ]<br />
then<br />
serial_num=&#8221;${file//$pvrusb2\//}&#8221;<br />
echo $serial_num<br />
exit 0<br />
fi<br />
done<br />
done</p>
<p>echo unknown_$1<br />
exit 0<br />
</code><br />
</b></p>
]]></content:encoded>
			<wfw:commentRss></wfw:commentRss>
		</item>
	<item>
		<title>Hauppauge WinTV HVR-1950 on Linux MythBuntu MythTV</title>
		<link>http://sray.squidpower.com/2009/02/18/hauppauge-wintv-hvr-1950-on-linux-mythbuntu-mythtv-analog-digital-video-including-s-video-and-composite-inputs/</link>
		<comments>http://sray.squidpower.com/2009/02/18/hauppauge-wintv-hvr-1950-on-linux-mythbuntu-mythtv-analog-digital-video-including-s-video-and-composite-inputs/#comments</comments>
		<pubDate>Thu, 19 Feb 2009 00:44:54 +0000</pubDate>
		<dc:creator>Steve Gudmundson</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://sray.squidpower.com/2009/02/18/hauppauge-wintv-hvr-1950-on-linux-mythbuntu-mythtv-analog-digital-video-including-s-video-and-composite-inputs/</guid>
		<description><![CDATA[What I did to get analog tv tuner, composite, or s-video capture to work:

Fresh install of mythbuntu 9.04
Extract and install the firmware files for HVR-1950:

Download http://www.isely.net/downloads/fwextract.pl to ~/Desktop
Insert the CD that came with your HVR-1950 (contains windows drivers) [assume it mounted as /media/cdrom0]
cd ~/Desktop
chmod u+x fwextract.pl
./fwextract.pl /media/cdrom0/Drivers/
sudo copy *.fw /lib/firmware


Run mythtv-setup using sudo

sudo mythtv-setup
Capture Card [...]]]></description>
			<content:encoded><![CDATA[<p>What I did to get analog tv tuner, composite, or s-video capture to work:</p>
<ol>
<li>Fresh install of mythbuntu 9.04</li>
<li>Extract and install the firmware files for HVR-1950:
<ol>
<li>Download <a href="http://www.isely.net/downloads/fwextract.pl">http://www.isely.net/downloads/fwextract.pl</a> to ~/Desktop</li>
<li>Insert the CD that came with your HVR-1950 (contains windows drivers) [assume it mounted as /media/cdrom0]</li>
<li>cd ~/Desktop</li>
<li>chmod u+x fwextract.pl</li>
<li>./fwextract.pl /media/cdrom0/Drivers/</li>
<li>sudo copy *.fw /lib/firmware</li>
</ol>
</li>
<li>Run mythtv-setup using sudo
<ol>
<li>sudo mythtv-setup</li>
<li>Capture Card Type: IVTV MPEG-2 encoder card</li>
<li>Video device: /dev/video0</li>
<li>Probed info: WinTV HVR-1950 Model Category 7 [pvrusb2]</li>
</ol>
</li>
<li>Run mythtvfrontend</li>
<li>(if the video looks really bad in mythfrontend):
<ol>
<li>Utilities/Setup</li>
<li>Setup</li>
<li>TV Settings</li>
<li>Recording Profiles</li>
<li>MPEG-2 Encoders (PVR-x50, PVR-500)</li>
<li>for Live TV, Default, High Quality, Low Quality
<ol>
<li>Change Width to 720</li>
<li>Change Height to 480</li>
</ol>
</li>
</ol>
</li>
</ol>
<p>Notes:</p>
<ul>
<li>To use it for digital capture instead of analog I think you need to use the DVB DTV capture card type.</li>
<li>If you do not run mythtv-setup through sudo you will get an error message: &#8220;Probed info: Failed to open&#8221; and &#8220;Could not open &#8216;/dev/video0&#8242; to probe its inputs.&#8221;</li>
<li>If you do not extract and install the firmware files, then the HVR-1950 usb will not init.  You should get the following files extracted and copied: v4l-cx2341x-enc.fw, v4l-cx25840.fw, v4l-pvrusb2-29xxx-01.fw, v4l-pvrusb2-73xxx-01.fw</li>
<li>If you try to do this on MythBuntu 8.10 you will run into the deadlock problem described in <a href="http://www.isely.net/pvrusb2/history.html">http://www.isely.net/pvrusb2/history.html</a> and fixed in the <a name="pvrusb2-mci-20081019" title="pvrusb2-mci-20081019"></a>pvrusb2-mci-20081019 release.  (I did not try to recompile the pvrusb2 driver in 8.10 because I assume it is part of the kernel and it seemed like a lot of work.  If you do and it works, let me know how.)</li>
<li>My research shows that MythBuntu does not use the standalone pvrusb2 driver but uses the -in V4L version thus further complicating the compiling of an up-to-date version of pvrusb2.  I also could not figure out which packages to force upgrade in order to get the latest pvrusb2.</li>
<li>Some things I did that I don&#8217;t think helped fix the problems:
<ul>
<li>sudo apt-get update</li>
<li>sudo apt-get dist-upgrade</li>
<li>sudo apt-get autoremove</li>
<li>sudo rmmod pvrusb2</li>
<li>sudo modprobe pvrusb2</li>
</ul>
</li>
<li>If you find this information useful you might also find a useful ad on my site and click to read more about it.  <img src='http://squidpower.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </li>
</ul>
<p>References:</p>
<ul>
<li><a href="http://www.mythbuntu.org/">http://www.mythbuntu.org/</a></li>
<li><a href="http://www.isely.net/pvrusb2/pvrusb2.html">http://www.isely.net/pvrusb2/pvrusb2.html</a></li>
<li><a href="http://ubuntuforums.org/showthread.php?p=6732655#post6732655">http://ubuntuforums.org/showthread.php?p=6732655#post6732655</a></li>
<li><a href="http://www.linuxtv.org/wiki/index.php/ATSC_USB_Devices">http://www.linuxtv.org/wiki/index.php/ATSC_USB_Devices</a></li>
</ul>
<p>dmesg output should be something like this when the device is connected properly:<br />
<code><br />
[ 3014.636441] usbcore: registered new interface driver pvrusb2<br />
[ 3014.636450] pvrusb2: V4L in-tree version:Hauppauge WinTV-PVR-USB2 MPEG2 Encoder/Tuner<br />
[ 3014.636456] pvrusb2: Debug mask is 31 (0x1f)<br />
[ 3015.636130] usb 5-6: firmware: requesting v4l-pvrusb2-73xxx-01.fw<br />
[ 3015.647622] pvrusb2: Device microcontroller firmware (re)loaded; it should now reset and reconnect.<br />
[ 3015.679396] usb 5-6: USB disconnect, address 5<br />
[ 3015.679836] pvrusb2: Device being rendered inoperable<br />
[ 3017.432020] usb 5-6: new high speed USB device using ehci_hcd and address 6<br />
[ 3017.573844] usb 5-6: configuration #1 chosen from 1 choice<br />
[ 3017.670711] cx25840' 0-0044: cx25843-24 found @ 0x88 (pvrusb2_a)<br />
[ 3017.703925] tuner' 0-0042: chip found @ 0x84 (pvrusb2_a)<br />
[ 3017.727963] tveeprom 0-00a2: Hauppauge model 75111, rev C3E9, serial# 5371008<br />
[ 3017.727968] tveeprom 0-00a2: MAC address is 00-0D-FE-51-F4-80<br />
[ 3017.727972] tveeprom 0-00a2: tuner model is Philips 18271_8295 (idx 149, type 54)<br />
[ 3017.727976] tveeprom 0-00a2: TV standards NTSC(M) ATSC/DVB Digital (eeprom 0x88)<br />
[ 3017.727979] tveeprom 0-00a2: audio processor is CX25843 (idx 37)<br />
[ 3017.727982] tveeprom 0-00a2: decoder processor is CX25843 (idx 30)<br />
[ 3017.727985] tveeprom 0-00a2: has radio, has IR receiver, has IR transmitter<br />
[ 3017.727992] pvrusb2: Supported video standard(s) reported available in hardware: PAL-M/N/Nc;NTSC-M/Mj/Mk;ATSC-8VSB/16VSB<br />
[ 3017.727998] pvrusb2: Mapping standards mask=0x300b700 (PAL-M/N/Nc;NTSC-M/Mj/Mk;ATSC-8VSB/16VSB)<br />
[ 3017.728016] pvrusb2: Setting up 6 unique standard(s)<br />
[ 3017.728023] pvrusb2: Set up standard idx=0 name=PAL-M<br />
[ 3017.728026] pvrusb2: Set up standard idx=1 name=PAL-N<br />
[ 3017.728029] pvrusb2: Set up standard idx=2 name=PAL-Nc<br />
[ 3017.728033] pvrusb2: Set up standard idx=3 name=NTSC-M<br />
[ 3017.728036] pvrusb2: Set up standard idx=4 name=NTSC-Mj<br />
[ 3017.728039] pvrusb2: Set up standard idx=5 name=NTSC-Mk<br />
[ 3017.728042] pvrusb2: Initial video standard (determined by device type): NTSC-M<br />
[ 3017.731049] pvrusb2: Device initialization completed successfully.<br />
[ 3017.731131] pvrusb2: registered device video0 [mpeg]<br />
[ 3017.731135] DVB: registering new adapter (pvrusb2-dvb)<br />
[ 3017.757981] cx25840' 0-0044: firmware: requesting v4l-cx25840.fw<br />
[ 3019.986050] cx25840' 0-0044: loaded v4l-cx25840.fw firmware (16382 bytes)<br />
[ 3020.168547] tda829x 0-0042: setting tuner address to 60<br />
[ 3020.192529] tda18271 0-0060: creating new instance<br />
[ 3020.228545] TDA18271HD/C1 detected @ 0-0060<br />
[ 3021.424529] tda829x 0-0042: type set to tda8295+18271<br />
[ 3024.742477] cx25840' 0-0044: Video signal: not present<br />
[ 3024.742482] cx25840' 0-0044: Detected format: NTSC-M<br />
[ 3024.742485] cx25840' 0-0044: Specified standard: NTSC-M<br />
[ 3024.742487] cx25840' 0-0044: Specified video input: Composite 7<br />
[ 3024.742490] cx25840' 0-0044: Specified audioclock freq: 48000 Hz<br />
[ 3024.749349] cx25840' 0-0044: Detected audio mode: mono<br />
[ 3024.749353] cx25840' 0-0044: Detected audio standard: no detected audio standard<br />
[ 3024.749356] cx25840' 0-0044: Audio muted: no<br />
[ 3024.749359] cx25840' 0-0044: Audio microcontroller: detecting<br />
[ 3024.749362] cx25840' 0-0044: Configured audio standard: automatic detection<br />
[ 3024.749365] cx25840' 0-0044: Configured audio system: BTSC<br />
[ 3024.749367] cx25840' 0-0044: Specified audio input: Tuner (In8)<br />
[ 3024.749370] cx25840' 0-0044: Preferred audio mode: stereo<br />
[ 3024.808916] cx25840' 0-0044: firmware: requesting v4l-cx25840.fw<br />
[ 3027.024318] cx25840' 0-0044: loaded v4l-cx25840.fw firmware (16382 bytes)<br />
[ 3029.267787] usb 5-6: firmware: requesting v4l-cx2341x-enc.fw<br />
[ 3029.508914] cx25840' 0-0044: 0x0000 is not a valid video input!<br />
[ 3031.787749] DVB: registering adapter 0 frontend 0 (Samsung S5H1411 QAM/8VSB Frontend)...<br />
[ 3031.790123] tda829x 0-0042: type set to tda8295<br />
[ 3031.828013] tda18271 0-0060: attaching existing instance<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss></wfw:commentRss>
		</item>
	<item>
		<title>SPEEDTEST.NET MINI with JSP</title>
		<link>http://sray.squidpower.com/2009/02/13/speedtestnet-mini-with-jsp/</link>
		<comments>http://sray.squidpower.com/2009/02/13/speedtestnet-mini-with-jsp/#comments</comments>
		<pubDate>Fri, 13 Feb 2009 21:32:58 +0000</pubDate>
		<dc:creator>Steve Gudmundson</dc:creator>
		
		<category><![CDATA[JBoss]]></category>

		<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://sray.squidpower.com/2009/02/13/speedtestnet-mini-with-jsp/</guid>
		<description><![CDATA[You can download a neat flash broadband speed test from http://www.speedtest.net/mini.php and put it on your own web site.
It comes with server side scripts in PHP, ASP.NET, and ASP for the upload half of the test.  But what if you want it to run on your java web container server such as tomcat or jboss?
Well, I [...]]]></description>
			<content:encoded><![CDATA[<p>You can download a neat flash broadband speed test from <a href="http://www.speedtest.net/mini.php">http://www.speedtest.net/mini.php</a> and put it on your own web site.</p>
<p>It comes with server side scripts in PHP, ASP.NET, and ASP for the upload half of the test.  But what if you want it to run on your java web container server such as tomcat or jboss?</p>
<p>Well, I have the solution. </p>
<p>First, for the index.html file simply copy the index-asp.html and change the upload_extension line to read jsp instead of asp:</p>
<p><code>so.addVariable("upload_extension", "jsp");</code></p>
<p>Next, you will need to create an upload.jsp file alongside the upload.php and upload.asp files in the speedtest folder.</p>
<p>Here is the code for upload.jsp:</p>
<p><code></code><code>&lt;%<br />
long size = 0;</code><code>// add length of request header strings<br />
String name = "";<br />
for(java.util.Enumeration e = request.getHeaderNames(); e.hasMoreElements();){<br />
name = (String)e.nextElement();<br />
String value = "";<br />
for(java.util.Enumeration f = request.getHeaders(name); f.hasMoreElements();){<br />
value = (String)f.nextElement();<br />
size += name.length() + value.length() + 3;<br />
//out.print(name+"="+value+"\n");<br />
}<br />
}</code><code>/*<br />
// add length of request parameter strings<br />
name = "";<br />
for(java.util.Enumeration e = request.getParameterNames(); e.hasMoreElements();){<br />
name = (String)e.nextElement();<br />
String value = "";<br />
String[] values = request.getParameterValues(name);<br />
for(int i = 0; i 0);<br />
}<br />
*/</p>
<p>// add the length of the input stream of uploaded bytes<br />
java.io.InputStream is = request.getInputStream();<br />
if ( is != null ) {<br />
long skip = 0;<br />
do {<br />
skip = is.skip(Long.MAX_VALUE);<br />
size += skip;<br />
} while (skip &gt; 0);<br />
}</p>
<p>response.reset();<br />
response.resetBuffer();<br />
response.setContentType("text/html");<br />
out.print("size="+size);<br />
%&gt;</p>
<p></code></p>
]]></content:encoded>
			<wfw:commentRss></wfw:commentRss>
		</item>
	<item>
		<title>Using Boolean AND &#38;&#38; Operator in Flex MXML Data Binding</title>
		<link>http://sray.squidpower.com/2008/12/17/using-boolean-and-operator-in-flex-mxml-data-binding/</link>
		<comments>http://sray.squidpower.com/2008/12/17/using-boolean-and-operator-in-flex-mxml-data-binding/#comments</comments>
		<pubDate>Wed, 17 Dec 2008 18:31:07 +0000</pubDate>
		<dc:creator>Steve Gudmundson</dc:creator>
		
		<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://sray.squidpower.com/2008/12/17/using-boolean-and-operator-in-flex-mxml-data-binding/</guid>
		<description><![CDATA[As you probably know because you are searching for a solution to this error, the following Flex MXML code will not work:
&#60;HBox visible="{((booleanValue1) &#38;&#38; (booleanValue2))}" &#62;
You will get this error message during compile:
Error: The entity name must immediately follow the &#8216;&#38;&#8217; in the entity reference.
Instead you will need to use html escape codes for these [...]]]></description>
			<content:encoded><![CDATA[<p>As you probably know because you are searching for a solution to this error, the following Flex MXML code will not work:</p>
<p><code>&lt;HBox visible="{((booleanValue1) &amp;&amp; (booleanValue2))}" &gt;</code></p>
<p>You will get this error message during compile:</p>
<blockquote><p>Error: The entity name must immediately follow the &#8216;&amp;&#8217; in the entity reference.</p></blockquote>
<p>Instead you will need to use html escape codes for these as follows:</p>
<p><code>&lt;HBox visible="{((booleanValue1) &amp;amp;&amp;amp; (booleanValue2))}" &gt;</code></p>
]]></content:encoded>
			<wfw:commentRss></wfw:commentRss>
		</item>
	<item>
		<title>Backing up your Blog</title>
		<link>http://radfordbw.squidpower.com/2008/12/15/backing-up-your-blog/</link>
		<comments>http://radfordbw.squidpower.com/2008/12/15/backing-up-your-blog/#comments</comments>
		<pubDate>Mon, 15 Dec 2008 19:12:26 +0000</pubDate>
		<dc:creator>Brian Radford</dc:creator>
		
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://radfordbw.squidpower.com/2008/12/15/backing-up-your-blog/</guid>
		<description><![CDATA[If you want to check out a quick and easy way to back up your blog, check out http://www.bloggled.com/
There are several options including a FREE one.  It is easy to setup and get started.  Check it out!
]]></description>
			<content:encoded><![CDATA[<p>If you want to check out a quick and easy way to back up your blog, check out http://www.bloggled.com/</p>
<p>There are several options including a FREE one.  It is easy to setup and get started.  Check it out!</p>
]]></content:encoded>
			<wfw:commentRss></wfw:commentRss>
		</item>
	<item>
		<title>Knowledge Management Best Practices</title>
		<link>http://kicker.squidpower.com/2008/12/12/knowledge-management-best-practices/</link>
		<comments>http://kicker.squidpower.com/2008/12/12/knowledge-management-best-practices/#comments</comments>
		<pubDate>Sat, 13 Dec 2008 04:26:20 +0000</pubDate>
		<dc:creator>Blake Bigelow</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://kicker.squidpower.com/2008/12/12/knowledge-management-best-practices/</guid>
		<description><![CDATA[I work for a company named Knowlysis and our main focus is in configuring and delivering knowledge management solutions to different customers. We&#8217;ve done a lot of preaching that Knowledge Centered Support (KCS) is the way to go, and I do believe that the system works. The only problem is that the organization that created KCS didn&#8217;t plan out [...]]]></description>
			<content:encoded><![CDATA[<p>I work for a company named <a href="http://www.knowlysis.com" title="Knowlysis">Knowlysis</a> and our main focus is in configuring and delivering knowledge management solutions to different customers. We&#8217;ve done a lot of preaching that Knowledge Centered Support (KCS) is the way to go, and I do believe that the system works. The only problem is that the organization that created KCS didn&#8217;t plan out any way to help organizations to implement it in their business processes. So <a href="http://www.knowlysis.com" title="Knowlysis">Knowlysis</a> is trying to fill that gap on moving from your current support practices to following KCS principles. We call it Knowledge Management Best Practices Implementation Planning. A co-worker of mine has put up a blog post on what we do.<a href="http://www.knowlysis.com/blog/view.php?id=4"> http://www.knowlysis.com/blog/view.php?id=4</a>  I think will fill that gap left by KCS. </p>
]]></content:encoded>
			<wfw:commentRss></wfw:commentRss>
		</item>
	<item>
		<title>Brian Whitmer has moved</title>
		<link>http://whitmerbc.squidpower.com/2008/12/05/brian-whitmer-has-moved/</link>
		<comments>http://whitmerbc.squidpower.com/2008/12/05/brian-whitmer-has-moved/#comments</comments>
		<pubDate>Fri, 05 Dec 2008 17:57:45 +0000</pubDate>
		<dc:creator>whitmerbc</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://whitmerbc.squidpower.com/2008/12/05/brian-whitmer-has-moved/</guid>
		<description><![CDATA[Hey all, considering how I never use this blog, I figure I might as well direct you to something more meaningful.  Here&#8217;s my current blog, in all its glory.  Hopefully I won&#8217;t offend any WordPress-ites by hopping on the Blogger bandwagon :-).
]]></description>
			<content:encoded><![CDATA[<p>Hey all, considering how I never use this blog, I figure I might as well direct you to something more meaningful.  <a href="http://brianwhitmer.blogspot.com" title="The Other Brian Whitmer">Here&#8217;s my current blog</a>, in all its glory.  Hopefully I won&#8217;t offend any WordPress-ites by hopping on the Blogger bandwagon :-).</p>
]]></content:encoded>
			<wfw:commentRss></wfw:commentRss>
		</item>
	<item>
		<title>Lessons learned from side work</title>
		<link>http://kicker.squidpower.com/2008/11/27/lessons-learned-from-side-work/</link>
		<comments>http://kicker.squidpower.com/2008/11/27/lessons-learned-from-side-work/#comments</comments>
		<pubDate>Fri, 28 Nov 2008 05:41:03 +0000</pubDate>
		<dc:creator>Blake Bigelow</dc:creator>
		
		<category><![CDATA[Blogroll]]></category>

		<category><![CDATA[akelos]]></category>

		<category><![CDATA[development]]></category>

		<category><![CDATA[rails]]></category>

		<guid isPermaLink="false">http://kicker.squidpower.com/2008/11/27/lessons-learned-from-side-work/</guid>
		<description><![CDATA[I recently finished up a website for a fellow that got a hold of me through a friend. He needed somebody to create a whole website for him and he had the design setup for me already (if you know me I can&#8217;t visually design anything for the life of me). At first I decided [...]]]></description>
			<content:encoded><![CDATA[<p>I recently finished up a website for a fellow that got a hold of me through a friend. He needed somebody to create a whole website for him and he had the design setup for me already (if you know me I can&#8217;t visually design anything for the life of me). At first I decided to do it in PHP with the <a href="http://www.akelos.org">Akelos</a> framework. That had a little bit of a learning curve, but was able to get it all completed and running on my personal machine. The problems came when loading it up to the hosting service. After a long fight I found out that Akelos didn&#8217;t handle cgi/fcgi. That got me fuming. I had to totally redo the whole sight some other way. I ended up doing a ruby on rails sight knowing i could get that up and running because they advertised it. That went well until I went to check on the site and it wasn&#8217;t running. Found out the hosting service updated their rails version and didn&#8217;t keep their older version around. If you are curious about the site its <a href="http://www.ringofyourdreams.com" title="Make sure you get the ring of your dreams.">ring of your dreams</a>.  The main lesson I&#8217;ve learned from this is test your production deployment early to make sure you can do what you&#8217;re planning on instead of scrapping a complete site.  </p>
]]></content:encoded>
			<wfw:commentRss></wfw:commentRss>
		</item>
	<item>
		<title>2008/11/11/00.04.35</title>
		<link>http://x.squidpower.com/2008/11/10/20081111000435/</link>
		<comments>http://x.squidpower.com/2008/11/10/20081111000435/#comments</comments>
		<pubDate>Tue, 11 Nov 2008 04:13:30 +0000</pubDate>
		<dc:creator></dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://x.squidpower.com/2008/11/10/20081111000435/</guid>
		<description><![CDATA[Lisp function for converting a sequence of bytes (64 bits) to IEEE-754 Double

Brought to you, not just in part, but almost in entirety through documentation from Sun on IEEE-754.


This code is a bit messy, so I&#8217;ll probably come back in a few days with a post showing a cleaner version.

; This doesn't recognize -INF or [...]]]></description>
			<content:encoded><![CDATA[<h1>Lisp function for converting a sequence of bytes (64 bits) to IEEE-754 Double</h1>
<p>
Brought to you, not just in part, but almost in entirety through <a href="http://docs.sun.com/source/806-3568/ncg_math.html">documentation from Sun on IEEE-754</a>.
</p>
<p>
This code is a bit messy, so I&#8217;ll probably come back in a few days with a post showing a cleaner version.
</p>
<pre>; This doesn't recognize -INF or +INF
; It wouldn't be hard to add, I just figure
;    I won't see them in what I'm doing.
(defun seq-to-IEEE-754-double (seq)
  (let* ((int (seq-to-int seq))
         (s (ash int -63))
         (e (ash (logxor
                   (ash (ash int -63) 63)
                   (ash (ash int -52) 52))
                 -52))
         (f (logxor
              (ash (ash int -52) 52)
              int)))
    ;(format t "~&amp;~64,'0b~%~b ~11,'0b ~52,'0b~%" int s e f)
    ;(format t "~&amp;~f ~f ~f ~f~%" s e f (/ f (expt 10 (digits f))))

    (if (and (&lt; 0 e) (&lt; e 2047))
      (* (expt -1 s)
         (expt 2 (- e 1023))
         (+ 1 (/ f (expt 10 (digits f)))))

      (if (and (= e 0) (not (= f 0)))
        (* (expt -1 s)
           (expt 2 -1022)
           (/ f (expt 10 (digits f))))

        (if (and (= e 0) (= f 0))
          (* (expt -1 s)
             0.0)
             ; Yes, something times zero. It's a signed zero.
             ; Don't know if it matters, but it's what the docs said to do.

          'NaN)))))}}}
</pre>
<p>Original post by <em><a href="http://www.lithinos.com/blog/wiki/2008/11/11/00.04.35" title="">richard.lyman</a></em> and <em>software</em> by <a href="http://elliottback.com">Elliott Back</a></p>
]]></content:encoded>
			<wfw:commentRss></wfw:commentRss>
		</item>
	<item>
		<title>2008/10/27/00.01.12</title>
		<link>http://x.squidpower.com/2008/10/26/20081027000112/</link>
		<comments>http://x.squidpower.com/2008/10/26/20081027000112/#comments</comments>
		<pubDate>Mon, 27 Oct 2008 04:11:53 +0000</pubDate>
		<dc:creator></dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://x.squidpower.com/2008/10/26/20081027000112/</guid>
		<description><![CDATA[Advanced undo/redo in an AIR app using AS3

As a short follow-up post to the basic undo/redo functionality from the other day, here&#8217;s a really simple approach to adding more advanced kinds of undo/redo.


In the same place you added the &#8216;addBasicUndoItem&#8217; method from the previous post, you could add this method:

public function addAdvancedUndoItem( o : Object [...]]]></description>
			<content:encoded><![CDATA[<h1>Advanced undo/redo in an AIR app using AS3</h1>
<p>
As a short follow-up post to <a href="http://www.lithinos.com/blog/wiki/2008/10/25/02.33.30">the basic undo/redo functionality from the other day</a>, here&#8217;s a really simple approach to adding more advanced kinds of undo/redo.
</p>
<p>
In the same place you added the &#8216;addBasicUndoItem&#8217; method from the previous post, you could add this method:
</p>
<pre>public function addAdvancedUndoItem( o : Object ) : void {
	_redo = [];
	_undo.push( o );
	verifyUndoRedo();
}
</pre>
<p>
Yup. Some simple steps:
</p>
<ol>
<li>The class managing undo/redo admits that it has no clue about more complex undo/redo situations
</li>
<li>Hand the definition of complex undo/redo situations over to the relevant class.
</li>
<li>Give the relevant class a simple method to throw the undo/redo item on the managing stack.
</li>
</ol>
<p>
In other words, if another class &#8216;ClassA&#8217; has a method named &#8216;complexAction&#8217;, then that class would probably be best suited to defining the undo/redo functionality associated with the &#8216;complexAction&#8217;.
</p>
<pre>public class ClassA{
...
    public function complexAction() : void {
        ...
        addAdvancedUndoItem({
            undo:function():Object{ /* Some complex functionality */ return this; },
            redo:function():Object{ /* Some complex functionality */ return this; }
        });
        ...
    }
...
}
</pre>
<p>
Again, not too bad.
</p>
<p>Original post by <em><a href="http://www.lithinos.com/blog/wiki/2008/10/27/00.01.12" title="">richard.lyman</a></em> and <em>software</em> by <a href="http://elliottback.com">Elliott Back</a></p>
]]></content:encoded>
			<wfw:commentRss></wfw:commentRss>
		</item>
	<item>
		<title>2008/10/25/02.33.30</title>
		<link>http://x.squidpower.com/2008/10/25/20081025023330/</link>
		<comments>http://x.squidpower.com/2008/10/25/20081025023330/#comments</comments>
		<pubDate>Sat, 25 Oct 2008 06:47:05 +0000</pubDate>
		<dc:creator></dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://x.squidpower.com/2008/10/25/20081025023330/</guid>
		<description><![CDATA[Adding basic undo/redo to an AIR app using AS3

I was hoping that it wouldn&#8217;t take too much code (and that it&#8217;d look cool since it is ActionScript), and I was pleasantly surprised:

private var _undo : Array;
private var _redo : Array;
private function verifyUndoRedo() : void {
	mainMenuData..menuitem.(attribute('data')=='undo').@enabled = _undo.length &#62; 0;
	mainMenuData..menuitem.(attribute('data')=='redo').@enabled = _redo.length &#62; 0;
}
public function addBasicUndoItem( [...]]]></description>
			<content:encoded><![CDATA[<h1>Adding basic undo/redo to an AIR app using AS3</h1>
<p>
I was hoping that it wouldn&#8217;t take too much code (and that it&#8217;d look cool since it <i>is</i> ActionScript), and I was pleasantly surprised:
</p>
<pre>private var _undo : Array;
private var _redo : Array;
private function verifyUndoRedo() : void {
	mainMenuData..menuitem.(attribute('data')=='undo').@enabled = _undo.length &gt; 0;
	mainMenuData..menuitem.(attribute('data')=='redo').@enabled = _redo.length &gt; 0;
}
public function addBasicUndoItem( s : Object, o : *, n : * ) : void {
	_redo = [];
	_undo.push( {
		undo:function():Object{ for( var p : * in o ){ s[p] = o[p]; }; return this; },
		redo:function():Object{ for( var p : * in n ){ s[p] = n[p]; }; return this; }
	} );
	verifyUndoRedo();
}
private function undo() : void { if( _undo.length &gt; 0 ){ _redo.push( _undo.pop().undo() ); } verifyUndoRedo(); }
private function redo() : void { if( _redo.length &gt; 0 ){ _undo.push( _redo.pop().redo() ); } verifyUndoRedo(); }
</pre>
<p>
&#8216;Course you&#8217;ll want to make sure your _undo and _redo Arrays are initialized to [] and that you&#8217;re listening to the Ctrl-Z and Ctrl-Y KeyboardEvents&#8230;
</p>
<pre>public function onInvoke( invokeEvent : InvokeEvent ) : void {
	stage.addEventListener( KeyboardEvent.KEY_DOWN, handleKeyDown );
}

private function handleKeyDown( e : KeyboardEvent ) : void {
	if( e.charCode == 122 &amp;&amp; e.keyCode == 90 &amp;&amp; e.ctrlKey ){
		undo();
	}else if( e.charCode == 121 &amp;&amp; e.keyCode == 89 &amp;&amp; e.ctrlKey ){
		redo();
	}
}
</pre>
<p>
&#8230; and you&#8217;ll probably want to setup an easy to manage Menu&#8230;
</p>
<pre>&lt;mx:XML format="e4x" id="mainMenuData" xmlns="" &gt;
	&lt;root&gt;
		&lt;menuitem label="File"&gt;
			&lt;menuitem label="Exit" data="exit" /&gt;
		&lt;/menuitem&gt;
		&lt;menuitem label="Edit"&gt;
			&lt;menuitem label="Undo" data="undo" enabled="false" /&gt;
			&lt;menuitem label="Redo" data="redo" enabled="false" /&gt;
		&lt;/menuitem&gt;
	&lt;/root&gt;
&lt;/mx:XML&gt;
&lt;mx:MenuBar width="100%" dataProvider="{mainMenuData}" labelField="@label" itemClick="handleMenuSelection(event)" showRoot="false" /&gt;
</pre>
<p>
&#8230; with it&#8217;s related handleMenuSelection method&#8230;
</p>
<pre>private function handleMenuSelection( e : MenuEvent ) : void {
	if( e.item.@data == "exit" ){
		NativeApplication.nativeApplication.exit();
	}else if( e.item.@data == "undo" ){
		undo();
	}else if( e.item.@data == "redo" ){
		redo();
	}
}
</pre>
<p>
&#8230; like I said, not too bad.
</p>
<p>
Using it isn&#8217;t too taxing either. Assuming that you wanted to undo/redo the x and y position of an item after it had been dragged to a new position&#8230;
</p>
<pre>// Some code before the drag that set's the prevx and prevy var's to the previous x and y...
addBasicUndoItem( this, {x:prevx,y:prevy}, {x:x,y:y} )
</pre>
<p>Original post by <em><a href="http://www.lithinos.com/blog/wiki/2008/10/25/02.33.30" title="">richard.lyman</a></em> and <em>software</em> by <a href="http://elliottback.com">Elliott Back</a></p>
]]></content:encoded>
			<wfw:commentRss></wfw:commentRss>
		</item>
	<item>
		<title>2008/09/20/21.51.03</title>
		<link>http://x.squidpower.com/2008/09/20/20080920215103/</link>
		<comments>http://x.squidpower.com/2008/09/20/20080920215103/#comments</comments>
		<pubDate>Sun, 21 Sep 2008 01:54:18 +0000</pubDate>
		<dc:creator></dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://x.squidpower.com/2008/09/20/20080920215103/</guid>
		<description><![CDATA[Note to self: Home Depot has a mini Radio Shack

I really don&#8217;t think that I would have realized that Home Depot has cool little converters, wires, devices, and assorted odds-n-ends related to electronics - but they do. I&#8217;ve been looking for a USB card reader for a while and while WalMart and Radio Shack carry [...]]]></description>
			<content:encoded><![CDATA[<h1>Note to self: Home Depot has a mini Radio Shack</h1>
<p>
I really don&#8217;t think that I would have realized that Home Depot has cool little converters, wires, devices, and assorted odds-n-ends related to electronics - but they do. I&#8217;ve been looking for a USB card reader for a while and while WalMart and Radio Shack carry products that fit that bill they&#8217;re usually expensive. Home Depot had one for $14.
</p>
<p>
They claim that their device reads 19 different types of cards&#8230; I only care about one, but those who tinker always want solutions that have more options than they really need. :-)
</p>
<p>Original post by <em><a href="http://www.lithinos.com/blog/wiki/2008/09/20/21.51.03" title="">richard.lyman</a></em> and <em>software</em> by <a href="http://elliottback.com">Elliott Back</a></p>
]]></content:encoded>
			<wfw:commentRss></wfw:commentRss>
		</item>
	<item>
		<title>2008/08/21/18.19.19</title>
		<link>http://x.squidpower.com/2008/08/21/20080821181919/</link>
		<comments>http://x.squidpower.com/2008/08/21/20080821181919/#comments</comments>
		<pubDate>Thu, 21 Aug 2008 22:26:40 +0000</pubDate>
		<dc:creator></dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://x.squidpower.com/2008/08/21/20080821181919/</guid>
		<description><![CDATA[Custom VIM functions to navigate buffers by class names

So. I know the title is not the greatest. Sorry. :-)


Here&#8217;s what I&#8217;m trying to do in GVIM:


Navigate from the current buffer to another buffer (by selecting a word that can be interpreted as the name of the file I want to go to).

Keep a list of [...]]]></description>
			<content:encoded><![CDATA[<h1>Custom VIM functions to navigate buffers by class names</h1>
<p>
So. I know the title is not the greatest. Sorry. :-)
</p>
<p>
Here&#8217;s what I&#8217;m trying to do in GVIM:
</p>
<ol>
<li>Navigate from the current buffer to another buffer (by selecting a word that can be interpreted as the name of the file I want to go to).
</li>
<li>Keep a list of where I&#8217;ve been.
</li>
<li>Navigate back to previous files - in reverse order of when I saw them.
</li>
<li>Use simple controls that make sense in navigating forward and backward.
</li>
</ol>
<p>
Yeah&#8230; that&#8217;s why the title was a bit of a stretch.
</p>
<p>
In the end I used C-LeftMouse (Control + Left click) to navigate forward, and C-RightMouse to navigate backward. I know it&#8217;s a bit backward, but it follows navigating forward with the left mouse when you&#8217;re in a web page. The code I put in my _vimrc (the underscore comes from using GVIM on msWin) is shown below:
</p>
<pre>
let s:bufNameList = []

function PushFileJump()
	if len(s:bufNameList) == 0
		let prev = bufname("#")
		call add(s:bufNameList, strpart( prev, 0, stridx(prev,".") ) )
	endif
	call add(s:bufNameList, getreg('z') )
endfunction

function PopFileJump()
	if len(s:bufNameList) &gt; 0
		call remove(s:bufNameList,-1)
		call setreg( 'z', get(s:bufNameList,-1) )
	endif
endfunction

map! &lt;C-LeftMouse&gt; &lt;LeftMouse&gt;&lt;Esc&gt;b"zye:b&lt;Space&gt;&lt;C-r&gt;z.&lt;C-q&gt;	&lt;CR&gt;:call PushFileJump()&lt;CR&gt;
map &lt;C-LeftMouse&gt; &lt;LeftMouse&gt;b"zye:b&lt;Space&gt;&lt;C-r&gt;z.&lt;C-q&gt;	&lt;CR&gt;:call PushFileJump()&lt;CR&gt;
map! &lt;C-RightMouse&gt;  &lt;Esc&gt;:call PopFileJump()&lt;CR&gt;:b&lt;Space&gt;&lt;C-r&gt;z.&lt;C-q&gt;	&lt;CR&gt;
map &lt;C-RightMouse&gt;  :call PopFileJump()&lt;CR&gt;:b&lt;Space&gt;&lt;C-r&gt;z.&lt;C-q&gt;	&lt;CR&gt;
</pre>
<p>
To explain a bit, I used a List, and carried the file I want to go to in the z register. C-LeftMouse copies the word I clicked on into the z register, navigates to that word as a file, and then calls PushFileJump to add the new file into the List.
</p>
<p>
The only reason why PushFileJump is a bit more complex than that is because I need to add the previous buffers name to the List if it was the file I started navigating at.
</p>
<p>
C-RightMouse is simpler. It calls PopFileJump, which removes the current buffer name and sets the z register to the last buffer name in the List. The rest of the mapped command for C-RightMouse finishes using the z register to navigate to the previously seen file.
</p>
<p>
This should allow me to quickly navigate forward and backward - but it throws away anything I back over&#8230; so there is still some room for improvement.
</p>
<p>Original post by <em><a href="http://www.lithinos.com/blog/wiki/2008/08/21/18.19.19" title="">richard.lyman</a></em> and <em>software</em> by <a href="http://elliottback.com">Elliott Back</a></p>
]]></content:encoded>
			<wfw:commentRss></wfw:commentRss>
		</item>
	<item>
		<title>2008/08/21/11.35.23</title>
		<link>http://x.squidpower.com/2008/08/21/20080821113523/</link>
		<comments>http://x.squidpower.com/2008/08/21/20080821113523/#comments</comments>
		<pubDate>Thu, 21 Aug 2008 15:39:08 +0000</pubDate>
		<dc:creator></dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://x.squidpower.com/2008/08/21/20080821113523/</guid>
		<description><![CDATA[GVim on WinXP - switching buffer to first file whose name is under the cursor

The Ctrl-q is used in place of the Ctrl-v, since GVim on Windows has Ctrl-V mapped to the paste action. Use of the command &#8216;ye&#8217; is essential to get the word under the cursor, in place of the command &#8216;yw&#8217;, since [...]]]></description>
			<content:encoded><![CDATA[<h1>GVim on WinXP - switching buffer to first file whose name is under the cursor</h1>
<p>
The Ctrl-q is used in place of the Ctrl-v, since GVim on Windows has Ctrl-V mapped to the paste action. Use of the command &#8216;ye&#8217; is essential to get the word under the cursor, in place of the command &#8216;yw&#8217;, since the &#8216;w&#8217; will append whitespace if it can. Please note that there is an actual &lt;Tab&gt; character in these commands, <strong>before</strong> the final &lt;CR&gt;. This allows for auto completion of the word under the cursor, in case there is more than one file with a similar name. Of course, the word you&#8217;re wanting to use is placed in the Z buffer.
</p>
<pre>map! &lt;F4&gt; &lt;Esc&gt;b"zye:b&lt;Space&gt;&lt;C-r&gt;z.&lt;C-q&gt;	&lt;CR&gt;
map &lt;F4&gt; b"zye:b&lt;Space&gt;&lt;C-r&gt;z.&lt;C-q&gt;	&lt;CR&gt;
</pre>
<p>Original post by <em><a href="http://www.lithinos.com/blog/wiki/2008/08/21/11.35.23" title="">richard.lyman</a></em> and <em>software</em> by <a href="http://elliottback.com">Elliott Back</a></p>
]]></content:encoded>
			<wfw:commentRss></wfw:commentRss>
		</item>
	<item>
		<title>2008/08/18/00.37.56</title>
		<link>http://x.squidpower.com/2008/08/17/20080818003756/</link>
		<comments>http://x.squidpower.com/2008/08/17/20080818003756/#comments</comments>
		<pubDate>Mon, 18 Aug 2008 04:44:38 +0000</pubDate>
		<dc:creator></dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://x.squidpower.com/2008/08/17/20080818003756/</guid>
		<description><![CDATA[Avoid swapChildren and swapChildrenAt

Simply googling for the phrase flex RangeError swapChildrenAt returns enough reason to follow this advice. Here&#8217;s some pseudo-code that does work for swapping the depth of two children, A and B:


A needs to be at a depth above B

If not, then switch references to A and B.



Remember the depths of A and [...]]]></description>
			<content:encoded><![CDATA[<h1>Avoid swapChildren and swapChildrenAt</h1>
<p>
Simply googling for the phrase <a href="http://www.google.com/search?q=flex+RangeError+swapChildrenAt">flex RangeError swapChildrenAt</a> returns enough reason to follow this advice. Here&#8217;s some pseudo-code that <i>does</i> work for swapping the depth of two children, A and B:
</p>
<ol>
<li><strong>A</strong> needs to be at a depth above <strong>B</strong></p>
<ul>
<li>If not, then switch references to <strong>A</strong> and <strong>B</strong>.
</li>
</ul>
</li>
<li>Remember the depths of <strong>A</strong> and <strong>B</strong>
</li>
<li>Remove <strong>A</strong>
</li>
<li>Remove <strong>B</strong>
</li>
<li>Add <strong>A</strong> to the level where <strong>B</strong> was
</li>
<li>Add <strong>B</strong> to the level where <strong>A</strong> was
</li>
</ol>
<p>
As a side note: If you&#8217;re removing these children from inside either A or B, you&#8217;ll want to keep a reference to the parent in a local variable since you&#8217;ll lose it as soon as you remove A and B.
</p>
<p>Original post by <em><a href="http://www.lithinos.com/blog/wiki/2008/08/18/00.37.56" title="">richard.lyman</a></em> and <em>software</em> by <a href="http://elliottback.com">Elliott Back</a></p>
]]></content:encoded>
			<wfw:commentRss></wfw:commentRss>
		</item>
</channel>
</rss>
<!-- 121 queries 0.496 seconds. -->
