<?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>Ben Stone Online &#187; Computing</title>
	<atom:link href="http://www.benstoneonline.com/blog/category/computing/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.benstoneonline.com/blog</link>
	<description>The Only B.S. You Need To Listen To.</description>
	<lastBuildDate>Fri, 12 Feb 2010 12:38:25 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Fixing the WordPress 2.7 XML-RPC issue</title>
		<link>http://www.benstoneonline.com/blog/2009/02/10/fixing-the-wordpress-27-xml-rpc-issue/</link>
		<comments>http://www.benstoneonline.com/blog/2009/02/10/fixing-the-wordpress-27-xml-rpc-issue/#comments</comments>
		<pubDate>Tue, 10 Feb 2009 12:22:05 +0000</pubDate>
		<dc:creator>Ben</dc:creator>
				<category><![CDATA[Computing]]></category>

		<guid isPermaLink="false">http://www.benstoneonline.com/blog/2009/02/10/fixing-the-wordpress-27-xml-rpc-issue/</guid>
		<description><![CDATA[There’s an annoying issue with the latest version of WordPress. If you use the XML-RPC interface to post blog posts (anyone using Windows Live Writer, w.bloggar, or any other desktop blogging software) you’ll notice that &#60; and &#62; tags are stripped from the output. This means formatting in posts will be screwed up, and you’ll [...]]]></description>
			<content:encoded><![CDATA[<p>There’s an annoying issue with the latest version of WordPress. If you use the XML-RPC interface to post blog posts (anyone using Windows Live Writer, w.bloggar, or any other desktop blogging software) you’ll notice that &lt; and &gt; tags are stripped from the output. This means formatting in posts will be screwed up, and you’ll see bits of HTML tags everywhere. If your paragraphs suddenly end with /p, then this is probably the bug which is causing it.</p>
<p>The cause of the problem is libxml2 version 2.7.0 and newer, which for some reason changes the way that some bits of text are stripped. Libxml2 is used by PHP to handle XML parsing.</p>
<p>There are a few ways to fix this, wait for the new version of PHP (it’s fixed in 5.2.9), downgrade your copy of libxml2 to a version before 2.7.0, or hack WordPress so it won’t get libxml2 to parse angle brackets. The third option is the easiest. <img src='http://www.benstoneonline.com/blog/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> </p>
<p><a href="http://joncanady.com/2009/01/wordpress-xmlrpc-angle-bracket-fix/">This patch will fix your XMLRPC issues.</a> The only thing is you will need to update the code to check for libxml version 2.7.3 as well. This can be done by adding || to the end of the lines ending with 2.7.2 and adding a line underneath, &quot;LIBXML_DOTTED_VERSION == &#8216;2.7.3&#8242; &quot;. Re-upload the new class-ixr.php and rss.php and you’ll be good to go. <img src='http://www.benstoneonline.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>&#8211;Ben</p>
]]></content:encoded>
			<wfw:commentRss>http://www.benstoneonline.com/blog/2009/02/10/fixing-the-wordpress-27-xml-rpc-issue/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Article of the Day: How the TrackPoint was made</title>
		<link>http://www.benstoneonline.com/blog/2008/11/26/article-of-the-day-how-the-trackpoint-was-made/</link>
		<comments>http://www.benstoneonline.com/blog/2008/11/26/article-of-the-day-how-the-trackpoint-was-made/#comments</comments>
		<pubDate>Wed, 26 Nov 2008 01:57:38 +0000</pubDate>
		<dc:creator>Ben</dc:creator>
				<category><![CDATA[Computing]]></category>

		<guid isPermaLink="false">http://www.benstoneonline.com/blog/2008/11/26/article-of-the-day-how-the-trackpoint-was-made/</guid>
		<description><![CDATA[Here&#8217;s an interesting article on how the IBM TrackPoint was developed, how it was dismissed and forgotten about, and how it suddenly became the feature that made IBM ThinkPads the best notebooks on the market. For those who don&#8217;t know, the TrackPoint is the pointing stick found on IBM, Toshiba, the business Dells, and a [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s an interesting article on <a href="http://www.edn.com/article/CA66399.html">how the IBM TrackPoint was developed</a>, how it was dismissed and forgotten about, and how it suddenly became the feature that made IBM ThinkPads the best notebooks on the market. For those who don&#8217;t know, the TrackPoint is the pointing stick found on IBM, Toshiba, the business Dells, and a few other notebooks:</p>
<p><img alt="trackpoint pointing device closeup" src="http://www.codinghorror.com/blog/images/trackpoint.jpg"></p>
<p>&nbsp;</p>
<p>An interesting fact about the <strike>cli</strike>TrackPoint: initially it was integrated into some IBM desktop keyboards, before they realised it would be excellent in a notebook. IBM stopped making desktop keyboards with <strike>nip</strike>TrackPoints, but they later reappeared when <a href="http://www.pckeyboard.com">UniComp</a> bought out the keyboard manufacturing part of IBM (well, Lexmark at that time, since IBM spun off its peripherals business to Lexmark). They still make the excellent Model M-style clacky keyboards. I&#8217;m considering getting one, because they are really nice to type on. Anyway, their EnduraPro model is an old-school clacky keyboard .. PLUS a TrackPoint. It could very well be the best keyboard ever made. If all goes well I could be getting one for Christmas &#8230; but I&#8217;m still trying to decide whether to go for the <a href="http://www.daskeyboard.com">Das Keyboard</a> instead. Meh, i&#8217;ll figure it out. <img src='http://www.benstoneonline.com/blog/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> &nbsp;&nbsp; </p>
<p>&#8211;Ben</p>
]]></content:encoded>
			<wfw:commentRss>http://www.benstoneonline.com/blog/2008/11/26/article-of-the-day-how-the-trackpoint-was-made/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Installing XP/Server 2003 without using a CD Drive</title>
		<link>http://www.benstoneonline.com/blog/2008/05/05/installing-xpserver-2003-without-using-a-cd-drive/</link>
		<comments>http://www.benstoneonline.com/blog/2008/05/05/installing-xpserver-2003-without-using-a-cd-drive/#comments</comments>
		<pubDate>Mon, 05 May 2008 11:34:59 +0000</pubDate>
		<dc:creator>Ben</dc:creator>
				<category><![CDATA[Computing]]></category>

		<guid isPermaLink="false">http://www.benstoneonline.com/blog/2008/05/05/installing-xpserver-2003-without-using-a-cd-drive/</guid>
		<description><![CDATA[I just built a low-end server for testing and backup purposes, out of an old motherboard, an Antec case and a 640gb hard disk. I made a decision to not include an optical drive in my system, not necessarily because of price (a Pioneer SATA DVD-RW is $35 at CentreCom right now! &#60;/shameless-plug&#62;) but because [...]]]></description>
			<content:encoded><![CDATA[<p>I just built a low-end server for testing and backup purposes, out of an old motherboard, an Antec case and a 640gb hard disk. I made a decision to not include an optical drive in my system, not necessarily because of price (a Pioneer SATA DVD-RW is $35 at <a href="http://www.centrecom.com.au">CentreCom</a> right now! &lt;/shameless-plug&gt;) but because I didn&#8217;t really need it. This server is mainly going to sit underneath my desk and store my backups, and maybe run a web server for when I&#8217;m doing things with web applications. Therefore I didn&#8217;t really need one. Plus from what I had read on the internet, it wasn&#8217;t too hard to launch setup from a network or a USB key. However, after trying these, both didn&#8217;t seem to work very well. Perhaps if I had a USB2.0 device handy it would have worked better, but I only had a USB1.1 device, so it was painfully slow to boot into even the text-mode part of Windows Setup.</p>
<p>After a bit of research I found a better way to do this: install Windows from the hard disk it&#8217;s installing onto. I tried this a few times*, and found that after refining my process, it works really well. Even if you have a CD drive in your new computer, installing from the hard disk will be faster, and since we will be automating the installer, you can leave it to install while you go and do other things.</p>
<p><strong>You Will Need:</strong></p>
<ol>
<li><strong>Your new computer</strong> </li>
<li><strong>A computer already running Windows</strong> </li>
<li><strong>A Windows XP/2003 CD </strong>(whichever OS you want to install on your new machine) </li>
<li><strong>A USB-IDE or USB-SATA adapter, </strong>depending on the hard disk in the new computer. For this an external HDD enclosure is fine. Personally I use a <a href="http://www.scorptec.com.au/product/19605">USB-IDE+SATA adapter</a>, which works brilliantly. </li>
<li><strong>A copy of the latest service pack for your copy of Windows,</strong> if it isn&#8217;t already slipstreamed into your CD. </li>
</ol>
<p><strong>Partitioning</strong></p>
<p>Firstly we need to partition the hard disk. Take the hard disk out of the new computer, and connect it to your USB-SATA/IDE adapter. Windows should detect your hard disk.</p>
<p>Right-click My Computer, click Manage, then open the Disk Management snapin. Then select the drive you connected (it should contain all unallocated/free space). We need to create two partitions: a partition that will become the system partition, and a partition which will hold the setup files (which can later be a data partition, or you can delete it).</p>
<p><strong>WARNING!</strong>&#160; Partitioning your hard disk using Disk Management means you will <strong>LOSE </strong>all your <strong>DATA</strong>. Just so you know. <img src='http://www.benstoneonline.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>The first partition we will create will be the system partition. This will be a FAT32 partition (it will be converted to NTFS later). Make sure this is a Primary partition. Most importantly, <strong>do not assign it a drive letter.</strong> This is so during Windows Setup you don&#8217;t end up with a drive letter like F: as your system drive. Make sure this partition is at least about 20GB, or however much you estimate that a install of Windows will be when all of your applications are installed.</p>
<p>Now we need to create a partition for the setup files. Create a Primary NTFS partition, and <strong>assign it a drive letter. </strong>It doesn&#8217;t matter what this drive letter is, you can change it later. Make this partition at least 2GB.</p>
<p>Now right-click the setup partition, and select Mark Partition as Active.</p>
<p><strong>Copying the setup files</strong></p>
<p>The second NTFS partition you created should show up in Windows Explorer after it has finished formatting. Create a new folder on this partition called &quot;install&quot;. Now copy the entire contents of your Windows XP/Server 2003 CD to this folder.</p>
<p><strong>Slipstreaming the latest service pack</strong></p>
<p>If your Windows install CD doesn&#8217;t contain the latest service pack, you really should slipstream the latest service pack into the install files. This will save you time as you won&#8217;t have to install the service pack after you have installed Windows. Obtain the full (network) install packages of either <a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=049c9dbe-3b8e-4f30-8245-9e368d3cdb5a&amp;DisplayLang=en">Windows XP SP2</a> (note: this will be replaced by SP3 in a few days!) or <a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=95AC1610-C232-4644-B828-C55EEC605D55&amp;displaylang=en">Windows Server 2003 SP2</a>. Now open up a command prompt and run the EXE you just downloaded, with the Integrate parameter like this:</p>
<p><em>WindowsXP-KB835935-SP2-ENU.exe /integrate:X:\install</em></p>
<p>(where X is the setup partition)</p>
<p>After a few minutes, your install files will contain the latest service pack.</p>
<p><strong>Unattended Install</strong></p>
<p>We will be automating the install by entering in all of the data. This is mainly to save time, but also because we need to create an unattended install script anyway to tell the installer to convert the first partition to NTFS. In the SUPPORT\TOOLS folder in the Install folder, there is a file called deploy.cab. Extract the contents of this to a folder, and run SetupMgr.exe. This is Windows&#8217; unattended install script generator. You could also use nLite, which is actually a whole lot nicer, but this is sufficient. Make sure you select <strong>Fully Automated </strong>as the install method, otherwise you will need to click through the install, which defeats the purpose. Enter in all of your details such as your timezone, product key, etc, and save the unattended script as Unattend.txt in the Install folder on the setup partition.</p>
<p>Now open up Unattend.txt in Notepad, and under the [Unattended] heading, add the following line:</p>
<p><em>FileSystem = ConvertNTFS</em></p>
<p>This will ensure that the FAT32 partition is converted to NTFS during the text-mode phase of setup.</p>
<p><strong>Copying the setup files</strong></p>
<p>We now need to run the Windows Installer, and tell it to copy the installer boot files to the setup partition. Open up a command prompt to the i386 folder in the Install folder on the setup partition. Now type the following:</p>
<p><em>winnt32 /unattend:..\unattend.txt /dudisable     <br />/syspart:X /tempdrive:X /makelocalsource /noreboot</em></p>
<p>(where X is the setup partition. This should be all on one line.)</p>
<p>When you run this command, Windows Setup will run, and create $WIN_NT$.BT and $WIN_NT$.LS folders on the Setup partition. The next time a computer boots from this partition, Windows Setup will run and install Windows automatically.</p>
<blockquote><p>Interesting Sidenote: What do the switches mean?</p>
<p>/unattend: Tells the Windows Setup program to use the unattended install script in the folder above the i386 folder</p>
<p>/dudisable: Tells the Windows Setup program to not check the internet for updates</p>
<p>/syspart:X Tells the Windows Setup program to copy the setup files to the specified partition instead of the partition that the system is currently running from (usually C). If you don&#8217;t include this, then next time you reboot your old computer, it will boot into setup.</p>
<p>/tempdrive:X Tells the Windows Setup program to place temporary files on the setup partition.</p>
<p>/makelocalsource: Tells the Windows Setup program to create a copy of all of the setup files in the $WIN_NT$.LS folder. This is the most crucial step, as this means that setup will not look for files on the CD drive.</p>
<p>/noreboot: Tells Windows Setup to not reboot after it copies the files. Since usually when winnt32 is run, it is performing an install on the computer it is running on, it will reboot to start the text-mode phase of setup.</p>
</blockquote>
<p><strong> Installing Windows</strong></p>
<p>Safely remove the new computer&#8217;s hard disk and connect it to the new computer. Boot the new computer. Provided that it doesn&#8217;t try to boot to the network or a USB device, the system should boot straight into Windows Setup. It will continue without needing any user intervention, unless something goes wrong. It will also be considerably faster than a normal Windows install, as installing from a hard disk is a lot faster than installing from a CD.</p>
<p>In about 20 minutes, you should be faced with a Windows logon screen, or the annoying Windows Out-Of-Box-Experience (Let&#8217;s Activate Windows!) screen.</p>
<p><strong>Copying the boot loader</strong></p>
<p>Windows is ready to go, however the setup program will have most likely put the boot files on the second partition. To make everything self-contained, it is better if these are on the system partition. </p>
<p>Open up Windows Explorer to the system partition. Go to Tools -&gt; Folder Options -&gt; View, and select <em>Show hidden files and folders</em> and untick <em>Hide protected operating system files (Recommended).</em></p>
<p>As well as the Install folder we created, you will notice that there are three files, <em>ntldr, ntdetect.com </em>and <em>boot.ini</em>. Copy these three files to the root of the C:\ drive.</p>
<p>Now right-click My Computer, click Manage, then open the Disk Management snapin. Right-click the C: partition, and select Mark Partition as Active. Close Disk Management, and reboot. Your computer should boot as normal.</p>
<p>Now you can change the drive letter on the second partition, or delete the second partition if you want. You do not need to keep the install files that are on this partition. If you want to extend the C: partition to fill the drive, you could use either Windows&#8217; built-in Diskpart tool, or the excellent GParted+ Linux livecd (though in this case if you have no CD drive, you would probably boot it from a USB drive).</p>
<p><strong>Other nice things to try</strong></p>
<p>You can slipstream the latest service pack and set up the unattended install using <a href="http://www.nliteos.com/">nLite</a>. nLite will also give you a lot more options with regards to tweaking the system, and it also allows you to slipstream all of your drivers and software into the install, so you don&#8217;t have to install them later. If you do it using nLite, make sure you don&#8217;t create an ISO file on the final setup. You don&#8217;t need it, unless you want to burn your new nLited install to a CD.</p>
<p><strong>Why not use Ghost/Sysprep/RIS/USB/Floppy?</strong></p>
<p>Ghosting/imaging a SysPrepped copy of Windows requires you to have a somewhat-similar PC already set up with Windows to clone onto the new drive. RIS achieves the same thing as we did here, but you have to have a Windows Server 2003 machine handy. You can install Windows XP from a USB drive, but I didn&#8217;t have a USB2.0 device with enough space on it available. You cannot feasibly install Windows from a USB1.1 device, because it is too small. You cannot feasibly install Windows from a floppy disk either. <img src='http://www.benstoneonline.com/blog/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> </p>
<p>&#8211;Ben</p>
<p>* A few times is more like about 10 times &#8230; I reinstalled Server 2003 quite a few times on my machine, trying to figure out why it would bluescreen at random points during and after setup. Then I realised that one of the sticks of RAM I had was bad. *smacks head*.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.benstoneonline.com/blog/2008/05/05/installing-xpserver-2003-without-using-a-cd-drive/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Does Pascal code turn you on?</title>
		<link>http://www.benstoneonline.com/blog/2008/03/21/does-pascal-code-turn-you-on/</link>
		<comments>http://www.benstoneonline.com/blog/2008/03/21/does-pascal-code-turn-you-on/#comments</comments>
		<pubDate>Fri, 21 Mar 2008 07:49:52 +0000</pubDate>
		<dc:creator>Ben</dc:creator>
				<category><![CDATA[Computing]]></category>

		<guid isPermaLink="false">http://www.benstoneonline.com/blog/2008/03/21/does-pascal-code-turn-you-on/</guid>
		<description><![CDATA[It can if you want it to. The Synapse socket library for Pascal makes it quite easy to create a Wake On LAN program, which can be used to turn your computers on over the network. By sending a special packet via UDP, you can turn on any modern computer remotely, as long as it [...]]]></description>
			<content:encoded><![CDATA[<p>It can if you want it to. The Synapse socket library for Pascal makes it quite easy to create a Wake On LAN program, which can be used to turn your computers on over the network. By sending a special packet via UDP, you can turn on any modern computer remotely, as long as it is plugged into an Ethernet network. This short article will show you how to write a program to send a Wake On LAN packet using Pascal.</p>
<p><strong>Note:</strong> Before you start this program, make sure you have downloaded Synapse and placed it where FreePascal can find it. Also add the following to the top of your program: <em>uses StrUtils, SysUtils, blcksock;</em></p>
<p><strong>The Packet</strong></p>
<p>The &#8220;Magic Packet&#8221; consists of six FF bytes, followed by the MAC (hardware) address of the computer, repeated 16 times. To do this first we loop through the string containing the address, then use StrToInt plus a dollar sign to convert the hexadecimal number to a decimal. Then we pass that to the Chr function, which gives the actual byte. After the address string is generated, we use DupeString to repeat it 16 times.</p>

<div class="wp_syntax"><div class="code"><pre class="pascal"><span style="color: #000000; font-weight: bold;">function</span> BuildWOLPacket<span style="color: #66cc66;">&#40;</span>wolAddress : <span style="color: #993333;">string</span><span style="color: #66cc66;">&#41;</span> : <span style="color: #993333;">string</span>;
<span style="color: #b1b100;">var</span>
	i : <span style="color: #993333;">integer</span>;
	addressByte, address : <span style="color: #993333;">string</span>;
<span style="color: #b1b100;">begin</span>
	<span style="color: #808080; font-style: italic;">// This function will work with a MAC address formatted like this:</span>
	<span style="color: #808080; font-style: italic;">// &quot;01-23-45-67-89-0A&quot; ie. delimited by a character.</span>
	<span style="color: #808080; font-style: italic;">// So if the address isn't 17 chars long, we will quit.</span>
	<span style="color: #b1b100;">if</span> length<span style="color: #66cc66;">&#40;</span>wolAddress<span style="color: #66cc66;">&#41;</span> &amp;lt;&amp;gt; <span style="color: #cc66cc;">17</span> <span style="color: #b1b100;">then</span> exit;
&nbsp;
	<span style="color: #b1b100;">for</span> i := <span style="color: #cc66cc;">0</span> <span style="color: #b1b100;">to</span> <span style="color: #cc66cc;">5</span> <span style="color: #b1b100;">do</span>
	<span style="color: #b1b100;">begin</span>
		addressByte := UpperCase<span style="color: #66cc66;">&#40;</span>MidStr<span style="color: #66cc66;">&#40;</span>wolAddress, <span style="color: #cc66cc;">3</span>*i<span style="color: #cc66cc;">+1</span>,<span style="color: #cc66cc;">2</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
		address := address + <span style="">Chr</span><span style="color: #66cc66;">&#40;</span>StrToInt<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'$'</span> + addressByte<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
	<span style="color: #b1b100;">end</span>;
&nbsp;
	<span style="color: #808080; font-style: italic;">// Repeat #255 6 times, then repeat the address 16 times.</span>
	result := DupeString<span style="color: #66cc66;">&#40;</span>#<span style="color: #cc66cc;">255</span>,<span style="color: #cc66cc;">6</span><span style="color: #66cc66;">&#41;</span> + DupeString<span style="color: #66cc66;">&#40;</span>address,<span style="color: #cc66cc;">16</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #b1b100;">end</span>;</pre></div></div>

<p>This function will return a string which contains a WoL &#8220;Magic Packet.&#8221;</p>
<p><strong>Sending the packet</strong></p>
<p>To send this packet, we need to use the Synapse socket library. The Synapse library has a component called TUDPBlockSocket which we will use to send the packet to the broadcast address (255.255.255.255) on port 0 (some other ports can be used, eg. 9 and 7, however 0 seems to work).</p>

<div class="wp_syntax"><div class="code"><pre class="pascal"><span style="color: #000000; font-weight: bold;">procedure</span> SendWOLPacket<span style="color: #66cc66;">&#40;</span>wolPacket : <span style="color: #993333;">string</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #b1b100;">var</span>
	sock : TUDPBlockSocket;
<span style="color: #b1b100;">begin</span>
	<span style="color: #808080; font-style: italic;">// Create the socket</span>
	sock := TUDPBlockSocket.<span style="color: #202020;">Create</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
	<span style="color: #808080; font-style: italic;">// Enable broadcast support (this is important)</span>
	sock.<span style="color: #202020;">EnableBroadcast</span><span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">True</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
	sock.<span style="color: #202020;">Connect</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'255.255.255.255'</span>,<span style="color: #ff0000;">'0'</span><span style="color: #66cc66;">&#41;</span>
&nbsp;
	<span style="color: #808080; font-style: italic;">// Send the string.</span>
	sock.<span style="color: #202020;">SendString</span><span style="color: #66cc66;">&#40;</span>wolPacket<span style="color: #66cc66;">&#41;</span>;
&nbsp;
	<span style="color: #808080; font-style: italic;">// Close the socket.</span>
	sock.<span style="color: #202020;">CloseSocket</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #b1b100;">end</span>;</pre></div></div>

<p>Now that you have these two functions, it is easy to wake up a computer:</p>

<div class="wp_syntax"><div class="code"><pre class="pascal">wolPacket := BuildWOLPacket<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'00:13:37:BA:DA:55'</span><span style="color: #66cc66;">&#41;</span>;
SendWOLPacket<span style="color: #66cc66;">&#40;</span>wolPacket<span style="color: #66cc66;">&#41;</span>;</pre></div></div>

<p><strong>If it doesn&#8217;t work&#8230;</strong></p>
<p>You might want to try changing the port number from 0 to 9 or 7. There doesn&#8217;t seem to be a standard for which port is used for Wake On LAN (it actually doesn&#8217;t really matter on a LAN).</p>
<p>Also since this uses the Delphi syntax you will need to compile with the -Sd option if you&#8217;re using the FreePascal compiler.</p>
<p>&#8211;Ben</p>
]]></content:encoded>
			<wfw:commentRss>http://www.benstoneonline.com/blog/2008/03/21/does-pascal-code-turn-you-on/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
