<?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>P a u l C h i l t o n</title>
	<atom:link href="http://www.pchilton.co.uk/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.pchilton.co.uk</link>
	<description>electronics, programming, gadgets</description>
	<lastBuildDate>Sat, 30 Mar 2013 09:19:53 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>File Sharing on Raspberry Pi using Samba</title>
		<link>http://www.pchilton.co.uk/2013/03/30/file-sharing-on-raspberry-pi-using-samba/</link>
		<comments>http://www.pchilton.co.uk/2013/03/30/file-sharing-on-raspberry-pi-using-samba/#comments</comments>
		<pubDate>Sat, 30 Mar 2013 09:01:27 +0000</pubDate>
		<dc:creator>Paul</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Raspberry Pi]]></category>
		<category><![CDATA[Server Admin]]></category>
		<category><![CDATA[File Sharing]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[RPi]]></category>
		<category><![CDATA[Samba]]></category>
		<category><![CDATA[Server]]></category>

		<guid isPermaLink="false">http://www.pchilton.co.uk/?p=361</guid>
		<description><![CDATA[A quick simple one this time: Setting up a simple Samba file server on the Raspberry Pi so that you can copy files across or develop code on a Windows machine. To most familiar with Linux this is not rocket science but I wanted to document the simple setup I use to allow non-restricted file [...]]]></description>
				<content:encoded><![CDATA[<p>A quick simple one this time: Setting up a simple Samba file server on the Raspberry Pi so that you can copy files across or develop code on a Windows machine.</p>
<p>To most familiar with Linux this is not rocket science but I wanted to document the simple setup I use to allow non-restricted file sharing on the RPi.</p>
<p>This isn't designed to be a secure file server setup as it doesn't have any user authentication but for a local development node it allows quick and easy access.</p>
<p><span id="more-361"></span>First ensure Samba is installed:</p>
<pre class="brush: bash">
apt-get install samba
</pre>
<p>Edit the Samba configuration file:</p>
<pre class="brush: bash">
nano /etc/samba/smb.conf
</pre>
<p>Replace the contents with the below snippet:</p>
<pre class="brush: plain">
[global]
workgroup = workgroup
server string = %h
wins support = no
dns proxy = no
security = share
encrypt passwords = yes
panic action = /usr/share/samba/panic-action %d

[sites]
path = /sites
writeable = yes
broweable = yes
read only = no
guest ok = yes
force user = root
</pre>
<p>Finally restart Samba and test the file share</p>
<pre class="brush: bash">
/etc/init.d/samba restart
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.pchilton.co.uk/2013/03/30/file-sharing-on-raspberry-pi-using-samba/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Making the Raspberry Pi a Squeezebox Player</title>
		<link>http://www.pchilton.co.uk/2013/03/27/making-the-raspberry-pi-a-squeezebox-player/</link>
		<comments>http://www.pchilton.co.uk/2013/03/27/making-the-raspberry-pi-a-squeezebox-player/#comments</comments>
		<pubDate>Wed, 27 Mar 2013 12:40:37 +0000</pubDate>
		<dc:creator>Paul</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Raspberry Pi]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[RPi]]></category>
		<category><![CDATA[SONOS]]></category>
		<category><![CDATA[Squeezebox]]></category>
		<category><![CDATA[Squeezeslave]]></category>

		<guid isPermaLink="false">http://www.pchilton.co.uk/?p=351</guid>
		<description><![CDATA[In a previous article I detailed the steps I used to setup a Squeezebox server using a RPi. To continue on from this I want to setup a multi-room music system using the Pis. You can locate a RPi in each room in the house and connect a pair a speakers and create an easy [...]]]></description>
				<content:encoded><![CDATA[<p>In a <a href='http://www.pchilton.co.uk/2013/03/27/setup-a-squeezebox-server-using-a-raspberry-pi/'>previous article</a> I detailed the steps I used to setup a Squeezebox server using a RPi. To continue on from this I want to setup a multi-room music system using the Pis. You can locate a RPi in each room in the house and connect a pair a speakers and create an easy multi-room Sonos-like music system.</p>
<p>You can install the player (squeezeslave) on both the server RPi and/or seperate Pi's.<span id="more-351"></span></p>
<p>Start by downloading, extracting and renaming the squeezeslave application:</p>
<pre class="brush: bash">
cd /usr
sudo mkdir squeezeslavesrc
cd squeezeslavesrc
wget http://squeezeslave.googlecode.com/files/squeezeslave-1.2-367-armhf-lnx31.tar.gz
tar -xvf squeezeslave-1.2-367-armhf-lnx31.tar.gz
mv squeezeslave-1.2-367 squeezeslave
</pre>
<p>Ensure you have BZip2 installed:</p>
<pre class="brush: bash">
sudo apt-get install bzip2 -y
</pre>
<p>Download the following script and setup the initialisation script to run the player when the RPi boots:</p>
<pre class="brush: bash">
wget http://sourceforge.net/projects/softsqueeze/files/squeezeslave/squeezeslave-1.2.311/squeezeslave-1.2-311-src.tar.bz2
tar -xjvf squeezeslave-1.2-311-src.tar.bz2
sudo cp squeezeslave /usr/bin
sudo cp squeezeslave-1.2-311/config/squeezeslave.init.debian /etc/init.d/squeezeslave
sudo chmod 755 /etc/init.d/squeezeslave
sudo update-rc.d squeezeslave defaults
</pre>
<p>Get the MAC address from the network information:</p>
<pre class="brush: bash">
ifconfig
</pre>
<p>Copy the MAC address of eth0 from above and paste in the next snippet. This ensures that multiple slaves can all be used on the same network.<br />
Note that any additional configuration required to be applied to the squeezeslave executable should be included in this file, these options are passed to the executable when it is run.</p>
<pre class="brush: bash">
sudo echo &quot;SBSHOST=\&quot;-F -mac 00:00:00:00:00:00\&quot;&quot; &gt; defaultsqueezeslave
sudo cp defaultsqueezeslave /etc/default/squeezeslave
</pre>
<p>Start the slave player:</p>
<pre class="brush: bash">
sudo /etc/init.d/squeezeslave start
</pre>
<p>Open the sound mixer application:</p>
<pre class="brush: bash">
sudo alsamixer
</pre>
<p>Use the up arrow to increase the maximum volume output from the RPi. Press Esc to save and exit.</p>
<p>You can now open up the Squeezebox Server web admin page in your browser. You should see a slave device in the player drop-down.</p>
<p>To change the player name from 'squeezeslave' to something sensible like 'Living Room', open up the Settings from the server webpage, select the player tab and change the description.</p>
<p>Credits go to <a href='http://dabdig.blogspot.co.uk/2012/05/running-squeezeslave-on-raspberry-pi.html' target='_blank'>DABDig</a> for some of the original instructions.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pchilton.co.uk/2013/03/27/making-the-raspberry-pi-a-squeezebox-player/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Setup a Squeezebox server using a Raspberry Pi</title>
		<link>http://www.pchilton.co.uk/2013/03/27/setup-a-squeezebox-server-using-a-raspberry-pi/</link>
		<comments>http://www.pchilton.co.uk/2013/03/27/setup-a-squeezebox-server-using-a-raspberry-pi/#comments</comments>
		<pubDate>Wed, 27 Mar 2013 12:17:50 +0000</pubDate>
		<dc:creator>Paul</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Raspberry Pi]]></category>
		<category><![CDATA[Server Admin]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[RPi]]></category>
		<category><![CDATA[SONOS]]></category>
		<category><![CDATA[Squeezebox]]></category>
		<category><![CDATA[Squeezeslave]]></category>

		<guid isPermaLink="false">http://www.pchilton.co.uk/?p=342</guid>
		<description><![CDATA[This guide describes how to setup a Raspberry Pi as a Squeezebox server. It assumes a clean installation of Rasbian is setup and ready on the RPi. This will allow you to stream music from a central server to one or more players via your network. You can combine this with a wireless network and [...]]]></description>
				<content:encoded><![CDATA[<p>This guide describes how to setup a Raspberry Pi as a Squeezebox server. It assumes a clean installation of Rasbian is setup and ready on the RPi. This will allow you to stream music from a central server to one or more players via your network. You can combine this with a wireless network and power your RPi from a battery to make this a truely portable music system.</p>
<p>Player clients can be either 'proper' Squeezebox products or you can use software players together in the same system. I will detail in a seperate post how to setup the RPi to be a Squeezebox client, you can have the player running on the same device as the server or you can have it running on a seperate RPi. You can also choose to synchronise multiple devices to the same music source and therefore stream the same music to multiple rooms!<span id="more-342"></span></p>
<p>Please note that credit for the original instructions go to: <a href='http://allthingspi.webspace.virginmedia.com/lms.php' target='_blank'>All Things Pi</a>.</p>
<p>Start by updating libraries and installing some dependencies:</p>
<pre class="brush: bash">
sudo apt-get update &amp;amp;amp;&amp;amp;amp; sudo apt-get dist-upgrade 
sudo apt-get install libjpeg8 libpng12-0 libgif4 libexif12 libswscale2 libavcodec53
</pre>
<p>Download and install the Logitech Media Server:</p>
<pre class="brush: bash">
wget http://downloads.slimdevices.com/LogitechMediaServer_v7.7.2/logitechmediaserver_7.7.2_all.deb 
sudo dpkg -i logitechmediaserver_7.7.2_all.deb
sudo service logitechmediaserver stop
</pre>
<p>Download some helpful scripts from All Things Pi:</p>
<pre class="brush: bash">
wget http://allthingspi.webspace.virginmedia.com/files/lms-rpi-raspbian.tar.gz 
tar -zxvf lms-rpi-raspbian.tar.gz
</pre>
<p>Patch the Perl bootstrap module:</p>
<pre class="brush: bash">
sudo patch /usr/share/perl5/Slim/bootstrap.pm lms-rpi-bootstrap.patch
</pre>
<p>Copy files to the correct locations for running and create some symbolic links:</p>
<pre class="brush: bash">
sudo mv arm-linux-gnueabihf-thread-multi-64int /usr/share/squeezeboxserver/CPAN/arch/5.14/ 
sudo mv libmediascan.so.0.0.0 libfaad.so.2.0.0 /usr/local/lib 
sudo mv /usr/share/squeezeboxserver/Bin/arm-linux/faad /usr/share/squeezeboxserver/Bin/arm-linux/faad.old 
sudo mv faad /usr/share/squeezeboxserver/Bin/arm-linux 
sudo ln -s /usr/local/lib/libmediascan.so.0.0.0 /usr/local/lib/libmediascan.so 
sudo ln -s /usr/local/lib/libmediascan.so.0.0.0 /usr/local/lib/libmediascan.so.0 
sudo ln -s /usr/local/lib/libfaad.so.2.0.0 /usr/local/lib/libfaad.so 
sudo ln -s /usr/local/lib/libfaad.so.2.0.0 /usr/local/lib/libfaad.so.2 
sudo ldconfig
</pre>
<p>Set permissions for the server files:</p>
<pre class="brush: bash">
sudo chown -R squeezeboxserver:nogroup /usr/share/squeezeboxserver/
</pre>
<p>Start the server running:</p>
<pre class="brush: bash">
sudo service logitechmediaserver start
</pre>
<p>Navigate to http://10.0.0.31:9000 (where 10.0.0.31 is the IP of your RPi) and configure the Squeezebox server.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pchilton.co.uk/2013/03/27/setup-a-squeezebox-server-using-a-raspberry-pi/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Raspberry Pi Basic Setup</title>
		<link>http://www.pchilton.co.uk/2013/03/27/raspberry-pi-basic-setup/</link>
		<comments>http://www.pchilton.co.uk/2013/03/27/raspberry-pi-basic-setup/#comments</comments>
		<pubDate>Wed, 27 Mar 2013 10:32:00 +0000</pubDate>
		<dc:creator>Paul</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Raspberry Pi]]></category>
		<category><![CDATA[Server Admin]]></category>
		<category><![CDATA[RPi]]></category>

		<guid isPermaLink="false">http://www.pchilton.co.uk/?p=307</guid>
		<description><![CDATA[I am going to publish a small series of articles on the Raspberry Pi and give setup instructions for the things I am going to be using it for. As much as anything else these articles are for future reference for myself and I hope may be useful to some others too. This first article [...]]]></description>
				<content:encoded><![CDATA[<p>I am going to publish a small series of articles on the Raspberry Pi and give setup instructions for the things I am going to be using it for. As much as anything else these articles are for future reference for myself and I hope may be useful to some others too.</p>
<p>This first article details my basic setup of a Pi including setting a static IP ready for it to be used on whichever project I need.</p>
<p>Download and setup <a href="http://www.raspbian.org/" target="_blank">Raspbian </a>as per instructions on the <a href="http://www.raspberrypi.org/quick-start-guide" target="_blank">Pi site</a>, let it boot up and find it's IP address (I just let it boot and look at my routers DHCP table). Using Putty (or any other SSH terminal) login to your Pi (user: pi, password: raspberry).</p>
<p>The first thing I like to do is to run the configuration utility in order to set the timezone, change the login password and expand the file system to use all of the available SD space.</p>
<pre class="brush: bash">
sudo raspi-config
</pre>
<p><span id="more-307"></span>I like the coloured prompt even when I'm logged in as root:</p>
<pre class="brush: bash">
cd ~
sudo cp .bashrc /
sudo su
cp /.bashrc ~/
exit
</pre>
<p>Set a sensible hostname for this Pi. I have adopted a simple convention of colour coding whereby I stick a coloured sticker on each Pi and then name it 'redPi', 'bluePi' etc...</p>
<pre class="brush: bash">
sudo nano /etc/hostname
</pre>
<pre class="brush: bash">
#/etc/hostname:
redPi
</pre>
<pre class="brush: bash">
sudo nano /etc/hosts
</pre>
<p>Change references to raspberrypi to your hostname.</p>
<p>Setup a static IP address:</p>
<pre class="brush: bash">
sudo nano /etc/network/interfaces
</pre>
<pre class="brush: bash">
#/etc/network/interfaces:
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
address 10.0.0.31
gateway 10.0.0.1
netmask 255.255.255.0
network 10.0.0.0
broadcast 10.0.0.255
</pre>
<p>Restart the device for the settings to take affect.</p>
<pre class="brush: bash">
sudo shutdown -r now
</pre>
<p>Log into the Pi using the static IP and new password.</p>
<p>That's it for now, stay tuned for setup guides for Node.js and Squeezebox...</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pchilton.co.uk/2013/03/27/raspberry-pi-basic-setup/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Labman Automation Ltd</title>
		<link>http://www.pchilton.co.uk/2013/02/09/labman-automation-ltd/</link>
		<comments>http://www.pchilton.co.uk/2013/02/09/labman-automation-ltd/#comments</comments>
		<pubDate>Sat, 09 Feb 2013 00:08:53 +0000</pubDate>
		<dc:creator>Paul</dc:creator>
				<category><![CDATA[Labman]]></category>
		<category><![CDATA[Personal]]></category>
		<category><![CDATA[Robotics]]></category>
		<category><![CDATA[Work]]></category>

		<guid isPermaLink="false">http://www.pchilton.co.uk/?p=304</guid>
		<description><![CDATA[I work for a laboratory robotics and automation company called Labman Automation Ltd where I have the role of Senior Project Engineer. We manufacture robotic systems for laboratories around the world and work in all areas of industry, including pharmaceutical, water testing, clean energy research, household products, university projects, paints and many more. We have [...]]]></description>
				<content:encoded><![CDATA[<p>I work for a laboratory robotics and automation company called <a href="http://www.labman.co.uk">Labman Automation Ltd</a> where I have the role of Senior Project Engineer. We manufacture robotic systems for laboratories around the world and work in all areas of industry, including pharmaceutical, water testing, clean energy research, household products, university projects, paints and many more. We have recently launched our new website and I will be posting there from time to time on various topics. Please give us a visit.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pchilton.co.uk/2013/02/09/labman-automation-ltd/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>LPC1347 Startup Problem</title>
		<link>http://www.pchilton.co.uk/2012/12/02/lpc1347-startup-problem/</link>
		<comments>http://www.pchilton.co.uk/2012/12/02/lpc1347-startup-problem/#comments</comments>
		<pubDate>Sun, 02 Dec 2012 17:37:54 +0000</pubDate>
		<dc:creator>Paul</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.pchilton.co.uk/?p=292</guid>
		<description><![CDATA[I was having difficulty getting my NXP LPC1347 to correctly run a program when it wasn't in debug mode connected to the programmer. It turns out that you need to explicitly set a pre-processor symbol to instruct the processor the start running your application when it boots, otherwise it just sits and idles. In Keil [...]]]></description>
				<content:encoded><![CDATA[<p>I was having difficulty getting my NXP LPC1347 to correctly run a program when it wasn't in debug mode connected to the programmer. It turns out that you need to explicitly set a pre-processor symbol to instruct the processor the start running your application when it boots, otherwise it just sits and idles.</p>
<p>In Keil this is found in the C/C++ tab of the project options. Enter 'STARTUP_FROM_RESET' in the preprocessor symbols box (put it in without the quotes).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pchilton.co.uk/2012/12/02/lpc1347-startup-problem/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>ARM NXP LPC1347 Cortex M3 Processor</title>
		<link>http://www.pchilton.co.uk/2012/11/18/arm-nxp-lpc1347-cortex-m3-processor/</link>
		<comments>http://www.pchilton.co.uk/2012/11/18/arm-nxp-lpc1347-cortex-m3-processor/#comments</comments>
		<pubDate>Sun, 18 Nov 2012 22:28:45 +0000</pubDate>
		<dc:creator>Paul</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.pchilton.co.uk/?p=280</guid>
		<description><![CDATA[I've been playing about with some ARM processors recently after being inspired by NXP's mbed development board. I've started with the NXP LPC1347 Cortex M3 which can run up to 72MHz. I'm using the 48pin QFP package version which has 40 general purpose I/O lines, 8 of which can be used as PWM outputs as [...]]]></description>
				<content:encoded><![CDATA[<p>I've been playing about with some ARM processors recently after being inspired by NXP's mbed development board. I've started with the <a href="http://www.nxp.com/products/microcontrollers/cortex_m3/lpc1300/LPC1347FBD48.html" title="NXP LPC1347" target="_blank">NXP LPC1347</a> Cortex M3 which can run up to 72MHz. I'm using the 48pin QFP package version which has 40 general purpose I/O lines, 8 of which can be used as PWM outputs as well as many other features including ADC inputs, UART, USB2.0 and I2C. </p>
<p>One really nice feature of these that I've been using to program the device is the USB bootloader function, connecting to a USB port using only a handful of resistors and a PNP transistor the device appears as a USB flash drive and allows new firmware to be dropped on easily. This allows for rapid development and powers the board too all with a single USB cable.</p>
<p>They are readily available from major suppliers such as <a href="http://uk.farnell.com/nxp/lpc1347fbd48/mcu-32bit-arm-cortex-m3-48lqfp/dp/2103477?Ntt=LPC1347FBD48" title="Farnell" target="_blank"></a> and are under £5 each.<span id="more-280"></span></p>
<p>To start I ordered some small dev PCBs from <a href="http://www.seeedstudio.com/depot/fusion-pcb-service-p-835.html" title="Seeed Studio's Fusion PCB Service" target="_blank">Seeed Studio's Fusion PCB Service</a>. These cost less than £1 each for 10 boards. <a href="http://www.pchilton.co.uk/wp-content/uploads/2012/11/LPC1347-Dev-Board-Schematic.png"><img src="http://www.pchilton.co.uk/wp-content/uploads/2012/11/LPC1347-Dev-Board-Schematic-300x173.png" alt="" title="LPC1347 Dev Board Schematic" width="300" height="173" class="aligncenter size-medium wp-image-286" /></a><br />
<a href="http://www.pchilton.co.uk/wp-content/uploads/2012/11/LPC1347-Dev-Board-PCB.png"><img src="http://www.pchilton.co.uk/wp-content/uploads/2012/11/LPC1347-Dev-Board-PCB-300x300.png" alt="" title="LPC1347 Dev Board PCB" width="300" height="300" class="aligncenter size-medium wp-image-287" /></a></p>
<p>More on programming them soon...</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pchilton.co.uk/2012/11/18/arm-nxp-lpc1347-cortex-m3-processor/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Arduino</title>
		<link>http://www.pchilton.co.uk/2012/09/23/arduino/</link>
		<comments>http://www.pchilton.co.uk/2012/09/23/arduino/#comments</comments>
		<pubDate>Sun, 23 Sep 2012 14:11:17 +0000</pubDate>
		<dc:creator>Paul</dc:creator>
				<category><![CDATA[Electronics]]></category>
		<category><![CDATA[Arduino]]></category>

		<guid isPermaLink="false">http://www.pchilton.co.uk/?p=270</guid>
		<description><![CDATA[Inspired by reading the Jeelabs web-blog, I have started playing more with the ATmega328 for some basic sensor reading and control. The Arduino programming language and software is an open-source environment that allows easy programming of the microprocessors. The community is now vast and provides a large range of libraries for hardware control. I am [...]]]></description>
				<content:encoded><![CDATA[<p>Inspired by reading the <a href="http://jeelabs.org/" title="http://jeelabs.org/" target="_blank">Jeelabs</a> web-blog, I have started playing more with the ATmega328 for some basic sensor reading and control. The <a href="http://arduino.cc/en/" title="http://arduino.cc/en/" target="_blank">Arduino</a> programming language and software is an open-source environment that allows easy programming of the microprocessors. The community is now vast and provides a large range of libraries for hardware control.</p>
<p>I am looking at using them as small nodes to take sensor reading and send information back to a central controller, although they are capable of much more and are very cheap.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pchilton.co.uk/2012/09/23/arduino/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Windows 7 Search File Contents</title>
		<link>http://www.pchilton.co.uk/2012/04/02/windows-7-search-file-contents/</link>
		<comments>http://www.pchilton.co.uk/2012/04/02/windows-7-search-file-contents/#comments</comments>
		<pubDate>Mon, 02 Apr 2012 09:18:13 +0000</pubDate>
		<dc:creator>Paul</dc:creator>
				<category><![CDATA[Applications]]></category>
		<category><![CDATA[Search]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.pchilton.co.uk/?p=262</guid>
		<description><![CDATA[I quite regularly want to search a folder of code for a specific use of a function or feature. In Windows 7 search this functionality to search file contents is not often possible by default. There is a simple way to enable this however... Click on the Organise button in a Windows folder: And select [...]]]></description>
				<content:encoded><![CDATA[<p>I quite regularly want to search a folder of code for a specific use of a function or feature. In Windows 7 search this functionality to search file contents is not often possible by default. There is a simple way to enable this however...</p>
<p>Click on the Organise button in a Windows folder:<br />
<a href="http://www.pchilton.co.uk/wp-content/uploads/2012/04/Windows-7-Organise-Button.png"><img src="http://www.pchilton.co.uk/wp-content/uploads/2012/04/Windows-7-Organise-Button.png" alt="" title="Windows 7 Organise Button" width="149" height="121" class="aligncenter size-full wp-image-263" /></a><span id="more-262"></span></p>
<p>And select the Folder and search option:<br />
<a href="http://www.pchilton.co.uk/wp-content/uploads/2012/04/Windows-7-Organise-Dropdown.png"><img src="http://www.pchilton.co.uk/wp-content/uploads/2012/04/Windows-7-Organise-Dropdown-193x300.png" alt="" title="Windows 7 Organise Dropdown" width="193" height="300" class="aligncenter size-medium wp-image-264" /></a></p>
<p>On the search tab select "Always search filenames and contents" option:<br />
<a href="http://www.pchilton.co.uk/wp-content/uploads/2012/04/Windows-7-Search-Options.png"><img src="http://www.pchilton.co.uk/wp-content/uploads/2012/04/Windows-7-Search-Options-246x300.png" alt="" title="Windows 7 Search Options" width="246" height="300" class="aligncenter size-medium wp-image-265" /></a></p>
<p>Close this dialog and search as normal, this might take a while but you should get your results!<br />
<a href="http://www.pchilton.co.uk/wp-content/uploads/2012/04/Windows-7-Searching.png"><img src="http://www.pchilton.co.uk/wp-content/uploads/2012/04/Windows-7-Searching-300x187.png" alt="" title="Windows 7 Searching" width="300" height="187" class="aligncenter size-medium wp-image-266" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.pchilton.co.uk/2012/04/02/windows-7-search-file-contents/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Path Finding Pt1</title>
		<link>http://www.pchilton.co.uk/2012/04/02/path-finding-pt1/</link>
		<comments>http://www.pchilton.co.uk/2012/04/02/path-finding-pt1/#comments</comments>
		<pubDate>Mon, 02 Apr 2012 08:44:37 +0000</pubDate>
		<dc:creator>Paul</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[Path Finding]]></category>

		<guid isPermaLink="false">http://www.pchilton.co.uk/?p=248</guid>
		<description><![CDATA[I started to look into some algorithms for path finding in known environments in order to provide a navigation map based on waypoints in order to reach any given target position within the environment. The aim is to allow a robotic system to navigate from it's current position to a given target position avoiding obstructions [...]]]></description>
				<content:encoded><![CDATA[<p>I started to look into some algorithms for path finding in known environments in order to provide a navigation map based on waypoints in order to reach any given target position within the environment. The aim is to allow a robotic system to navigate from it's current position to a given target position avoiding obstructions within it's workspace. The obstructions are known and pre-defined in the system, the obstructions are specified as simple rectangular shapes that define the extents of where the robot cannot move (i.e. it can move right up to the edge of the specified rectangle without collision).<span id="more-248"></span></p>
<p><a href="http://www.pchilton.co.uk/wp-content/uploads/2012/04/Path-Finding-Basic.png"><img class="aligncenter size-medium wp-image-249" title="Path Finding Basic" src="http://www.pchilton.co.uk/wp-content/uploads/2012/04/Path-Finding-Basic-300x210.png" alt="" width="300" height="210" /></a></p>
<p>The most basic navigation simulation is shown above, navigating from one point to the other with NO obstructions!</p>
<p>I have setup a test environment in VB.NET where the start and end positions can be defined by clicked the left and right mouse buttons in the workspace. An obstruction can be defined by dragging a rectangle in the workspace. The system works on a very simple system of checking whether a particular vector between two points is clear of obstructions, if an obstruction is found between the two points then the program creates a list of which obstruction corners it can move directly to without hitting anything. From each of these potential paths the system iterates through and checks whether it can reach the target from there and so on.</p>
<p><a href="http://www.pchilton.co.uk/wp-content/uploads/2012/04/Path-Finding-One-Obstruction.png"><img class="aligncenter size-medium wp-image-250" title="Path Finding One Obstruction" src="http://www.pchilton.co.uk/wp-content/uploads/2012/04/Path-Finding-One-Obstruction-300x236.png" alt="" width="300" height="236" /></a></p>
<p>The function for checking whether the path between two points is clear of obstructions is given below.</p>
<pre class="brush: vb">

      &#039;&#039;&#039; &lt;summary&gt;
      &#039;&#039;&#039; This method checks if the vector path between two points is clear of obstruction
      &#039;&#039;&#039; &lt;/summary&gt;
      &#039;&#039;&#039; &lt;param name=&quot;pntStart&quot;&gt;The start point&lt;/param&gt;
      &#039;&#039;&#039; &lt;param name=&quot;pntEnd&quot;&gt;The end point&lt;/param&gt;
      &#039;&#039;&#039; &lt;returns&gt;True if the vector between the two points is clear of obstructions, else False if an obstruction is found&lt;/returns&gt;
      Private Function blnVectorClear(ByVal pntStart As Point, ByVal pntEnd As Point) As Boolean
            &#039;Work out the gradient between the two points
            Dim dblX As Double = 0
            Dim dblY As Double = 0
            Dim dblGradient As Double = (pntEnd.Y - pntStart.Y) / (pntEnd.X - pntStart.X)

            &#039;If the dominent axis is the Y axis
            If Math.Abs(pntEnd.Y - pntStart.Y) &gt; Math.Abs(pntEnd.X - pntStart.X) Then
                  &#039;Invert the gradient
                  dblGradient = 1 / dblGradient

                  &#039;Determine whether to work up-down or down-up
                  Dim intStep As Double = 1
                  If (pntEnd.Y - pntStart.Y) &lt; 1 Then
                        intStep = -intStep
                  End If

                  &#039;Loop through each point in the Y plane
                  For intY As Double = 0 To (pntEnd.Y - pntStart.Y) Step intStep
                        &#039;Calculate the position in the X axis for this Y position
                        &#039;y = mx + c but where x &amp;amp;amp; y are reversed!
                        dblX = (dblGradient * intY) + pntStart.X
                        dblY = intY + pntStart.Y
                        
                        &#039;If there is an obstruction in this position
                        If blnCheckCollision(dblX, dblY) Then
                              &#039;Vector is not clear!
                              Return False
                        End If
                  Next
            Else
                  &#039;Determine whether to work left-right or right-left
                  Dim intStep As Integer = 1
                  If (pntEnd.X - pntStart.X) &lt; 1 Then
                        intStep = -1
                  End If

                  &#039;Loop through each point in the X plane
                  For intX As Double = 0 To (pntEnd.X - pntStart.X) Step intStep
                        &#039;Calculate the position in the Y axis for this X position
                        &#039;y = mx + c
                        dblX = intX + pntStart.X
                        dblY = (dblGradient * intX) + pntStart.Y

                        &#039;If there is an obstruction in this position
                        If blnCheckCollision(dblX, dblY) Then
                              &#039;Vector is not clear!
                              Return False
                        End If
                  Next
            End If

            &#039;Vector has been checked and is not obstructed!
            Return True
      End Function

      &#039;&#039;&#039; &lt;summary&gt;
      &#039;&#039;&#039; This function checks whether a specified point in the workspace is within one of the defined obstructions
      &#039;&#039;&#039; &lt;/summary&gt;
      &#039;&#039;&#039; &lt;param name=&quot;dblX&quot;&gt;The X position within the workspace to check&lt;/param&gt;
      &#039;&#039;&#039; &lt;param name=&quot;dblY&quot;&gt;The Y position within the workspace to check&lt;/param&gt;
      &#039;&#039;&#039; &lt;returns&gt;True if the position is within an obstruction&lt;/returns&gt;
      Private Function blnCheckCollision(ByVal dblX As Double, ByVal dblY As Double) As Boolean
            &#039;Loop through each of the boxes defined as obstructions
            For Each objBox In m_colBoxes
                  &#039;If the X and Y position given is within the bounds of this obstruction
                  If dblX &gt; objBox.Left And dblX &lt; objBox.Right And dblY &gt; objBox.Top And dblY &lt; objBox.Bottom Then
                        &#039;Collision found!
                        Return True
                  End If
            Next

            &#039;No obstruction found
            Return False
      End Function

</pre>
<p>Future development needs to work out all of the possible paths between the two points and calculate the most efficient route to take.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pchilton.co.uk/2012/04/02/path-finding-pt1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->