<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="wordpress/2.3.2" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>

<channel>
	<title>Code, coke and coins</title>
	<link>http://www.atomic14.co.uk/blog</link>
	<description>Occassional murmurs from your average software developer</description>
	<pubDate>Sat, 03 Mar 2007 12:11:41 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.3.2</generator>
	<language>en</language>
			<item>
		<title>ASP.NET Viewstate</title>
		<link>http://www.atomic14.co.uk/blog/archives/51</link>
		<comments>http://www.atomic14.co.uk/blog/archives/51#comments</comments>
		<pubDate>Sat, 03 Mar 2007 12:11:41 +0000</pubDate>
		<dc:creator>walrus</dc:creator>
		
		<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://www.atomic14.co.uk/blog/archives/51</guid>
		<description><![CDATA[  I was recently musing over the use of ASP.NET&#8217;s viewstate, and had a quick truddle around the web to find something that explained the in and outs of it. I feel compelled to link to this article which I believe is one of the most throughout and better written articles I&#8217;ve seen in a [...] ]]></description>
			<content:encoded><![CDATA[<p> I was recently musing over the use of ASP.NET&#8217;s viewstate, and had a quick truddle around the web to find something that explained the in and outs of it. I feel compelled to link to this <a href="url=http://weblogs.asp.net/infinitiesloop/archive/2006/08/03/Truly-Understanding-Viewstate.aspx">article</a> which I believe is one of the most throughout and better written articles I&#8217;ve seen in a long time.</p>
<p>With, what I believe is, an ever degrading quaility of Microsoft articles and help, we need more articles like this written by individuals who have used the technology.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.atomic14.co.uk/blog/archives/51/feed</wfw:commentRss>
		</item>
		<item>
		<title>More COM capers in Visual Studio 2005</title>
		<link>http://www.atomic14.co.uk/blog/archives/50</link>
		<comments>http://www.atomic14.co.uk/blog/archives/50#comments</comments>
		<pubDate>Sun, 25 Feb 2007 12:49:29 +0000</pubDate>
		<dc:creator>walrus</dc:creator>
		
		<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://www.atomic14.co.uk/blog/archives/50</guid>
		<description><![CDATA[  I recently wrote about creating early bound COM objects in .NET, the object (no pun intended) of the exercise was to persuade Visual Studio 2005 to produce an early binable COM object without any &#8216;jiggery pokery&#8217; after the standard build. The exercise proved successful, I could simply &#8216;build&#8217; and start using my COM object [...] ]]></description>
			<content:encoded><![CDATA[<p> I recently wrote about <a href="http://www.atomic14.co.uk/blog/archives/47">creating early bound COM objects in .NET</a>, the object (no pun intended) of the exercise was to persuade Visual Studio 2005 to produce an early binable COM object without any &#8216;jiggery pokery&#8217; after the standard build. The exercise proved successful, I could simply &#8216;build&#8217; and start using my COM object from my unmanaged code.</p>
<p>However I did run into some issues, the first of which was caused by .NET not initialising it&#8217;s FPU control word when being called from unmanaged code. The issue occured because the unmanaged application I was calling my component from was written in Borland Delphi, which doesn&#8217;t suppress certain floating exceptions in the same was Microsoft does. If I&#8217;d had access to the Delphi source I could have recompiled turning off the exceptions, something like <a href="http://homepages.borland.com/ccalvert/TechPapers/FloatingPoint.html">this</a>.</p>
<p>Here is how to turn them off in C++Builder:<br />
<code>#include float.h<br />
&nbsp;<br />
__fastcall TForm1::TForm1(TComponent* Owner)<br />
&nbsp;&nbsp;&nbsp;&nbsp;: TForm(Owner)<br />
{<br />
&nbsp;&nbsp;_control87(MCW_EM, MCW_EM);<br />
}<br />
</code></p>
<p>Here is how to turn them off in Delphi:<br />
<code>const MCW_EM = DWord($133f);<br />
&nbsp;&nbsp;begin<br />
&nbsp;&nbsp;&nbsp;&nbsp;Set8087CW(MCW_EM);<br />
&nbsp;&nbsp;end;<br />
</code></p>
<p>Of course I&#8217;d have to produce a solution from my component, the easiest implementation I could find for this was to add something to my default constructor of my COMBase class. I started using code to explicitly set the control word, something along these lines&#8230;</p>
<p><code>[DllImport(&quot;msvcrt.dll&quot;, EntryPoint=&quot;_control87&quot;)]<br />
public static extern UInt32 Control87(UInt32 Toggle, UInt32 Mask);<br />
&nbsp;<br />
UInt32 OldControlWord = Control87(0, 0); // Get current value<br />
&nbsp;<br />
Control87(0&#215;9001f, 0xffffffff); // Set to .NET default<br />
// Call Code Here<br />
Control87(OldControlWord, 0xffffffff); // Restore to previous value<br />
</code></p>
<p>Although this works admirably, whilst I was working on it, a much simpler solution was offered to be from another developer, which I  added to my COMBase class.</p>
<p><code>[ComVisible(false)]<br />
&nbsp;&nbsp;&nbsp;&nbsp;public class COMBase <br />
&nbsp;&nbsp;&nbsp;&nbsp;{<br />
&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;public COMBase()<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// Ensure FPU Control Word is set when called from unmanaged applications.<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;try { Double.IsNaN(Double.NaN); }<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;catch (ArithmeticException) { /* Intentionally empty. .NET will initialise the FPU at this point. */ }<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />
&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/*&nbsp;&nbsp;Snip */<br />
&nbsp;&nbsp;&nbsp;&nbsp;}<br />
</code></p>
<p>With this solved, the only remaining task was distribution of my COM component. For this I added a simple installer component to my code, which would be called from my setup project.</p>
<p><code>[ComVisible(false)]<br />
&nbsp;&nbsp;&nbsp;&nbsp;[RunInstaller(true)]<br />
&nbsp;&nbsp;&nbsp;&nbsp;public partial class CustomInstall : Installer<br />
&nbsp;&nbsp;&nbsp;&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;public CustomInstall()<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;InitializeComponent();<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />
&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;public override void Install(IDictionary stateSaver)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;base.Install(stateSaver);<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;RegistrationServices regSrv = new RegistrationServices();<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;regSrv.RegisterAssembly(base.GetType().Assembly, AssemblyRegistrationFlags.SetCodeBase);<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />
&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;public override void Uninstall(IDictionary savedState)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;base.Uninstall(savedState);<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;RegistrationServices regSrv = new RegistrationServices();<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;regSrv.UnregisterAssembly(base.GetType().Assembly);<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />
&nbsp;&nbsp;&nbsp;&nbsp;}</code></p>
<p>With the project output added as &#8216;custom actions&#8217; to my setup project, I could simply build my COM component, test it; then build an MSI for distribution which ensured calling of the registration functions, which in turn registered it for COM. It&#8217;s important to note that my components are not flagged for COM registration in the setup project, this is all catered for by the custom code in my installer class and COMBase class.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.atomic14.co.uk/blog/archives/50/feed</wfw:commentRss>
		</item>
		<item>
		<title>Curious Database Indentity Fields</title>
		<link>http://www.atomic14.co.uk/blog/archives/49</link>
		<comments>http://www.atomic14.co.uk/blog/archives/49#comments</comments>
		<pubDate>Thu, 25 Jan 2007 21:32:27 +0000</pubDate>
		<dc:creator>walrus</dc:creator>
		
		<category><![CDATA[Waffle]]></category>

		<guid isPermaLink="false">http://www.atomic14.co.uk/blog/archives/49</guid>
		<description><![CDATA[  Ah databases, now I&#8217;m no DBA by any stretch of the imagination, but I&#8217;ve recently come across a new trend in database design which I&#8217;m pretty sure isn&#8217;t ideal.
When designing databases I&#8217;ve always taken the basic principle of using identity fields in each table and using foreign keys to &#8216;link&#8217; the tables, a pretty [...] ]]></description>
			<content:encoded><![CDATA[<p> Ah databases, now I&#8217;m no DBA by any stretch of the imagination, but I&#8217;ve recently come across a new trend in database design which I&#8217;m pretty sure isn&#8217;t ideal.</p>
<p>When designing databases I&#8217;ve always taken the basic principle of using identity fields in each table and using foreign keys to &#8216;link&#8217; the tables, a pretty standard affair I thought. I primarily work with SQL server, and as your average joe, I generally use an &#8216;int&#8217; for my identity field. It&#8217;s never let me down and gives me a possible 2,147,483,647 (2^31 -1) indentities. The largest tables I tend to work with have about 8.5 million rows, so plenty of scope for expansion. I suppose if I were really worried I could use a bigint, which gives me a staggering 9,223,372,036,854,775,807 (2^63 - 1) possible indentities.</p>
<p>Back to that less than ideal design&#8230;.. two databases I&#8217;ve recently worked with (both SQL server based and both &#8216;live&#8217; commercial applications) have taken a different approach to indentities. In fact neither use a traditional identity field at all, both &#8216;maintain&#8217; their own ids. Both shall remain nameless to protect the innocent.</p>
<p>The first uses a curious varchar(20) identifier, which is split into 2 parts, comma delimited no less. The first part is essentially the &#8216;customer identifier&#8217; which is a number, the second part after the comma is a base36 alphanumeric. The arguments behind this are that, firstly it allows for easy merging of records from mulitiple &#8216;customers&#8217; into the same table and secondly that base36 numbers are easy to read/recognise when large!!?! For example &#8220;1,BCV32J&#8221;, ah yes I know what that is, not!</p>
<p>The second database &#8216;indentifier&#8217; design is possibly even more curious, each table has a composite key consisting of a bigint and a guid. There seems to be no logical rhyme nor reason to this, other than to make sure we have plenty of indentifiers. This we sure have, a guid has about 2^128 combinations and the bigint about 2^63, giving a possible total number of combinations of 2^191! Which is erm&#8230;. a lot. Put into perspective I could generate 1,000,000 identifiers per second and still not run out before the Sun expands and swallows planet Earth.</p>
<p>I suppose there is one plus side, at least they are using SQL server and not an Excel spreadsheet (where most &#8216;enterprise&#8217; databases seem to get stored these days).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.atomic14.co.uk/blog/archives/49/feed</wfw:commentRss>
		</item>
		<item>
		<title>Creating early bindable COM objects in .NET 2</title>
		<link>http://www.atomic14.co.uk/blog/archives/47</link>
		<comments>http://www.atomic14.co.uk/blog/archives/47#comments</comments>
		<pubDate>Mon, 22 Jan 2007 18:26:31 +0000</pubDate>
		<dc:creator>walrus</dc:creator>
		
		<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://www.atomic14.co.uk/blog/archives/47</guid>
		<description><![CDATA[  Many will ask why do such a daft thing as creating COM objects in .NET? Well the answer is fairly simple, at my current place of work we only have Microsoft Visual Studio 2005 and I needed to create a COM object for compatibility with an older application, which only understood early bound COM. [...] ]]></description>
			<content:encoded><![CDATA[<p> Many will ask why do such a daft thing as creating COM objects in .NET? Well the answer is fairly simple, at my current place of work we only have Microsoft Visual Studio 2005 and I needed to create a COM object for compatibility with an older application, which only understood early bound COM. The application is a &#8216;drag and drop&#8217; business rules and workflow editor, COM can be used to provide additional custom functions otherwise not available.</p>
<p>I thought to myself, this can&#8217;t be that difficult, just follow the tickboxes&#8230;..</p>
<ul>
<li>Project Properties->Application->Assembly Information->Make Assembly COM Visible - <strong>Check</strong></li>
<li>Project Properties->Build->Register for COM Interop (automatically exports a typelibrary) - <strong>Check</strong></li>
<li>Project Properties->Signing-> Sign the assembly (make a new strong key name file) - <strong>Check</strong></li>
</ul>
<p>&#8230;. surely that&#8217;s enough? Wrong. The assembly was a late bound COM object only.</p>
<p>A few help topics and Googles later, I&#8217;m doing all sorts of tricks, adding and deleting things in the GAC and learning the wonders of regasm. However, none of it worked.</p>
<p>Back to basics, the type library defines the interfaces for early binding, so why couldn&#8217;t COM see the type library definitions? The answer turned out to be very simple, the C# complier didn&#8217;t add the required information into the registry during the build. Help was at hand however, in the form of the attributes [ComRegisterFunction] and [ComUnregisterFunction]. It should be noted that the C# build does add partial information to the registry, but not the required TypeLib key&#8230;&#8230;</p>
<p><code><br />
[ComVisible(false)]<br />
public class COMBase<br />
{<br />
 [ComRegisterFunction]<br />
 static void ComRegister(Type t)<br />
 {<br />
&nbsp;&nbsp;string keyName = @&quot;CLSID\&quot; + t.GUID.ToString(&quot;B&quot;);<br />
&nbsp;&nbsp;using (RegistryKey key = <br />
&nbsp;&nbsp;&nbsp;&nbsp; Registry.ClassesRoot.OpenSubKey(keyName, true))<br />
&nbsp;&nbsp;{<br />
&nbsp;&nbsp; using (RegistryKey subkey =<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;key.CreateSubKey(&quot;TypeLib&quot;))<br />
&nbsp;&nbsp; {<br />
&nbsp;&nbsp;&nbsp;&nbsp;Guid libid = <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Marshal.GetTypeLibGuidForAssembly(t.Assembly);<br />
&nbsp;&nbsp;&nbsp;&nbsp;subkey.SetValue(&quot;&quot;, libid.ToString(&quot;B&quot;));<br />
&nbsp;&nbsp; }<br />
&nbsp;&nbsp; using (RegistryKey subkey = <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;key.CreateSubKey(&quot;Version&quot;))<br />
&nbsp;&nbsp; {<br />
&nbsp;&nbsp;&nbsp;&nbsp; Version ver = t.Assembly.GetName().Version;<br />
&nbsp;&nbsp;&nbsp;&nbsp; string version = <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;string.Format(&quot;{0}.{1}&quot;, ver.Major, ver.Minor);<br />
&nbsp;&nbsp;&nbsp;&nbsp; subkey.SetValue(&quot;&quot;, version);<br />
&nbsp;&nbsp; }<br />
&nbsp;&nbsp;}<br />
 }<br />
&nbsp;<br />
 [ComUnregisterFunction]<br />
 static void ComUnregister(Type t)<br />
 {<br />
&nbsp;&nbsp;string keyName = @&quot;CLSID\&quot; + t.GUID.ToString(&quot;B&quot;);<br />
&nbsp;&nbsp;Registry.ClassesRoot.DeleteSubKeyTree(keyName);<br />
 }<br />
}<br />
</code></p>
<p>Volia, derive all my &#8216;COM&#8217; classes from &#8216;COMBase&#8217; and I have a working early binable COM object. Should also mention, none of the GAC and regasm manual processing is needed either. Not particulary neat, I would certainly like to know if there&#8217;s a better way.</p>
<p>As an aside, during my time with COM in .NET I picked up a few pointers on &#8216;best practices&#8217; the most useful of which is using defined interfaces, with fixed GUIDs to keep the resultant COM &#8216;backwards compatible&#8217;.</p>
<p>For example:-</p>
<p><code><br />
[Guid(&quot;89B65A92-5CE6-4295-A6DF-9506530C7877&quot;)]<br />
[InterfaceType(ComInterfaceType.InterfaceIsDual)]<br />
public interface IFoo<br />
{<br />
 int Bar();<br />
}<br />
&nbsp;<br />
[ProgId(&quot;MyCOMObject.Foo&quot;)]<br />
[ClassInterface(ClassInterfaceType.None)]<br />
public class Foo : COMBase, IFoo<br />
{<br />
 public int Bar()<br />
 {<br />
&nbsp;&nbsp;&nbsp;&nbsp;return 42;<br />
 }<br />
}<br />
</code></p>
<p>Should also be noted that explicitly specifiying the COM &#8216;ProgID&#8217; makes it easier to manage also (and elminates the need to shorten namespaces and class names for COM). Specifiying &#8216;ClassInterfaceType.None&#8217; for the class effectively hides it from COM, leaving only the parts you want to explicitly expose in the interface.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.atomic14.co.uk/blog/archives/47/feed</wfw:commentRss>
		</item>
		<item>
		<title>From Quad-Core to Infinity</title>
		<link>http://www.atomic14.co.uk/blog/archives/46</link>
		<comments>http://www.atomic14.co.uk/blog/archives/46#comments</comments>
		<pubDate>Tue, 21 Nov 2006 22:52:21 +0000</pubDate>
		<dc:creator>walrus</dc:creator>
		
		<category><![CDATA[Hardware]]></category>

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

		<guid isPermaLink="false">http://www.atomic14.co.uk/blog/archives/46</guid>
		<description><![CDATA[  So the Intel QX6700 is upon us, for those not in the know, it&#8217;s not really a true &#8216;quad&#8217; core processor, but a dual-dual processor. Two separate pieces of silicon (each containing an E6700 Dual core CPU) on a single physical package. But for all intensive purposes it is four physical CPUs in one [...] ]]></description>
			<content:encoded><![CDATA[<p> So the <a href="http://www.intel.com/design/processor/datashts/315592.htm">Intel QX6700</a> is upon us, for those not in the know, it&#8217;s not really a true &#8216;quad&#8217; core processor, but a dual-dual processor. Two separate pieces of silicon (each containing an E6700 Dual core CPU) on a single physical package. But for all intensive purposes it <em>is</em> four physical CPUs in one drop-in LGA775 package.</p>
<p>The QX6700 marks the way forward to more mainstream &#8216;Quad&#8217; CPUs in Q1-Q2 2007 and true Quad CPUs (one silicon slice, shared cache etc) in Q3-Q4 2007 from both Intel and AMD. If we believe everything we read we can expect up to 32 cores per processor in only a few years, which brings me to my problem&#8230;&#8230;.</p>
<p>The software market is far from ready for multiple core CPUs on the desktop.</p>
<p>The crux of the problem is that the vast majority of applications are not designed to work with multiple cores. Additionally the programmers who write software are also not &#8216;designed to work with multiple cores&#8217;. Writing an application to use multiple CPU cores is no easy task, and based on personal experience I&#8217;d not be suprised if the vast majority of programmers today will never be able to write such an application.</p>
<p>There are some applications today that can take good advantage of multiple cores but these are, in the main, high-end graphics packages or specialist server software. Other applications tend to be written for a single core, with only occassional use of a second core and no more.</p>
<p>The popularity of dual-core is however justified, simply because it effectively allows the application you are working on to have a core to itself, whilst all those other things, such as virus-checkers can trundle along on the other core. But this doesn&#8217;t scale, you certainly don&#8217;t need a &#8216;whole core&#8217; for each application, for the vast majority of people, dual-core is more than enough.</p>
<p>So what&#8217;s the answer? That&#8217;s the worrying thing, there is no easy answer, if there is a shortage of people capable of writing applications for multiple cores, it will be a very slow road for software&#8230;.. whilst hardware races ahead.</p>
<p>So by all means enjoy the artificial benchmarking scores a new quad-core processor will bring you, but unless you use scare and specialised software regularly the benefits of quad and beyond will be minimal.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.atomic14.co.uk/blog/archives/46/feed</wfw:commentRss>
		</item>
		<item>
		<title>Hug a tree, enable SpeedStep</title>
		<link>http://www.atomic14.co.uk/blog/archives/45</link>
		<comments>http://www.atomic14.co.uk/blog/archives/45#comments</comments>
		<pubDate>Sat, 07 Oct 2006 13:48:21 +0000</pubDate>
		<dc:creator>walrus</dc:creator>
		
		<category><![CDATA[Hardware]]></category>

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

		<guid isPermaLink="false">http://www.atomic14.co.uk/blog/archives/45</guid>
		<description><![CDATA[  Like many I&#8217;m sure, I run my PC for long periods of time, on many occassions it runs 24/7 for particulary long downloads or FTP server access when I&#8217;m away. All this time the CPU is buzzing away, doing nothing for the large part, except comsuming power and generating heat.
One thing I was suprised [...] ]]></description>
			<content:encoded><![CDATA[<p> Like many I&#8217;m sure, I run my PC for long periods of time, on many occassions it runs 24/7 for particulary long downloads or FTP server access when I&#8217;m away. All this time the CPU is buzzing away, doing nothing for the large part, except comsuming power and generating heat.</p>
<p>One thing I was suprised with after my recent PC purchase, was that SpeedStep wasn&#8217;t enabled by default. SpeedStep is a technology by Intel that enables their CPUs to run at slower speeds when they aren&#8217;t so busy, laptop users may well be familiar with the technology as it&#8217;s fairly essential for long battery life. However this doesn&#8217;t seem to apply to desktop PCs, or at least it doesn&#8217;t in their default configurations as supplied by manufacturers. It should be noted that AMD support a similar technology &#8220;cool and quiet&#8221; for their CPUs.</p>
<p>The nice thing about SpeedStep is that the CPU changing speeds is transparent, when the power is needed i.e. by a game or other intensive processing task - the CPU automatically ramps up to a higher speed. There is no detectable performance hit whatsoever.</p>
<p>After a little research I found that the following Intel CPUs support SpeedStep,</p>
<ul>
<li>Pentium 4 (3Ghz +)</li>
<li>All Pentium D</li>
<li>All Core</li>
</ul>
<p>You can verify your processor supports SpeedStep using the <a href="http://processorfinder.intel.com/">Intel Processor Spec Finder</a>, which allows you to find your CPU and then &#8216;filter&#8217; on SpeedStep technology.</p>
<p>There are other parts to the equation too, namely your motherboard must also support SpeedStep, as well as your Operating System. Those that are happy to look in their PCs BIOS settings should hunt around for &#8220;EIST&#8221; or &#8220;SpeedStep&#8221; (EIST = Enhanced Intel SpeedStep) and make sure it&#8217;s enabled. Even if you aren&#8217;t happy to delve into your BIOS you can try altering your Windows settings anyway, it may well be it&#8217;s already enabled elsewhere.</p>
<p>To enable SpeedStep in your OS, you simply need to change your &#8220;Power Scheme&#8221; in Control Panel - Power Options. Intel themselves explain this best and have some screenshots to show how you can verify SpeedStep is enabled, available <a href="http://www.intel.com/cd/channel/reseller/asmo-na/eng/products/box_processors/desktop/proc_dsk_p4/technical_reference/203838.htm">here</a>.</p>
<p>For my Intel Core 2 E6700 CPU, the speed changes from the default 2667Mhz down to 1600Mhz at the slowest speed and also 2133Mhz inbetween, depending on how much power is required. It&#8217;s completely unnoticeable in day to day use, but I&#8217;m happy in the knowledge my PC is comsuming less power and producing less heat.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.atomic14.co.uk/blog/archives/45/feed</wfw:commentRss>
		</item>
		<item>
		<title>NOD32, Anti-virus holy grail?</title>
		<link>http://www.atomic14.co.uk/blog/archives/43</link>
		<comments>http://www.atomic14.co.uk/blog/archives/43#comments</comments>
		<pubDate>Thu, 21 Sep 2006 17:56:36 +0000</pubDate>
		<dc:creator>walrus</dc:creator>
		
		<category><![CDATA[Waffle]]></category>

		<guid isPermaLink="false">http://www.atomic14.co.uk/blog/archives/43</guid>
		<description><![CDATA[  I recently built a new PC and was trying to decide which anti-virus software to use on it. I&#8217;d not had this decision to make for many, many years&#8230;. since 1990, when Norton Anti-Virus was introduced.
I&#8217;ve stuck with Norton Anti-virus all that time, happily paying my subscription annually in the knowledge that I was [...] ]]></description>
			<content:encoded><![CDATA[<p> I <a href="http://www.atomic14.co.uk/blog/archives/44">recently built a new PC</a> and was trying to decide which anti-virus software to use on it. I&#8217;d not had this decision to make for many, many years&#8230;. since 1990, when <a href="http://www.symantec.com/">Norton Anti-Virus</a> was introduced.</p>
<p>I&#8217;ve stuck with Norton Anti-virus all that time, happily paying my subscription annually in the knowledge that I was protected from viruses. However since the 2003 release and possibly earlier I&#8217;ve noticed a sharp increase in the amount of resources and time Norton spends thrashing around on my harddrives. I believe I&#8217;m not alone, many people have complained about this, however Symantec continue to &#8216;bloat&#8217; Anti-Virus with each subsequent release. Norton Anti-Virus 2006 was and probably will remain the last release of the product that I purchase.</p>
<p>Certainly I didn&#8217;t want to load Norton on my shiney new PC, I needed an alternative anti-virus solution. Something that harked back to the super fast and effective early releases of the Norton product.</p>
<p>I believe that product is <a href="http://www.eset.com/">NOD32 from Esnet</a>.</p>
<p>NOD32 is largely written in assembly code, which shows in it&#8217;s performance. It&#8217;s throughput of files when scanning and minimal system impact has to be seen to be believed. In these early days I can&#8217;t judge it&#8217;s detection rate (I rarely encounter viruses anyway due to being very wary and diligent), however it has the lowest failure rate in tests performed by <a href="http://www.virusbtn.com/">Virus Bulletin</a>, which can&#8217;t be a bad thing. That said it <em>did</em> find 1 trojan on my archived data disk that Norton had never found.</p>
<p>It does have it&#8217;s downside, user-friendliness isn&#8217;t all it could be. Components of the product have strange 4 letter acronyms e.g. AMON, DMON, IMON, EMON (a side-effect of being an assembly language programmer I suspect!) and setup options are plentiful, maybe too plentiful? However, given a little patience and thought, it does all make sense and should be possible for most &#8216;computer literate&#8217; people to setup and configure without too much pain.</p>
<p>After initial setup and configuration, it just works, it really is barely noticeable - especially if go for the rather good &#8220;silent mode&#8221; option. Silent mode only disturbs you if it has a reason to, no more daft &#8220;I&#8217;m great because I&#8217;ve just managed to update myself&#8221; style popups.</p>
<p>My trial period (one month) is about to expire, they will certainly be getting my £46 for a 1 PC, 3 year licence, worth every penny. It&#8217;s also worth noting they have student and non-profit organisation rates too.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.atomic14.co.uk/blog/archives/43/feed</wfw:commentRss>
		</item>
		<item>
		<title>Shuttle SD37P2 - SFF has arrived</title>
		<link>http://www.atomic14.co.uk/blog/archives/44</link>
		<comments>http://www.atomic14.co.uk/blog/archives/44#comments</comments>
		<pubDate>Wed, 20 Sep 2006 21:44:02 +0000</pubDate>
		<dc:creator>walrus</dc:creator>
		
		<category><![CDATA[Hardware]]></category>

		<guid isPermaLink="false">http://www.atomic14.co.uk/blog/archives/44</guid>
		<description><![CDATA[  Back in March I wrote about SFF PC&#8217;s, I&#8217;ve had my mind set on getting one for sometime. It&#8217;s taken this long for me to purchase one, as I&#8217;ve never been completely at ease with the specifications available, there always seemed to be a compromise.
Then, while trawling the net, I stumbled across Shuttle&#8217;s plans [...] ]]></description>
			<content:encoded><![CDATA[<p> Back in March I <a href="http://www.atomic14.co.uk/blog/archives/35">wrote about SFF PC&#8217;s</a>, I&#8217;ve had my mind set on getting one for sometime. It&#8217;s taken this long for me to purchase one, as I&#8217;ve never been completely at ease with the specifications available, there always seemed to be a compromise.</p>
<p>Then, while trawling the net, I stumbled across Shuttle&#8217;s plans to release the <a href="http://eu.shuttle.com/en/desktopdefault.aspx/searchcall-12/searchcategory-365/noblendout-1/tabid-72/170_read-13285/">SD37P2</a>. </p>
<p><img src="http://atomic14.co.uk/images/sd37p2_sm.jpg" alt="Shuttle SD37P2" /></p>
<p>I suppose the compromise, if any, is it&#8217;s size. It&#8217;s not as small as some modern designs, however it is substantially smaller than my pair of <a href="http://www.gamepc.com/labs/view_content.asp?id=atc201&#038;page=1">Coolermaster ATC-201&#8217;s</a> that it is replacing.</p>
<p>The real attraction with the SD37P2 is the Intel 975X chipset, which can take anything from a Celeron to a top end X8600 &#8220;Conroe&#8221; Core 2 Duo. This had a huge bearing on my choice, as when I upgrade, I tend to look for a substantial performance increase, otherwise what is the point?</p>
<p>My primary use of this machine is software development, followed by &#8220;office&#8221; type tasks and finally some gaming. Being the least important factor, gaming didn&#8217;t steer me into the scary world of ultra-high end graphics cards, however reasonable performance and a modern GPU was required.</p>
<p>The first decision however, was the CPU, I really had to have a new Intel &#8220;Conroe&#8221;, by all accounts the fastest CPU available by some margin and at a reasonable price. A fast CPU makes a world of difference in software development, especially with larger projects. The sensible man would have bought the E6600 flavour of Conroe, I however got the E6700 at a substantial premium. At least I didn&#8217;t go mad and get the X6800, which only really has an attraction for the &#8216;overclocker&#8217;, something I don&#8217;t intend to be doing.</p>
<p>Once the CPU decision was made, the choice of memory was an easy one. The SD37P2 supports only 533Mhz and 667Mhz variants of DDR2 RAM, unlike some of the Intel motherboards that also support 800Mhz. However, unless overclocking 533Mhz DDR2 is the obvious choice as it runs 1:1 with the CPU (CPU FSB is quad 266Mhz = 1066Mhz, DDR2 in dual configuration is 2 x 533Mhz = 1066Mhz). Even though Intel have addressed latency to some extent with pre-fetching, I choose to purchase some decent low latency RAM manufactured by OCZ. I&#8217;ve used OCZ RAM before, quite simply put, it&#8217;s faultless and fast.</p>
<p>The decision on graphics card took more time, I was determined to purchase the fastest possible passive card. One of the aims of this build was for the PC to be as quiet as possible, without resorting to specialist components and soundproofing. A card that caught my eye early on was the nVidia 7600GS, primarily because it&#8217;s latest generation and designed to be passive in it&#8217;s reference design. I had a nagging doubt that it might just not be fast enough to play some of the latest titles at decent settings. It is so difficult to determine from review benchmarks, many only compare to synthetic tests, which are meaningless. Other benchmarks enable daft levels of detail, thereby making cards look slower than they actually are. </p>
<p>I took a gamble and plumped for a XFX 7600GS, the &#8216;pre-overclocked&#8217; XFX 7600GS Extreme missing out by a very small margin - I figured heat might pose a problem in such a small case. Elder Scrolls IV - Oblivion (with patch 1.1) selects &#8220;High&#8221; by default, only one notch down from the top &#8220;Ultra High&#8221; presets available - a result if ever I saw one; Oblivion has to be about the most intensive graphical games available currently, it looks fantastic and plays very smoothly.</p>
<p>Other choices of components were two Samsung 320GB SATA hard drives (chosen for quietness) that run in RAID 0 configuration for speed. And and LG DVD/CD -R/+R/RAM writer for optical disc duties.</p>
<p>The full rundown was as follows:-</p>
<ul>
<li><a href="http://eu.shuttle.com/en/desktopdefault.aspx/searchcall-12/searchcategory-365/noblendout-1/tabid-72/170_read-13285/">Shuttle SD37P2</a></li>
<li><a href="http://www.intel.com/cd/products/services/emea/eng/processors/300131.htm">Intel &#8220;Conroe&#8221; Core 2 Duo E6700</a></li>
<li><a href="http://www.ocztechnology.com/products/memory/ocz_ddr2_pc2_4200_gold_gx_xtc_dual_channel">2GB (2&#215;1GB) OCZ DDR2 PC2-4200 Gold GX XTC</a></li>
<li><a href="http://www.samsung.com/Products/HardDiskDrive">2 x Samsung 320GB SATA Hard drives</a></li>
<li><a href="http://www.xfxforce.com/web/product/listConfigurations.jspa?seriesId=186022&#038;productId=198676">XFX GeForce 7600GS 256MB DDR2 DUAL DVI TV</a></li>
<li><a href="http://uk.lge.com/">LG GSA-H10NBAL 16x DVDRW/RAM Black Dual Layer/12x RAM/DVDRW</a></li>
</ul>
<p>The whole thing was built in under an hour, OS installation (Windows XP MCE), application installation and restoration/transfer of existing data took another 4 or 5 evenings! The end result was certainly worth the expense and effort, it is lightyears ahead of my old Intel &#8220;Northwood&#8221; Pentium 4 2.53Ghz based machine.</p>
<p>I&#8217;ll not be posting benchmarks I think they are misleading, but Oblivion running in &#8220;High&#8221; mode and Visual Studio 2005 starting being ready to compile projects in under 3 seconds should give a rough idea. All this and very quiet with it, yes there is a &#8220;hum&#8221; from the CPU and HDD case fans, but it&#8217;s minimal.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.atomic14.co.uk/blog/archives/44/feed</wfw:commentRss>
		</item>
		<item>
		<title>Magic ADSL</title>
		<link>http://www.atomic14.co.uk/blog/archives/42</link>
		<comments>http://www.atomic14.co.uk/blog/archives/42#comments</comments>
		<pubDate>Wed, 05 Jul 2006 09:13:30 +0000</pubDate>
		<dc:creator>walrus</dc:creator>
		
		<category><![CDATA[PlusNet]]></category>

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

		<guid isPermaLink="false">http://www.atomic14.co.uk/blog/archives/42</guid>
		<description><![CDATA[  Over the past few weeks, for the first time ever, my ADSL connection at home started to play up. Nothing major, the modem would loose synchronisation momentarily (1 or 2 seconds) every few hours and then resync - Windows remained perfectly oblivious to this activity and carried on as if nothing had occured.
Past experience [...] ]]></description>
			<content:encoded><![CDATA[<p> Over the past few weeks, for the first time ever, my ADSL connection at home started to play up. Nothing major, the modem would loose synchronisation momentarily (1 or 2 seconds) every few hours and then resync - Windows remained perfectly oblivious to this activity and carried on as if nothing had occured.</p>
<p>Past experience with my connection had been faultless; at one point I was connected for around 4 months straight with no glitches, only disconnecting when I needed to &#8216;bounce&#8217; my gateway PC for updates. This is also testament to the connection provided by my ISP, <a href="http://portal.plus.net/my/mydiscount_info/landing_page.html?WRKUh%2Fz%2FuZ5dXmEjImm%2BIMkRiDrJhibK68I95EISja8%3D">PlusNet</a> who for all their faults provide rock solid connections for most of their customers (current trial MaxDSL issues aside!).</p>
<p>The answer to the ADSL issue I was experiencing came about almost by chance, the battery in my mobile phone drained after a particulary long working day. Due to this I was forced to use a landline, after finding my telephone I was dismayed to find no dialtone. I probably should say at this point that I&#8217;m part of a growing number of people with no need for a landline for day-to-day use, it is there for ADSL only.</p>
<p>After breathing some life back into my mobile, one of my first calls was to BT faults. I could have used the <a href="http://www.bt.com/faults">BT website to report the fault</a>, oddly something tells me to use a phone to report a phone fault! As it happens the service is completely automated with various options such as SMS text updates etc.</p>
<p>Roll on Saturday morning, I get a phone call from a BT engineer who is on his way to investigate the problem with the line. Within 10 minutes of his arrival he&#8217;s identified the problem as being 15 metres down the line, which just so happens to coincide with the junction box on the wall. Outside and up the ladder he goes, almost instantly proclaiming &#8220;think I&#8217;ve found the problem!&#8221;, pointing feverishly at a single wire that is completely disconnected from the rest and sticking out at right-angles from the wall.</p>
<p>Reconnection of my second wire solved the &#8216;dialtone&#8217; problem, a fully working phone line again, and resolved my ADSL &#8216;hiccups&#8217;. I queried the BT engineer as to how the ADSL continued to work at full capacity for the most part with so few problems&#8230;..</p>
<p>&#8220;Even we don&#8217;t understand how it works, it&#8217;s magic&#8221;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.atomic14.co.uk/blog/archives/42/feed</wfw:commentRss>
		</item>
		<item>
		<title>Things I&#8217;d forgotten you could do with VB6</title>
		<link>http://www.atomic14.co.uk/blog/archives/41</link>
		<comments>http://www.atomic14.co.uk/blog/archives/41#comments</comments>
		<pubDate>Thu, 29 Jun 2006 19:29:39 +0000</pubDate>
		<dc:creator>walrus</dc:creator>
		
		<category><![CDATA[Development]]></category>

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

		<guid isPermaLink="false">http://www.atomic14.co.uk/blog/archives/41</guid>
		<description><![CDATA[  My last 2 jobs have involved a large amount of Visual Basic 6 development (amongst T_SQL, C and various script languages), but have been very different in terms of design and implementation of code.
Prior to my current role, the VB6 code was about as cutting-edge as you can get with an 8 year old [...] ]]></description>
			<content:encoded><![CDATA[<p> My last 2 jobs have involved a large amount of Visual Basic 6 development (amongst T_SQL, C and various script languages), but have been very different in terms of design and implementation of code.</p>
<p>Prior to my current role, the VB6 code was about as cutting-edge as you can get with an 8 year old development environment. Extensive use was made of collections, classes and COM to build a robust central object library that was a breeze to use.</p>
<p>By comparision, the product I&#8217;m working with currently has &#8216;history&#8217;, and a lot of it. The only time a class is used is to provide a public interface to an ActiveX control. By and large the majority of the &#8216;framework&#8217; is implemented in shared modules.</p>
<p>Neither way is the &#8216;right&#8217; way, both are valid in VB6, one being an object oriented approach and the other very much &#8216;procedural&#8217;. That said it is difficult moving back to procedural programming after writing so much object oriented code.</p>
<p>It&#8217;s the procedural code, having been around as long as VB6 itself, that threw up a few surprises for me. Along with the fact that several contributers had their roots in VB to the early versions. That said I don&#8217;t remember using some of these features, even way back in VB3&#8230;..</p>
<p><em>Multiple executions on one line of code</em><br />
<code>foo=1:bar=1</code></p>
<p><em>GoSubs!</em><br />
<code>Private Sub Foo()<br />
&nbsp;&nbsp;&nbsp;&nbsp;GoSub Bar<br />
Exit Sub<br />
Bar:<br />
&nbsp;&nbsp;&nbsp;&nbsp;MsgBox &quot;Hello world!&quot;<br />
Return<br />
End Sub</code></p>
<p><em>Option Compare*</em><br />
<code>Option Compare Text</code></p>
<p>&#8230;and an interesting technique to detect a VB program was running interpreted&#8230;..</p>
<p><code>Debug.Print 1/0</code></p>
<p>&#8230;I&#8217;d always for some reason used Debug.Assert to call a function and set a value. I&#8217;m sure both techniques have their pros and cons.</p>
<p>* Not strictly &#8216;forgotten&#8217;, just never used, the default binary has always suited.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.atomic14.co.uk/blog/archives/41/feed</wfw:commentRss>
		</item>
	</channel>
</rss>
