<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="wordpress/2.0.5" -->
<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>HW Happy Days</title>
	<link>http://www.hwhappy.co.uk</link>
	<description>You cannot wield it. None of us can.</description>
	<pubDate>Mon, 07 May 2007 13:07:59 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.0.5</generator>
	<language>en</language>
	<image>
	<title>HW Happy Days</title>
	<width>120</width>
	<height>50</height>
	<link>http://www.hwhappy.co.uk</link>
	<url>http://www.hwhappy.co.uk/wp-images/hwhappyrss.jpg</url>
	</image>
			<item>
		<title>Vista Cookies</title>
		<link>http://www.hwhappy.co.uk/2007/05/07/vista-cookies/</link>
		<comments>http://www.hwhappy.co.uk/2007/05/07/vista-cookies/#comments</comments>
		<pubDate>Mon, 07 May 2007 13:06:56 +0000</pubDate>
		<dc:creator>HWHappy</dc:creator>
		
		<category>Computing</category>

		<guid isPermaLink="false">http://www.hwhappy.co.uk/2007/05/07/vista-cookies/</guid>
		<description><![CDATA[As many affiliate marketers will be aware, cookies are quite important to their business. It is quite common to test links to merchants and then check your cookies to make sure the link is functioning properly. I was doing this myself just the other day when I decided to try and find the cookie directory [...]]]></description>
			<content:encoded><![CDATA[<p>As many affiliate marketers will be aware, cookies are quite important to their business. It is quite common to test links to merchants and then check your cookies to make sure the link is functioning properly. I was doing this myself just the other day when I decided to try and find the cookie directory on Windows Vista. As it took quite a few google searches I thought I would list the directories and explain the difference as no one seems terribly clear on it.<a id="more-15"></a></p>
<p><strong>Finding Cookies</strong> </p>
<p>Firstly lets look at where they used to be on Windows XP machines :</p>
<p>C:\documents and settings\[username]\Cookies</p>
<p>Now taking this a step forward or backwards, as Vista has done with many things, they are now located here</p>
<p>C:\Users\[username]\AppData\Roaming\Microsoft\Windows\Cookies\</p>
<p>and</p>
<p>C:\Users\[username]\AppData\Roaming\Microsoft\Windows\Cookies\Low\</p>
<p>Most of the cookies you are looking for are located in the low folder, meaning &#8220;lower privileged&#8221; application cookie store. So for things like Internet Explorer you will find them here.</p>
<p><strong>I can&#8217;t see no cookies!</strong></p>
<p>To see the cookie folder you need to uncheck &#8216;Hide protected operating system files&#8217; from the folder tools dialog. Access this by opening any folder, hold down Alt, select Tools, select Folder Options, select View Tab and then half way down the list, uncheck &#8216;Hide&#8230;.</p>
<p><strong>Deleting Cookies</strong></p>
<p>Remember if you wish to delete a single cookie rather than all the cookies, go to the relevant folder above, find the cookie with the domain name you wish to delete, this may be <a href="mailto:happy@domain.com">happy@domain.com</a> and <a href="mailto:happy@www.domain.com">happy@www.domain.com</a> and similarly for every subdomain you have visited at the site so make sure you find the right one. Delete the file from the folder, and then close and re-open Internet Explorer as if you don&#8217;t perform this step, and visit the site again, chances are the cookie will still be there as it is cached in it&#8217;s internal DB.</p>
<p><strong>My favourite cookies</strong></p>
<p>It is a fact the Marks and Spencers make the best <a title="mmm cookies" href="http://www.hwhappy.co.uk/2006/12/27/the-real-cookie/">cookies</a>, if you hang around the shop and wait for the in-store bakery to make them, mmm, better than hot muffins.
</p>
]]></content:encoded>
			<wfw:commentRss>http://www.hwhappy.co.uk/2007/05/07/vista-cookies/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Ruby on what?</title>
		<link>http://www.hwhappy.co.uk/2007/03/26/ruby-on-what/</link>
		<comments>http://www.hwhappy.co.uk/2007/03/26/ruby-on-what/#comments</comments>
		<pubDate>Mon, 26 Mar 2007 10:18:29 +0000</pubDate>
		<dc:creator>HWHappy</dc:creator>
		
		<category>Computing</category>

		<guid isPermaLink="false">http://www.hwhappy.co.uk/2007/03/26/ruby-on-what/</guid>
		<description><![CDATA[Techie and I as well as a few friends went to Bar Camp a while back now. I think being a little pessimistic we slightly dismissed the whole thing due to the lack of business awareness it seemed. Now having time to reflect the one thing that I did enjoy was the events ability to [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.hwtechie.co.uk">Techie</a> and I as well as a few friends went to <a href="http://barcamp.org/BarCampScotland">Bar Camp</a> a while back now. I think being a little pessimistic we slightly dismissed the whole thing due to the lack of business awareness it seemed. Now having time to reflect the one thing that I did enjoy was the events ability to increase awareness of new trends. It was really hard not to notice that every 2nd person seemed to have some interest in Ruby on Rails. After looking into this further I have decided to explore my findings.</p>
<p><a id="more-14"></a></p>
<p><strong>What is Ruby on Rails?</strong></p>
<p>Basically <a href="http://www.ruby-lang.org/en/">Ruby</a> is a programming language similar to many we have today; Ada, Python, Perl, Php (did I just mention ada). It originated from Japan and dates back to the 1990s. However it&#8217;s popularity has increased over the last few years due to much more English documentation being made available. What makes Ruby different from other programming languages is that its focus is on simplifying much of the mundane repitition with a strong focus on productivity.</p>
<p>Ruby was built from the ground up having major influence by a language called Smalltalk. The idea was to consider everything as an object. Many of the features of Ruby have been designed to make it easier for the programmer with the main issues being described <a href="http://www.ruby-lang.org/en/about/">here</a>. However, one of the features that stood out for me was Ruby&#8217;s ability to offer multithreading regardless of which platform Ruby runs on. In one of my previous posts I talk about using Ajax to give the illusion of multithreading (<a href="http://www.hwhappy.co.uk/2006/11/07/concurrent-xml-queries-with-ajax/">concurrent xml</a>), its still not true concurrency.</p>
<p><strong>Rails</strong></p>
<p>Rails is an open source framework using Ruby to develop web and database driven applications similar to what you would expect from Php on Apache and the dotnet framework. Once again with the focus being on simplification rails allows you to write standard web applications up to 10 times faster. For example, every Rails project starts the same way by generating a wack of standard code that normally you would have to create yourself, such as test suites, image folders, db config files, robots file and a set of standard scripts that you will inevitably use. So this already has saved you a good hour.</p>
<p>Frequently with database driven applications we need to be able to read, write, update and delete the data from our database. Regularly I have to create admin functions that do just this for a given set of tables. This is somewhere that Rails really comes into play. Using built in functionality, once the DB tables are created Rails can automatically generate the code to manipulate the data from these tables. To do this in Rails you use something called <em>scaffolding </em>:</p>
<p><strong><font color="#003366">ruby script\generate scaffold customers customers</font></strong> </p>
<p>This basically tells Rails to generate the <a href="http://en.wikipedia.org/wiki/Model-view-controller">Model, View and Controller</a> for editing the customers tables. Looking at the code it generates you can see which parts relate to the update, create and deletion functions e.g. create function</p>
<p>def create<br />
     @customer = Customer.new(params[:customer])<br />
     @customer.date = Time.now</p>
<p>     if @customer.save<br />
          flash[:notice] = &#8216;Customer details saved successfully&#8217;<br />
          redirect_to :action => &#8216;list&#8217;<br />
     else<br />
          render :action => &#8216;new&#8217;<br />
     end<br />
end</p>
<p>One of the strong points of the language is the way it communicates with the DB for simple statements. No need to type &#8221;INSERT INTO customers VALUES&#8230;&#8221; or  &#8221;SELECT * FROM customers&#8221;, but quite simply :</p>
<p>Customer.find(params[:id])<br />
Customer.new(params[:customer])</p>
<p>Obviously if you would like to add some custom business logic in, that can be done, but you have saved yourself time by having that created automatically. There is nothing worse than creating edit,update,delete pages and this is a great bonus.</p>
<p>The downside to all the automatically generated code is that for something I would consolidate into 1 file, Rails generates about 15, with 1 for each function for the code, and for the view. While it&#8217;s not really a problem, for those of you who like a really clean tidy directory structure, it will take a bit of getting used to.</p>
<p><strong>Learning</strong></p>
<p>Like many this is my first look at Ruby on Rails and I can certainly see from a developers point of view it has many advantages, specifically with reference to the code generation, almost the logical step forward from code completion in a sense. However even as a developer I am slightly wary of all the hype, yes it is simple, but I would imagine it will still take time to get your head round this new model of programming. Considering most web projects dont follow the tradition model-view-controller rules it could take some time for beginners to understand this too. Another question that puzzles me, a lot of the commands are run directly from the prompt. This can&#8217;t leave much scope for companies without direct access to the server, although I do imagine some sort of admin provision will be made for this by ISPs that support it.</p>
<p>Still, I like it and will certainly invest some time into learning this new language with the goal of using it for a project in the future. I&#8217;ll keep you updated.</p>
<p> 
</p>
]]></content:encoded>
			<wfw:commentRss>http://www.hwhappy.co.uk/2007/03/26/ruby-on-what/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Vista Tweaks - View Source Editor</title>
		<link>http://www.hwhappy.co.uk/2007/02/21/vista-tweaks-view-source-editor/</link>
		<comments>http://www.hwhappy.co.uk/2007/02/21/vista-tweaks-view-source-editor/#comments</comments>
		<pubDate>Wed, 21 Feb 2007 11:22:09 +0000</pubDate>
		<dc:creator>HWHappy</dc:creator>
		
		<category>Computing</category>

		<guid isPermaLink="false">http://www.hwhappy.co.uk/2007/02/21/vista-tweaks-view-source-editor/</guid>
		<description><![CDATA[Recently having installed Windows Vista onto my development computer I am coming across a few things that have changed since XP. For example, Microsoft Script Debugger now no longer works, or at least crashes Internet Explorer when it&#8217;s installed. (update :see comments)
I thought however I would keep an open post and keep adding the solutions [...]]]></description>
			<content:encoded><![CDATA[<p>Recently having installed Windows Vista onto my development computer I am coming across a few things that have changed since XP. For example, Microsoft Script Debugger now no longer works, or at least crashes Internet Explorer when it&#8217;s installed. (<em>update :see comments</em>)</p>
<p>I thought however I would keep an open post and keep adding the solutions to things that I have found. The first is View Source Editor, as I am using a 64 bit version of Vista, the View Source Editor is now stored in a different location in the registry.</p>
<p><a id="more-12"></a></p>
<p>Start by opening regedit.exe, then add the keys &#8220;View Source Editor&#8221; and &#8220;Editor Name&#8221; under the relevant keys shown below. Finally change the default value of the Editor Name key to the location of the new text editor.</p>
<p>HKEY_LOCAL_MACHINE<br />
|- Software<br />
|&#8211; Wow6432Node<br />
|&#8212;- Microsoft<br />
|&#8212;&#8211; Internet Explorer<br />
|&#8212;&#8212; <strong style="color: black; background-color: #ffff66">View Source Editor</strong><br />
|&#8212;&#8212;- Editor Name (Default) = C:\neweditorpath&#8230;&#8230;.</p>
<p>If this doesn&#8217;t work for you I would use the original path as well</p>
<p>HKEY_LOCAL_MACHINE<br />
|- Software<br />
|&#8211; Microsoft<br />
|&#8212; Internet Explorer<br />
|&#8212;- <strong style="color: black; background-color: #ffff66">View Source Editor</strong><br />
|&#8212;&#8211; Editor Name (Default) = C:\neweditorpath&#8230;&#8230;
</p>
]]></content:encoded>
			<wfw:commentRss>http://www.hwhappy.co.uk/2007/02/21/vista-tweaks-view-source-editor/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Firefox Script Timeout and other Customisable Features</title>
		<link>http://www.hwhappy.co.uk/2007/02/16/firefox-script-timeout-and-other-customisable-features/</link>
		<comments>http://www.hwhappy.co.uk/2007/02/16/firefox-script-timeout-and-other-customisable-features/#comments</comments>
		<pubDate>Fri, 16 Feb 2007 09:03:31 +0000</pubDate>
		<dc:creator>HWHappy</dc:creator>
		
		<category>Computing</category>

		<guid isPermaLink="false">http://www.hwhappy.co.uk/2007/02/16/firefox-script-timeout-and-other-customisable-features/</guid>
		<description><![CDATA[Ever been running a complex script and have firefox alert you every 10 seconds or so, just to let you know that a script is running and would you like it to continue?
 

 
A script on this page may be busy, or it may have stopped responding. You can stop the script right now, or you [...]]]></description>
			<content:encoded><![CDATA[<p>Ever been running a complex script and have firefox alert you every 10 seconds or so, just to let you know that a script is running and would you like it to continue?</p>
<p> </p>
<div style="text-align: center"><img title="Script on this page may be busy" alt="Script on this page may be busy" src="http://www.hwhappy.co.uk/wp-images/unresponsive.gif" /></div>
<p> </p>
<p><em>A script on this page may be busy, or it may have stopped responding. You can stop the script right now, or you can continue to see if it completes.</em></p>
<p>It does get quite annoying sometimes, considerably when without the pop ups the script would take half the time to execute. Obviously there are benefits to keeping this quite low for security reasons, on the otherhand if you just want to increase it a little here is how you do it along with other useful tips and tweaks :</p>
<p><a id="more-11"></a></p>
<p><strong>dom.max_script_runtime</strong> </p>
<p>Type  about:config into Firefox address bar and press Enter. You will now see a full list of all the customisable features. Scroll down to the key named dom.max_script_runtime, double click on the row or right click and select modify to change the value.</p>
<p> </p>
<div style="text-align: center"><img title="dom.max_script_runtime" alt="dom.max_script_runtime" src="http://www.hwhappy.co.uk/wp-images/dom1.gif" /></div>
<p>  </p>
<p>By default it is set to 10, I recommend changing it to at least 60. That&#8217;s it, you don&#8217;t even need to close down Firefox for it to come into play.</p>
<p><strong>network.http.pipelining</strong></p>
<p>Firefox is generally considered quite a fast browser. However this tweak could make it even better by allowing several requests for the same page to occur similtaneously. Each call will request a different part of the page and Firefox will patch it together and return the page quicker than before. To do this you need to find the key network.http.pipelining and change the value to true, and also set network.http.proxy.pipelining to true as well just in case and finally set network.http.pipelining.maxrequests to anything greater than 4, but less than or equal to 8. This is the actual number of requests it will fire out but it is capped at 8 as specified by the standards.</p>
<p><strong>network.prefetch-next</strong></p>
<p>Another weird, some may say wonderful, feature of Firefox is that it prefetches some pages by presuming you will go there next. How it works out which ones is a mystery but logically it probably looks at links to pages quite near the top of your current page and start prefetching them in order to speed up the next click page load. This does come at a cost however and uses up some bandwidth too. You can disable this quite simply by setting network.prefetch-next to false.</p>
<p><strong>browser.tabs.closeButtons</strong></p>
<p>This is the level of customisation that I like, you can choose which tabs you want close buttons on. The following shows the effects :</p>
<p>browser.tabs.closeButtons  0  -  Displays a close button only on the active tab<br />
browser.tabs.closeButtons  1  -  Displays a close button on all the tabs<br />
browser.tabs.closeButtons  2  -  No Close buttons (?!?)<br />
browser.tabs.closeButtons  4  -  Displays a single close button at the far right of the tab strip.</p>
<p> </p>
<p>There are many other little tweaks for instance getting rid of the go button (or arrow), set <strong>browser.urlbar.hideGoButton</strong> to true. However the best thing to do is scan down the list looking at the names, see anything interesting just paste into a search engine and someone will have documented it somewhere, most likely Mozilla. It is a bit like Window&#8217;s registry, just be careful with the values you do change and if something doesn&#8217;t work just reset the value by right clicking on the key and selecting reset. It&#8217;s easy to see the ones you have changed as they are highlighted in bold text.  Have fun&#8230;
</p>
]]></content:encoded>
			<wfw:commentRss>http://www.hwhappy.co.uk/2007/02/16/firefox-script-timeout-and-other-customisable-features/feed/</wfw:commentRss>
		</item>
		<item>
		<title>The Irony of the Frequent Flyer</title>
		<link>http://www.hwhappy.co.uk/2007/01/19/flying-in-moderation/</link>
		<comments>http://www.hwhappy.co.uk/2007/01/19/flying-in-moderation/#comments</comments>
		<pubDate>Fri, 19 Jan 2007 09:32:21 +0000</pubDate>
		<dc:creator>HWHappy</dc:creator>
		
		<category>Life of me</category>

		<guid isPermaLink="false">http://www.hwhappy.co.uk/2007/01/19/flying-in-moderation/</guid>
		<description><![CDATA[Those of you who know me will know that I am not particularly fond of flying. There is certainly something not quite right about being that high above the ground, travelling at 400mph in a metal can sitting beside 2 colleagues who take pleasure in hearing creaking noises, things that don&#8217;t sound normal and pointing [...]]]></description>
			<content:encoded><![CDATA[<p>Those of you who know me will know that I am not particularly fond of flying. There is certainly something not quite right about being that high above the ground, travelling at 400mph in a metal can sitting beside 2 colleagues who take pleasure in hearing creaking noises, things that don&#8217;t sound normal and pointing them out to me, thanks Tweag. I don&#8217;t really like take off and mid flight turbulance doesn&#8217;t help much either. I think the biggest fear of flying for me, is if something was to go wrong, theres a long way to fall.</p>
<p> An argument I often hear is, well it would be over in an instant. How exactly is that supposed to help my fear of flying !!!! If I was happy with that, there would be no fear.</p>
<p>However the thing that baffles me most, is myself. I have a fear of flying, yet just last year I knocked up just over 40 flights and so far this year I have been on 6 Flights and 2 helicopter journeys and it&#8217;s not even the 20th of January yet. I wouldn&#8217;t say I don&#8217;t have a choice really, but most of the flights are necessary.</p>
<p>So what is the point of this post, I&#8217;m not sure really but I thought I would share the irony of the frequent flyer. There is one saving grace to all this, I discovered BA Terraces/Lounges yesterday and <a title="hw techie" href="http://www.hwtechie.co.uk">Chris</a> seemed quite keen too, so I&#8217;m thinking more visits to there will help me relax, theres always hope.
</p>
]]></content:encoded>
			<wfw:commentRss>http://www.hwhappy.co.uk/2007/01/19/flying-in-moderation/feed/</wfw:commentRss>
		</item>
		<item>
		<title>The Real Cookie</title>
		<link>http://www.hwhappy.co.uk/2006/12/27/the-real-cookie/</link>
		<comments>http://www.hwhappy.co.uk/2006/12/27/the-real-cookie/#comments</comments>
		<pubDate>Wed, 27 Dec 2006 10:05:42 +0000</pubDate>
		<dc:creator>HWHappy</dc:creator>
		
		<category>Life of me</category>

		<guid isPermaLink="false">http://www.hwhappy.co.uk/2006/12/27/the-real-cookie/</guid>
		<description><![CDATA[The art of making a good cookie has only befallen a few in the supermarket and retail industry. There is nothing worse than buying cookies and getting a rock hard, biscuit like texture with no chocolate bits,  or whatever the flavour that you have purchased. Below is a guide for British consumers on the advantages and [...]]]></description>
			<content:encoded><![CDATA[<p>The art of making a good cookie has only befallen a few in the supermarket and retail industry. There is nothing worse than buying cookies and getting a rock hard, biscuit like texture with no chocolate bits,  or whatever the flavour that you have purchased. Below is a guide for British consumers on the advantages and disadvantages of cookies from each store.</p>
<p><a id="more-6"></a></p>
<p><strong>Tesco</strong></p>
<p>Tesco have 2 types of cookies, &#8220;Finest Choice&#8221; and standard. With Finest Choice cookies you usually get 4 to a pack for about £1.20. These cookies are fairly chunky and usually always come with adequate fillings. The common choice consists of milk, white, and dark chocolate in the one cookie. The cookie itself is soft and almost a brownlie like texture. The size is ok considering it has a little depth to it. Along with the big chunks of chocolate make this a tasty cookie. I would give Tesco&#8217;s Finest Choice Cookies 8/10.</p>
<p>The standard cookie from Tesco comes in packs of 5 for 99p. They are small and quite thin, soft and usually quite goey. Can&#8217;t go wrong for 99p but nothing special. 6/10</p>
<p><strong>Marks And Spencer</strong></p>
<p>Cookies from Marks and Spencer have only really been around for the last 3 years when they started introducing In-Store bakeries. Much like the supermarkets every so often cookies will be cooked during the day and put into packets. If you time it right you can get freshly cooked, warm cookies which are fantastic. M and S only do one type of cookie in 3 different flavours; Milk Chocoloate, Double Chocolate and White Chocolate. The cookie itself is thin and soft, ofset with lots of chunks of smooth velvety chocolate, making an irresitable cookie. M and S cookies are however slightly more expensive and they have been inflating the price every year. They originally started out at £1.20 for 5 and it is now up at £1.84 for 5. Despite the price these are some of the nicest cookies on the market. 9/10</p>
<p><strong>Asda</strong></p>
<p>Asda only really have one type of cookie from their bakery. Once again it&#8217;s similar to the other Supermarkets cheaper options. 5 for 99p, soft goey average sized cookies. Coming in Double Chocolate, Milk Chocolate and White Chocolate varieties. Very similar to Tesco&#8217;s cheaper options. 6/10</p>
<p><strong>Morrisons</strong></p>
<p>Morrisons up until recently have only offered one type. However they have recently introduced &#8220;Best of&#8221; range which contain 4 cookies in a packet and at the moment only come in Milk Chocolate variety. The price is about £1.29. The cookies themselves are almost a little too crumbly, shortbread esk but not as crunchy. The chunks of chocolate are average but on the whole the cookie is quite nice, albeit slightly different from the norm. I would give this cookie 7/10.</p>
<p>Morrisons standard cookie is similar to Asdas and Tescos standard variety. 6/10</p>
<p><strong>Sainsburys</strong></p>
<p>Sainsburys offer 5 American style cookies, soft but often with crunchy edges, smallish in size but 5 for 99p can&#8217;t go wrong. 6/10</p>
<p><strong>Millies Cookies</strong></p>
<p>Millies Cookies is a strange shop. For only selling cookies and sweets the cookies aren&#8217;t that great. Firstly the size of them is pitaful and they rarely have decent amounts of chunks or filling. The prices arent that great either. You often think you are getting a great deal 8 for £2.50 and the like, but if you went along to Morrisons, Sainsburys, Tesco e.t.c. you could get 10 slightly bigger cookies for £2. Millies have also released a range called Super Gourmet, which are really what you would expect their normal cookies to be but for a grossly inflated price.</p>
<p>On the other hand, you do get one thing that you dont get anywhere else, and that&#8217;s choice. They have a great variety of different flavours some often very weird. I would rate Millies Cookies 5/10 based on the price for a below average cookie.</p>
<p><strong>Somerfield</strong></p>
<p>Occasionally a supermarket that you don&#8217;t often visit can yield results. There isn&#8217;t actually a Somerfield near me but when visiting my mothers I often have a look. It is a small Somerfield that only has the bakery selection of single items, rather than a collection in a packet. However the cookies are quite good but a little more pricey. They are a cross between Tesco and Asda and as they are single the size is quite good too. 7/10</p>
<p> </p>
<p>There you have it, the low down on where to get your cookies. Most of the styles above resemble the typical &#8220;Amercian Style&#8221; cookie, but this is a good thing. Soft, chewy, goey cookies are the best. If you like a little crunch in your cookie, buy biscuits, or short bread instead.</p>
<p>There is no doubt about it though, Marks and Spencers&#8217; still make the best cookie because they are not frozen before hand and are made freshly in store. Go and buy some, mmm, cookies.</p>
<p> 
</p>
]]></content:encoded>
			<wfw:commentRss>http://www.hwhappy.co.uk/2006/12/27/the-real-cookie/feed/</wfw:commentRss>
		</item>
		<item>
		<title>PHP vs ASP.NET</title>
		<link>http://www.hwhappy.co.uk/2006/12/11/php-vs-aspnet/</link>
		<comments>http://www.hwhappy.co.uk/2006/12/11/php-vs-aspnet/#comments</comments>
		<pubDate>Mon, 11 Dec 2006 09:05:40 +0000</pubDate>
		<dc:creator>HWHappy</dc:creator>
		
		<category>Computing</category>

		<guid isPermaLink="false">http://www.hwhappy.co.uk/2006/12/11/php-vs-aspnet/</guid>
		<description><![CDATA[It would be fair to say that the last post PHP vs ASP, was slightly one sided due to the fact that ASP is almost extinct now. However that is not to say people still don&#8217;t use it when there are other options available. Obvioulsy a fairer comparison would be PHP vs ASP.NET and this [...]]]></description>
			<content:encoded><![CDATA[<p>It would be fair to say that the last post PHP vs ASP, was slightly one sided due to the fact that ASP is almost extinct now. However that is not to say people still don&#8217;t use it when there are other options available. Obvioulsy a fairer comparison would be PHP vs ASP.NET and this is what I discuss next.</p>
<p><a id="more-8"></a></p>
<p>Having used both of these languages for a variety of applications and websites I have made up another list comparing one over the other. Although PHP 5 has been released, for the purpose of this document I will be comparing the most widely used and supported version 4.11</p>
<p><strong>Why PHP is better</strong><br />
1. Once again PHP is Free and that is a major advantage and often the decider between which language should be used. Microsoft have expensive licensing costs which are handed back to the user via more expensive hosting costs. Dedicated servers with your own MS SQL database from Microsoft is rare for smaller sites due to the cost involved.<br />
2. Ease of learning. PHP is a straight forward scripting language, there is not a great deal of learning required before you can start programming with this language. PHP.net does a lot to help for this, it is the single, most convenient API and reference guide and in my opinion better than any other for any other language that is available. ASP.NET on the other hand requires basic programming fundamentals, and an understanding of object oriented principles which may be beyond the causal coder.<br />
3. PHP is a very fast and efficient implementation of a programming language. It doesn&#8217;t nearly use as much memory or execution time as ASP.NET, while this may not be noticable to many websites, for people pushing the limits of their website, it is a major consideration.<br />
4. One argument I hear a lot of ASP.NET developers raise is that there is a great IDE to develop the software on, Visual Studio.NET . While I have to agree that it is great, it does once again come with a price. Similar alternatives for the PHP language, such as Zend Studio are just as good and come at a tenth of the price.<br />
5. PHP runs on APACHE which has a great security track record and is open source. However IIS, the platform for ASP.NET has in the past been plagued with problems and security concerns. Regardless of whether people are just attacking it because it&#8217;s Microsoft, the flaw to be exposed is still there.</p>
<p><strong>Why ASP.NET is better</strong><br />
1. ASP.NET has something called the Common Language Runtime(CLR), and without going into too much detail, you can use a variety of different languages to program in, and when built they will all compile to the same code at that level. This means that you can use languages such as C#, Visual Basic.NET, Java.NET and you can even get implementations in PHP. This aids transition and helps other developers already learned in the lore of a certain language quickly pick up.<br />
2. This isn&#8217;t necessarily a positive but as ASP.NET is a commercial framework, bigger companies have more faith and trust in the software, and quite often a great deal of support can be gained because of this.<br />
3. .NET is a modern framework that has been designed from scratch. Thus meaning that the architecture, design and implementation of the languages involved are up to date and using modern principles. For example, C# is a fully object oriented language and builds on all the correct rules of programming. Regardless of the fact it may indeed take longer to program this way, it is cleaner, and logically it makes more sense and in the long run leads to less mistakes due to it&#8217;s strong typing.<br />
4. Exception/Event Based Error handling is a definite positive for ASP.NET. With the use of try catch blocks (although expensive) allow more sophisticated error handling. Whilst error handling in PHP is possible, there is no built in standardised way to achieve this.<br />
5. ASP.NET allows what is known as Code Behind Sheets. This effectively separates the logic from the design and allows you to create classes for each of your pages, leading to easier maintenance and clean code. This is possible in PHP but is certainly not a built in or standard feature as such.</p>
<p>So the main question is, which one would I pick? Really, it&#8217;s not that simple, it&#8217;s usually more a question of which one is the best for the job in hand, or even more likely the project you have to work on has already been started in one language by your employers and which you must continue in.</p>
<p>If it was entirely a personal opinion, I would pick the cheaper option PHP, if however there was no costs I would pick ASP.NET.
</p>
]]></content:encoded>
			<wfw:commentRss>http://www.hwhappy.co.uk/2006/12/11/php-vs-aspnet/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Why PHP is better than ASP</title>
		<link>http://www.hwhappy.co.uk/2006/11/30/why-php-is-better-than-asp/</link>
		<comments>http://www.hwhappy.co.uk/2006/11/30/why-php-is-better-than-asp/#comments</comments>
		<pubDate>Thu, 30 Nov 2006 17:52:55 +0000</pubDate>
		<dc:creator>HWHappy</dc:creator>
		
		<category>Computing</category>

		<guid isPermaLink="false">http://www.hwhappy.co.uk/2006/11/30/why-php-is-better-than-asp/</guid>
		<description><![CDATA[When I moved jobs, like most people I had to learn a new language. Lucky for me my boss was one from the modern era who was capable to understand that learning a new computer language for a programmer is not a major obstacle. I&#8217;ve had so many interviews in the past where they ask [...]]]></description>
			<content:encoded><![CDATA[<p>When I moved jobs, like most people I had to learn a new language. Lucky for me my boss was one from the modern era who was capable to understand that learning a new computer language for a programmer is not a major obstacle. I&#8217;ve had so many interviews in the past where they ask &#8220;so do you know xxx language&#8221;, and my reply being &#8220;no, but it wont take me long&#8221;, and still they refuse to hire me because of time needed to train. Nonsense! It takes most programmers at most a week to have mastered a new language!</p>
<p>Anyway rant aside, the new language I learned was PHP, in a sense learning php is more like learning a new framework; Linux, Apache, Mysql and PHP commonly known<br />
as LAMP. After using it for a short while I realised all the time I had spent in the darkside was wasted! Here is why:</p>
<p><a id="more-7"></a></p>
<p><strong>10 Reasons Why PHP is better than ASP</strong></p>
<ol>
<li>PHP.NET the greatest API resource known to MAN</li>
<li>If you have a problem, someone will have already implemented a solution in PHP for you</li>
<li>Syntax is better, closer to C, C++, and Java. Unlike VB where anything goes.</li>
<li>To run ASP you need IIS on windows, which is not free, for PHP however you need linux and apache which are FREE!!</li>
<li>Great built in support for ftp, email, graphics package GD2 and also MySQL (also FREE).</li>
<li>PHP will run on Unix, Linux, Solaris and Windows. ASP is mainly only Windows associated but you can use it on linux with additional modules installed.</li>
<li>PHP code is much faster, ASP is developed on the COM based architecture, this is an overhead for the server.</li>
<li>mod_rewrite, need I say more.</li>
<li>Advanced Perl-compatible regular expression functions and loads of built in support for regular expressions on the whole.</li>
</ol>
<p>10. Greater control over error handling, and more detailed error messages.</p>
<p>It would be fair to say that ASP (although some companies will continue to stand by this for a long time I&#8217;m sure) is almost extinct and a fairer comparison would be PHP vs ASP.NET, which hopefully I will do next.
</p>
]]></content:encoded>
			<wfw:commentRss>http://www.hwhappy.co.uk/2006/11/30/why-php-is-better-than-asp/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Affiliate Revenue Share</title>
		<link>http://www.hwhappy.co.uk/2006/11/21/affiliate-revenue-share/</link>
		<comments>http://www.hwhappy.co.uk/2006/11/21/affiliate-revenue-share/#comments</comments>
		<pubDate>Tue, 21 Nov 2006 13:26:38 +0000</pubDate>
		<dc:creator>HWHappy</dc:creator>
		
		<category>Computing</category>

		<guid isPermaLink="false">http://www.hwhappy.co.uk/2006/11/21/affiliate-revenue-share/</guid>
		<description><![CDATA[One of the latest advancements in affiliate marketing is a new model titled Revenue Share. Quite simply it encourages affiliates to work together in order to gain a sale, the commission made from that sale or lead is then divided between the affiliates that helped. The rest of this post will cover how it all [...]]]></description>
			<content:encoded><![CDATA[<p>One of the latest advancements in affiliate marketing is a new model titled Revenue Share. Quite simply it encourages affiliates to work together in order to gain a sale, the commission made from that sale or lead is then divided between the affiliates that helped. The rest of this post will cover how it all works at a more technical level.<br />
<a id="more-5"></a><strong> </strong></p>
<p><strong>How does this actually work</strong></p>
<p>We will start by examining the existing model. If a visitor on an affiliate site clicks through to a merchant, the visitor is first directed to the affiliate network (Affiliate Future, Affiliate Window e.t.c.) At this stage, the network places a cookie containing the referring affiliate ID onto the client&#8217;s machine and then redirects them to the merchant, indicating where the visitor has come from. This is all completely transparent to the user and allows the network to keep track of who is referring the clients to the merchant site. If the visitor then decides to make a purchase on the merchant, the merchant will check to see what network (if any) their buyer has come from and call a script that tells the network one of their affiliates has referred a sale.</p>
<p> </p>
<div style="text-align: center"><img title="Existing affiliate commission model" alt="Existing affiliate commission model" src="http://www.hwhappy.co.uk/wp-images/hwr1a.gif" /></div>
<p> </p>
<p>This is the standard, widely adopted model that is based on cookie tracking. It is not the only model, there are URL based schemes, Self replicated pages, and direct links but these are out with the scope of this post.</p>
<p><strong>Revenue Share Model</strong></p>
<p>So what&#8217;s the difference with Revenue Share? The only real difference is there is usually 1 extra player, but essentially the principles are just the same. The visitor is referred from the affiliate site as before. The network places a cookie on the visitors machine once again, to aid with tracking. It then calls a script on the 2nd affiliates site to indicate where the visitor came from, this script will usually just place a cookie that the 2nd affiliate can read.</p>
<p>If the visitor then decides to visit a merchant from the 2nd affiliate, the 2nd affiliate then creates and stores it&#8217;s own tracking code and also stores which affiliate referred that visitor. The visitor is then sent to the merchant once again via the affiliate network. When the sale comes in, the merchant calls the script that tells the network a sale has been made. This time the network calls a script (known as a callback) on the 2nd affiliate to indicate a revenue share sale has been made, passing the tracking code that was created at the referral time. The 2nd affiliate now looks up its tracking code to find who the visitor was referred by and calls its own script telling the network to pass on a certain agreed percentage of the commission directly back to the original affiliate.</p>
<p style="text-align: center"><img title="Revenue share affiliate commission model" alt="Revenue share affiliate commission model" src="http://www.hwhappy.co.uk/wp-images/hwr2a.gif" /></p>
<p style="text-align: center"> </p>
<p>This can be represented in 3 easy stages:</p>
<p><strong>Stage 1:</strong></p>
<ol>
<li>Visitor clicks on link to 2nd affiliate.</li>
<li>Network places first cookie on client</li>
<li>Network calls tracking code on 2nd affiliate site</li>
<li>Visitor is redirected to 2nd affiliate site</li>
</ol>
<p><strong>Stage 2:</strong></p>
<ol>
<li>Visitor clicks on link to merchant.</li>
<li>2nd affiliate stores its own tracking code</li>
<li>Network places new cookie on client</li>
<li>Network redirects to merchant site</li>
</ol>
<p><strong>Stage 3:</strong></p>
<ol>
<li>Visitor decides to buy from merchant</li>
<li>Merchant calls the sale network script</li>
<li>Network stores sale details and fires a callback script on the 2nd merchant</li>
<li>2nd merchant looks up own tracking table</li>
<li>2nd merchant calls network script to pass commission onto original affiliate.</li>
</ol>
<p><strong>Coding</strong></p>
<p>Coding this model if not too difficult as long as you think of it in separate stages as above. Taking the role of the 2nd merchant there are 2 main areas to code. You have incoming visitors and outgoing visitors. When a visitor leaves your site you need to know whether it is from an affiliate who is part of the revenue share model or whether it&#8217;s just natural traffic.</p>
<p>To do this, setup your affiliate network to call a script when a visitor from another affiliate is sent to your site. Using this script, place a cookie on the visitor&#8217;s machine. In this cookie, store the information that the network provide, i.e. the affiliate ID that the client has come from, and any tracking they have provided. Store this in the cookie in a form you can extract later.</p>
<p align="center">e.g. <span style="color: blue">AFF@@affyid123@@affytracking</span></p>
<p>This not only allows you to track the visitors from that affiliate, but also allows you to customise the site if necessary, for example, turning off other certain links that are not relevant to where the visitor came from, hence focussing the site for the sale. When the visitor leaves your site through one of your links, you need to store the information you have in the cookie along with your own tracking ID. So when a visitor leaves your site the first thing you want to check is the cookie. If the cookie contains the affiliate information, you know its a revenue share sale and hence you must track it. For example, you could store this in your database :</p>
<table align="center">
<tr>
<td>tracking id</td>
<td>affiliate id</td>
<td>affiliate tracking code</td>
<td>datetime</td>
</tr>
<tr>
<td>172</td>
<td>1234</td>
<td>Banner1</td>
<td>2006-11-20 13:24</td>
</tr>
</table>
<p>The visitor would then be sent to the network containing your newly generated ID as a tracking code. This information is essential, when the network calls you back to indicate a sale, it passes back your tracking ID ( e.g. 172) and commission details, you then use this to look up who referred the visitor to your site, and call the network back with details of the commission to be passed on to the original affiliate.
</p>
]]></content:encoded>
			<wfw:commentRss>http://www.hwhappy.co.uk/2006/11/21/affiliate-revenue-share/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Concurrent XML Queries with AJAX</title>
		<link>http://www.hwhappy.co.uk/2006/11/07/concurrent-xml-queries-with-ajax/</link>
		<comments>http://www.hwhappy.co.uk/2006/11/07/concurrent-xml-queries-with-ajax/#comments</comments>
		<pubDate>Tue, 07 Nov 2006 13:11:45 +0000</pubDate>
		<dc:creator>HWHappy</dc:creator>
		
		<category>Computing</category>

		<guid isPermaLink="false">http://www.hwhappy.co.uk/2006/11/07/concurrent-xml-queries-with-ajax/</guid>
		<description><![CDATA[This year I’ve been involved with a couple of projects that required aggregating data from several different companies XML feeds. Initially the XML calls were made one after the other in a traditional sequential manner. However it soon became apparent that this was not really feasible as each search took in the region of 10 [...]]]></description>
			<content:encoded><![CDATA[<p>This year I’ve been involved with a couple of projects that required aggregating data from several different companies XML feeds. Initially the XML calls were made one after the other in a traditional sequential manner. However it soon became apparent that this was not really feasible as each search took in the region of 10 to 20 seconds to complete and with 4 or 5 companies this was increasing the wait time for the user to over a minute.</p>
<p><a id="more-4"></a></p>
<p><img title="Graphical representation of the traditional sequential model." alt="Graphical representation of the traditional sequential model." src="http://www.hwhappy.co.uk/wp-images/process1.gif" align="middle" /><br />
Ideally we were looking for a solution that would first reduce the wait time, but second reduce the amount of data shown to the user, as it is mostly similar data consolidating and filtering the data before returning it to the user is essential. The maximum time we wanted to wait would be the longest time for one of the threads to return and if that exceeded some sort of hard limit we would want to stop it then. To achieve these goals we would ideally be looking for some sort of &#8220;threaded&#8221; model similar to the observer/observable model, where each XML query is launched on its own &#8220;thread&#8221;. This is not exactly rocket science and neither is it brand new, however searching the net for something that talks about multi threaded web pages and you will probably not find what you are looking for. The rest of this post will explain the simple concept of using javascript to try and achieve a performance increase to help improve your site.</p>
<p>Traditional client web technologies do not offer a threaded model. However with the advent of AJAX (A-Synchronous JavaScript and XML) a better user interface has been possible. The reason why AJAX has become so popular is because of its ability to do things &#8220;concurrently&#8221; or in the background. Just to be clear though, there is no true concurrency, or parallel processing in JavaScript, however we can spawn off background processes that will at least allow us to do more than one task at once and give us the illusion of threaded scripts, it isn&#8217;t true parallelism but allows a certain degree of concurrentness. This has allowed simple tasks such as logging a customer in without a server side refresh, to more advanced uses such as Google Maps (notice how when you scan the map the images are downloaded almost seamlessly in the background) or even Yahoo&#8217;s new mail client, using AJAX has allowed it to clone a traditional desktop application email client.</p>
<p>Taking the theory of &#8220;concurrent&#8221; calls using the XMLHttpRequest we can fire off A-Synchronous requests for our XML feeds. As the XMLHttpRequest is asynchronous, as soon as the call is made, control is handled back to the script and it carries on, allowing you to fire off more calls to other functions. As it&#8217;s not true concurrentness the order in which they are called may be a factor. It may be worth putting the longest query to return first, this gives it the benefit of a few extra milliseconds before the other calls are made. It’s not going to make much of a difference, but look after the milliseconds and the seconds will look after themselves!</p>
<p>They key to making this work is how you handle the data that is now returned. As each call returns, you can either process the data individually, in this situation the data from one &#8220;thread&#8221; has no relevance to the others and can be processed as it is received, displayed to the user or just stored in variables for further manipulation. The other method where the data is all relevant, it would make sense if it is stored in some form of intermediary storage, such as a database. With this model the important factor here is to be notified when all the &#8220;threads&#8221; have finished. To do this we can use settimeout to periodically check some sort of status variable. e.g.</p>
<p>// create a handler for each feed<br />
feed1Handler(set status of feed 1 to finished);</p>
<p>// make the calls<br />
asyncCall(webfeed1, feed1Handler);<br />
asyncCall(webfeed2, feed2Handler);<br />
asyncCall(webfeed3, feed3Handler);<br />
asyncCall(webfeed4, feed4Handler);</p>
<p>// check to see if all feeds have returned<br />
setTimeout(checkstatus,1000);</p>
<p><img title="Graphical representation of the 'threaded' model" alt="Graphical representation of the 'threaded' model" src="http://www.hwhappy.co.uk/wp-images/process2.gif" align="middle" /></p>
<p>The above example works quite simply, using your Ajax class or methods, call each feed in turn, providing a handler that will change the status of the feed state when finished. After the calls are made, as they run in the background the code continues to run and executes the settimeout function. This simply checks the status fields of all the feeds, if they are all finished it carries on, otherwise it recursively calls itself until they are. This method is suitable when you must wait for all feeds to return before progressing, for example if the data must be compared before returning it to the user. Once the calls have returned, another call can be made to retrieve the data from the database and process to display to the user.</p>
<p>There are several draw backs that become apparent when discussing this approach however. As mentioned above, you must wait for all calls to return before you can proceed. Hence at this stage it’s advisable to implement a hard cut off. Building a time limit into the settimeout function, you can check this limit every time it is called, if greater than 10 seconds say, exit the loop and display the results to the user.</p>
<p>This method of implementation lends itself to something known as Closures, which isn&#8217;t entirely safe considering IE&#8217;s memory leak problems (I’d optimistically like to assume this will not be an issue in IE7). A further discussion of this can be found at http://jibbering.com/faq/faq_notes/closures.html#clMem</p>
<p>The other main caveat with this model is more and more of the processing power needed is required from the client, as JavaScript is a client side language all calls and data processing is done on the client side machine. Most computers nowadays should not have any issues with this, however if the computer has been attacked by spyware we all know how the internet can become painstakingly slow. Consequently this model assumes a certain amount of work must be done by the client.</p>
<p>Another limiting factor is obviously the users download speed. The more feeds or calls implemented into this solution will obviously take more time, but this is something that can be tweaked until an optimum is achieved.</p>
<p>The main reason for writing this is to hopefully provide someone heading down this road a little bit of guidance, and confidence a solution is workable. With new “comparison” sites appearing every day, using the model above should greatly speed up the process for the consumer with no detriment to the performance of the site. The concepts we used are already widely discussed on the net, however I felt that putting it in a practical context made it seem a lot less theoretical.</p>
<p><strong>Acknowledgements</strong></p>
<p>Chris Clarkson : <a href="http://www.hwtechie.co.uk/">http://www.hwtechie.co.uk/</a><br />
Dan Robins : <a href="http://www.carhiresearch.co.uk/">http://www.carhiresearch.co.uk/</a>
</p>
]]></content:encoded>
			<wfw:commentRss>http://www.hwhappy.co.uk/2006/11/07/concurrent-xml-queries-with-ajax/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
