<?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>Beakersoft Blog &#187; Programming</title>
	<atom:link href="http://www.beakersoft.co.uk/category/programming/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.beakersoft.co.uk</link>
	<description>My (mis)adventures in the IT industry</description>
	<lastBuildDate>Thu, 11 Mar 2010 19:40:59 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<image>
  <link>http://www.beakersoft.co.uk</link>
  <url>http://www.beakersoft.co.uk/wordpress/wp-content/themes/Beakersoft/favicon.ico</url>
  <title>Beakersoft Blog</title>
</image>
		<item>
		<title>Folder2Page Plugin</title>
		<link>http://www.beakersoft.co.uk/2010/02/11/folder2page-plugin/</link>
		<comments>http://www.beakersoft.co.uk/2010/02/11/folder2page-plugin/#comments</comments>
		<pubDate>Thu, 11 Feb 2010 21:29:49 +0000</pubDate>
		<dc:creator>beakersoft</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.beakersoft.co.uk/?p=321</guid>
		<description><![CDATA[Just a quick post to point you in the direction of my latest (ok second ever!) plugin for wordpress. Its called folder2page, you can check out more info at beakersoft.co.uk/folder2page
Its a simple plugin that will allow you to use a directory of images you have on your web space as a simple gallery on page [...]]]></description>
			<content:encoded><![CDATA[<p>Just a quick post to point you in the direction of my latest (ok second ever!) plugin for wordpress. Its called folder2page, you can check out more info at <a href="http://www.beakersoft.co.uk/folder2page">beakersoft.co.uk/folder2page</a></p>
<p>Its a simple plugin that will allow you to use a directory of images you have on your web space as a simple gallery on page in your blog. There seemed to be a lot of plugins out there for getting images from flickr and other image hosting services, but not much if you wanted to get at the images your self.</p>
<p>Any comments, suggestions etc please let me know!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.beakersoft.co.uk/2010/02/11/folder2page-plugin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordSlice &#8211; My First WordPress plugin</title>
		<link>http://www.beakersoft.co.uk/2009/06/15/wordslice-my-first-wordpress-plugin/</link>
		<comments>http://www.beakersoft.co.uk/2009/06/15/wordslice-my-first-wordpress-plugin/#comments</comments>
		<pubDate>Mon, 15 Jun 2009 22:00:53 +0000</pubDate>
		<dc:creator>beakersoft</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[programing]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://www.beakersoft.co.uk/?p=220</guid>
		<description><![CDATA[
I while ago I wrote an artical (here)about the new Web slice feature in IE8. A few people have asked about a plugin for WordPress, and the other night I finally decided to have a go.
Head over to http://www.beakersoft.co.uk/wordslice for all the info, or to http://wordpress.org/extend/plugins/wordslice/ for the download and the install notes.
Hopefully in the [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone" title="Webslice header" src="http://www.beakersoft.co.uk/img/wordpress_webslice-header.jpg" alt="" width="450" height="50" /></p>
<p>I while ago I wrote an artical (<a href="http://www.beakersoft.co.uk/2008/03/24/webslices-in-wordpress/">here</a>)about the new Web slice feature in IE8. A few people have asked about a plugin for WordPress, and the other night I finally decided to have a go.</p>
<p>Head over to <a href="http://www.beakersoft.co.uk/wordslice">http://www.beakersoft.co.uk/wordslice</a> for all the info, or to <a href="http://wordpress.org/extend/plugins/wordslice/">http://wordpress.org/extend/plugins/wordslice/</a> for the download and the install notes.</p>
<p>Hopefully in the not to distant future i will be add some extra features to it (its kind of limited at the moment) so stay tuned!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.beakersoft.co.uk/2009/06/15/wordslice-my-first-wordpress-plugin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Creating a Check for update Routine</title>
		<link>http://www.beakersoft.co.uk/2008/10/07/creating-a-check-for-update-routine/</link>
		<comments>http://www.beakersoft.co.uk/2008/10/07/creating-a-check-for-update-routine/#comments</comments>
		<pubDate>Tue, 07 Oct 2008 18:07:32 +0000</pubDate>
		<dc:creator>beakersoft</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Visual Basic]]></category>

		<guid isPermaLink="false">http://www.beakersoft.co.uk/?p=178</guid>
		<description><![CDATA[First off, i apologise for not blogging for a while, ive had quite a few other projects on over the summer, plus holidays so I&#8217;ve not really had time. Hopefully now I should be able to get back into it with a bit more frequency.
Anyway on to the topic of this post. Most applications nowadays [...]]]></description>
			<content:encoded><![CDATA[<p>First off, i apologise for not blogging for a while, ive had quite a few other projects on over the summer, plus holidays so I&#8217;ve not really had time. Hopefully now I should be able to get back into it with a bit more frequency.</p>
<p>Anyway on to the topic of this post. Most applications nowadays will automaticly go onto the web and check to see if there is a new version, and if there is offer to download/install/visit page etc. I was looking for a simple way to do this using the dotnet framework and Visual Basic.Net, and came across the <em>System.Net</em> class.</p>
<p>This class is extremely powerful, as it contains functions for network communication.  The main one we will use here is the <em>System.net.WebClient</em>. We are going to use this to pull a file down of our web server that will give us information about the latest version of our application.</p>
<h2>Information File</h2>
<p>So first of all, create a text file, we are going to look on our web server for this file and read information. In the file we will have the following info: App name, version and download location, delimited by a pipe (|) character. You could also add extra things like new features, release date etc to this file. The example file will look something like this.</p>
<p>1.1.0|TestApp|www.beakersoft.co.uk/downloads/</p>
<p>Once you have this file, save it as something like TestApp_Ver_Control.txt, and upload it to your web server.</p>
<h2>Downloading the Version information</h2>
<p>Now the file containing version information is on your web server, we can write a function in vb that will open the file up, get the information contained in it and use that information to decided if our application is the latest version or not. This is where the <em>System.net.WebClient</em> comes in. First of declare a couple of variables. One is the <em>WebClient</em>, one is the url of the file you have just uploaded and a string array to hold the details of the file.</p>
<pre class="vb.net:nocontrols:nogutter">Dim myWebClient As New Net.WebClient
Dim RemoteUri As String = "www.beakersoft.co.uk/TestApp_Ver_Control.txt"
Dim strFileInfo()As String</pre>
<p>Now, we can go and get the file of the web server, using the webclient and read the contents into a string. Then we can split the content of the string up using the pipe char, and there you have all the info you need to check the version.</p>
<p>All the code is wrapped up in a <em>try/catch </em>block to make sure we dont get any unhandled errors such as when there is no net connection, file missing etc.</p>
<pre class="vb.net:nocontrols:nogutter">	Try
	Dim file As New System.IO.StreamReader( _
                    myWebClient.OpenRead(RemoteUri))
        Dim Contents As String = file.ReadToEnd()

	'Split up the sections of the text based on the pipe (|) delimiator
	strFileInfo = Split(Contents, "|")

	'see if we need a new version
	If strFileInfo(0) &gt; Application.ProductVersion Then
		'if we have a new version, make sure the app name matchs from the file
                If strFileInfo(1) = application.ProductName Then

			'we have a new version! So throw up a message, set a flag ect

                End If
	End If

	'close the file stream and web client
	myWebClient = Nothing
	file.Close()

        Catch ex As Exception
	If InStr(ex.Message, "(404)") Then
		'404 means file not found on webserver
                Msgbox("Problem Finding the update information file - " &amp; vbNewLine &amp; ex.Message &amp; _
                        vbNewLine &amp; "Please contact the appliaction vendor")
	Else
                Msgbox("Problem getting update information - " &amp; vbNewLine &amp; ex.Message &amp; _
                        vbNewLine &amp; "Check your internet settings and try again")
	End If
End Try</pre>
<p>And thats pritty much it! This is a very bare bones way of doing it, and you probably want to add in support for using a proxy (you can do that using the <em>System.Net.WebRequest.DefaultWebProxy </em>class, and pass login credentials to <em>myWebClient.Credentials </em>using <em>Net.NetworkCredential</em> ) but as a very basic form this should work.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.beakersoft.co.uk/2008/10/07/creating-a-check-for-update-routine/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Error Logging ASP.Net with Elmah</title>
		<link>http://www.beakersoft.co.uk/2008/05/23/error-logging-aspnet-with-elmah/</link>
		<comments>http://www.beakersoft.co.uk/2008/05/23/error-logging-aspnet-with-elmah/#comments</comments>
		<pubDate>Fri, 23 May 2008 09:02:35 +0000</pubDate>
		<dc:creator>beakersoft</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Elmah]]></category>
		<category><![CDATA[exeption handling]]></category>
		<category><![CDATA[IIS]]></category>
		<category><![CDATA[programing]]></category>

		<guid isPermaLink="false">http://www.beakersoft.co.uk/?p=174</guid>
		<description><![CDATA[I&#8217;ve been in the situation a few times with ASP.Net applications where someone says to you &#8216;I got this error on screen when I did x, I don&#8217;t know what it said but i couldn&#8217;t work.&#8217;
Odds are you have got an unhanded exception in your web application, but how are you meant to debug it [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been in the situation a few times with ASP.Net applications where someone says to you &#8216;I got this error on screen when I did x, I don&#8217;t know what it said but i couldn&#8217;t work.&#8217;</p>
<p>Odds are you have got an unhanded exception in your web application, but how are you meant to debug it when the error has long gone? Elmah (<em>error logging and error handling modules for asp.net) </em>may well be your saviour. Download it out now from <a title="elmah download" href="http://code.google.com/p/elmah/" target="_blank">http://code.google.com/p/elmah/</a></p>
<h2>So, what does it do?</h2>
<p>Well, once you have it configured on your application or server, every time something causes an unhanded exception it will log it into a database, send you an email alert and fix the code for you (last part was a joke!). So, now when the user tells you they have had an problem you can look in the system and see exactly what happened.</p>
<p><img style="vertical-align: middle;" src="http://www.beakersoft.co.uk/img/elmah_1.jpg" alt="elmah example" /></p>
<p>The application is open source, and is based on the article at <a href="http://msdn.microsoft.com/en-us/library/aa479332.aspx" target="_blank">http://msdn.microsoft.com/en-us/library/aa479332.aspx</a>, check that article out if you want to know more about how it was written</p>
<h2>Installing it</h2>
<p>You can run it in two ways, on a particular web application or at the server level. As I was a bit confused at first as to how to set it up, here is a quick guide to installing it for an individual application and log the errors onto a SQL 2000 server.</p>
<ol>
<li>Download the zip file from the website, if you are using dotnet 2.0 you will need the latest beta version.</li>
<li>Extract the files, in the <em>src/Elmah/</em> folder find the <em>Database.sql</em> script. This is the script that will build the tables it needs. Create a new database and run this script on the database</li>
<li>Next, go into the <em>bin/net-2.0/Release/</em> folder, and copy the <em>Elmah.dll</em> and <em>Elmah.xml</em> files into you applications <em>/bin</em> folder</li>
<li>Once you have the assembly, you need to configure your application to use it. You do this by adding some sections into your applications web.config file. In the <em>/samples</em> folder there is an example web.config file you can get all the information out of to put in your file. For the most part it is easy to follow, but I had a couple of problems.</li>
<li>The first one was the database connection, make sure you add a new connection to your <em>&lt;connectionStrings&gt; </em>section that points at the database you have created.</li>
<li>You then need to point to this connection in the <em>connectionStringName</em> section of the elmah <em>errorLog.</em></li>
<li>Once you have added the other sections into your config file you should just be able to browse to your site /<em>elmah.axd</em> to see your errors</li>
</ol>
<p>You can also configure options such as getting it to send an email when an exception occurs, subscribe to the log as an rss feed etc.</p>
<p>So now you should have a handy reference point for all your exemptions. You can tell the user you are looking into there problem before they even report it to you!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.beakersoft.co.uk/2008/05/23/error-logging-aspnet-with-elmah/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Webslices in Wordpress</title>
		<link>http://www.beakersoft.co.uk/2008/03/24/webslices-in-wordpress/</link>
		<comments>http://www.beakersoft.co.uk/2008/03/24/webslices-in-wordpress/#comments</comments>
		<pubDate>Mon, 24 Mar 2008 17:42:40 +0000</pubDate>
		<dc:creator>beakersoft</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Internet Explorer 8]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[Webslices]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://www.beakersoft.co.uk/2008/03/24/webslices-in-wordpress/</guid>
		<description><![CDATA[
One of the new features in the beta of Internet Explorer 8 is something called Webslices. These work in a similar way to RSS feeds, but allow you to subscribe to a section of a web page, as opposed to just a feed. The section of the page you subscribe to is a div with [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.beakersoft.co.uk/img/wordpress_webslice-header.jpg" alt="Wordpress and Webslices header" width="450" height="50" align="middle" /></p>
<p>One of the new features in the beta of <a title="IE 8" href="http://www.microsoft.com/windows/products/winfamily/ie/ie8/default.mspx">Internet Explorer 8</a> is something called <a title="WebSlices" href="http://msdn2.microsoft.com/en-us/library/cc196992(VS.85).aspx">Webslices</a>. These work in a similar way to RSS feeds, but allow you to subscribe to a section of a web page, as opposed to just a feed. The section of the page you subscribe to is a div with a class name of <em>hsclice</em>.</p>
<p>If a page contains webslice&#8217;s that can be subscribed to, a little purple icon shows in the IE tool bar, along with any rss feed options for the page. If you click on the webslice option a new link appears in the favorites bar, when you click on this you get the contents of the div. If the content of the div is updated, the item in the favorites bar shimmers and goes bold to inform you of the update.</p>
<p><img src="http://www.beakersoft.co.uk/img/wordpress_webslice1.jpg" alt="Webslice" width="195" height="97" align="middle" /></p>
<p>So, I have written a small php script that can be used on a Wordpress blog to subscribe to the 7 last posts as a webslice. At the moment all I have is a script, but if people are interested I can turn it into a Wordpress plugin. You can download all the parts as a .zip file at the end of the post, but here is what it contains</p>
<ul>
<li><strong>readme.txt</strong> &#8211; This file contains the bit of HTML code you need to insert in your index.php file (or where ever you want the webslice subscription option to show) and more detailed install information.</li>
<li><strong>webslice.php</strong> &#8211; The actual file that contains a div with the last 7 posts</li>
<li><strong>webslice.css</strong> &#8211; Style sheet for the php file</li>
</ul>
<p>When you have downloaded the files, change the css to suite you, insert the div code into your page, upload to the server and away you go.</p>
<h2>More Info on the script</h2>
<p>When I first looked at adding a webslice to my Wordpress blog, I thought i would just place the hslice div around the existing previous posts section in my side bar. I went away from that idea though as I wanted the ability to format it differently, maybe add a graphic to the bottom etc so i went with an external file.</p>
<p>To make the page flag as having a webslice, but re-direct it to another page for the actual div, I used the <em>class=&#8221;feedurl&#8221;</em> option in the div. This just tells IE to look in a different place for the actual content. You can tell it to look at a page or an rss feed. The div containing all this info is hidden so it doesn&#8217;t interfere with any of the existing front page content.</p>
<p>The script it&#8217;s self is very straight forward. It just looks in your Wordpress DB for the last 7 (you can easily change this) posts , and puts them into n unordered list on the page, the formating is controlled by an external style sheet.</p>
<p>Please note this might not be 100% reliable. IE 8 is still in beta so its possible (but unlikely) the way it handles Webslices could change. I have also only tested this on one machine running the new IE, so it might not always work right. If you have problems get in contact and ill try and iron them out.</p>
<p>As I mentioned before if there is enough interest I might turn it into a plug-in</p>
<p><em>Edit: </em>Since upgrading to the release version of Internet Explorer 8, any web slices I had suddenly stopped working. All I kept getting was &#8216;page cannot be displayed&#8217; error in the space where the slice was. After much searching and head scratching I finally found the solution at <a href="http://support.microsoft.com/kb/969213">http://support.microsoft.com/kb/969213</a></p>
<p>It turns out that Google Gears was stopping them from working, just disable the add on in IE and they start to work fine again</p>
<div class="download">
<div class="download-title">Download The Zip Archive</div>
<p>Download the script: <a title="Webslice for wordpress" href="http://www.beakersoft.co.uk/wordpress/wp-content/wordpress_webslice.zip">wordpress_webslice.zip</a></div>
]]></content:encoded>
			<wfw:commentRss>http://www.beakersoft.co.uk/2008/03/24/webslices-in-wordpress/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>Flickr, Google Maps and Classic ASP</title>
		<link>http://www.beakersoft.co.uk/2008/01/03/flickr-google-maps-and-classic-asp/</link>
		<comments>http://www.beakersoft.co.uk/2008/01/03/flickr-google-maps-and-classic-asp/#comments</comments>
		<pubDate>Thu, 03 Jan 2008 21:13:27 +0000</pubDate>
		<dc:creator>beakersoft</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Classic ASP]]></category>
		<category><![CDATA[Flickr]]></category>
		<category><![CDATA[Google Maps]]></category>
		<category><![CDATA[Mapping]]></category>
		<category><![CDATA[XML]]></category>

		<guid isPermaLink="false">http://www.beakersoft.co.uk/2008/01/03/flickr-google-maps-and-classic-asp/</guid>
		<description><![CDATA[
I went on Holiday to the German Beer festival, Oktoberfest and wanted to be able to upload photos from my camera phone onto Flickr, so I can put them onto a website I run. I also wanted to put the pictures onto a Google map. There were quite a few things that would allow me [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.beakersoft.co.uk/img/flickr2googlemaps_head.jpg" alt="Header" align="middle" height="55" width="450" /></p>
<p>I went on Holiday to the German Beer festival, <a href="http://www.oktoberfest.de/en/">Oktoberfest </a>and wanted to be able to upload photos from my camera phone onto <a href="http://Flickr.com">Flickr</a>, so I can put them onto a website I run. I also wanted to put the pictures onto a Google <a href="http://maps.google.com">map</a>. There were quite a few things that would allow me to do this, but none met my criteria:</p>
<ul>
<li> Most of the scrips i found were PHP or .net, I needed an classic asp one</li>
<li>I needed to be able to tag the GPS co-ords into a tag on the photo. My camera phone did not have GPS built in, so I wanted to add two tags to them containing the info, called geo:lat=[xxx] and geo:lon=[xxx]</li>
</ul>
<p>So, I came up with this script, you can see it in action at <a href="http://www.oldmanales.co.uk/feat_OktoberFest07.asp" title="Example Google map">http://www.oldmanales.co.uk/feat_OktoberFest07.asp</a></p>
<p>In order to use the script, you will need a couple of things:</p>
<ul>
<li>An account on Flickr with some pictures tagged with valid geo:lat= and geo:lon= values. These are used to display the picys on the map</li>
<li>A Flickr API key (mine is in the example file but please use your own) get it at <a href="http://www.flickr.com/services/api/keys/apply/">http://flickr.com/services/api/keys/apply</a></li>
<li>A Google maps API key (again, mine is in the script but please use yours) get it at <a href="http://code.google.com/apis/maps/signup.html">http://code.google.com/apis/maps/signup.html</a></li>
<li>Your Flickr ID. This is not the same as your username, find it at<a href="http://idgettr.com/"> http://idgettr.com</a></li>
</ul>
<p>Once you have these, change the API key values to yours in the script, then upload it to your server. Now, call the script something like this:</p>
<p><em>FlickrTags2Google.asp?lat=11.511955&amp;long=48.129893&amp;tags=Oktoberfest_07&amp;flickrID=7389734@N03</em></p>
<p>The lat and long parts of the string are where in the world the map will be placed when the pages loads, the tags are a comma separate list of tags to show on the map, in this case everything I have tagged as <em>Oktoberfest_07</em>. The last parameter is your flickrID.</p>
<p>Hopefully, when your call the page now you should get something like the screen shots below, the photos are indicated by the little camera icon, when you click on them you should get a popup preview of the image along with some info on the photo:</p>
<p><img src="http://www.beakersoft.co.uk/img/map_preview1.jpg" alt="Preview1" align="middle" /></p>
<div class="download">
<div class="download-title">Download The ASP Script</div>
<p>Download the file :<a href="http://www.beakersoft.co.uk/wordpress/wp-content/flickrtags2google.txt" title="FlickrTags2Google.asp">FlickrTags2Google.asp </a><br />
(and dont forget to rename it to a .asp extension otherwise it wont run.)
</div>
<p>Hopefully when I get time I will document the code a bit better. If you find problems with it, or have any good ideas for enhancements let me know.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.beakersoft.co.uk/2008/01/03/flickr-google-maps-and-classic-asp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Going Green &#8211; Creating a PC Shutdown Script</title>
		<link>http://www.beakersoft.co.uk/2007/11/15/going-green-creating-a-pc-shutdown-script/</link>
		<comments>http://www.beakersoft.co.uk/2007/11/15/going-green-creating-a-pc-shutdown-script/#comments</comments>
		<pubDate>Thu, 15 Nov 2007 16:06:00 +0000</pubDate>
		<dc:creator>beakersoft</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.beakersoft.co.uk/2007/11/15/going-green-creating-a-pc-shutdown-script/</guid>
		<description><![CDATA[There&#8217;s been a lot of talk throughout the IT industry recently about being more &#8216;Green&#8217;. Well, being all for that and also sick of users who leave there pc&#8217;s turned on all night for no good reason I have come up with a script to turn of pc&#8217;s.
The script looks into Active Directory for computer [...]]]></description>
			<content:encoded><![CDATA[<p>There&#8217;s been a lot of talk throughout the IT industry recently about being more &#8216;Green&#8217;. Well, being all for that and also sick of users who leave there pc&#8217;s turned on all night for no good reason I have come up with a script to turn of pc&#8217;s.</p>
<p>The script looks into <a href="http://en.wikipedia.org/wiki/Active_Directory">Active Directory</a> for computer objects in a specific OU, loops through all of the computers and creates a batch file that calls the windows script <span style="font-style: italic;">Shutdown.vbs</span>. This is a script that comes bundled with XP, and allows an administrator to shutdown a remote machine from the command line.</p>
<p>You can download the script from <a href="http://www.beakersoft.oldmanales.co.uk/ShutDownPCs.txt">http://www.beakersoft.oldmanales.co.uk/ShutDownPCs.txt</a></p>
<p>Rename the file to a .vbs file, change the 3 variables at the top of the script to match your environment and it should create your file. A couple of things to note before using this script:</p>
<p>BE CAREFUL! You could end up shutting down servers or client machines that are being used. I would make sure first the pc&#8217;s are ok to shutdown, and only run the script after you know the users aren&#8217;t likely to be using them.</p>
<p>This script will not forcefully close open applications, so not to  lose any users work. If you really want to force the machine down (even if the user has un-saved open work) you can add a  &#8216;-f&#8217; switch to the script on the line where it writes the computer name out to the file.</p>
<p>You will need to be a Domain admin or similar to shutdown the remote machines, or you&#8217;ll just get an access denied  errors.</p>
<p>As I mentioned before this could be dangerous so make sure the pc&#8217;s are ok to shut down before running the script.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.beakersoft.co.uk/2007/11/15/going-green-creating-a-pc-shutdown-script/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>API Wrapper Classes</title>
		<link>http://www.beakersoft.co.uk/2007/11/08/api-wrapper-classes/</link>
		<comments>http://www.beakersoft.co.uk/2007/11/08/api-wrapper-classes/#comments</comments>
		<pubDate>Thu, 08 Nov 2007 19:50:00 +0000</pubDate>
		<dc:creator>beakersoft</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.beakersoft.co.uk/2007/11/08/api-wrapper-classes/</guid>
		<description><![CDATA[The past couple of days I have been on a short course run by one of our vendors about using the API from one of there products.
Now I have to firstly applaud them for making there product open enough for us to call it using its api, there are some bits of business logic missing, [...]]]></description>
			<content:encoded><![CDATA[<p>The past couple of days I have been on a short course run by one of our vendors about using the API from one of there products.</p>
<p>Now I have to firstly applaud them for making there product open enough for us to call it using its api, there are some bits of business logic missing, but for the most part it is very good and very well documented.</p>
<p>The only problem with it is the amount of parameters you can pass to some of the methods, and the amount of information you get back. In some case&#8217;s there are over 30 inputs to a method, but only 2 are mandatory. So Calling the API could look something like this:</p>
<p><span style="font-style: italic;">result = AppInteraction.API(&#8220;APICustSearch&#8221;, pi_pointer, pi_source, type.missing, </span><span style="font-style: italic;">type.missing, </span><span style="font-style: italic;">type.missing) </span>etc etc<br /><span style="font-style: italic;"><br /></span>This kind of code while functional can get very messy and hard to read. What we could do with is a class to wrap the functionality of the API calls in.</p>
<p>First thing to do is create a couple of classes for the input and outputs of the method. This example is using the method called <span style="font-style: italic;">APICustSearch</span>, it will have 5 possible inputs and 3 outputs.</p>
<p><span style="font-style: italic;font-family:courier new;font-size:85%;"  >Public Class </span><span style="font-style: italic;font-family:courier new;font-size:85%;"  >CustSearch</span><span style="font-style: italic;font-family:courier new;font-size:85%;"  > _input</span><span style="font-size:85%;"><span style="font-family:courier new;"> </span></span><span style="font-style: italic;font-family:courier new;font-size:85%;"  ><br />Public Spointer As String</span><span style="font-size:85%;"><span style="font-family:courier new;"> </span></span><span style="font-style: italic;font-family:courier new;font-size:85%;"  ><br />Public Source As String</span><span style="font-size:85%;"><span style="font-family:courier new;"> </span></span><span style="font-style: italic;font-family:courier new;font-size:85%;"  ><br />Public date As String</span><span style="font-size:85%;"><span style="font-family:courier new;"> </span><span style="font-style: italic;font-family:courier new;" ><br /></span></span><span style="font-style: italic;font-family:courier new;font-size:85%;"  >Public Active As String</span><span style="font-size:85%;"><span style="font-family:courier new;"> </span></span><span style="font-style: italic;font-family:courier new;font-size:85%;"  ><br />Public MinSpend As String</span><span style="font-size:85%;"><span style="font-family:courier new;"> </span></span><span style="font-style: italic;font-family:courier new;font-size:85%;"  ><br />End Class</span></p>
<p><span style="font-style: italic;font-family:courier new;font-size:85%;"  >Public Class </span><span style="font-style: italic;font-family:courier new;font-size:85%;"  >CustSearch</span><span style="font-style: italic;font-family:courier new;font-size:85%;"  > _results</span><span style="font-size:85%;"><span style="font-family:courier new;"> </span></span><span style="font-style: italic;font-family:courier new;font-size:85%;"  ><br /> Public Result As Integer</span><span style="font-size:85%;"><span style="font-family:courier new;"> </span></span><span style="font-style: italic;font-family:courier new;font-size:85%;"  ><br />Public Resulttext As String</span><span style="font-size:85%;"><span style="font-family:courier new;"> </span></span><span style="font-style: italic;font-family:courier new;font-size:85%;"  ><br />Public Custname As String</span><span style="font-size:85%;"><span style="font-family:courier new;"> </span></span><span style="font-style: italic;"><span style="font-size:85%;"><br /><span style="font-family:courier new;">End Class</span></span></p>
<p></span>The above classes just deal with the inputs/outputs of the api, next we need to code the actual api call into a class:</p>
<p><span style="font-size:85%;"><span style="font-family:courier new;">Public Class AppWrapper</span><br /><span style="font-family:courier new;">&#8216; Defintion for API APICustSearch</span><br /><span style="font-family:courier new;">    Public Function CustSearch(ByVal oInput As CustSearch_input) As CustSearch_results</span></p>
<p><span style="font-family:courier new;">        Dim oApp As New AppAPI.Interaction</span><br /><span style="font-family:courier new;">        Dim oResults As New AppAPI.colGeneric</span><br /><span style="font-family:courier new;">        Dim oReturn As New Suborderrestart_results</span></p>
<p><span style="font-family:courier new;">        oResults = oApp.API(&#8220;APICustSearch&#8221;, oInput.Spointer , oInput.Source, oInput.date, oInput.Active, oInput.MinSpend )</span></p>
<p><span style="font-family:courier new;">        While System.Runtime.InteropServices.Marshal.ReleaseComObject(oApp) > 0</span><br /><span style="font-family:courier new;">        End While</span><br /><span style="font-family:courier new;">        While System.Runtime.InteropServices.Marshal.ReleaseComObject(oResults) > 0</span><br /><span style="font-family:courier new;">        End While</span><br /><span style="font-family:courier new;">        </span><br /><span style="font-family:courier new;">        oResults = Nothing</span><br /><span style="font-family:courier new;">        oApp = Nothing</span><br /><span style="font-family:courier new;">        </span><br /><span style="font-family:courier new;">    Return oReturn</span><br /><span style="font-family:courier new;">    End Function</span></p>
<p><span style="font-family:courier new;">End Class</span></span></p>
<p>So now we have our class to call the functionality of the API method we are interested in, we can easily call it from our application like so:</p>
<p><span style="font-size:85%;"><span style="font-family:courier new;">Dim App As New AppWrapper</span><br /><span style="font-family:courier new;">        Dim CustSearchParam As New CustSearch_input</span><br /><span style="font-family:courier new;">        Dim search_result As CustSearch_results</span></p>
<p><span style="font-family:courier new;">        With CustSearchParam</span><br /><span style="font-family:courier new;">            .Spointer = &#8220;12345&#8243;</span><br /><span style="font-family:courier new;">            .Source = &#8220;API&#8221;</span><br /><span style="font-family:courier new;">            .date = &#8220;08/11/2007&#8243;</span><br /><span style="font-family:courier new;">            .Active = &#8220;Y&#8221;</span><br /><span style="font-family:courier new;">            .MinSpend = &#8220;0&#8243;</span><br /><span style="font-family:courier new;">        End With</span></span></p>
<p><span style="font-size:85%;"><span style="font-family:courier new;">        search_result = App.CustSearch(CustSearchParam)</span></p>
<p><span style="font-family:courier new;">    &#8216;this is some checking specific to the API i was working with. If the search_result.Result was not 0</span><br /><span style="font-family:courier new;">    &#8216;an error had happened and the details were in search_result.Resulttext</span><br /><span style="font-family:courier new;">        If (search_result.Result <> 0) Then</span><br /><span style="font-family:courier new;">            MessageBox.Show(search_result.Resulttext, &#8220;Search error&#8221;)</span><br /><span style="font-family:courier new;">        End If</span></p>
<p><span style="font-family:courier new;">        If (search_result.Result = 0) Then</span><br /><span style="font-family:courier new;">            MessageBox.Show(search_result.Resulttext, &#8220;SubOrderRestart Suceeded&#8221; &amp; vbnewline &amp; search_result.Custname )</span><br /><span style="font-family:courier new;">        End If</p>
<p></span></span>You will obviously have to tailor the classes  based on the api you are using, but you can just add all the methods you use the the AppWrapper class, and create new input and output classes based on the spec.</p>
<p>Apologies for any errors in the example code, I have re-written sections of mine to make it more generic, but hopefully you should get the idea</p>
]]></content:encoded>
			<wfw:commentRss>http://www.beakersoft.co.uk/2007/11/08/api-wrapper-classes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Google Maps and IE6</title>
		<link>http://www.beakersoft.co.uk/2007/10/02/google-maps-and-ie6/</link>
		<comments>http://www.beakersoft.co.uk/2007/10/02/google-maps-and-ie6/#comments</comments>
		<pubDate>Tue, 02 Oct 2007 11:36:00 +0000</pubDate>
		<dc:creator>beakersoft</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.beakersoft.co.uk/2007/10/02/google-maps-and-ie6/</guid>
		<description><![CDATA[I&#8217;ve been doing some messing about over the last week or so with the Google maps and Fickr API&#8217;s, to get photos on Flickr displayed on a map.
After much tinkering and hacking around, I finally got it working. You can see the results on my beer website at http://www.oldmanales.co.uk/feat_OktoberFest07.asp
While writing this I came across a [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been doing some messing about over the last week or so with the <a href="http://maps.google.com/">Google maps</a> and <a href="http://flickr.com/">Fickr</a> API&#8217;s, to get photos on Flickr displayed on a map.</p>
<p>After much tinkering and hacking around, I finally got it working. You can see the results on my beer website at <a href="http://www.oldmanales.co.uk/feat_OktoberFest07.asp">http://www.oldmanales.co.uk/feat_OktoberFest07.asp</a></p>
<p>While writing this I came across a strange bug that seamed to effect IE6. I only started noticing it the last couple of days though, so maybe Google have been messing with the code.</p>
<p>Anyway, what would happen is when I loaded my map I got the little error  icon at the bottom left corner of my browser.  Double clicking it gave this error:</p>
<p><span style="font-style: italic">GIcon is undefinded</span></p>
<p>GIcon was the variable I was using to create a marker on the map that you can click and it would show a pop-up window.</p>
<p>I looked at  a few posts, some suggested changing the version of the maps api, some building the icon differently and a couple more. However, the only one that worked for me was going into IE&#8217;s advanced settings and turning on <span style="font-style: italic">allow HTTP 1.1 through proxy connections </span>option.</p>
<p><img src="file:///C:/DOCUME%7E1/LUKE%7E1.NIL/LOCALS%7E1/Temp/moz-screenshot.jpg" /><a href="http://bp2.blogger.com/_RwfokkwAYVk/Rwj9djwitwI/AAAAAAAAABo/FQT9PjS0qGk/s1600-h/blogger.jpg" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"><img src="http://bp2.blogger.com/_RwfokkwAYVk/Rwj9djwitwI/AAAAAAAAABo/FQT9PjS0qGk/s400/blogger.jpg" style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer" id="BLOGGER_PHOTO_ID_5118619660763444994" border="0" /></a><br />
Once this had been turned on I know longer got the error and my map is displayed without ant problems.</p>
<p>Once I thought about the error I realised that I noticed it first when I checked the map at work, using a proxy server, and judging by the name of the setting it probably only happens when using a proxy to access the web.<br />
I&#8217;m not entity sure what the setting means but i will look into it.</p>
<p>On the topic of the map, once I have finished it off all the features i want to put in it and I&#8217;ve tested it as much as possible i will post the code for it on here.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.beakersoft.co.uk/2007/10/02/google-maps-and-ie6/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Open to everyone</title>
		<link>http://www.beakersoft.co.uk/2007/07/19/open-to-everyone/</link>
		<comments>http://www.beakersoft.co.uk/2007/07/19/open-to-everyone/#comments</comments>
		<pubDate>Thu, 19 Jul 2007 12:21:00 +0000</pubDate>
		<dc:creator>beakersoft</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.beakersoft.co.uk/2007/07/19/open-to-everyone/</guid>
		<description><![CDATA[If you look at the right hand side off my blog now, you&#8217;ll will see that you can now translate my blog into different languages.  The idea came about when I was looking on FeedBurner at the different places visitors were coming from, and all the different languages they were using.
I had a quick [...]]]></description>
			<content:encoded><![CDATA[<p>If you look at the right hand side off my blog now, you&#8217;ll will see that you can now translate my blog into different languages.  The idea came about when I was looking on <a href="http://www.feedburner.com/">FeedBurner </a>at the different places visitors were coming from, and all the different languages they were using.</p>
<p>I had a quick look around the web to see if there were any &#8216;widgets&#8217; I could steel to accomplish this. The only one I could find was using Babel fish by Alta Vista, you can get it at <a href="http://www.altavista.com/help/free/free_searchbox_transl">http://www.altavista.com/help/free/free_searchbox_transl</a> the only thing that put me of using this was the Google translate tool supported more languages.</p>
<p>So I headed over to <a href="http://www.google.com/translate_t">http://www.google.com/translate_t</a>, and basicly looked at the source code of that page and created a form of my own. Now if you click on one of the flags it will translate the blog page your are looking at to your language. Simple but effective!</p>
<p>If you are in the UK try and get hold of a copy of this weeks IT Week, on page 27 there&#8217;s a really interesting article about a company doing some interesting research into the future of power consumption. Unfortunately I  can find it on there website so you&#8217;ll have to get hold of the magazine.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.beakersoft.co.uk/2007/07/19/open-to-everyone/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
