<?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>Pushing Pixels &#187; tips</title>
	<atom:link href="http://familywhitfield.co.uk/wordpress/tag/tips/feed/" rel="self" type="application/rss+xml" />
	<link>http://familywhitfield.co.uk/wordpress</link>
	<description>Computing and Digital Imaging</description>
	<lastBuildDate>Thu, 24 Mar 2011 20:54:55 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Backing up using Carbonite</title>
		<link>http://familywhitfield.co.uk/wordpress/2010/12/31/backing-up-using-carbonite/</link>
		<comments>http://familywhitfield.co.uk/wordpress/2010/12/31/backing-up-using-carbonite/#comments</comments>
		<pubDate>Fri, 31 Dec 2010 01:06:48 +0000</pubDate>
		<dc:creator>Greg</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[PC]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://familywhitfield.co.uk/wordpress/2010/12/31/backing-up-using-carbonite/</guid>
		<description><![CDATA[<div class="addthis_toolbox addthis_default_style" addthis:url='http://familywhitfield.co.uk/wordpress/2010/12/31/backing-up-using-carbonite/' addthis:title='Backing up using Carbonite' ><a class="addthis_button_twitter"></a><a class="addthis_button_facebook"></a><a class="addthis_button_email"></a><a class="addthis_button_google_plusone"></a><a class="addthis_button_digg"></a><a class="addthis_button_compact"></a></div>At home I have a fairly good backup scheme for ensuring my main PC and the wife’s laptop have their critical data stored on at least a couple of other disks. In addition to using cross-copying each other’s content, I have a second hard disk in the main PC just for backups and an external [...]]]></description>
			<content:encoded><![CDATA[<div class="addthis_toolbox addthis_default_style" addthis:url='http://familywhitfield.co.uk/wordpress/2010/12/31/backing-up-using-carbonite/' addthis:title='Backing up using Carbonite' ><a class="addthis_button_twitter"></a><a class="addthis_button_facebook"></a><a class="addthis_button_email"></a><a class="addthis_button_google_plusone"></a><a class="addthis_button_digg"></a><a class="addthis_button_compact"></a></div><div class="posterous_autopost">
<p><span style="font-family: Arial; font-size: x-small;"><span style="font-size: 10.0pt; font-family: Arial;"><a href="http://posterous.com/getfile/files.posterous.com/gregwhitfield/WzFa44TP6epW8CHkTVPP0Auunc0xUYtL50qts306obWPICPsbKFZaNZK6epj/image002.jpg"><img src="http://posterous.com/getfile/files.posterous.com/gregwhitfield/qhdQmTFGXS9icsXvF4K7qocEEPVTpheKJ1ZMGDbpzdQA5LaOZL1ulgJiRAbR/image002.jpg.scaled.500.jpg" alt="" width="500" height="222" /></a> </span></span></p>
<p><span style="font-family: Arial; font-size: x-small;"><span style="font-size: 10.0pt; font-family: Arial;"> </span></span></p>
<p><span style="font-family: Arial; font-size: x-small;"><span style="font-size: 10.0pt; font-family: Arial;">At home I have a fairly good backup scheme for ensuring my main PC and the wife’s laptop have their critical data stored on at least a couple of other disks. In addition to using cross-copying each other’s content, I have a second hard disk in the main PC just for backups and an external USB disk for backing this up to. I also have a few hundred megabytes of useful everyday stuff synced across machines and into ‘the cloud’ using the excellent <a href="http://www.dropbox.com/">Dropbox</a> utility. So I’m pretty well covered against hard disk failure, and my critical files on Dropbox are insurance against houshold disaster.</span></span></p>
<p><span style="font-family: Arial; font-size: x-small;"><span style="font-size: 10.0pt; font-family: Arial;">Yet I’ve always had this nagging feeling at the back of my mind about the 80+Gb (and growing) of other data such as photos, videos, and general stuff that falls under the category of don’t-look-at-much-but-don’t-want-to-lose. While the hard disk duplication may cover me against hardware failure, and in fact did so a couple of years ago, I retain a nervousness over fire, theft, flood, or enormous wine spillage in my IT area.</span></span></p>
<p><span style="font-family: Arial; font-size: x-small;"><span style="font-size: 10.0pt; font-family: Arial;"><span id="more-368"></span><br />
</span></span></p>
<p><span style="font-family: Arial; font-size: x-small;"><span style="font-size: 10.0pt; font-family: Arial;">So I decided over the Christmas break to try out an offsite ‘cloud’ archiving system call Carbonite, that for a mere £40/year will store copies of all the data I want, and automatically update changes. This takes away the weekly naus of doing backups myself. You simply install a little monitor program, and – much like Dropbox – whenever changes to your files happen, they are pushed up out onto some big hairy servers humming away in a couple of duplicated multiple-redundancy data centers somewhere in the world. I chose Carbonite as it had a good reputation, and gets a lot of mentions on the <a href="http://www.twit.tv/">TWiT network</a>, many of whose podcasts are sponsored by the company.</span></span></p>
<p><span style="font-family: Arial; font-size: x-small;"><span style="font-size: 10.0pt; font-family: Arial;">I am currently right at the beginning of a free 15-day trial period, which is painless as you don’t even need to hand over credit card details to do this. Should I decide to buy (likely at the moment), there is a TWiT coupon code for a couple of free months subscription. Getting started was easy – sign up, download a program, and just let it go on the initial backup, which by Carbonites’ own admission could take several days. I slimmed down the initial 120+Gb that was selected for upload, but that still leaves it with just under 100Gb to do. As you can see from the above picture, it will take a while – it has so far needed about 25hours to do 3%. Even though I have a good download speed, because of the ‘A’ in ADSL, you don’t get such a great upload (approx 800kbits/sec) rate.</span></span></p>
<p><span style="font-family: Arial; font-size: x-small;"><span style="font-size: 10.0pt; font-family: Arial;">So, I think all my free trial period will be taken by uploading, and I need to remember to keep the PC turned on as much as possible. But looking good so far. There is an iPhone app that lets you browse your backed up files, and this works quite well for the limited use I have made of it so far. You can also do this using a regular web browser interface, but to date I have not yet tried it.</span></span></p>
<p><span style="font-family: Arial; font-size: x-small;"><span style="font-size: 10.0pt; font-family: Arial;">The feature that has most impressed me so far is that the program that sits in the background seems pretty clever about when to pause uploading so it does not get in the way of regular usage of the PC. I’ve watched streamed TV programmes, used Photoshop, browsed the web, used a few different applications, all without noticable slowdown. Carbonite just detects other activity, sleeps or slows down for a bit, then wakes up again when not so busy. Smart.</span></span></p>
</div>
<a href="javascript:toggleStartStop();PicLensLite.start({feedUrl:'http://familywhitfield.co.uk/wordpress/wp-content/plugins/wp-piclens/mrss.php?id=368'});">Start Slide Show with PicLens Lite <img src="http://familywhitfield.co.uk/wordpress/wp-content/plugins/wp-piclens/PicLensButton.png" alt="PicLens" width="16" height="12" border="0" align="top"></a>]]></content:encoded>
			<wfw:commentRss>http://familywhitfield.co.uk/wordpress/2010/12/31/backing-up-using-carbonite/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>A simple Perforce backup script for the home</title>
		<link>http://familywhitfield.co.uk/wordpress/2007/07/07/a-simple-perforce-backup-script-for-the-home/</link>
		<comments>http://familywhitfield.co.uk/wordpress/2007/07/07/a-simple-perforce-backup-script-for-the-home/#comments</comments>
		<pubDate>Sat, 07 Jul 2007 20:46:38 +0000</pubDate>
		<dc:creator>Greg</dc:creator>
				<category><![CDATA[Perforce]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[PC]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://familywhitfield.co.uk/wordpress/?p=24</guid>
		<description><![CDATA[<div class="addthis_toolbox addthis_default_style" addthis:url='http://familywhitfield.co.uk/wordpress/2007/07/07/a-simple-perforce-backup-script-for-the-home/' addthis:title='A simple Perforce backup script for the home' ><a class="addthis_button_twitter"></a><a class="addthis_button_facebook"></a><a class="addthis_button_email"></a><a class="addthis_button_google_plusone"></a><a class="addthis_button_digg"></a><a class="addthis_button_compact"></a></div>I use the free license of Perforce on my home network just to ensure version control and management of home coding projects, university thesis stuff, and general files that I just want to ensure I have previous versions of. It&#8217;s a really nice part of the Perforce licensing model that I can get two users [...]]]></description>
			<content:encoded><![CDATA[<div class="addthis_toolbox addthis_default_style" addthis:url='http://familywhitfield.co.uk/wordpress/2007/07/07/a-simple-perforce-backup-script-for-the-home/' addthis:title='A simple Perforce backup script for the home' ><a class="addthis_button_twitter"></a><a class="addthis_button_facebook"></a><a class="addthis_button_email"></a><a class="addthis_button_google_plusone"></a><a class="addthis_button_digg"></a><a class="addthis_button_compact"></a></div><p>I use the free license of <a href="http://www.perforce.com">Perforce</a> on my home network just to ensure version control and management of home coding projects, university thesis stuff, and general files that I just want to ensure I have previous versions of. It&#8217;s a really nice part of the Perforce licensing model that I can get two users and five clients for free. My network has my main PC (with Perforce depot), my personal laptop, my wife&#8217;s laptop, and my work laptop all connected. It&#8217;ll get worse when my four-year old starts wanting to source control things from his PC!</p>
<p>Having been responsible for some pretty heavyweight Perforce installations in my working life, I did not want to forget the golden rule of checkpointing and backing up. While it would not be a disaster if my Perforce data got lost or messed up, it would be an inconvenience. The scripts published on Perforce user forums, however, tend to be focussed on industrial installations and can be quite complex. For the home it is nice to have something more simple.<br />
<span id="more-24"></span></p>
<p>So the script here is really aimed at the home user. I don&#8217;t use Perforce everyday at home, and so a nightly checkpoint and backup is a waste of time. I tend to run it every two to four weeks. My environment is that I have my main home PC running Perforce, and hanging off this on a USB-2 link is a Western-Digital MyBook external drive that shows itself as D: .  Sitting in the Perforce root folder (where the P4 db.* files are, and defined by the P4ROOT environment variable), I have a simple batch file called &#8220;backup.bat&#8221; (see code below).</p>
<p>The basic backup mechanism is this:</p>
<ol>
<li>Stop the Perforce server</li>
<li>Take a checkpoint</li>
<li>Copy checkpoint to a location on the MyBook external disk</li>
<li>Copy checkpoints to a location on the main PC &#8211; just duplication for safety</li>
<li>Delete checkpoints from P4ROOT</li>
<li>Use Robocopy to incrementally backup all depot files for each depot</li>
<li>Restart Perforce server</li>
</ol>
<p>Here&#8217;s the script. Just copy it into a .bat file put it into the P4ROOT folder. To run it, either do as a scheduled task or &#8211; as I do &#8211; just run it manually at whatever frequency you are happy with.</p>

<div class="wp_syntax"><div class="code"><pre class="dos" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">REM  *** Backs up Perforce</span>
p4 admin stop
p4d -jc -z
<span style="color: #b1b100; font-weight: bold;">copy</span> *.gz d:\Perforce\checkpoints
<span style="color: #b1b100; font-weight: bold;">copy</span> *.gz old_checkpoints
<span style="color: #b1b100; font-weight: bold;">del</span> /Q /F *.gz
<span style="color: #808080; font-style: italic;">rem *** now backup depot files. See following text for explanation</span>
robocopy depot d:\perforce\depotfiles\depot /S /E /MIR /R:1 /W:5 <span style="color: #33cc33;">&amp;</span>gt;robolog-depot.txt
robocopy perforce d:\perforce\depotfiles\perforce /S /E /MIR /R:1 /W:5 <span style="color: #33cc33;">&amp;</span>gt;<span style="color: #33cc33;">&amp;</span>gt;robolog-p4.txt
robocopy work d:\perforce\depotfiles\work /S /E /MIR /R:1 /W:5 <span style="color: #33cc33;">&amp;</span>gt;<span style="color: #33cc33;">&amp;</span>gt;robolog-work.txt
<span style="color: #808080; font-style: italic;">rem *** Restart server</span>
net start Perforce</pre></div></div>

<p>The three robocopy lines reflect that I have three depots on my server &#8211; &#8216;depot&#8217;, &#8216;perforce&#8217;, and &#8216;work&#8217;. Change these to reflect your own depots.</p>
<p>Robocopy is a free utility that runs under Windows that provides extremely flexible folder copy functionality. See the <a href="http://en.wikipedia.org/wiki/Robocopy">Wikipedia entry</a> for more details. Just make sure it is either on your search path, or place the EXE in the P4ROOT folder.</p>
<p>The options given to Robocopy just tell it to only copy files that are different to those that already exist. In otherwords, it synchronises one folder structure to another. I pipe the output into a log file so I can see exactly what new files have been copied if I need to.</p>
<p>And that&#8217;s it. Dead simple &#8211; will take you two minutes to set up, but could save you hours of hassle should something go awry in the future.</p>
]]></content:encoded>
			<wfw:commentRss>http://familywhitfield.co.uk/wordpress/2007/07/07/a-simple-perforce-backup-script-for-the-home/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Plotting your GPS tracks in Google Earth</title>
		<link>http://familywhitfield.co.uk/wordpress/2007/06/26/plotting-your-gps-tracks-in-google-earth/</link>
		<comments>http://familywhitfield.co.uk/wordpress/2007/06/26/plotting-your-gps-tracks-in-google-earth/#comments</comments>
		<pubDate>Tue, 26 Jun 2007 19:47:31 +0000</pubDate>
		<dc:creator>Greg</dc:creator>
				<category><![CDATA[Google Earth/Maps]]></category>
		<category><![CDATA[GPS]]></category>
		<category><![CDATA[geotagging]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[travel]]></category>

		<guid isPermaLink="false">http://familywhitfield.co.uk/wordpress/?p=22</guid>
		<description><![CDATA[<div class="addthis_toolbox addthis_default_style" addthis:url='http://familywhitfield.co.uk/wordpress/2007/06/26/plotting-your-gps-tracks-in-google-earth/' addthis:title='Plotting your GPS tracks in Google Earth' ><a class="addthis_button_twitter"></a><a class="addthis_button_facebook"></a><a class="addthis_button_email"></a><a class="addthis_button_google_plusone"></a><a class="addthis_button_digg"></a><a class="addthis_button_compact"></a></div>As a follow up to my previous post about using Google Maps in conjunction with your own GPS data, you can also do the same thing in Google Earth. Something I missed before was that the same GPSVisualizer site provides the service so that you upload your GPS file, and it generates a Google KMZ [...]]]></description>
			<content:encoded><![CDATA[<div class="addthis_toolbox addthis_default_style" addthis:url='http://familywhitfield.co.uk/wordpress/2007/06/26/plotting-your-gps-tracks-in-google-earth/' addthis:title='Plotting your GPS tracks in Google Earth' ><a class="addthis_button_twitter"></a><a class="addthis_button_facebook"></a><a class="addthis_button_email"></a><a class="addthis_button_google_plusone"></a><a class="addthis_button_digg"></a><a class="addthis_button_compact"></a></div><p><a title="Google Earth" href="http://familywhitfield.co.uk/wordpress/wp-content/uploads/2007/07/gegpsview.jpg"><img src="http://familywhitfield.co.uk/wordpress/wp-content/uploads/2007/07/gegpsview.thumbnail.jpg" alt="Google Earth" /></a></p>
<p>As a follow up to my previous post about using Google Maps in conjunction with your own GPS data, you can also do the same thing in Google Earth. Something I missed before was that the same <a href="http://www.gpsvisualizer.com/map?form=googleearth">GPSVisualizer</a> site provides the service so that you upload your GPS file, and it generates a Google KMZ file for you. Click on it, and the file gets downloaded and launched in Google Earth directly. Very neat and very easy. Here&#8217;s a screenshot:<br />
<span id="more-22"></span></p>
<p><img id="image21" src="http://familywhitfield.co.uk/wordpress/wp-content/uploads/2007/07/gegpsview.jpg" alt="GPS track in Google Earth" /></p>
<p>The purple line is the overlayed GPS track. As you can see from the loop at the right edge, I had to turn around &#8211; the road was closed by flooding.</p>
<p>A difference between this approach in Google Earth to that of Google Maps is it is easier to share the information in the latter. People don&#8217;t need anything other than a web browser, and you do not need to send them a data file.</p>
<p>I did see somewhere a GPS track overlay in Google Earth that rendered it as 3D &#8211; the height of the track related to speed. If I can find it and make it work, I&#8217;ll post back here.</p>
<p>Now, all I need is to find a way in GE that I can measure the length of a GPS track and I&#8217;ll be extremely happy. It would be great to go for a walk, bike ride, or a drive; plugin your GPS data, and calculate how far exactly you had been and see data such as elapsed time between points. Then do this a number of times with different routes and you will get a very intuitive way of analysing best routes over a period of time.</p>
<a href="javascript:toggleStartStop();PicLensLite.start({feedUrl:'http://familywhitfield.co.uk/wordpress/wp-content/plugins/wp-piclens/mrss.php?id=22'});">Start Slide Show with PicLens Lite <img src="http://familywhitfield.co.uk/wordpress/wp-content/plugins/wp-piclens/PicLensButton.png" alt="PicLens" width="16" height="12" border="0" align="top"></a>]]></content:encoded>
			<wfw:commentRss>http://familywhitfield.co.uk/wordpress/2007/06/26/plotting-your-gps-tracks-in-google-earth/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Playtime with Google Maps and GPS</title>
		<link>http://familywhitfield.co.uk/wordpress/2007/06/26/playtime-with-google-maps-and-gps/</link>
		<comments>http://familywhitfield.co.uk/wordpress/2007/06/26/playtime-with-google-maps-and-gps/#comments</comments>
		<pubDate>Tue, 26 Jun 2007 14:25:05 +0000</pubDate>
		<dc:creator>Greg</dc:creator>
				<category><![CDATA[Google Earth/Maps]]></category>
		<category><![CDATA[GPS]]></category>
		<category><![CDATA[geotagging]]></category>
		<category><![CDATA[Google maps]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://familywhitfield.co.uk/wordpress/?p=20</guid>
		<description><![CDATA[<div class="addthis_toolbox addthis_default_style" addthis:url='http://familywhitfield.co.uk/wordpress/2007/06/26/playtime-with-google-maps-and-gps/' addthis:title='Playtime with Google Maps and GPS' ><a class="addthis_button_twitter"></a><a class="addthis_button_facebook"></a><a class="addthis_button_email"></a><a class="addthis_button_google_plusone"></a><a class="addthis_button_digg"></a><a class="addthis_button_compact"></a></div>I&#8217;ve been dabbling with Google Maps recently as I want to download some GPS data from my PDA to visualise and analyse journeys that I have made. I also think Google Maps and its 3D sibling Google Earth are the absolute dogs doodads of applications and so any excuse to play with these was welcome. [...]]]></description>
			<content:encoded><![CDATA[<div class="addthis_toolbox addthis_default_style" addthis:url='http://familywhitfield.co.uk/wordpress/2007/06/26/playtime-with-google-maps-and-gps/' addthis:title='Playtime with Google Maps and GPS' ><a class="addthis_button_twitter"></a><a class="addthis_button_facebook"></a><a class="addthis_button_email"></a><a class="addthis_button_google_plusone"></a><a class="addthis_button_digg"></a><a class="addthis_button_compact"></a></div><p>I&#8217;ve been dabbling with <a href="http://maps.google.co.uk/maps">Google Maps</a> recently as I want to download some GPS data from my PDA to visualise and analyse journeys that I have made. I also think Google Maps and its 3D sibling <a href="http://earth.google.com/">Google Earth</a> are the absolute dogs doodads of applications and so any excuse to play with these was welcome.</p>
<p>I started with a .GPS file that was generated automatically by <a href="http://www.alk.eu.com/">Copilot</a>, which is the in-car satellite navigation software that I use. It&#8217;s pretty good, but like all Satnav systems you need to be aware of its foibles to get the best out of it. Never, ever, simply follow the instructions!</p>
<p>The GPS track was a record of my travels on Monday 25th June as I tried to get into work in Sheffield as it was getting hit by <a href="http://news.bbc.co.uk/1/hi/in_pictures/6240038.stm">freak floods</a>. Getting in was OK(ish), but took a long time. Getting home again was a bit more interesting as I kept trying to avoid all the bad traffic.</p>
<p>Anyway, since I was being forced to turn around and try new routes to avoid flooded roads, jams etc, I wanted to see on my PC where I had been. What I did not know was a quick and easy way to do it.</p>
<p>Copilot has a PC hosted planning application, but that won&#8217;t take the GPS tracks that the PDA version generates (sigh&#8230;.). Ideally I wanted to put the tracks into Google Earth to look at in glorious 3D, but I currently only have the free version that does not allow GPS tracks to be imported.</p>
<p>A quick webhunt brought up <a href="http://www.gpsvisualizer.com">GPS Visualizer</a>. This provides a free service that allows me to upload the GPS file, and it generates a Google Map with a vector overlay of the results. Even better, the site contains instructions on hosting the resulting map on your own website.</p>
<p>So I had a go at this. The HTML pathway was a huge faff, to be honest, as I was rather foolishly trying to use Frontpage. The problem was that it was trying to be too smart on the Cut and Paste operation, which screwed HTML tags over. In the end, a quick path was to:</p>
<ol>
<li>View GPS Visualizer page source</li>
<li>Save source to local HTML file on disk</li>
<li>Open HTML with an editor. Even Frontpage could manage this bit!</li>
<li>Locate the Google API key, and replace it with my own (see below).</li>
<li>Set page titles, modify the default 600&#215;600 window</li>
<li>Upload to my website</li>
<p>The resulting page can be seen <a href="http://www.familywhitfield.co.uk/googlemap4.html">here</a>.</p>
<p>If you want to do this yourself you&#8217;ll need a Google API key, which you can get from <a href="http://www.google.com/apis/maps/signup.html">here</a></ol>
]]></content:encoded>
			<wfw:commentRss>http://familywhitfield.co.uk/wordpress/2007/06/26/playtime-with-google-maps-and-gps/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tips for returning IDENTITY values from INSERT</title>
		<link>http://familywhitfield.co.uk/wordpress/2007/01/14/tips-for-returning-identity-values-from-insert/</link>
		<comments>http://familywhitfield.co.uk/wordpress/2007/01/14/tips-for-returning-identity-values-from-insert/#comments</comments>
		<pubDate>Sun, 14 Jan 2007 17:04:00 +0000</pubDate>
		<dc:creator>Greg</dc:creator>
				<category><![CDATA[ASP2]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://familywhitfield.co.uk/wordpress/?p=16</guid>
		<description><![CDATA[<div class="addthis_toolbox addthis_default_style" addthis:url='http://familywhitfield.co.uk/wordpress/2007/01/14/tips-for-returning-identity-values-from-insert/' addthis:title='Tips for returning IDENTITY values from INSERT' ><a class="addthis_button_twitter"></a><a class="addthis_button_facebook"></a><a class="addthis_button_email"></a><a class="addthis_button_google_plusone"></a><a class="addthis_button_digg"></a><a class="addthis_button_compact"></a></div>There&#8217;s a good article by Scott Guthrie here that describes the basics. Just scroll down to Tutorial 5 for the INSERT specific bit &#8211; it is pretty straightforward and there is no point my repeating it here. One point to note, however, and why I wrote this particular post. The key step in getting this [...]]]></description>
			<content:encoded><![CDATA[<div class="addthis_toolbox addthis_default_style" addthis:url='http://familywhitfield.co.uk/wordpress/2007/01/14/tips-for-returning-identity-values-from-insert/' addthis:title='Tips for returning IDENTITY values from INSERT' ><a class="addthis_button_twitter"></a><a class="addthis_button_facebook"></a><a class="addthis_button_email"></a><a class="addthis_button_google_plusone"></a><a class="addthis_button_digg"></a><a class="addthis_button_compact"></a></div><p>There&#8217;s a good article by Scott Guthrie <a href="http://aspalliance.com/914_Building_a_DAL_using_Strongly_Typed_TableAdapters_and_DataTables_in_VS_2005_and_ASPNET_20">here</a> that describes the basics. Just scroll down to Tutorial 5 for the INSERT specific bit &#8211; it is pretty straightforward and there is no point my repeating it here.</p>
<p>One point to note, however, and why I wrote this particular post. The key step in getting this working is changing the query type from NonQuery to Scalar. But this can get reset by Visual Studio if you choose the Configure option on the ObjectDataSource&#8217;s smart tags to modify the query in any way. If you don&#8217;t notice this, then suddenly the identity value stops getting returned and your code breaks.</p>
<p>The second tip is that by default the type returned by the insert query is decimal. This can cause some extra casting in your code if you were expecting it to be int. To fix this, just modify the SQL in Scott&#8217;s original article to be this:</p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">SELECT</span> <span style="color: #993333; font-weight: bold;">CAST</span> <span style="color: #66cc66;">&#40;</span>SCOPE_IDENTITY<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">AS</span> <span style="color: #993333; font-weight: bold;">INT</span><span style="color: #66cc66;">&#41;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://familywhitfield.co.uk/wordpress/2007/01/14/tips-for-returning-identity-values-from-insert/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Perforce server logging problem</title>
		<link>http://familywhitfield.co.uk/wordpress/2007/01/02/perforce-server-logging-problem/</link>
		<comments>http://familywhitfield.co.uk/wordpress/2007/01/02/perforce-server-logging-problem/#comments</comments>
		<pubDate>Tue, 02 Jan 2007 13:04:30 +0000</pubDate>
		<dc:creator>Greg</dc:creator>
				<category><![CDATA[Perforce]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://familywhitfield.co.uk/wordpress/?p=6</guid>
		<description><![CDATA[<div class="addthis_toolbox addthis_default_style" addthis:url='http://familywhitfield.co.uk/wordpress/2007/01/02/perforce-server-logging-problem/' addthis:title='Perforce server logging problem' ><a class="addthis_button_twitter"></a><a class="addthis_button_facebook"></a><a class="addthis_button_email"></a><a class="addthis_button_google_plusone"></a><a class="addthis_button_digg"></a><a class="addthis_button_compact"></a></div>When setting up a server it is often useful to enable one of the logging levels. The admin guide states that you need to do this: p4 set P4DEBUG=server=2 which sets the server logging level to 2. You then need to restart the Perforce server. However, if Perforce is running as a service (the default [...]]]></description>
			<content:encoded><![CDATA[<div class="addthis_toolbox addthis_default_style" addthis:url='http://familywhitfield.co.uk/wordpress/2007/01/02/perforce-server-logging-problem/' addthis:title='Perforce server logging problem' ><a class="addthis_button_twitter"></a><a class="addthis_button_facebook"></a><a class="addthis_button_email"></a><a class="addthis_button_google_plusone"></a><a class="addthis_button_digg"></a><a class="addthis_button_compact"></a></div><p class="MsoNormal"><span lang="EN-GB">When setting up a server it is often useful to enable one of the logging levels. The <a href="http://www.perforce.com/perforce/doc.061/manuals/p4sag/03_superuser.html#1079236" target="_blank">admin guide</a> states that you need to do this:</span></p>
<ul type="disc">
<li class="MsoNormal"><span lang="EN-GB">p4 set      P4DEBUG=server=2 </span></li>
</ul>
<p class="MsoNormal"><span lang="EN-GB"><br />
which sets the server logging level to 2. You then need to restart the Perforce server.</span></p>
<p>However, if Perforce is running as a service (the default under Windows), then this does not work. The reason is that &#8220;p4 set&#8221; only sets the variable in for HKEY_CURRENT_USER in the Windows registry. However, when running as a service, p4d picks up its environment variables from HKEY_LOCAL_MACHINE. To do this you need to set the &#8216;-s&#8217; flag. E.g.</p>
<ul type="disc">
<li class="MsoNormal"><span lang="EN-GB">p4 set -s      P4DEBUG=server=2 </span></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://familywhitfield.co.uk/wordpress/2007/01/02/perforce-server-logging-problem/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Streamlining your PC to play games</title>
		<link>http://familywhitfield.co.uk/wordpress/2006/12/29/streamlining-your-pc-to-play-games/</link>
		<comments>http://familywhitfield.co.uk/wordpress/2006/12/29/streamlining-your-pc-to-play-games/#comments</comments>
		<pubDate>Fri, 29 Dec 2006 23:14:54 +0000</pubDate>
		<dc:creator>Greg</dc:creator>
				<category><![CDATA[Computer Games]]></category>
		<category><![CDATA[PC]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://familywhitfield.co.uk/wordpress/?p=4</guid>
		<description><![CDATA[<div class="addthis_toolbox addthis_default_style" addthis:url='http://familywhitfield.co.uk/wordpress/2006/12/29/streamlining-your-pc-to-play-games/' addthis:title='Streamlining your PC to play games' ><a class="addthis_button_twitter"></a><a class="addthis_button_facebook"></a><a class="addthis_button_email"></a><a class="addthis_button_google_plusone"></a><a class="addthis_button_digg"></a><a class="addthis_button_compact"></a></div>Overview Before I run a resource intensive game, I execute a little batch file that kills a bunch of background processes that are simply not needed when playing the game. I&#8217;ll explain the details below. I have also noticed that before I used to do this, I experienced awful crashing problems with my PC just [...]]]></description>
			<content:encoded><![CDATA[<div class="addthis_toolbox addthis_default_style" addthis:url='http://familywhitfield.co.uk/wordpress/2006/12/29/streamlining-your-pc-to-play-games/' addthis:title='Streamlining your PC to play games' ><a class="addthis_button_twitter"></a><a class="addthis_button_facebook"></a><a class="addthis_button_email"></a><a class="addthis_button_google_plusone"></a><a class="addthis_button_digg"></a><a class="addthis_button_compact"></a></div><h2>Overview</h2>
<p class="MsoNormal" style="margin-bottom: 12pt;"><span lang="EN-GB">Before I run a resource intensive game, I execute a little batch file that kills a bunch of background processes that are simply not needed when playing the game. I&#8217;ll explain the details below.</span></p>
<p>I have also noticed that before I used to do this, I experienced awful crashing problems with my PC just locking when playing. Since killing these extraneous processes, however, I have not had a single in-game crash that I used to get regularly with both BF2 and BFV. I think this shows that something in my system is having a bad interaction with the game &#8211; probably the graphics driver. I used to think it was an interaction with Panda antivirus, but recently I modified the script to not kill Panda and things still run OK. This makes me a little happier that I can keep my AV program running at all times.<br />
<span id="more-4"></span><br />
After I finish playing, I simply reboot my PC to restore normality. I could, alternatively, have written a simple script that restarted all the services, but to be honest it is just as quick to reboot. It also prevents worrying about start up order for dependent services.</p>
<p>Before I start, it&#8217;s just worth explaining that a &#8220;service&#8221; in WindowsXP-speak is just a program that Windows starts up automatically to do something useful. For example, Bluetooth connectivity is simply a service, as is the ability to log in multiple users at once.</p>
<p>When do you need this? Well, if you run Task Manager and click on the Processes tab, if you have more than 35 or so processes running when all your normal programs have exited, then I would seriously consider streamlining your PC before running a game like BF2. This improves performance – perhaps not absolute frame rate, but will almost certainly remove the cause of most periodic judders and temporary freezes. It also reduces the chance of extra disk paging as the load on the memory system is reduced. If you suffer from jerks or freezes, consider this.</p>
<h2>Instructions</h2>
<p><a name="Instructions"></a><a name="Instructions"></a>The script I&#8217;ll post below safely shuts down a number of services that you just don&#8217;t need when fragging the enemy. Your system may vary slightly &#8211; chances are you may not have the exact same set of services running that I do. I’ll provide some hints on finding what to kill at the end. I am hoping that readers of this post will reply with other services that can be safely terminated too.</p>
<p><a name="Instructions"></a><a name="Instructions"></a>Steps 1-4 are just one off setup steps. Every time you play a game, just start at step 5.<br />
<!--[if !supportLineBreakNewLine]--></p>
<p><a name="Instructions"></a></p>
<ol><a name="Instructions"></a></p>
<li><a name="Instructions"></a>Firstly you need to create a “batch” file – I call mine “minimal.bat”. Put it somewhere on your disk you can find it again – e.g. My Documents/games. You can do this with Notepad, but you may need to manually force the extension in Windows File Manager to “.bat”, as default XP installations will make Notepad append a “.txt” extension, and it won’t work.</li>
<li>Create a shortcut to the file, and put that on your desktop. Alternatively, just save the original file to your desktop.</li>
<li>Paste the following text into that file:<br />
<code><br />
REM Kills all non-essential services<br />
net stop "Automatic Updates"<br />
net stop "Background Intelligent Transfer Service"<br />
net stop "Bluetooth Service"<br />
net stop "COM+ Event System"<br />
net stop "Computer Browser"<br />
net stop "Distributed Link Tracking Client"<br />
net stop "Help and Support"<br />
net stop "Secondary Logon"<br />
net stop "Themes"<br />
net stop "Windows Image Acquisition (WIA)"<br />
</code></li>
<li>Bring up Task Manager and show the processes tab. Note the process count.</li>
<li>Exit all your non-essential programs. E.g. for me, I exit Skype, Internet Explorer, Messenger, Outlook etc</li>
<li>Just prior to playing a game, double click the icon for the minimal.bat file – or its shortcut, depending on what you did in (1). A command window will come up, and various bits of text will scroll past. You may find that you get asked to confirm certain process shutdowns – just hit Yes each time.</li>
<li>When it finishes, note that your process count will have reduced.</li>
<li>An optional extra step here is to manually shut down processes that were started by Windows, but which are not services – only services can be halted by the “net stop” command. In which case, right click and hit “End Process”. Examples of these on my system are:
<ul>
<li>fpdisp4.exe:      which is the excellent FinePrint utility</li>
<li>msnmsgr.exe:      Windows Messenger.</li>
<li>BTSTAC.exe:      Bluetooth stack &#8211; safe to kill, unless you have Bluetooth devices you need to work while playing the game. E.g. Bluetooth wireless mouse.</li>
</ul>
<p>Be very careful about what you kill off. If in doubt, Google for the process name.</li>
<li>Run your game</li>
<p><a name="Instructions"></a></ol>
<p><a name="Instructions"></a> <!--[if !supportLineBreakNewLine]--><br />
<!--[endif]--><a name="Instructions"></a>This probably sounds harder than it really is – once you have the batch file set up, it really is a piece of duff to do.<br />
Ideally step 8 could be added to the batch file too. But WindowsXP does not have a command line tool to kill named processes directly. You can download things like Pskill from <a href="http://www.systinternals.com/" target="_blank">www.sysinternals.com</a>, but I find my AV program kills those dead, as they often form part of virus payloads.<a name="Automating_the_manual_bit_step_8"></a></p>
<p><a name="Automating_the_manual_bit_step_8"></a><a name="Automating_the_manual_bit_step_8"></a></p>
<p><a name="Automating_the_manual_bit_step_8"></a></p>
<h2><a name="Automating_the_manual_bit_step_8"></a>Automating the manual bit &#8211; step 8</h2>
<p><a name="Automating_the_manual_bit_step_8"></a><a name="Automating_the_manual_bit_step_8"></a><a name="Automating_the_manual_bit_step_8"></a> You can automate step 8 above if you download &#8220;kill.exe&#8221; and put it in the same location you store your batch file &#8211; or anywhere else on your search path. If you don&#8217;t know what a search path is, then stick it where the batch file was saved.<br />
Add the following lines to your batch file. The process names may vary, but to show you how it would work for my example in step 8, add:<br />
<code><br />
kill -f fpdisp4.exe<br />
kill -f msnmsgr.exe<br />
kill -f pdfsaver3.exe<br />
kill -f WCESCOMM.EXE<br />
kill -f BTSTAC.exe<br />
</code><br />
<a name="Automating_the_manual_bit_step_8"></a><a name="Automating_the_manual_bit_step_8"></a><a name="Automating_the_manual_bit_step_8"></a>You can just Google for kill.exe. I downloaded it from here:<br />
<a href="http://www.mattkruse.com/utilities/" target="_blank">http://www.mattkruse.com/utilities/</a><a name="How_the_hell_do_I_know_what_services_to_"></a></p>
<p><a name="How_the_hell_do_I_know_what_services_to_"></a><a name="How_the_hell_do_I_know_what_services_to_"></a></p>
<p><a name="How_the_hell_do_I_know_what_services_to_"></a></p>
<h2><a name="How_the_hell_do_I_know_what_services_to_"></a>How the hell do I know what services to kill?</h2>
<p><a name="How_the_hell_do_I_know_what_services_to_"></a><a name="How_the_hell_do_I_know_what_services_to_"></a><a name="How_the_hell_do_I_know_what_services_to_"></a> A fine question. From Control Panel-&gt;Administrative Tools, select “Services”. Sort by “Status”, and you’ll see all services that are running. If you see one that from its name and description looks like it is surplus to gaming requirements, take a note of its name and add it to the batch file, preceded by the words “net stop”. A quick Google search should help work out what a given filename does.</p>
<p>If you want to know what processes you may be able to kill that are not services, look at the processes tab in Task Manager.<a name="Summary"></a></p>
<p><a name="Summary"></a><a name="Summary"></a></p>
<p><a name="Summary"></a></p>
<h2><a name="Summary"></a>Summary</h2>
<p><a name="Summary"></a><a name="Summary"></a><a name="Summary"></a>This post has ended up being way longer than I originally planned, but I hope I have added enough explanation to help people get the best out of their PC’s when playing games. As I mentioned above, this process has improved my gaming experience enormously.</p>
<p><a name="Summary"></a><a name="Summary"></a><a name="Summary"></a>Let me just state that this is completely safe – the next time your PC reboots normality will be restored. If you end up trying to stop a service and it kills your PC, again just a reboot will fix everything. All changes that this script executes are temporary.</p>
<p><a name="Summary"></a><a name="Summary"></a><a name="Summary"></a></p>
<p><a name="Summary"></a><a name="Summary"></a><!--[endif]--></p>
<p><a name="Summary"></a></p>
]]></content:encoded>
			<wfw:commentRss>http://familywhitfield.co.uk/wordpress/2006/12/29/streamlining-your-pc-to-play-games/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Gotcha on setting up a data connection</title>
		<link>http://familywhitfield.co.uk/wordpress/2006/12/29/gotcha-on-setting-up-a-data-connection/</link>
		<comments>http://familywhitfield.co.uk/wordpress/2006/12/29/gotcha-on-setting-up-a-data-connection/#comments</comments>
		<pubDate>Fri, 29 Dec 2006 14:26:51 +0000</pubDate>
		<dc:creator>Greg</dc:creator>
				<category><![CDATA[ASP2]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://familywhitfield.co.uk/wordpress/?p=3</guid>
		<description><![CDATA[<div class="addthis_toolbox addthis_default_style" addthis:url='http://familywhitfield.co.uk/wordpress/2006/12/29/gotcha-on-setting-up-a-data-connection/' addthis:title='Gotcha on setting up a data connection' ><a class="addthis_button_twitter"></a><a class="addthis_button_facebook"></a><a class="addthis_button_email"></a><a class="addthis_button_google_plusone"></a><a class="addthis_button_digg"></a><a class="addthis_button_compact"></a></div>This one gets me every time. When you set up a new data connection to a database running on a local copy of Sql Server Express, in the &#8220;Add Connection&#8221; dialog you need to prefix your machine name to the defaulted value of &#8220;SQLEXPRESS&#8221;. E.g. if the network name of your PC is called &#8220;devpc&#8221;, [...]]]></description>
			<content:encoded><![CDATA[<div class="addthis_toolbox addthis_default_style" addthis:url='http://familywhitfield.co.uk/wordpress/2006/12/29/gotcha-on-setting-up-a-data-connection/' addthis:title='Gotcha on setting up a data connection' ><a class="addthis_button_twitter"></a><a class="addthis_button_facebook"></a><a class="addthis_button_email"></a><a class="addthis_button_google_plusone"></a><a class="addthis_button_digg"></a><a class="addthis_button_compact"></a></div><p class="MsoNormal"><span lang="EN-GB">This one gets me every time. When you set up a new data connection to a database running on a local copy of Sql Server Express, in the &#8220;Add Connection&#8221; dialog you need to prefix your machine name to the defaulted value of &#8220;SQLEXPRESS&#8221;. E.g. if the network name of your PC is called &#8220;devpc&#8221;, then the connection string is:</span></p>
<ul>
<li>DEVPC\SQLEXPRESS</li>
</ul>
<p>While this is the obvious choice and works for many circumstances, a subtle variation is to use the following instead:</p>
<ul>
<li>localhost\SQLEXPRESS</li>
</ul>
<p>This now points the connection to an instance of SQL Server Express running on your local machine. If working in a team where each developer needs their own local copy of a database, then setting this in the web.config file can be a real help.</p>
]]></content:encoded>
			<wfw:commentRss>http://familywhitfield.co.uk/wordpress/2006/12/29/gotcha-on-setting-up-a-data-connection/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

